From a2971da463f5fb5b99c255865db7f08b2bf36686 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jun 2024 13:49:55 +0200 Subject: [PATCH] Debug v20 --- htdocs/core/lib/project.lib.php | 10 +++++++--- htdocs/projet/activity/perday.php | 8 ++++---- htdocs/projet/activity/permonth.php | 8 ++++++-- htdocs/projet/activity/perweek.php | 10 +++++++--- htdocs/theme/eldy/global.inc.php | 8 ++++++-- htdocs/theme/md/style.css.php | 2 +- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 562c1db904a..4776907192f 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1662,7 +1662,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr } // Select hour - print ''; + print ''; $tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask); print $tableCell; print ''; @@ -2063,7 +2063,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ // Fields to show current time $tableCell = ''; $modeinput = 'hours'; + $j = 0; for ($idw = 0; $idw < 7; $idw++) { + $j++; $tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); if (!isset($totalforeachday[$tmpday])) { $totalforeachday[$tmpday] = 0; @@ -2099,7 +2101,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $disabledtaskday = 1; } - $tableCell = ''; + $tableCell = ''; //$tableCell .= 'idw='.$idw.' '.$conf->global->MAIN_START_WEEK.' '.$numstartworkingday.'-'.$numendworkingday; $placeholder = ''; if ($alreadyspent) { @@ -2376,7 +2378,9 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $firstdaytoshowarray = dol_getdate($firstdaytoshow); $year = $firstdaytoshowarray['year']; $month = $firstdaytoshowarray['mon']; + $j = 0; foreach ($TWeek as $weekIndex => $weekNb) { + $j++; $weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0 ; if (!isset($totalforeachweek[$weekNb])) { $totalforeachweek[$weekNb] = 0; @@ -2396,7 +2400,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $disabledtaskweek = 1; } - $tableCell = ''; + $tableCell = ''; $placeholder = ''; if ($alreadyspent) { $tableCell .= ''; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 24a7d63d36f..292c19b82a0 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -685,7 +685,7 @@ print "\n"; $colspan = 2 + (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT') ? 0 : 2); -if ($conf->use_javascript_ajax) { +if ($conf->use_javascript_ajax && count($tasksarray) >= getDolGlobalInt('NBLINES_TO_DUPLICATE_TOTAL_TIMESPENT_ON_TOP', 10)) { print ''; print ''; print $langs->trans("Total"); @@ -757,7 +757,7 @@ if (count($tasksarray) > 0) { print ''; } print ''; - print ''; + print ''; $timeonothertasks = ($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]); //if ($timeonothertasks) //{ @@ -768,7 +768,7 @@ if (count($tasksarray) > 0) { print '">'; //} print ''; - print ' '; + print ' '; print ' '; print ''; } @@ -782,7 +782,7 @@ if (count($tasksarray) > 0) { print ''; print ''; } - print ''; + print ''; //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index f20a5cd88bf..f293576f07b 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -707,8 +707,10 @@ if (count($tasksarray) > 0) { print ''; print ''; } + $j = 0; foreach ($TWeek as $weekNb) { - print ''; + $j++; + print ''; $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]); if ($timeonothertasks) { @@ -733,8 +735,10 @@ if (count($tasksarray) > 0) { print ''; } + $j = 0; foreach ($TWeek as $weekNb) { - print '
'.convertSecondToTime($totalforvisibletasks[$weekNb], 'allhourmin').'
'; + $j++; + print '
'.convertSecondToTime($totalforvisibletasks[$weekNb], 'allhourmin').'
'; } print '
 
'; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 7d86383e671..a309b8235c6 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -707,7 +707,7 @@ print "\n"; $colspan = 1 + (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT') ? 0 : 2); // Show lines with total -if ($conf->use_javascript_ajax) { +if ($conf->use_javascript_ajax && count($tasksarray) >= getDolGlobalInt('NBLINES_TO_DUPLICATE_TOTAL_TIMESPENT_ON_TOP', 10)) { print ''; print ''; print $langs->trans("Total"); @@ -804,13 +804,15 @@ if (count($tasksarray) > 0) { print ''; print ''; } + $j = 0; for ($idw = 0; $idw < 7; $idw++) { + $j++; $cssweekend = ''; if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css. $cssweekend = 'weekend'; } - print ''; + print ''; $tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); $timeonothertasks = ($totalforeachday[$tmpday] - $totalforvisibletasks[$tmpday]); if ($timeonothertasks) { @@ -835,7 +837,9 @@ if (count($tasksarray) > 0) { print ''; } + $j = 0; for ($idw = 0; $idw < 7; $idw++) { + $j++; $cssweekend = ''; if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css. $cssweekend = 'weekend'; @@ -852,7 +856,7 @@ if (count($tasksarray) > 0) { $cssonholiday .= 'onholidayafternoon '; } - print '
 
'; + print '
 
'; } print '
 
'; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index eafa4007156..306d86dd940 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -533,11 +533,15 @@ td.onholidayallday:not(.weekend) input { background-color: #f8f7f0; } td.weekend { /* must be after td.onholidayallday */ - background-color: #eee; + background-color: #f8f4f4; } td.weekend input { - background-color: #f8f8f8; + /* background-color: #f8f8f8; */ } +tr:hover td.weekend { + background: var(--colorbacklinepairhover) !important; +} + /* td.leftborder, td.hide0 { border-left: 1px solid #ccc; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index cc42f6ae82c..21308c34410 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -736,7 +736,7 @@ td.weekend { /* must be after td.onholidayallday */ background-color: #eee; } td.weekend input { - background-color: #f8f8f8; + /* background-color: #f8f8f8; */ } td.leftborder, td.hide0 { border-left: 1px solid #ccc;