';
+ global $daytoparse;
+ $tmparray = dol_getdate($daytoparse,true); // detail of current day
+ $idw = $tmparray['wday'];
+ global $numstartworkingday, $numendworkingday;
+ $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';
+ }
+
+ // Duration
+ print '
';
+ global $numstartworkingday, $numendworkingday;
+ $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';
+ }
+
+ $tableCell ='
';
// By default, we can edit only tasks we are assigned to
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
// Get if user is available or not for each day
$holiday = new Holiday($db);
+
$isavailable=array();
+if (! empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
+{
+ $tmparray=explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
+ if (count($tmparray) >= 2)
+ {
+ $numstartworkingday = $tmparray[0];
+ $numendworkingday = $tmparray[1];
+ }
+}
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse); // $daytoparse is a date with hours = 0
$isavailable[$daytoparse]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
+$tmparray = dol_getdate($daytoparse,true); // detail of current day
+$idw = $tmparray['wday'];
+
+$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 '
'.$langs->trans("Duration").'
';
+print '
'.$langs->trans("Note").'
';
+print '
';
+print "\n";
+
+
if (count($tasksarray) > 0)
{
//var_dump($tasksarray); // contains only selected tasks
@@ -571,13 +590,24 @@ if (count($tasksarray) > 0)
if ($conf->use_javascript_ajax)
{
- print '
';
+
+ $tmparray = dol_getdate($daytoparse,true); // detail of current day
+ $idw = $tmparray['wday'];
+
+ $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 '
';
}
@@ -489,12 +489,22 @@ $startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['fi
// Get if user is available or not for each day
$holiday = new Holiday($db);
-$isavailable=array();
-for ($i=0;$i<7;$i++)
+$isavailable=array();
+if (! empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
{
- $dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $i, 'd'); // $firstdaytoshow is a date with hours = 0
- $dayinloop = dol_time_plus_duree($startday, $i, 'd');
+ $tmparray=explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
+ if (count($tmparray) >= 2)
+ {
+ $numstartworkingday = $tmparray[0];
+ $numendworkingday = $tmparray[1];
+ }
+}
+
+for ($idw=0; $idw<7; $idw++)
+{
+ $dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
+ $dayinloop = dol_time_plus_duree($startday, $idw, 'd');
// Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow
//$tmparray = dol_getdate($dayinloop);
@@ -505,7 +515,14 @@ for ($i=0;$i<7;$i++)
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow);
$isavailable[$dayinloopfromfirstdaytoshow]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
- print '
';
+
+ $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 '
';
+ $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 '
';
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
$timeonothertasks=($totalforeachday[$tmpday] - $totalforvisibletasks[$tmpday]);
if ($timeonothertasks)
@@ -599,15 +622,19 @@ if (count($tasksarray) > 0)
+ print '';
+
+ for ($idw = 0; $idw < 7; $idw++)
+ {
+ $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 '