diff --git a/plugins/kolab_delegation/kolab_delegation.js b/plugins/kolab_delegation/kolab_delegation.js index 9b08dc94..2462fa3c 100644 --- a/plugins/kolab_delegation/kolab_delegation.js +++ b/plugins/kolab_delegation/kolab_delegation.js @@ -130,10 +130,32 @@ rcube_webmail.prototype.delegate_add = function() // handler for delete commands rcube_webmail.prototype.delegate_delete = function() { - if (this.env.active_delegate && confirm(this.gettext('delegatedeleteconfirm', 'kolab_delegation'))) { - var lock = this.set_busy(true, 'kolab_delegation.savingdata'); - this.http_post('plugin.delegation-delete', {id: this.env.active_delegate}, lock); + if (!this.env.active_delegate) + return; + + 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 diff --git a/plugins/kolab_delegation/kolab_delegation.php b/plugins/kolab_delegation/kolab_delegation.php index 07be8163..b3882343 100644 --- a/plugins/kolab_delegation/kolab_delegation.php +++ b/plugins/kolab_delegation/kolab_delegation.php @@ -51,7 +51,7 @@ class kolab_delegation extends rcube_plugin $this->register_action('plugin.delegation-autocomplete', array($this, 'controller_action')); 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'); $skin_path = $this->local_skin_path(); $this->include_stylesheet("$skin_path/style.css"); @@ -221,7 +221,7 @@ class kolab_delegation extends rcube_plugin // Delegate delete if ($this->rc->action == 'plugin.delegation-delete') { $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) { $this->rc->output->show_message($this->gettext('deletesuccess'), 'confirmation'); diff --git a/plugins/kolab_delegation/localization/en_US.inc b/plugins/kolab_delegation/localization/en_US.inc index fed8e4c1..c445f7f9 100644 --- a/plugins/kolab_delegation/localization/en_US.inc +++ b/plugins/kolab_delegation/localization/en_US.inc @@ -10,12 +10,16 @@ $labels['contact'] = 'Address Books'; $labels['event'] = 'Calendars'; $labels['task'] = 'Tasks'; $labels['note'] = 'Notes'; +$labels['yes'] = 'Yes'; +$labels['no'] = 'No'; $labels['adddelegate'] = 'Add delegate'; $labels['deletedelegate'] = 'Delete delegate'; $labels['savingdata'] = 'Saving data...'; $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['deleteerror'] = 'Could not remove delegate.'; $labels['updatesuccess'] = 'The delegate was successfully updated.'; diff --git a/plugins/kolab_delegation/skins/classic/style.css b/plugins/kolab_delegation/skins/classic/style.css index c01a70b9..db227200 100644 --- a/plugins/kolab_delegation/skins/classic/style.css +++ b/plugins/kolab_delegation/skins/classic/style.css @@ -84,3 +84,11 @@ div.foldersblock h3.note { overflow: auto; margin-top: 0.5em; } + +#delegate-delete-dialog { + display: none; +} + +#delegate-delete-dialog p { + font-weight: bold; +} diff --git a/plugins/kolab_delegation/skins/classic/templates/settings.html b/plugins/kolab_delegation/skins/classic/templates/settings.html index ac701ff5..af75c322 100644 --- a/plugins/kolab_delegation/skins/classic/templates/settings.html +++ b/plugins/kolab_delegation/skins/classic/templates/settings.html @@ -35,5 +35,10 @@ +