- Add "loading" messages for contacts copying and groups assignment

release-0.6
alecpl 13 years ago
parent 159763861e
commit 2c77f553c8

@ -309,11 +309,8 @@ function rcube_webmail()
this.enable_command('show', 'edit', true); this.enable_command('show', 'edit', true);
// register handlers for group assignment via checkboxes // register handlers for group assignment via checkboxes
if (this.gui_objects.editform) { if (this.gui_objects.editform) {
$('input.groupmember').change(function(){ $('input.groupmember').change(function() {
var cmd = this.checked ? 'group-addmembers' : 'group-delmembers'; ref.group_member_change(this.checked ? 'add' : 'del', ref.env.cid, ref.env.source, this.value);
ref.http_post(cmd, '_cid='+urlencode(ref.env.cid)
+ '&_source='+urlencode(ref.env.source)
+ '&_gid='+urlencode(this.value));
}); });
} }
} }
@ -3916,29 +3913,39 @@ function rcube_webmail()
return true; return true;
}; };
// add/delete member to/from the group
this.group_member_change = function(what, cid, source, gid)
{
what = what == 'add' ? 'add' : 'del';
var lock = this.display_message(this.get_label(what == 'add' ? 'addingmember' : 'removingmember'), 'loading');
this.http_post('group-'+what+'members', '_cid='+urlencode(cid)
+ '&_source='+urlencode(source)
+ '&_gid='+urlencode(gid), lock);
};
// copy a contact to the specified target (group or directory) // copy a contact to the specified target (group or directory)
this.copy_contact = function(cid, to) this.copy_contact = function(cid, to)
{ {
if (!cid) if (!cid)
cid = this.contact_list.get_selection().join(','); cid = this.contact_list.get_selection().join(',');
if (to.type == 'group' && to.source == this.env.source) { if (to.type == 'group' && to.source == this.env.source)
this.http_post('group-addmembers', '_cid='+urlencode(cid) this.group_member_change('add', cid, to.source, to.id);
+ '&_source='+urlencode(this.env.source)
+ '&_gid='+urlencode(to.id));
}
else if (to.type == 'group' && !this.env.address_sources[to.source].readonly) { else if (to.type == 'group' && !this.env.address_sources[to.source].readonly) {
var lock = this.display_message(this.get_label('copyingcontact'), 'loading');
this.http_post('copy', '_cid='+urlencode(cid) this.http_post('copy', '_cid='+urlencode(cid)
+ '&_source='+urlencode(this.env.source) + '&_source='+urlencode(this.env.source)
+ '&_to='+urlencode(to.source) + '&_to='+urlencode(to.source)
+ '&_togid='+urlencode(to.id) + '&_togid='+urlencode(to.id)
+ (this.env.group ? '&_gid='+urlencode(this.env.group) : '')); + (this.env.group ? '&_gid='+urlencode(this.env.group) : ''), lock);
} }
else if (to.id != this.env.source && cid && this.env.address_sources[to.id] && !this.env.address_sources[to.id].readonly) { else if (to.id != this.env.source && cid && this.env.address_sources[to.id] && !this.env.address_sources[to.id].readonly) {
var lock = this.display_message(this.get_label('copyingcontact'), 'loading');
this.http_post('copy', '_cid='+urlencode(cid) this.http_post('copy', '_cid='+urlencode(cid)
+ '&_source='+urlencode(this.env.source) + '&_source='+urlencode(this.env.source)
+ '&_to='+urlencode(to.id) + '&_to='+urlencode(to.id)
+ (this.env.group ? '&_gid='+urlencode(this.env.group) : '')); + (this.env.group ? '&_gid='+urlencode(this.env.group) : ''), lock);
} }
}; };

@ -100,8 +100,11 @@ $messages['sourceisreadonly'] = 'This address source is read only.';
$messages['errorsavingcontact'] = 'Could not save the contact address.'; $messages['errorsavingcontact'] = 'Could not save the contact address.';
$messages['movingmessage'] = 'Moving message(s)...'; $messages['movingmessage'] = 'Moving message(s)...';
$messages['copyingmessage'] = 'Copying message(s)...'; $messages['copyingmessage'] = 'Copying message(s)...';
$messages['copyingcontact'] = 'Copying contact(s)...';
$messages['deletingmessage'] = 'Deleting message(s)...'; $messages['deletingmessage'] = 'Deleting message(s)...';
$messages['markingmessage'] = 'Marking message(s)...'; $messages['markingmessage'] = 'Marking message(s)...';
$messages['addingmember'] = 'Adding contact(s) to the group...';
$messages['removingmember'] = 'Removing contact(s) from the group...';
$messages['receiptsent'] = 'Successfully sent a read receipt.'; $messages['receiptsent'] = 'Successfully sent a read receipt.';
$messages['errorsendingreceipt'] = 'Could not send the receipt.'; $messages['errorsendingreceipt'] = 'Could not send the receipt.';
$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.'; $messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
@ -112,8 +115,8 @@ $messages['contactaddedtogroup'] = 'Successfully added the contacts to this grou
$messages['contactremovedfromgroup'] = 'Successfully removed contacts from this group.'; $messages['contactremovedfromgroup'] = 'Successfully removed contacts from this group.';
$messages['importwait'] = 'Importing, please wait...'; $messages['importwait'] = 'Importing, please wait...';
$messages['importerror'] = 'Import failed! The uploaded file is not a valid vCard file.'; $messages['importerror'] = 'Import failed! The uploaded file is not a valid vCard file.';
$messages['importconfirm'] = '<b>Successfully imported $inserted contacts.</b>'; $messages['importconfirm'] = '<b>Successfully imported $inserted contacts</b>';
$messages['importconfirmskipped'] = '<b>Skipped $skipped existing entries.</b>'; $messages['importconfirmskipped'] = '<b>Skipped $skipped existing entries</b>';
$messages['opnotpermitted'] = 'Operation not permitted!'; $messages['opnotpermitted'] = 'Operation not permitted!';
$messages['nofromaddress'] = 'Missing e-mail address in selected identity.'; $messages['nofromaddress'] = 'Missing e-mail address in selected identity.';
$messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?'; $messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?';

@ -224,7 +224,7 @@ function rcmail_directory_list($attrib)
$OUTPUT->set_env('contactgroups', $jsdata); $OUTPUT->set_env('contactgroups', $jsdata);
$OUTPUT->add_gui_object('folderlist', $attrib['id']); $OUTPUT->add_gui_object('folderlist', $attrib['id']);
// add some labels to client // add some labels to client
$OUTPUT->add_label('deletegroupconfirm', 'groupdeleting'); $OUTPUT->add_label('deletegroupconfirm', 'groupdeleting', 'addingmember', 'removingmember');
return html::tag('ul', $attrib, $out, html::$common_attrib); return html::tag('ul', $attrib, $out, html::$common_attrib);
} }
@ -281,7 +281,7 @@ function rcmail_contacts_list($attrib)
$OUTPUT->include_script('list.js'); $OUTPUT->include_script('list.js');
// add some labels to client // add some labels to client
$OUTPUT->add_label('deletecontactconfirm'); $OUTPUT->add_label('deletecontactconfirm', 'copyingcontact');
return $out; return $out;
} }

@ -201,6 +201,7 @@ function rcmail_contact_record_groups($contact_id)
$form_end = '</form>'; $form_end = '</form>';
$RCMAIL->output->add_gui_object('editform', 'form'); $RCMAIL->output->add_gui_object('editform', 'form');
$RCMAIL->output->add_label('addingmember', 'removingmember');
return $form_start . $table->show() . $form_end; return $form_start . $table->show() . $form_end;
} }

Loading…
Cancel
Save