Fix & re-enable showing linked infologs of multiple contacts

This commit is contained in:
Nathan Gray 2014-03-13 19:04:47 +00:00
parent fe21f0fd74
commit cefb47641f
2 changed files with 17 additions and 7 deletions

View File

@ -517,8 +517,7 @@ class addressbook_ui extends addressbook_bo
'infolog' => array( 'infolog' => array(
'caption' => lang('View linked InfoLog entries'), 'caption' => lang('View linked InfoLog entries'),
'icon' => 'infolog/navbar', 'icon' => 'infolog/navbar',
'onExecute' => 'javaScript:app.addressbook.view_infolog', 'onExecute' => 'javaScript:app.addressbook.view_infolog'
'allowOnMultiple' => false
), ),
'infolog_add' => array( 'infolog_add' => array(
'caption' => 'Add a new Infolog', 'caption' => 'Add a new Infolog',
@ -778,7 +777,7 @@ window.egw_LAB.wait(function() {
'action' => 'addressbook', 'action' => 'addressbook',
'action_id' => implode(',',$checked), 'action_id' => implode(',',$checked),
'action_title' => $org, 'action_title' => $org,
)); ),'infolog');
} }
function ajax_add_whole_list($list, $email_type = 'email') 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 (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 // Just switched from contact view, update actions
$query['actions'] = $this->get_actions($query['col_filter']['tid'], $query['org_view']); $query['actions'] = $this->get_actions($query['col_filter']['tid'], $query['org_view']);

View File

@ -183,9 +183,20 @@ app.classes.addressbook = AppJS.extend(
action_id: [], action_id: [],
action_title: _senders.length > 1 ? this.egw.lang('selected contacts') : '' action_title: _senders.length > 1 ? this.egw.lang('selected contacts') : ''
}; };
// Remove UID prefix for just contact_id for(var i = 0; i < _senders.length; i++)
var id = _senders[0].id.split('::'); {
extras.action_id = id[1]; // 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'); egw.open('', 'infolog', 'list', extras, 'infolog');
}, },