* InfoLog: new context menu: View parent with children

This commit is contained in:
Ralf Becker 2015-02-13 18:03:40 +00:00
parent 40f3961901
commit f994089389
4 changed files with 45 additions and 2 deletions

View File

@ -456,7 +456,7 @@ class infolog_ui
$rows = array(); $rows = array();
// Don't add parent in if info_id_parent (expanding to show subs) // 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(); $parents = $query['action'] == 'sp' && $query['action_id'] ? (array)$query['action_id'] : array();
if (count($parents) == 1 && is_array($query['action_id'])) if (count($parents) == 1 && is_array($query['action_id']))
@ -1064,6 +1064,14 @@ class infolog_ui
'popup' => egw_link::get_registry('infolog', 'add_popup'), 'popup' => egw_link::get_registry('infolog', 'add_popup'),
'group' => $group=1, '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( 'add' => array(
'caption' => 'Add', 'caption' => 'Add',
'group' => $group, 'group' => $group,

View File

@ -520,5 +520,38 @@ app.classes.infolog = AppJS.extend(
{ {
var widget = this.et2.getWidgetById('info_subject'); var widget = this.et2.getWidgetById('info_subject');
if(widget) return widget.options.value; 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;
} }
}); });

View File

@ -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 all subs of this entry infolog de alle Untereinträge dieses Eintrag anzeigen
view other subs infolog de andere Untereinträge anzeigen view other subs infolog de andere Untereinträge anzeigen
view parent infolog de Elterneintrag 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 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 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 view this linked entry in its application infolog de diesen verknüpfen Eintrag in seiner Anwendung anzeigen

View File

@ -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 all subs of this entry infolog en View all subs of this entry
view other subs infolog en View other subs view other subs infolog en View other subs
view parent infolog en View parent view parent infolog en View parent
view parent with children infolog en View parent with children
view subs infolog en View subs 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 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 view this linked entry in its application infolog en View this linked entry in its application