mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-16 14:31:29 +01:00
NEW Add total of time spent in timespent page at top of page too.
This commit is contained in:
@@ -213,11 +213,9 @@ function updateTotal(days,mode)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (document.getElementById('totalDay['+days+']')) // May be null if no task records to output (nbline is also 0 in this case)
|
if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+days).addClass("bold");
|
||||||
{
|
else jQuery('.totalDay'+days).removeClass("bold");
|
||||||
document.getElementById('totalDay['+days+']').innerHTML = pad(total.getHours())+':'+pad(total.getMinutes());
|
jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes()));
|
||||||
//addText(,total.getHours()+':'+total.getMinutes());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -257,10 +255,10 @@ function updateTotal(days,mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (document.getElementById('totalDay['+days+']')) // May be null if no task records to output (nbline is also 0 in this case)
|
|
||||||
{
|
if (total) jQuery('.totalDay'+days).addClass("bold");
|
||||||
document.getElementById('totalDay['+days+']').innerHTML = total;
|
else jQuery('.totalDay'+days).removeClass("bold");
|
||||||
}
|
jQuery('.totalDay'+days).text(total);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -940,7 +940,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Planned Workload
|
// Planned Workload
|
||||||
print '<td align="right">';
|
print '<td align="right" class="leftborder plannedworkload">';
|
||||||
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
|
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
|
||||||
else print '--:--';
|
else print '--:--';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@@ -1224,7 +1224,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Planned Workload
|
// Planned Workload
|
||||||
print '<td align="right">';
|
print '<td align="right" class="leftborder plannedworkload">';
|
||||||
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
|
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
|
||||||
else print '--:--';
|
else print '--:--';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ PrivateProject=Project contacts
|
|||||||
ProjectsImContactFor=Projects I'm explicitely a contact of
|
ProjectsImContactFor=Projects I'm explicitely a contact of
|
||||||
AllAllowedProjects=All project I can read (mine + public)
|
AllAllowedProjects=All project I can read (mine + public)
|
||||||
AllProjects=All projects
|
AllProjects=All projects
|
||||||
MyProjectsDesc=This view is limited to projects you are a contact for.
|
MyProjectsDesc=This view is limited to projects you are a contact for
|
||||||
ProjectsPublicDesc=This view presents all projects you are allowed to read.
|
ProjectsPublicDesc=This view presents all projects you are allowed to read.
|
||||||
TasksOnProjectsPublicDesc=This view presents all tasks on projects you are allowed to read.
|
TasksOnProjectsPublicDesc=This view presents all tasks on projects you are allowed to read.
|
||||||
ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read.
|
ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read.
|
||||||
ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything).
|
ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything).
|
||||||
TasksOnProjectsDesc=This view presents all tasks on all projects (your user permissions grant you permission to view everything).
|
TasksOnProjectsDesc=This view presents all tasks on all projects (your user permissions grant you permission to view everything).
|
||||||
MyTasksDesc=This view is limited to projects or tasks you are a contact for.
|
MyTasksDesc=This view is limited to projects or tasks you are a contact for
|
||||||
OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible).
|
OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible).
|
||||||
ClosedProjectsAreHidden=Closed projects are not visible.
|
ClosedProjectsAreHidden=Closed projects are not visible.
|
||||||
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
|
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj
|
|||||||
|
|
||||||
llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
$param.=($mode?'&mode='.$mode:'');
|
$param.=($mode?'&mode='.$mode:'');
|
||||||
@@ -375,7 +375,7 @@ print '<input type="hidden" name="addtimemonth" value="'.$tmp['mon'].'">';
|
|||||||
print '<input type="hidden" name="addtimeday" value="'.$tmp['mday'].'">';
|
print '<input type="hidden" name="addtimeday" value="'.$tmp['mday'].'">';
|
||||||
|
|
||||||
$head=project_timesheet_prepare_head($mode, $usertoprocess);
|
$head=project_timesheet_prepare_head($mode, $usertoprocess);
|
||||||
dol_fiche_head($head, 'inputperday', '', -1, 'task');
|
dol_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, 'task');
|
||||||
|
|
||||||
// Show description of content
|
// Show description of content
|
||||||
print '<div class="hideonsmartphone">';
|
print '<div class="hideonsmartphone">';
|
||||||
@@ -474,7 +474,7 @@ print '<td>'.$langs->trans("Project").'</td>';
|
|||||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||||
//print '<td>'.$langs->trans("RefTask").'</td>';
|
//print '<td>'.$langs->trans("RefTask").'</td>';
|
||||||
print '<td>'.$langs->trans("Task").'</td>';
|
print '<td>'.$langs->trans("Task").'</td>';
|
||||||
print '<td align="right" class="maxwidth100">'.$langs->trans("PlannedWorkload").'</td>';
|
print '<td align="right" class="leftborder plannedworkload maxwidth100">'.$langs->trans("PlannedWorkload").'</td>';
|
||||||
print '<td align="right" class="maxwidth100">'.$langs->trans("ProgressDeclared").'</td>';
|
print '<td align="right" class="maxwidth100">'.$langs->trans("ProgressDeclared").'</td>';
|
||||||
/*print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpent").'</td>';
|
/*print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpent").'</td>';
|
||||||
if ($usertoprocess->id == $user->id) print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpentByYou").'</td>';
|
if ($usertoprocess->id == $user->id) print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpentByYou").'</td>';
|
||||||
@@ -517,6 +517,32 @@ print '<td class="center">'.$langs->trans("Note").'</td>';
|
|||||||
print '<td class="center"></td>';
|
print '<td class="center"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$colspan = 8;
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="liste_total" colspan="'.$colspan.'">';
|
||||||
|
print $langs->trans("Total");
|
||||||
|
//print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
$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 '<td class="liste_total center'.($cssweekend?' '.$cssweekend:'').'"><div class="totalDay0"> </div></td>';
|
||||||
|
|
||||||
|
print '<td class="liste_total"></td>
|
||||||
|
<td class="liste_total"></td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (count($tasksarray) > 0)
|
if (count($tasksarray) > 0)
|
||||||
{
|
{
|
||||||
@@ -565,8 +591,6 @@ if (count($tasksarray) > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$colspan = 8;
|
|
||||||
|
|
||||||
// There is a diff between total shown on screen and total spent by user, so we add a line with all other cumulated time of user
|
// There is a diff between total shown on screen and total spent by user, so we add a line with all other cumulated time of user
|
||||||
if ($isdiff)
|
if ($isdiff)
|
||||||
{
|
{
|
||||||
@@ -605,7 +629,7 @@ if (count($tasksarray) > 0)
|
|||||||
$cssweekend='weekend';
|
$cssweekend='weekend';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="liste_total hide0 center'.($cssweekend?' '.$cssweekend:'').'"><div id="totalDay[0]"> </div></td>';
|
print '<td class="liste_total center'.($cssweekend?' '.$cssweekend:'').'"><div class="totalDay0"> </div></td>';
|
||||||
|
|
||||||
print '<td class="liste_total"></td>
|
print '<td class="liste_total"></td>
|
||||||
<td class="liste_total"></td>
|
<td class="liste_total"></td>
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj
|
|||||||
|
|
||||||
llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
$param.=($mode?'&mode='.$mode:'');
|
$param.=($mode?'&mode='.$mode:'');
|
||||||
@@ -376,7 +376,7 @@ print '<input type="hidden" name="month" value="'.$month.'">';
|
|||||||
print '<input type="hidden" name="year" value="'.$year.'">';
|
print '<input type="hidden" name="year" value="'.$year.'">';
|
||||||
|
|
||||||
$head=project_timesheet_prepare_head($mode, $usertoprocess);
|
$head=project_timesheet_prepare_head($mode, $usertoprocess);
|
||||||
dol_fiche_head($head, 'inputperweek', '', -1, 'task');
|
dol_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, 'task');
|
||||||
|
|
||||||
// Show description of content
|
// Show description of content
|
||||||
print '<div class="hideonsmartphone">';
|
print '<div class="hideonsmartphone">';
|
||||||
@@ -477,7 +477,7 @@ print '<td>'.$langs->trans("Project").'</td>';
|
|||||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||||
//print '<td>'.$langs->trans("RefTask").'</td>';
|
//print '<td>'.$langs->trans("RefTask").'</td>';
|
||||||
print '<td>'.$langs->trans("Task").'</td>';
|
print '<td>'.$langs->trans("Task").'</td>';
|
||||||
print '<td align="right" class="maxwidth75">'.$langs->trans("PlannedWorkload").'</td>';
|
print '<td align="right" class="leftborder plannedworkload maxwidth75">'.$langs->trans("PlannedWorkload").'</td>';
|
||||||
print '<td align="right" class="maxwidth75">'.$langs->trans("ProgressDeclared").'</td>';
|
print '<td align="right" class="maxwidth75">'.$langs->trans("ProgressDeclared").'</td>';
|
||||||
/*print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").'</td>';
|
/*print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").'</td>';
|
||||||
if ($usertoprocess->id == $user->id) print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpentByYou").'</td>';
|
if ($usertoprocess->id == $user->id) print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpentByYou").'</td>';
|
||||||
@@ -522,11 +522,37 @@ for ($idw=0; $idw<7; $idw++)
|
|||||||
$cssweekend='weekend';
|
$cssweekend='weekend';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td width="6%" align="center" class="hide'.$idw.($cssweekend?' '.$cssweekend:'').'">'.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</td>';
|
print '<td width="6%" align="center" class="bold hide'.$idw.($cssweekend?' '.$cssweekend:'').'">'.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</td>';
|
||||||
}
|
}
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$colspan=7;
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">
|
||||||
|
<td class="liste_total" colspan="'.$colspan.'">';
|
||||||
|
print $langs->trans("Total");
|
||||||
|
print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
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 '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||||
|
}
|
||||||
|
print '<td class="liste_total"></td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// By default, we can edit only tasks we are assigned to
|
// By default, we can edit only tasks we are assigned to
|
||||||
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
|
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
|
||||||
|
|
||||||
@@ -584,8 +610,6 @@ if (count($tasksarray) > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$colspan=7;
|
|
||||||
|
|
||||||
// There is a diff between total shown on screen and total spent by user, so we add a line with all other cumulated time of user
|
// There is a diff between total shown on screen and total spent by user, so we add a line with all other cumulated time of user
|
||||||
if ($isdiff)
|
if ($isdiff)
|
||||||
{
|
{
|
||||||
@@ -632,7 +656,7 @@ if (count($tasksarray) > 0)
|
|||||||
$cssweekend='weekend';
|
$cssweekend='weekend';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div id="totalDay['.$idw.']"> </div></td>';
|
print '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_total"></td>
|
print '<td class="liste_total"></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|||||||
@@ -404,6 +404,9 @@ td.onholidaymorning, td.onholidayafternoon {
|
|||||||
td.onholidayallday {
|
td.onholidayallday {
|
||||||
background-color: #f4eede;
|
background-color: #f4eede;
|
||||||
}
|
}
|
||||||
|
td.leftborder, td.hide0 {
|
||||||
|
border-left: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
td.actionbuttons a {
|
td.actionbuttons a {
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
@@ -597,6 +600,9 @@ textarea.centpercent {
|
|||||||
.wordbreak {
|
.wordbreak {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
.bold {
|
||||||
|
font-weight: bold !important;
|
||||||
|
}
|
||||||
.nobold {
|
.nobold {
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -408,6 +408,10 @@ td.onholidayallday {
|
|||||||
td.actionbuttons a {
|
td.actionbuttons a {
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
}
|
}
|
||||||
|
td.leftborder, td.hide0 {
|
||||||
|
border-left: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
select.flat, form.flat select {
|
select.flat, form.flat select {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: unset;
|
font-size: unset;
|
||||||
@@ -594,6 +598,9 @@ textarea.centpercent {
|
|||||||
.wordbreak {
|
.wordbreak {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
.bold {
|
||||||
|
font-weight: bold !important;
|
||||||
|
}
|
||||||
.nobold {
|
.nobold {
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user