diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 57d06f6072..51e3a63789 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -2742,7 +2742,7 @@ class addressbook_ui extends addressbook_bo if(is_array($content)) { $button = key($content['button']); - switch ($content['toolbar'] ? $content['toolbar'] : $button) + switch ($button) { case 'vcard': Egw::redirect_link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$content['id']); @@ -2844,8 +2844,7 @@ class addressbook_ui extends addressbook_bo // make everything not explicit mentioned readonly $readonlys['__ALL__'] = true; - $readonlys['photo'] = $readonlys['button[cancel]'] = $readonlys['button[copy]'] = - $readonlys['button[ok]'] = $readonlys['button[more]'] = $readonlys['toolbar'] = false; + $readonlys['photo'] = $readonlys['button[copy]'] =false; foreach(array_keys($this->contact_fields) as $key) { @@ -2945,40 +2944,6 @@ class addressbook_ui extends addressbook_bo // dont show an app-header $GLOBALS['egw_info']['flags']['app_header'] = ''; - $actions = array( - 'open' => array( - 'caption' => 'Open', - 'toolbarDefault' => true, - ), - 'copy' => 'Copy', - 'delete' => array( - 'caption' => 'Delete', - 'confirm' => 'Delete this entry', - ), - 'cancel' => array( - 'caption' => 'Cancel', - 'toolbarDefault' => true, - 'icon' => 'close' - ), - 'back' => array( - 'caption' => 'Back', - 'toolbarDefault' => true, - ), - 'next' => array( - 'caption' => 'Next', - 'toolbarDefault' => true, - ), - ); - if (!isset($content['index']) || !$content['index']) - { - unset($actions['back']); - } - if (!isset($content['index']) || $content['index'] >= $num_rows-1) - { - unset($actions['next']); - } - $this->tmpl->setElementAttribute('toolbar', 'actions', $actions); - // always show sidebox, as it contains contact-data unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']); diff --git a/addressbook/js/app.js b/addressbook/js/app.js index ac01850987..51a7386aed 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -227,20 +227,22 @@ var AddressbookApp = /** @class */ (function (_super) { * * @param {object} _action */ - AddressbookApp.prototype.view_actions = function (_action) { - var id = this.et2.getArrayMgr('content').data.id; - switch (_action.id) { - case 'open': + AddressbookApp.prototype.view_actions = function (_action, _widget) { + var app_id = _widget.dom_id.split('_'); + var et2 = etemplate2_1.etemplate2.getById(app_id[0]); + var id = et2.widgetContainer.getArrayMgr('content').data.id; + switch (_widget.id) { + case 'button[edit]': this.egw.open(id, 'addressbook', 'edit'); break; - case 'copy': + case 'button[copy]': this.egw.open(id, 'addressbook', 'edit', { makecp: 1 }); break; - case 'cancel': - this.egw.open(null, 'addressbook', 'list', null, '_self', 'addressbook'); + case 'button[delete]': + et2_dialog.confirm(_widget, egw.lang('Delete this contact?'), egw.lang('Delete')); break; default: // submit all other buttons back to server - this.et2._inst.submit(); + et2.widgetContainer._inst.submit(); break; } }; diff --git a/addressbook/js/app.ts b/addressbook/js/app.ts index b2d281131d..5d0f8b6173 100644 --- a/addressbook/js/app.ts +++ b/addressbook/js/app.ts @@ -258,23 +258,26 @@ class AddressbookApp extends EgwApp * * @param {object} _action */ - view_actions(_action) + view_actions(_action, _widget) { - var id = this.et2.getArrayMgr('content').data.id; - switch(_action.id) + var app_id = _widget.dom_id.split('_'); + var et2 = etemplate2.getById(app_id[0]); + var id = et2.widgetContainer.getArrayMgr('content').data.id; + + switch(_widget.id) { - case 'open': + case 'button[edit]': this.egw.open(id, 'addressbook', 'edit'); break; - case 'copy': + case 'button[copy]': this.egw.open(id, 'addressbook', 'edit', { makecp: 1}); break; - case 'cancel': - this.egw.open(null, 'addressbook', 'list', null, '_self', 'addressbook'); + case 'button[delete]': + et2_dialog.confirm(_widget, egw.lang('Delete this contact?'), egw.lang('Delete')); break; default: // submit all other buttons back to server - this.et2._inst.submit(); + et2.widgetContainer._inst.submit(); break; } } diff --git a/addressbook/templates/default/app.css b/addressbook/templates/default/app.css index b68cf3ab3a..15e720cb2b 100644 --- a/addressbook/templates/default/app.css +++ b/addressbook/templates/default/app.css @@ -13,7 +13,7 @@ td.addressbook_sidebox_header { height: 20px; vertical-align: bottom; } -#addressbook-view.et2_container { +form[id^=addressbook-view].et2_container { height: 0 !important; } td.addressbook_sidebox_toolbar { diff --git a/addressbook/templates/default/view.xet b/addressbook/templates/default/view.xet index 6e55875466..48fddb0f6a 100644 --- a/addressbook/templates/default/view.xet +++ b/addressbook/templates/default/view.xet @@ -51,7 +51,11 @@ - + +