Handle context action view infolog entries in JS, previously opened infolog list into addressbook tab

This commit is contained in:
Nathan Gray 2014-01-16 15:15:50 +00:00
parent 4b789c932d
commit 5a1fe439c5
2 changed files with 21 additions and 10 deletions

View File

@ -516,6 +516,8 @@ 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',
'allowOnMultiple' => false
), ),
'infolog_add' => array( 'infolog_add' => array(
'caption' => 'Add a new Infolog', 'caption' => 'Add a new Infolog',
@ -895,16 +897,6 @@ window.egw_LAB.wait(function() {
$Ok = false; $Ok = false;
break; break;
case 'infolog':
egw::redirect_link('/index.php',array(
'menuaction' => 'infolog.infolog_ui.index',
'action' => 'addressbook',
'action_id' => implode(',',$checked),
'action_title' => count($checked) > 1 ? lang('selected contacts') : '',
'ajax' => 'true'
));
break;
case 'merge': case 'merge':
$success = $this->merge($checked,$error_msg); $success = $this->merge($checked,$error_msg);
$failed = count($checked) - (int)$success; $failed = count($checked) - (int)$success;

View File

@ -109,6 +109,25 @@ app.classes.addressbook = AppJS.extend(
} }
}, },
/**
* View infolog entries linked to selected contact - just one, infolog fails with multiple
* @param {egwAction} _action Select action
* @param {egwActionObject[]} _senders Selected contact(s)
*/
view_infolog: function(_action, _senders)
{
var extras = {
action: 'addressbook',
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];
egw.open('', 'infolog', 'list', extras, 'infolog');
},
/** /**
* Add task for selected contacts, call default nm_action after some checks * Add task for selected contacts, call default nm_action after some checks
* *