Show email action in addressbook's context menu

This commit is contained in:
Hadi Nategh 2013-12-19 10:31:44 +00:00
parent 1d14ecc80f
commit 78d3a5126f

View File

@ -307,7 +307,7 @@ class addressbook_ui extends addressbook_bo
$sel_options['org_view'] = $this->org_views; $sel_options['org_view'] = $this->org_views;
if (isset($org_view)) $content['nm']['org_view'] = $org_view; if (isset($org_view)) $content['nm']['org_view'] = $org_view;
$content['nm']['actions'] = $this->get_actions($do_email, $content['nm']['col_filter']['tid'], $content['nm']['org_view']); $content['nm']['actions'] = $this->get_actions($content['nm']['col_filter']['tid'], $content['nm']['org_view']);
if (!isset($sel_options['org_view'][(string) $content['nm']['org_view']])) if (!isset($sel_options['org_view'][(string) $content['nm']['org_view']]))
{ {
@ -330,12 +330,11 @@ class addressbook_ui extends addressbook_bo
/** /**
* Get actions / context menu items * Get actions / context menu items
* *
* @param boolean $do_email=false
* @param string $tid_filter=null * @param string $tid_filter=null
* @param string $org_view=null * @param string $org_view=null
* @return array see nextmatch_widget::get_actions() * @return array see nextmatch_widget::get_actions()
*/ */
private function get_actions($do_email=false, $tid_filter=null, $org_view=null) private function get_actions($tid_filter=null, $org_view=null)
{ {
// we have no org view (view of one org has context menu like regular "add contacts" view, as it shows contacts // we have no org view (view of one org has context menu like regular "add contacts" view, as it shows contacts
if (!isset($this->org_views[(string) $org_view])) if (!isset($this->org_views[(string) $org_view]))
@ -396,24 +395,21 @@ class addressbook_ui extends addressbook_bo
), ),
); );
} }
//Send to email
if ($do_email) $actions += array(
{ 'email' => array(
$actions += array( 'caption' => lang('Add %1',lang('business email')),
'email' => array( 'no_lang' => true,
'caption' => lang('Add %1',lang('business email')), 'onExecute' => 'javaScript:app.addressbook.addEmail',
'no_lang' => true, 'group' => ++$group,
'onExecute' => 'javaScript:app.addressbook.addEmail', ),
'group' => ++$group, 'email_home' => array(
), 'caption' => lang('Add %1',lang('home email')),
'email_home' => array( 'no_lang' => true,
'caption' => lang('Add %1',lang('home email')), 'onExecute' => 'javaScript:app.addressbook.addEmail',
'no_lang' => true, 'group' => $group,
'onExecute' => 'javaScript:app.addressbook.addEmail', ),
'group' => $group, );
),
);
}
++$group; // other AB related stuff group: lists, AB's, categories ++$group; // other AB related stuff group: lists, AB's, categories
// categories submenu // categories submenu