From 693cf1f11675825bad1a74b9d61e86395b5e9663 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 3 Nov 2022 13:51:27 +0100 Subject: [PATCH] run same logic for timer timesheets started on an other app's entry, as used for timesheets manually booked on them --- timesheet/inc/class.timesheet_ui.inc.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 61fdff8e9f..f32d0deff6 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -112,11 +112,19 @@ class timesheet_ui extends timesheet_bo { if (!empty($event['tse_app']) && $event['tse_app'] !== TIMESHEET_APP && !empty($event['tse_app_id'])) { - if (!isset($this->data['link_to']['to_id'])) + if (!isset($_REQUEST['link_app'])) { - $this->data['link_to']['to_id'] = $this->data['ts_id'] ?? []; + $_REQUEST['link_app'] = $event['tse_app']; + $_REQUEST['link_id'] = $event['tse_app_id']; + } + else + { + if (!isset($this->data['link_to']['to_id'])) + { + $this->data['link_to']['to_id'] = $this->data['ts_id'] ?? []; + } + Api\Link::link(TIMESHEET_APP, $this->data['link_to']['to_id'], $event['tse_app'], $event['tse_app_id']); } - Api\Link::link(TIMESHEET_APP, $this->data['link_to']['to_id'], $event['tse_app'], $event['tse_app_id']); } } }