feat: Add auto-start timer configuration for task popup
This commit is contained in:
@@ -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 ) );
|
||||
|
||||
Reference in New Issue
Block a user