diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index a658c979a6..428a60bf92 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -362,21 +362,21 @@ class timesheet_ui extends timesheet_bo 'referer' => $referer, 'ts_title_blur' => $content['ts_title_blur'], ); - $content = array_merge($this->data,array( - 'msg' => $msg, - 'view' => $view, - 'tabs' => $content['tabs'], - 'link_to' => array( - 'to_id' => $this->data['ts_id'] ? $this->data['ts_id'] : + $content = array_merge($this->data, array( + 'msg' => $msg, + 'view' => $view, + 'tabs' => $content['tabs'], + 'link_to' => array( + 'to_id' => $this->data['ts_id'] ? $this->data['ts_id'] : ($this->data['link_to']['to_id'] ? $this->data['link_to']['to_id'] : $content['link_to']['to_id']), 'to_app' => TIMESHEET_APP, ), - 'ts_quantity_blur' => $this->data['ts_duration'] ? round($this->data['ts_duration'] / 60.0,3) : '', - 'ts_quantity' => $this->data['ts_duration']/60.0 == $this->data['ts_quantity'] ? null : $this->data['ts_quantity'], - 'start_time' => isset($this->data['start_time']) ? $this->data['start_time'] : $this->data['ts_start'], - 'pm_integration' => $this->pm_integration, - 'no_ts_status' => !$this->status_labels && ($this->data['ts_status'] != self::DELETED_STATUS), - 'tabs' => $_GET['tabs'] ?? 'general', + 'ts_quantity_blur' => $this->data['ts_duration'] ? round($this->data['ts_duration'] / 60.0, 3) : '', + 'ts_quantity' => $this->data['ts_duration'] / 60.0 == $this->data['ts_quantity'] ? null : (float)$this->data['ts_quantity'], + 'start_time' => isset($this->data['start_time']) ? $this->data['start_time'] : $this->data['ts_start'], + 'pm_integration' => $this->pm_integration, + 'no_ts_status' => !$this->status_labels && ($this->data['ts_status'] != self::DELETED_STATUS), + 'tabs' => $_GET['tabs'] ?? 'general', )); $links = array(); // create links specified in the REQUEST (URL) diff --git a/timesheet/js/app.ts b/timesheet/js/app.ts index c6a198c226..5f92af3991 100644 --- a/timesheet/js/app.ts +++ b/timesheet/js/app.ts @@ -202,8 +202,18 @@ class TimesheetApp extends EgwApp const quantity = this.et2.getWidgetById("ts_quantity"); if(quantity) { + // use decimal separator from user prefs + const format = this.egw.preference('number_format'); + const sep = format ? format[0] : '.'; + // Duration is in minutes, round to hours with 1 decimal - quantity.placeholder = Math.round(parseInt(widget.value) / 6) / 10; + let val = "" + (Math.round(parseInt(widget.value) / 6) / 10); + if(format && sep && sep !== '.') + { + val = val.replace('.', sep); + } + + quantity.placeholder = val; } }