feat: Remove tasks auto-start timer setting and related logic from task popup

This commit is contained in:
2026-02-22 17:26:10 +01:00
parent 8d4d539283
commit 86d96f1d39
4 changed files with 1 additions and 480 deletions

View File

@@ -130,9 +130,6 @@
<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 ) {
@@ -326,20 +323,11 @@
function close_task_popup() {
var popup = $( '.task_popup' );
var details = popup.find( '.task_details' );
var task_id = details.attr( 'task_id' );
var is_timer_running = details.find( '.task_end' ).length && !details.find( '.task_end' ).hasClass( 'hidden' );
popup.empty().hide();
if ( task_id && is_timer_running )
stop_task_timer( task_id );
}
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 ) );
function task_popup( task_id, open_works_time = false ) {
$.ajax({
url: '/tasks/task_popup/',
@@ -375,9 +363,6 @@
if ( open_works_time )
$( '.task_popup .task_details' ).addClass( 'open_works_time' );
if ( should_auto_start_timer )
start_task_timer( task_id );
}
});
}