Make optional ACL removal on delegate deletion, added checkbox in confirmation dialog
This commit is contained in:
parent
56928b74eb
commit
6f4f949f8f
7 changed files with 61 additions and 5 deletions
|
@ -130,10 +130,32 @@ rcube_webmail.prototype.delegate_add = function()
|
||||||
// handler for delete commands
|
// handler for delete commands
|
||||||
rcube_webmail.prototype.delegate_delete = function()
|
rcube_webmail.prototype.delegate_delete = function()
|
||||||
{
|
{
|
||||||
if (this.env.active_delegate && confirm(this.gettext('delegatedeleteconfirm', 'kolab_delegation'))) {
|
if (!this.env.active_delegate)
|
||||||
var lock = this.set_busy(true, 'kolab_delegation.savingdata');
|
return;
|
||||||
this.http_post('plugin.delegation-delete', {id: this.env.active_delegate}, lock);
|
|
||||||
|
var $dialog = $("#delegate-delete-dialog").addClass('uidialog'),
|
||||||
|
buttons = {};
|
||||||
|
|
||||||
|
buttons[this.gettext('no', 'kolab_delegation')] = function() {
|
||||||
|
$dialog.dialog('close');
|
||||||
|
};
|
||||||
|
buttons[this.gettext('yes', 'kolab_delegation')] = function() {
|
||||||
|
$dialog.dialog('close');
|
||||||
|
var lock = rcmail.set_busy(true, 'kolab_delegation.savingdata');
|
||||||
|
rcmail.http_post('plugin.delegation-delete', {id: rcmail.env.active_delegate,
|
||||||
|
acl: $("#delegate-delete-dialog input:checked").length}, lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// open jquery UI dialog
|
||||||
|
$dialog.dialog({
|
||||||
|
modal: true,
|
||||||
|
resizable: false,
|
||||||
|
closeOnEscape: true,
|
||||||
|
title: this.gettext('deleteconfirm', 'kolab_delegation'),
|
||||||
|
close: function() { $dialog.dialog('destroy').hide(); },
|
||||||
|
buttons: buttons,
|
||||||
|
width: 400
|
||||||
|
}).show();
|
||||||
};
|
};
|
||||||
|
|
||||||
// submit delegate form to the server
|
// submit delegate form to the server
|
||||||
|
|
|
@ -51,7 +51,7 @@ class kolab_delegation extends rcube_plugin
|
||||||
$this->register_action('plugin.delegation-autocomplete', array($this, 'controller_action'));
|
$this->register_action('plugin.delegation-autocomplete', array($this, 'controller_action'));
|
||||||
|
|
||||||
if ($this->rc->action == 'plugin.delegation' || empty($_REQUEST['_framed'])) {
|
if ($this->rc->action == 'plugin.delegation' || empty($_REQUEST['_framed'])) {
|
||||||
$this->add_texts('localization/', array('tabtitle', 'delegatedeleteconfirm', 'savingdata'));
|
$this->add_texts('localization/', array('tabtitle', 'deleteconfirm', 'savingdata', 'yes', 'no'));
|
||||||
$this->include_script('kolab_delegation.js');
|
$this->include_script('kolab_delegation.js');
|
||||||
$skin_path = $this->local_skin_path();
|
$skin_path = $this->local_skin_path();
|
||||||
$this->include_stylesheet("$skin_path/style.css");
|
$this->include_stylesheet("$skin_path/style.css");
|
||||||
|
@ -221,7 +221,7 @@ class kolab_delegation extends rcube_plugin
|
||||||
// Delegate delete
|
// Delegate delete
|
||||||
if ($this->rc->action == 'plugin.delegation-delete') {
|
if ($this->rc->action == 'plugin.delegation-delete') {
|
||||||
$id = get_input_value('id', RCUBE_INPUT_GPC);
|
$id = get_input_value('id', RCUBE_INPUT_GPC);
|
||||||
$success = $engine->delegate_delete($id, true);
|
$success = $engine->delegate_delete($id, (bool) get_input_value('acl', RCUBE_INPUT_GPC));
|
||||||
|
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$this->rc->output->show_message($this->gettext('deletesuccess'), 'confirmation');
|
$this->rc->output->show_message($this->gettext('deletesuccess'), 'confirmation');
|
||||||
|
|
|
@ -10,12 +10,16 @@ $labels['contact'] = 'Address Books';
|
||||||
$labels['event'] = 'Calendars';
|
$labels['event'] = 'Calendars';
|
||||||
$labels['task'] = 'Tasks';
|
$labels['task'] = 'Tasks';
|
||||||
$labels['note'] = 'Notes';
|
$labels['note'] = 'Notes';
|
||||||
|
$labels['yes'] = 'Yes';
|
||||||
|
$labels['no'] = 'No';
|
||||||
|
|
||||||
$labels['adddelegate'] = 'Add delegate';
|
$labels['adddelegate'] = 'Add delegate';
|
||||||
$labels['deletedelegate'] = 'Delete delegate';
|
$labels['deletedelegate'] = 'Delete delegate';
|
||||||
|
|
||||||
$labels['savingdata'] = 'Saving data...';
|
$labels['savingdata'] = 'Saving data...';
|
||||||
$labels['delegatedeleteconfirm'] = 'Do you really want to delete this delegate?';
|
$labels['delegatedeleteconfirm'] = 'Do you really want to delete this delegate?';
|
||||||
|
$labels['delegateremoveacl'] = 'remove access rights on folders assigned to this user';
|
||||||
|
$labels['deleteconfirm'] = 'Confirmation';
|
||||||
$labels['deletesuccess'] = 'The delegate was successfully removed.';
|
$labels['deletesuccess'] = 'The delegate was successfully removed.';
|
||||||
$labels['deleteerror'] = 'Could not remove delegate.';
|
$labels['deleteerror'] = 'Could not remove delegate.';
|
||||||
$labels['updatesuccess'] = 'The delegate was successfully updated.';
|
$labels['updatesuccess'] = 'The delegate was successfully updated.';
|
||||||
|
|
|
@ -84,3 +84,11 @@ div.foldersblock h3.note {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#delegate-delete-dialog {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#delegate-delete-dialog p {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
|
@ -35,5 +35,10 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="delegate-delete-dialog">
|
||||||
|
<p><roundcube:label name="kolab_delegation.delegatedeleteconfirm" /></p>
|
||||||
|
<span><input type="checkbox" value="1" checked="checked" /><roundcube:label name="kolab_delegation.delegateremoveacl" /></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -102,3 +102,15 @@ div.foldersblock h3.note {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#delegate-delete-dialog {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#delegate-delete-dialog p {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#delegate-delete-dialog input {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
|
@ -44,5 +44,10 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div id="delegate-delete-dialog">
|
||||||
|
<p><roundcube:label name="kolab_delegation.delegatedeleteconfirm" /></p>
|
||||||
|
<span><input type="checkbox" value="1" checked="checked" /><roundcube:label name="kolab_delegation.delegateremoveacl" /></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue