From cefb47641f126d884d45d7b32a3e6065b80ac4b2 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 13 Mar 2014 19:04:47 +0000 Subject: [PATCH] Fix & re-enable showing linked infologs of multiple contacts --- addressbook/inc/class.addressbook_ui.inc.php | 7 +++---- addressbook/js/app.js | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 52e4e12aa1..a103de576c 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -517,8 +517,7 @@ class addressbook_ui extends addressbook_bo 'infolog' => array( 'caption' => lang('View linked InfoLog entries'), 'icon' => 'infolog/navbar', - 'onExecute' => 'javaScript:app.addressbook.view_infolog', - 'allowOnMultiple' => false + 'onExecute' => 'javaScript:app.addressbook.view_infolog' ), 'infolog_add' => array( 'caption' => 'Add a new Infolog', @@ -778,7 +777,7 @@ window.egw_LAB.wait(function() { 'action' => 'addressbook', 'action_id' => implode(',',$checked), 'action_title' => $org, - )); + ),'infolog'); } function ajax_add_whole_list($list, $email_type = 'email') @@ -1273,7 +1272,7 @@ window.egw_LAB.wait(function() { if (isset($this->org_views[(string) $query['org_view']])) // we have an org view { - if($query['actions'] && $query['actions']['edit']) + if($query['actions'] && $query['actions']['open']) { // Just switched from contact view, update actions $query['actions'] = $this->get_actions($query['col_filter']['tid'], $query['org_view']); diff --git a/addressbook/js/app.js b/addressbook/js/app.js index a9ca34b53c..2104b920cc 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -183,9 +183,20 @@ app.classes.addressbook = AppJS.extend( action_id: [], action_title: _senders.length > 1 ? this.egw.lang('selected contacts') : '' }; - // Remove UID prefix for just contact_id - var id = _senders[0].id.split('::'); - extras.action_id = id[1]; + for(var i = 0; i < _senders.length; i++) + { + // Remove UID prefix for just contact_id + var ids = _senders[i].id.split('::'); + ids.shift(); + ids = ids.join('::'); + + // Orgs go through the server to get all IDs + if (ids.substr(0,9) == 'org_name:') + { + return nm_action(_action,_senders); + } + extras.action_id.push(ids); + } egw.open('', 'infolog', 'list', extras, 'infolog'); },