From e5d58dc40ff232d173f6a55658174fb0aba6fd6e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 13 Feb 2015 18:03:59 +0000 Subject: [PATCH] * InfoLog: new context menu: View parent with children --- infolog/inc/class.infolog_ui.inc.php | 10 +++++++- infolog/js/app.js | 35 +++++++++++++++++++++++++++- infolog/lang/egw_de.lang | 1 + infolog/lang/egw_en.lang | 1 + 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index e2d8ceacbb..93e942043f 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -456,7 +456,7 @@ class infolog_ui $rows = array(); // Don't add parent in if info_id_parent (expanding to show subs) - if ($query['action_id'] && !$query['col_filter']['info_id_parent']) + if ($query['action_id'] && $query['csv_export'] !== 'children') { $parents = $query['action'] == 'sp' && $query['action_id'] ? (array)$query['action_id'] : array(); if (count($parents) == 1 && is_array($query['action_id'])) @@ -1064,6 +1064,14 @@ class infolog_ui 'popup' => egw_link::get_registry('infolog', 'add_popup'), 'group' => $group=1, ), + 'parent' => array( + 'caption' => 'View parent with children', + 'icon' => 'up.grey', + 'allowOnMultiple' => false, + 'enabled' => 'javaScript:app.infolog.has_parent', + 'onExecute' => 'javaScript:app.infolog.view_parent', + 'group' => $group, + ), 'add' => array( 'caption' => 'Add', 'group' => $group, diff --git a/infolog/js/app.js b/infolog/js/app.js index fd41986738..f8c1e04f45 100644 --- a/infolog/js/app.js +++ b/infolog/js/app.js @@ -511,7 +511,7 @@ app.classes.infolog = AppJS.extend( }; egw.open('','infolog','add',extras); }, - + /** * Get title in order to set it as document title * @returns {string} @@ -520,5 +520,38 @@ app.classes.infolog = AppJS.extend( { var widget = this.et2.getWidgetById('info_subject'); if(widget) return widget.options.value; + }, + + /** + * View parent entry with all children + * + * @param {aciton object} _action + * @param {object} _selected + */ + view_parent: function(_action, _selected) + { + var data = egw.dataGetUIDdata(_selected[0].id); + if (data && data.data && data.data.info_id_parent) + { + egw.link_handler(egw.link('/index.php', { + menuaction: "infolog.infolog_ui.index", + action: "sp", + action_id: data.data.info_id_parent, + ajax: "true" + }), "infolog"); + } + }, + + /** + * Go to parent entry + * + * @param {aciton object} _action + * @param {object} _selected + */ + has_parent: function(_action, _selected) + { + var data = egw.dataGetUIDdata(_selected[0].id); + + return data && data.data && data.data.info_id_parent > 0; } }); diff --git a/infolog/lang/egw_de.lang b/infolog/lang/egw_de.lang index b185fbfd05..a5e4861a8e 100644 --- a/infolog/lang/egw_de.lang +++ b/infolog/lang/egw_de.lang @@ -502,6 +502,7 @@ values for selectbox infolog de Werte für die Auswahlbox view all subs of this entry infolog de alle Untereinträge dieses Eintrag anzeigen view other subs infolog de andere Untereinträge anzeigen view parent infolog de Elterneintrag anzeigen +view parent with children infolog de Elterneintrag mit Untereinträgen anzeigen view subs infolog de Untereinträge anzeigen view the parent of this entry and all his subs infolog de übergeordneter Eintrag mit allen seinen Untereinträgen anzeigen view this linked entry in its application infolog de diesen verknüpfen Eintrag in seiner Anwendung anzeigen diff --git a/infolog/lang/egw_en.lang b/infolog/lang/egw_en.lang index 1cc620454a..9de1e5a82c 100644 --- a/infolog/lang/egw_en.lang +++ b/infolog/lang/egw_en.lang @@ -503,6 +503,7 @@ values for selectbox infolog en Values for select box view all subs of this entry infolog en View all subs of this entry view other subs infolog en View other subs view parent infolog en View parent +view parent with children infolog en View parent with children view subs infolog en View subs view the parent of this entry and all his subs infolog en View the parent of this entry and all other subs view this linked entry in its application infolog en View this linked entry in its application