diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 523f93e97e496..aad0471027bd3 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -2119,6 +2119,9 @@ function setDetailVisibility() { break; } + // Line is invoiced if it has an invoice_id + $invoiced = $task_time->invoice_id ? true : false; + $date1 = $db->jdate($task_time->element_date); $date2 = $db->jdate($task_time->element_datehour); @@ -2156,7 +2159,18 @@ function setDetailVisibility() { $selected = 1; } print ' '; - print ''; + + // Disable select if task not billable or already invoiced + $disabled = (intval($task_time->billable) != 1 || $invoiced); + $ctrl = ''; + if ($disabled) { + // If disabled, a dbl-click very close outside the control + // will re-enable it, so that user is not blocked if needed. + print ''.$ctrl.''; + print ''; + } else { + print $ctrl; + } } } } @@ -2426,7 +2440,6 @@ function setDetailVisibility() { } // Invoiced - $invoiced = false; if (!empty($arrayfields['valuebilled']['checked'])) { print '