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 @@
-
+
+
+
+
+
diff --git a/addressbook/templates/pixelegg/app.css b/addressbook/templates/pixelegg/app.css
index c3dce0edee..5312979cfb 100755
--- a/addressbook/templates/pixelegg/app.css
+++ b/addressbook/templates/pixelegg/app.css
@@ -27,7 +27,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 {
@@ -200,22 +200,22 @@ select#addressbook-index_col_filter\[tid\] {
vertical-align: top;
margin-right: 5px;
}
- div.addressbook_view_sidebox #addressbook-view_n_fn {
+ div.addressbook_view_sidebox .addressbook_sidebox_name {
font-size: 14px;
font-weight: bold;
padding: 2px 0 2px 0;
width: 85%;
}
- div.addressbook_view_sidebox #addressbook-view_org_name {
+ div.addressbook_view_sidebox .addressbook_sidebox_org {
font-size: 14px;
padding: 2px 0 2px 0;
width: 85%;
}
- div.addressbook_view_sidebox #addressbook-view_org_unit {
+ div.addressbook_view_sidebox span[id^=addressbook-view-addressbook][id$=_org_unit] {
font-size: 11px;
padding: 2px 0 2px 0;
}
- div.addressbook_view_sidebox #addressbook-view_adr_one_locality {
+ div.addressbook_view_sidebox span[id^=addressbook-view-addressbook][id$=_adr_one_locality] {
font-size: 11px;
padding: 2px 0 2px 0;
}
diff --git a/addressbook/templates/pixelegg/app.less b/addressbook/templates/pixelegg/app.less
index 7c8e1265b8..cd647351ba 100755
--- a/addressbook/templates/pixelegg/app.less
+++ b/addressbook/templates/pixelegg/app.less
@@ -53,25 +53,25 @@
margin-right: 5px;
}
// name
- #addressbook-view_n_fn {
+ .addressbook_sidebox_name {
.fontsize_xl;
font-weight: bold;
padding: 2px 0 2px 0;
width: 85%;
}
// org
- #addressbook-view_org_name {
+ .addressbook_sidebox_org {
.fontsize_xl;
padding: 2px 0 2px 0;
width: 85%;
}
// Unit
- #addressbook-view_org_unit {
+ span[id^=addressbook-view-addressbook][id $=_org_unit] {
.fontsize_m;
padding: 2px 0 2px 0;
}
// Ort
- #addressbook-view_adr_one_locality {
+ span[id^=addressbook-view-addressbook][id $=_adr_one_locality] {
.fontsize_m;
padding: 2px 0 2px 0;
}
diff --git a/api/js/etemplate/etemplate2.js b/api/js/etemplate/etemplate2.js
index ea3ba8bb7b..5c657fdeed 100644
--- a/api/js/etemplate/etemplate2.js
+++ b/api/js/etemplate/etemplate2.js
@@ -84,7 +84,7 @@ var egw_app_1 = require("../jsapi/egw_app");
* @param _menuaction is the URL to which the form data should be submitted.
*/
var etemplate2 = /** @class */ (function () {
- function etemplate2(_container, _menuaction) {
+ function etemplate2(_container, _menuaction, _uniqueId) {
if (typeof _menuaction == "undefined") {
_menuaction = "EGroupware\\Api\\Etemplate::ajax_process_content";
}
@@ -92,7 +92,7 @@ var etemplate2 = /** @class */ (function () {
this._DOMContainer = _container;
this.menuaction = _menuaction;
// Unique ID to prevent DOM collisions across multiple templates
- this.uniqueId = _container.getAttribute("id") ? _container.getAttribute("id").replace('.', '-') : '';
+ this.uniqueId = _uniqueId ? _uniqueId : (_container.getAttribute("id") ? _container.getAttribute("id").replace('.', '-') : '');
/**
* Preset the object variable
* @type {et2_container}
@@ -1013,6 +1013,7 @@ var etemplate2 = /** @class */ (function () {
else {
// Not etemplate
var node = document.getElementById(data.DOMNodeID);
+ var uniqueId = '';
if (node) {
if (node.children.length) {
// Node has children already? Check for loading over an
@@ -1021,7 +1022,10 @@ var etemplate2 = /** @class */ (function () {
if (old)
old.clear();
}
- var et2 = new etemplate2(node, data.menuaction);
+ if (data['open_target']) {
+ uniqueId = data.DOMNodeID.replace('.', '-') + '-' + data['open_target'];
+ }
+ var et2 = new etemplate2(node, data.menuaction, uniqueId);
et2.load(data.name, data.url, data.data, null, null, null, data['open-target']);
return true;
}
diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts
index 900c90c337..0ca52189d8 100644
--- a/api/js/etemplate/etemplate2.ts
+++ b/api/js/etemplate/etemplate2.ts
@@ -112,7 +112,7 @@ export class etemplate2
private app_obj: EgwApp;
app: string;
- constructor(_container : HTMLElement, _menuaction? : string)
+ constructor(_container : HTMLElement, _menuaction? : string, _uniqueId?: string)
{
if (typeof _menuaction == "undefined")
{
@@ -124,7 +124,7 @@ export class etemplate2
this.menuaction = _menuaction;
// Unique ID to prevent DOM collisions across multiple templates
- this.uniqueId = _container.getAttribute("id") ? _container.getAttribute("id").replace('.', '-') : '';
+ this.uniqueId = _uniqueId ? _uniqueId : (_container.getAttribute("id") ? _container.getAttribute("id").replace('.', '-') : '');
/**
* Preset the object variable
@@ -1302,6 +1302,7 @@ export class etemplate2
{
// Not etemplate
const node = document.getElementById(data.DOMNodeID);
+ let uniqueId = '';
if (node)
{
if (node.children.length)
@@ -1311,7 +1312,11 @@ export class etemplate2
const old = etemplate2.getById(node.id);
if (old) old.clear();
}
- const et2 = new etemplate2(node, data.menuaction);
+ if (data['open_target'])
+ {
+ uniqueId = data.DOMNodeID.replace('.', '-') + '-' + data['open_target'];
+ }
+ const et2 = new etemplate2(node, data.menuaction, uniqueId);
et2.load(data.name, data.url, data.data, null, null, null, data['open-target']);
return true;
}
diff --git a/api/js/framework/fw_base.js b/api/js/framework/fw_base.js
index 490dd1db55..55fe9b1eb0 100644
--- a/api/js/framework/fw_base.js
+++ b/api/js/framework/fw_base.js
@@ -680,9 +680,10 @@ var fw_base = (function(){ "use strict"; return Class.extend(
var app = this.parseAppFromUrl(_link);
if (app)
{
- var appname = app.appName+":"+(_extra.id ? _extra.id : btoa(_link));
+ var appname = app.appName+"-"+(_extra.id ? _extra.id : btoa(_link));
+ var self = this;
// add target flag
- _link += '&target='+appname;
+ _link += '&fw_target='+appname;
// create an actual clone of existing app object
this.applications[appname] = jQuery.extend(true, {}, app);
// merge extra framework app data into the new one
@@ -693,7 +694,9 @@ var fw_base = (function(){ "use strict"; return Class.extend(
this.applications[appname]['browser'] = null; // must be rest to create a new browser content
this.applications[appname]['sidemenuEntry'] = this.sidemenuUi.addEntry(
this.applications[appname].displayName, this.applications[appname].icon,
- this.applicationClickCallback, this.applications[appname], appname);
+ function(){
+ self.applicationTabNavigate(self.applications[appname], _link, false, -1, null);
+ }, this.applications[appname], appname);
this.applicationTabNavigate(this.applications[appname], _link, false, -1, null);
diff --git a/api/src/Etemplate.php b/api/src/Etemplate.php
index d0b9fb87a3..5f3bc90375 100644
--- a/api/src/Etemplate.php
+++ b/api/src/Etemplate.php
@@ -527,7 +527,8 @@ class Etemplate extends Etemplate\Widget\Template
$this->version=$version, $this->laod_via = $load_via);
//error_log(__METHOD__."('$name', '$template_set', '$lang', $group, '$version', '$load_via') rel_path=".array2string($this->rel_path));
- $this->dom_id = $name;
+ $this->dom_id = isset($_GET['fw_target']) && preg_match('/^[a-z0-9-]+$/i', $_GET['fw_target']) ?
+ $name.'-'.$_GET['fw_target'] : $name;
return (boolean)$this->rel_path;
}
diff --git a/api/src/Framework/Ajax.php b/api/src/Framework/Ajax.php
index 38a65af59a..b0f504074e 100755
--- a/api/src/Framework/Ajax.php
+++ b/api/src/Framework/Ajax.php
@@ -1007,7 +1007,7 @@ abstract class Ajax extends Api\Framework
$GLOBALS['egw']->framework->response->call('egw.set_preferences',
(array)$GLOBALS['egw_info']['user']['preferences'][$app], $app);
// flag to indicate target of output e.g. _tab
- if ($_GET['target']) $GLOBALS['egw']->framework->set_extra('open','target',$_GET['target']);
+ if ($_GET['fw_target']) $GLOBALS['egw']->framework->set_extra('open','target',$_GET['fw_target']);
// call application menuaction
ob_start();
$obj->$method();