From cfc6993ddde9c953a1a58b5a7e900fb3460d6a2e Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 18 Jun 2018 11:57:25 -0600 Subject: [PATCH] Use same action for timsheet in list view as other views --- calendar/inc/class.calendar_uilist.inc.php | 4 ++-- calendar/inc/class.calendar_uiviews.inc.php | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index ea32013a81..50c5fe35cf 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -959,11 +959,11 @@ class calendar_uilist extends calendar_ui $actions['timesheet'] = array( // interactive add for a single event 'icon' => 'timesheet/navbar', 'caption' => 'Timesheet', - 'url' => 'menuaction=timesheet.timesheet_ui.edit&link_app[]=$app&link_id[]=$id', 'group' => $group, 'allowOnMultiple' => false, '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'), ); $actions['timesheet-add'] = array( // automatic add for multiple events diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index fccbf5e3f2..c06268ee24 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -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']['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']) { // TODO: See if we can get this working sensibly