From d988585f86da831de2498922a3b3f25d350e4cc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Apr 2018 11:03:50 +0200 Subject: [PATCH] Save spaces in timesheet report page --- htdocs/core/lib/project.lib.php | 26 ++++++++++++---------- htdocs/projet/activity/perday.php | 35 ++++++++++++++++++------------ htdocs/projet/activity/perweek.php | 29 +++++++++++++++++-------- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index c82839d8499..06d0b7aa6d3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -893,8 +893,9 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) { print ''."\n"; - print ''; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print ''; + print $projectstatic->getNomUrl(1,'',0,''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); if ($projectstatic->title) { print ' - '; @@ -916,14 +917,14 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr */ // Project - print ""; + /*print ""; if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print ""; + print "";*/ // Thirdparty - print ''; + /*print ''; if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10); - print ''; + print '';*/ // Ref print ''; @@ -1176,8 +1177,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) { print ''."\n"; - print ''; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print ''; + print $projectstatic->getNomUrl(1,'',0,''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); if ($projectstatic->title) { print ' - '; @@ -1199,14 +1201,14 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ */ // Project - print ''; + /*print ''; if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print ""; + print "";*/ // Thirdparty - print ''; + /*print ''; if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project'); - print ''; + print '';*/ // Ref print ''; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 43720614a2e..9dd57d3c776 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -409,7 +409,7 @@ print '
'; $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); print '
'; print ' '; -print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200'); +print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print ''; print ''; @@ -433,9 +433,22 @@ $moreforfilter.='
'; $moreforfilter.='
'.$langs->trans('User'). '
'; $includeonly='hierachyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); -$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); $moreforfilter.='
'; +if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) +{ + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('Project'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; + + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('ThirdParty'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; +} + if (! empty($moreforfilter)) { print '
'; @@ -451,9 +464,8 @@ print '
'; print ''."\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -470,9 +482,8 @@ print ''; print "\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -522,7 +533,7 @@ print ''; print ''; print "\n"; -$colspan = 8; +$colspan = 6+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2);; if ($conf->use_javascript_ajax) { @@ -607,13 +618,9 @@ if (count($tasksarray) > 0) if ($isdiff) { print ''; - print ''; - print ''; - print ''; - print ''; - print ''; print ''; print '
'.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("Note").'
'; + print ''; print $langs->trans("OtherFilteredTasks"); print ''; $timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index b7d731d786b..37c5b789669 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -411,7 +411,7 @@ print '
'; $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); print '
'; print ' '; -print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200'); +print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print ''; print ''; @@ -471,6 +471,19 @@ if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.=''; +if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) +{ + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('Project'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; + + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('ThirdParty'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; +} + if (! empty($moreforfilter)) { print '
'; @@ -485,9 +498,8 @@ print '
'; print ''."\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -505,9 +517,8 @@ print ''; print "\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -540,7 +551,7 @@ for ($idw=0; $idw<7; $idw++) print ''; print "\n"; -$colspan=7; +$colspan=5+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2); if ($conf->use_javascript_ajax) { @@ -634,7 +645,7 @@ if (count($tasksarray) > 0) if ($isdiff) { print ''; - print ''; for ($idw = 0; $idw < 7; $idw++)
'.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").'
'; + print ''; print $langs->trans("OtherFilteredTasks"); print '