Changeset 3457 in subversion
- Timestamp:
- Apr 1, 2010 2:39:06 AM (3 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 4 edited
-
index.php (modified) (1 diff)
-
program/js/app.js (modified) (4 diffs)
-
program/localization/en_US/messages.inc (modified) (1 diff)
-
program/steps/addressbook/groups.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/index.php
r3449 r3457 222 222 'group-rename' => 'groups.inc', 223 223 'group-delete' => 'groups.inc', 224 'group-addmember ' => 'groups.inc',225 'group-delme nber' => 'groups.inc',224 'group-addmembers' => 'groups.inc', 225 'group-delmembers' => 'groups.inc', 226 226 ), 227 227 -
trunk/roundcubemail/program/js/app.js
r3449 r3457 3239 3239 3240 3240 // insert all members of a group 3241 if (typeof this.env.contacts[id] == 'object' && this.env.contacts[id].id) { 3242 insert += this.env.contacts[id].name + ', '; 3243 this.group2expand = $.extend({}, this.env.contacts[id]); 3244 this.group2expand.input = this.ksearch_input; 3245 this.http_request('group-expand', '_source='+urlencode(this.env.contacts[id].source)+'&_gid='+urlencode(this.env.contacts[id].id), false); 3241 if (typeof this.env.contacts[id] == 'object' && this.env.contacts[id].members) { 3242 for (var i=0; i < this.env.contacts[id].members.length; i++) 3243 insert += this.env.contacts[id].members[i] + ', '; 3246 3244 } 3247 3245 else if (typeof this.env.contacts[id] == 'string') … … 3254 3252 if (this.ksearch_input.setSelectionRange) 3255 3253 this.ksearch_input.setSelectionRange(cpos, cpos); 3256 };3257 3258 this.replace_group_recipients = function(id, recipients)3259 {3260 if (this.group2expand && this.group2expand.id == id) {3261 this.group2expand.input.value = this.group2expand.input.value.replace(this.group2expand.name, recipients);3262 this.group2expand = null;3263 }3264 3254 }; 3265 3255 … … 3520 3510 3521 3511 if (to.type == 'group') 3522 this.http_post('group-addmember ', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(to.id));3512 this.http_post('group-addmembers', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(to.id)); 3523 3513 else if (to.id != this.env.source && cid && this.env.address_sources[to.id] && !this.env.address_sources[to.id].readonly) 3524 3514 this.http_post('copy', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_to='+urlencode(to.id)); … … 3559 3549 // send request to server 3560 3550 if (this.env.group) 3561 this.http_post('group-delmember ', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+qs);3551 this.http_post('group-delmembers', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+qs); 3562 3552 else 3563 3553 this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs); -
trunk/roundcubemail/program/localization/en_US/messages.inc
r3425 r3457 98 98 $messages['contactaddedtogroup'] = 'Successfully added the contacts to this group'; 99 99 $messages['contactremovedfromgroup'] = 'Successfully remove contacts from this group'; 100 100 101 $messages['importwait'] = 'Importing, please wait...'; 101 102 $messages['importerror'] = 'Import failed! The uploaded file is not a valid vCard file.'; -
trunk/roundcubemail/program/steps/addressbook/groups.inc
r3448 r3457 26 26 } 27 27 28 if ($RCMAIL->action == 'group-addmember') { 29 if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) 30 if ($CONTACTS->add_to_group($gid, $ids)) 31 $OUTPUT->show_message('contactaddedtogroup'); 32 //else 33 // $OUTPUT->show_message('erroraddingcontact', 'warning'); 28 $source = get_input_value('_source', RCUBE_INPUT_GPC); 29 30 if ($RCMAIL->action == 'group-addmembers') { 31 if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) { 32 $plugin = $RCMAIL->plugins->exec_hook('group_addmember', array('group_id' => $gid, 'ids' => $ids, 'source' => $source)); 33 34 if (!$plugin['abort'] && $CONTACTS->add_to_group($gid, $plugin['ids'])) 35 $OUTPUT->show_message('contactaddedtogroup'); 36 else if ($plugin['message']) 37 $OUTPUT->show_message($plugin['message'], 'warning'); 38 } 34 39 } 35 40 36 else if ($RCMAIL->action == 'group-delmember') { 37 if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) 38 if ($CONTACTS->remove_from_group($gid, $ids)) 39 $OUTPUT->show_message('contactremovedfromgroup'); 40 //else 41 // $OUTPUT->show_message('erroraddingcontact', 'warning'); 41 else if ($RCMAIL->action == 'group-delmembers') { 42 if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($ids = get_input_value('_cid', RCUBE_INPUT_POST))) { 43 $plugin = $RCMAIL->plugins->exec_hook('group_delmembers', array('group_id' => $gid, 'ids' => $ids, 'source' => $source)); 44 $ids = $plugin['ids']; 45 46 if (!$plugin['abort'] && $CONTACTS->remove_from_group($gid, $ids)) 47 $OUTPUT->show_message('contactremovedfromgroup'); 48 else if ($plugin['message']) 49 $OUTPUT->show_message($plugin['message'], 'warning'); 50 } 42 51 } 43 52 44 53 else if ($RCMAIL->action == 'group-create') { 45 if (!empty($_POST['_name'])) { 46 $name = trim(get_input_value('_name', RCUBE_INPUT_POST)); 47 $created = $CONTACTS->create_group($name); 54 if ($name = trim(get_input_value('_name', RCUBE_INPUT_POST))) { 55 $plugin = $RCMAIL->plugins->exec_hook('group_create', array('name' => $name, 'source' => $source)); 56 if (!$plugin['abort']) 57 $created = $CONTACTS->create_group($plugin['name']); 48 58 } 49 59 … … 51 61 $OUTPUT->command('insert_contact_group', $created); 52 62 } 53 else if (!$create ) {54 $OUTPUT->show_message( 'errorsaving', 'error');63 else if (!$created) { 64 $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 55 65 } 56 66 } 57 67 58 68 else if ($RCMAIL->action == 'group-rename') { 59 if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($name = trim(get_input_value('_name', RCUBE_INPUT_POST)))) 60 $newname = $CONTACTS->rename_group($gid, $name); 69 if (($gid = get_input_value('_gid', RCUBE_INPUT_POST)) && ($name = trim(get_input_value('_name', RCUBE_INPUT_POST)))) { 70 $plugin = $RCMAIL->plugins->exec_hook('group_rename', array('group_id' => $gid, 'name' => $name, 'source' => $source)); 71 if (!$plugin['abort']) 72 $newname = $CONTACTS->rename_group($gid, $plugin['name']); 73 } 61 74 62 75 if ($newname && $OUTPUT->ajax_call) 63 76 $OUTPUT->command('update_contact_group', $gid, $newname); 64 77 else if (!$newname) 65 $OUTPUT->show_message( 'errorsaving', 'error');78 $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 66 79 } 67 80 68 81 else if ($RCMAIL->action == 'group-delete') { 69 if ($gid = get_input_value('_gid', RCUBE_INPUT_POST)) 70 $deleted = $CONTACTS->delete_group($gid); 82 if ($gid = get_input_value('_gid', RCUBE_INPUT_POST)) { 83 $plugin = $RCMAIL->plugins->exec_hook('group_delete', array('group_id' => $gid, 'source' => $source)); 84 if (!$plugin['abort']) 85 $deleted = $CONTACTS->delete_group($gid); 86 } 71 87 72 88 if ($deleted) 73 89 $OUTPUT->command('remove_group_item', $gid); 74 90 else 75 $OUTPUT->show_message( 'errorsaving', 'error');91 $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); 76 92 } 77 93
Note: See TracChangeset
for help on using the changeset viewer.
