feat: Add auto-start timer configuration for task popup

This commit is contained in:
2026-02-08 21:48:23 +01:00
parent ba84cdab3d
commit 0c5a133aa7
3 changed files with 14 additions and 1 deletions

View File

@@ -130,6 +130,9 @@
<script type="text/javascript">
let isProgrammaticUpdate = false;
// Configuration: auto-start timer when opening task popup
var TASKS_AUTO_START_TIMER = <?= isset( $GLOBALS['settings']['tasks_auto_start_timer'] ) && $GLOBALS['settings']['tasks_auto_start_timer'] ? 'true' : 'false' ?>;
var tasks = [
<?
foreach ( $this -> tasks_gantt as $task ) {
@@ -309,7 +312,7 @@
stop_task_timer( task_id );
}
function task_popup( task_id, open_works_time = false, auto_start_timer = true ) {
function task_popup( task_id, open_works_time = false, auto_start_timer = TASKS_AUTO_START_TIMER ) {
var current_popup_task_id = $( '.task_popup .task_details' ).attr( 'task_id' );
var popup_already_open = $( '.task_popup' ).is( ':visible' ) && $( '.task_popup .task_details' ).length;
var should_auto_start_timer = auto_start_timer && !( popup_already_open && String( current_popup_task_id ) === String( task_id ) );