Use same action for timsheet in list view as other views

This commit is contained in:
nathangray 2018-06-18 11:57:25 -06:00
parent b049a68cb9
commit 17daf70e8a
2 changed files with 2 additions and 7 deletions

View File

@ -959,11 +959,11 @@ class calendar_uilist extends calendar_ui
$actions['timesheet'] = array( // interactive add for a single event $actions['timesheet'] = array( // interactive add for a single event
'icon' => 'timesheet/navbar', 'icon' => 'timesheet/navbar',
'caption' => 'Timesheet', 'caption' => 'Timesheet',
'url' => 'menuaction=timesheet.timesheet_ui.edit&link_app[]=$app&link_id[]=$id',
'group' => $group, 'group' => $group,
'allowOnMultiple' => false, 'allowOnMultiple' => false,
'hideOnDisabled' => true, // show only one timesheet action in context menu 'hideOnDisabled' => true, // show only one timesheet action in context menu
'onExecute' => 'javaScript:app.calendar.cal_fix_app_id', 'onExecute' => 'javaScript:app.calendar.action_open',
'open' => '{"app": "timesheet", "type": "add", "extra": "link_app[]=$app&link_id[]=$app_id"}',
'popup' => Link::get_registry('timesheet', 'add_popup'), 'popup' => Link::get_registry('timesheet', 'add_popup'),
); );
$actions['timesheet-add'] = array( // automatic add for multiple events $actions['timesheet-add'] = array( // automatic add for multiple events

View File

@ -931,11 +931,6 @@ class calendar_uiviews extends calendar_ui
$actions['infolog_app']['open'] = '{"app": "infolog", "type": "add", "extra": "type=task&action=$app&action_id=$id"}'; $actions['infolog_app']['open'] = '{"app": "infolog", "type": "add", "extra": "type=task&action=$app&action_id=$id"}';
$actions['infolog_app']['onExecute'] = 'javaScript:app.calendar.action_open'; $actions['infolog_app']['onExecute'] = 'javaScript:app.calendar.action_open';
} }
if ($actions['timesheet'])
{
$actions['timesheet']['open'] = '{"app": "timesheet", "type": "add", "extra": "link_app[]=$app&link_id[]=$app_id"}';
$actions['timesheet']['onExecute'] = 'javaScript:app.calendar.action_open';
}
if ($actions['documents']) if ($actions['documents'])
{ {
// TODO: See if we can get this working sensibly // TODO: See if we can get this working sensibly