From 9f58502839ecc0c28fd92a4d8cab9d78d925db8b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 28 Mar 2018 13:31:05 +0000 Subject: [PATCH] Unified addressbook folder edit/create forms with the rest of plugins --- .../kolab_addressbook/kolab_addressbook.js | 90 ++++++--------- .../kolab_addressbook/kolab_addressbook.php | 15 +-- .../lib/kolab_addressbook_ui.php | 108 +++++++----------- .../skins/elastic/templates/bookedit.html | 13 --- .../skins/larry/templates/bookedit.html | 22 ---- 5 files changed, 90 insertions(+), 158 deletions(-) delete mode 100644 plugins/kolab_addressbook/skins/elastic/templates/bookedit.html delete mode 100644 plugins/kolab_addressbook/skins/larry/templates/bookedit.html diff --git a/plugins/kolab_addressbook/kolab_addressbook.js b/plugins/kolab_addressbook/kolab_addressbook.js index e2f700a1..8e455c18 100644 --- a/plugins/kolab_addressbook/kolab_addressbook.js +++ b/plugins/kolab_addressbook/kolab_addressbook.js @@ -29,9 +29,6 @@ if (window.rcmail) { rcmail.addEventListener('init', function() { rcmail.set_book_actions(); - if (rcmail.gui_objects.editform && rcmail.env.action.match(/^plugin\.book/)) { - rcmail.enable_command('book-save', true); - } // contextmenu kolab_addressbook_contextmenu(); @@ -142,12 +139,48 @@ rcube_webmail.prototype.set_book_actions = function() rcube_webmail.prototype.book_create = function() { - this.book_show_contentframe('create'); + this.book_dialog('create'); }; rcube_webmail.prototype.book_edit = function() { - this.book_show_contentframe('edit'); + this.book_dialog('edit'); +}; + +// displays page with book edit/create form +rcube_webmail.prototype.book_dialog = function(action) +{ + var title = rcmail.gettext('kolab_addressbook.book' + action), + params = {_act: action, _source: this.book_realname(), _framed: 1}, + dialog = $('