CSS
This commit is contained in:
parent
4d94327ead
commit
f659b62316
@ -302,7 +302,7 @@ $projectstatic=new Project($db);
|
||||
$project = new Project($db);
|
||||
$taskstatic = new Task($db);
|
||||
$thirdpartystatic = new Societe($db);
|
||||
|
||||
$holiday = new Holiday($db);
|
||||
|
||||
$prev = dol_getdate($daytoparse - (24 * 3600));
|
||||
$prev_year = $prev['year'];
|
||||
@ -487,8 +487,6 @@ print '<td class="center leftborder">'.$langs->trans("HourStart").'</td>';
|
||||
$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))
|
||||
{
|
||||
@ -512,7 +510,14 @@ if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This
|
||||
$cssweekend='weekend';
|
||||
}
|
||||
|
||||
print '<td class="center'.($cssweekend?' '.$cssweekend:'').'">'.$langs->trans("Duration").'</td>';
|
||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$daytoparse]['morning'] && ! $isavailable[$daytoparse]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$daytoparse]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$daytoparse]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
print '<td class="center'.($cssonholiday?' '.$cssonholiday:'').($cssweekend?' '.$cssweekend:'').'">'.$langs->trans("Duration").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Note").'</td>';
|
||||
print '<td class="center"></td>';
|
||||
print "</tr>\n";
|
||||
@ -522,8 +527,10 @@ $colspan = 8;
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="liste_total" colspan="'.$colspan.'">';
|
||||
print '<td class="liste_total" colspan="'.($colspan-1).'">';
|
||||
print $langs->trans("Total");
|
||||
print '</td>';
|
||||
print '<td class="liste_total leftborder">';
|
||||
//print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||
print '</td>';
|
||||
|
||||
@ -531,12 +538,17 @@ if ($conf->use_javascript_ajax)
|
||||
$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.
|
||||
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 '<td class="liste_total center'.($cssweekend?' '.$cssweekend:'').'"><div class="totalDay0"> </div></td>';
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$daytoparse]['morning'] && ! $isavailable[$daytoparse]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$daytoparse]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$daytoparse]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
print '<td class="liste_total center'.($cssonholiday?' '.$cssonholiday:'').($cssweekend?' '.$cssweekend:'').'"><div class="totalDay0"> </div></td>';
|
||||
|
||||
print '<td class="liste_total"></td>
|
||||
<td class="liste_total"></td>
|
||||
@ -620,8 +632,10 @@ if (count($tasksarray) > 0)
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="liste_total" colspan="'.$colspan.'">';
|
||||
print '<td class="liste_total" colspan="'.($colspan-1).'">';
|
||||
print $langs->trans("Total");
|
||||
print '</td>';
|
||||
print '<td class="liste_total leftborder">';
|
||||
//print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||
print '</td>';
|
||||
|
||||
@ -629,12 +643,17 @@ if (count($tasksarray) > 0)
|
||||
$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.
|
||||
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 '<td class="liste_total center'.($cssweekend?' '.$cssweekend:'').'"><div class="totalDay0"> </div></td>';
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$daytoparse]['morning'] && ! $isavailable[$daytoparse]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$daytoparse]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$daytoparse]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
print '<td class="liste_total center'.($cssonholiday?' '.$cssonholiday:'').($cssweekend?' '.$cssweekend:'').'"><div class="totalDay0"> </div></td>';
|
||||
|
||||
print '<td class="liste_total"></td>
|
||||
<td class="liste_total"></td>
|
||||
|
||||
@ -314,6 +314,7 @@ $projectstatic=new Project($db);
|
||||
$project = new Project($db);
|
||||
$taskstatic = new Task($db);
|
||||
$thirdpartystatic = new Societe($db);
|
||||
$holiday = new Holiday($db);
|
||||
|
||||
$title=$langs->trans("TimeSpent");
|
||||
|
||||
@ -417,6 +418,38 @@ print '</div>';
|
||||
print '<div class="clearboth" style="padding-bottom: 8px;"></div>';
|
||||
|
||||
|
||||
|
||||
$startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']);
|
||||
|
||||
// Get if user is available or not for each day
|
||||
$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];
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
//$dayinloopwithouthours=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
|
||||
//print dol_print_date($dayinloop, 'dayhour').' ';
|
||||
//print dol_print_date($dayinloopwithouthours, 'dayhour').' ';
|
||||
//print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'<br>';
|
||||
|
||||
$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
|
||||
}
|
||||
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
// Filter on categories
|
||||
@ -448,7 +481,6 @@ if (! empty($moreforfilter))
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'" id="tablelines3">'."\n";
|
||||
|
||||
@ -461,7 +493,7 @@ print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
for($idw=0;$idw<7;$idw++)
|
||||
for ($idw=0;$idw<7;$idw++)
|
||||
{
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
@ -485,44 +517,25 @@ print '<td align="right" class="maxwidth75">'.$langs->trans("ProgressDeclared").
|
||||
print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").'<br>('.$langs->trans("Everybody").')</td>';
|
||||
print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").($usertoprocess->firstname?'<br>('.$usertoprocess->firstname.')':'').'</td>';
|
||||
|
||||
$startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']);
|
||||
|
||||
// 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];
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
//$dayinloopwithouthours=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
|
||||
//print dol_print_date($dayinloop, 'dayhour').' ';
|
||||
//print dol_print_date($dayinloopwithouthours, 'dayhour').' ';
|
||||
//print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'<br>';
|
||||
|
||||
$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
|
||||
|
||||
$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 '<td width="6%" align="center" class="bold hide'.$idw.($cssweekend?' '.$cssweekend:'').'">'.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</td>';
|
||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
print '<td width="6%" align="center" class="bold hide'.$idw.($cssonholiday?' '.$cssonholiday:'').($cssweekend?' '.$cssweekend:'').'">'.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</td>';
|
||||
}
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
@ -540,12 +553,19 @@ if ($conf->use_javascript_ajax)
|
||||
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.
|
||||
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 '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
print '<td class="liste_total hide'.$idw.($cssonholiday?' '.$cssonholiday:'').($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||
}
|
||||
print '<td class="liste_total center"><div class="totalDayAll"> </div></td>';
|
||||
print '</tr>';
|
||||
@ -651,12 +671,19 @@ if (count($tasksarray) > 0)
|
||||
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.
|
||||
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 '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
|
||||
$cssonholiday='';
|
||||
if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
|
||||
elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
|
||||
elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
|
||||
|
||||
print '<td class="liste_total hide'.$idw.($cssonholiday?' '.$cssonholiday:'').($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||
}
|
||||
print '<td class="liste_total center"><div class="totalDayAll"> </div></td>
|
||||
</tr>';
|
||||
|
||||
@ -414,6 +414,9 @@ td.leftborder, td.hide0 {
|
||||
td.leftborder, td.hide6 {
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
td.rightborder {
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
|
||||
td.actionbuttons a {
|
||||
padding-left: 6px;
|
||||
|
||||
@ -417,6 +417,9 @@ td.leftborder, td.hide0 {
|
||||
td.leftborder, td.hide6 {
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
td.rightborder {
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
|
||||
select.flat, form.flat select {
|
||||
font-weight: normal;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user