summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-10-22 15:24:39 +0000
committerthomascube <thomas@roundcube.net>2010-10-22 15:24:39 +0000
commitcb7d32ebdd1c783f201e2f3fa6c52f1fafdc6fcf (patch)
treef82963865616671696c87c3ff5a4ca577941bf7c /program/js
parent6a16031d043ab1a3999ecae6181ecb50cb6f1636 (diff)
List groups in address detail view and allow to subscribe/unsubscribe from there (#1486753)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 45569ea95..4587ce898 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -306,8 +306,18 @@ function rcube_webmail()
this.enable_command('group-create', this.env.address_sources[this.env.source].groups);
}
- if (this.env.cid)
+ if (this.env.cid) {
this.enable_command('show', 'edit', true);
+ // register handlers for group assignment via checkboxes
+ if (this.gui_objects.editform) {
+ $('input.groupmember').change(function(){
+ var cmd = this.checked ? 'group-addmembers' : 'group-delmembers';
+ ref.http_post(cmd, '_cid='+urlencode(ref.env.cid)
+ + '&_source='+urlencode(ref.env.source)
+ + '&_gid='+urlencode(this.value));
+ });
+ }
+ }
if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform) {
this.enable_command('save', true);
@@ -3713,7 +3723,7 @@ function rcube_webmail()
{
// exit if no mailbox specified or if selection is empty
var selection = this.contact_list.get_selection();
- if (!(selection.length || this.env.cid) || (!this.env.group && !confirm(this.get_label('deletecontactconfirm'))))
+ if (!(selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm')))
return;
var id, a_cids = [], qs = '';
@@ -3737,10 +3747,7 @@ function rcube_webmail()
qs += '&_search='+this.env.search_request;
// send request to server
- if (this.env.group)
- this.http_post('group-delmembers', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+qs);
- else
- this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
+ this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
return true;
};