diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index ba3f8b2edd1..20a713ce220 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -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) - { - document.getElementById('totalDay['+days+']').innerHTML = pad(total.getHours())+':'+pad(total.getMinutes()); - //addText(,total.getHours()+':'+total.getMinutes()); - } + if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+days).addClass("bold"); + else jQuery('.totalDay'+days).removeClass("bold"); + jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes())); } 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) - { - document.getElementById('totalDay['+days+']').innerHTML = total; - } + + if (total) jQuery('.totalDay'+days).addClass("bold"); + else jQuery('.totalDay'+days).removeClass("bold"); + jQuery('.totalDay'+days).text(total); } } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 67600a7ba3e..49474d1e190 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -940,7 +940,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print "\n"; // Planned Workload - print ''; + print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); else print '--:--'; print ''; @@ -1224,7 +1224,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print "\n"; // Planned Workload - print ''; + print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); else print '--:--'; print ''; diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 86d09ff3edc..ab044618556 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -10,13 +10,13 @@ PrivateProject=Project contacts ProjectsImContactFor=Projects I'm explicitely a contact of AllAllowedProjects=All project I can read (mine + public) 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. 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. 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). -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). ClosedProjectsAreHidden=Closed projects are not visible. TasksPublicDesc=This view presents all projects and tasks you are allowed to read. diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index dd3aa856817..8475b607de6 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -345,7 +345,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj 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.=($mode?'&mode='.$mode:''); @@ -375,7 +375,7 @@ print ''; print ''; $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 print '
'; @@ -474,7 +474,7 @@ print ''.$langs->trans("Project").''; print ''.$langs->trans("ThirdParty").''; //print ''.$langs->trans("RefTask").''; print ''.$langs->trans("Task").''; -print ''.$langs->trans("PlannedWorkload").''; +print ''.$langs->trans("PlannedWorkload").''; print ''.$langs->trans("ProgressDeclared").''; /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; @@ -517,6 +517,32 @@ print ''.$langs->trans("Note").''; print ''; print "\n"; +$colspan = 8; + +if ($conf->use_javascript_ajax) +{ + print ''; + print ''; + print $langs->trans("Total"); + //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + 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 '
 
'; + + print ' + + '; +} + 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 if ($isdiff) { @@ -605,7 +629,7 @@ if (count($tasksarray) > 0) $cssweekend='weekend'; } - print '
 
'; + print '
 
'; print ' diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index ba0e773d114..c3c4efa836f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -347,7 +347,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj 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.=($mode?'&mode='.$mode:''); @@ -376,7 +376,7 @@ print ''; print ''; $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 print '
'; @@ -477,7 +477,7 @@ print ''.$langs->trans("Project").''; print ''.$langs->trans("ThirdParty").''; //print ''.$langs->trans("RefTask").''; print ''.$langs->trans("Task").''; -print ''.$langs->trans("PlannedWorkload").''; +print ''.$langs->trans("PlannedWorkload").''; print ''.$langs->trans("ProgressDeclared").''; /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; @@ -522,11 +522,37 @@ for ($idw=0; $idw<7; $idw++) $cssweekend='weekend'; } - print ''.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'
'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').''; + print ''.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'
'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').''; } print ''; print "\n"; +$colspan=7; + +if ($conf->use_javascript_ajax) +{ + print ' + '; + print $langs->trans("Total"); + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 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 '
 
'; + } + print ' + '; +} + + + // By default, we can edit only tasks we are assigned to $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 if ($isdiff) { @@ -632,7 +656,7 @@ if (count($tasksarray) > 0) $cssweekend='weekend'; } - print '
 
'; + print '
 
'; } print ' '; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index eea9a06f16f..e7f50732cd4 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -404,6 +404,9 @@ td.onholidaymorning, td.onholidayafternoon { td.onholidayallday { background-color: #f4eede; } +td.leftborder, td.hide0 { + border-left: 1px solid #ccc; +} td.actionbuttons a { padding-left: 6px; @@ -597,6 +600,9 @@ textarea.centpercent { .wordbreak { word-break: break-all; } +.bold { + font-weight: bold !important; +} .nobold { font-weight: normal !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c9a0a9239b2..869654cc0cd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -408,6 +408,10 @@ td.onholidayallday { td.actionbuttons a { padding-left: 6px; } +td.leftborder, td.hide0 { + border-left: 1px solid #ccc; +} + select.flat, form.flat select { font-weight: normal; font-size: unset; @@ -594,6 +598,9 @@ textarea.centpercent { .wordbreak { word-break: break-all; } +.bold { + font-weight: bold !important; +} .nobold { font-weight: normal !important; }