Clean code

This commit is contained in:
Laurent Destailleur 2020-03-23 20:16:51 +01:00
parent f4a52470e3
commit 063cf15bcb
2 changed files with 19 additions and 28 deletions

View File

@ -358,7 +358,7 @@ function project_admin_prepare_head()
*/ */
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0) function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0)
{ {
global $user, $bc, $langs, $conf, $db; global $user, $langs, $conf, $db;
global $projectstatic, $taskstatic; global $projectstatic, $taskstatic;
$lastprojectid = 0; $lastprojectid = 0;
@ -450,7 +450,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$lastprojectid = $lines[$i]->fk_project; $lastprojectid = $lines[$i]->fk_project;
} }
print '<tr '.$bc[$var].' id="row-'.$lines[$i]->id.'">'."\n"; print '<tr class="oddeven" id="row-'.$lines[$i]->id.'">'."\n";
$projectstatic->id = $lines[$i]->fk_project; $projectstatic->id = $lines[$i]->fk_project;
$projectstatic->ref = $lines[$i]->projectref; $projectstatic->ref = $lines[$i]->projectref;
@ -758,7 +758,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
*/ */
function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0) function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0)
{ {
global $conf, $db, $user, $bc, $langs; global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
$lastprojectid = 0; $lastprojectid = 0;
@ -986,7 +986,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
*/ */
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null) function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
{ {
global $conf, $db, $user, $bc, $langs; global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
$lastprojectid = 0; $lastprojectid = 0;
@ -1177,15 +1177,12 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
// Ref // Ref
print '<td>'; print '<td>';
print '<!-- Task id = '.$lines[$i]->id.' -->'; print '<!-- Task id = '.$lines[$i]->id.' -->';
for ($k = 0; $k < $level; $k++) print "&nbsp;&nbsp;&nbsp;"; for ($k = 0; $k < $level; $k++) print '<div class="marginleftonly">';
print $taskstatic->getNomUrl(1, 'withproject', 'time'); print $taskstatic->getNomUrl(1, 'withproject', 'time');
// Label task // Label task
print '<br>'; print '<br>';
for ($k = 0; $k < $level; $k++) print "&nbsp;&nbsp;&nbsp;"; print '<span class="opacitymedium">'.$taskstatic->label.'</a>';
print $taskstatic->label; for ($k = 0; $k < $level; $k++) print "</div>";
//print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n"; print "</td>\n";
// TASK extrafields // TASK extrafields
@ -1365,7 +1362,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
*/ */
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null) function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null)
{ {
global $conf, $db, $user, $bc, $langs; global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
$numlines = count($lines); $numlines = count($lines);
@ -1556,16 +1553,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
// Ref // Ref
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<!-- Task id = '.$lines[$i]->id.' -->'; print '<!-- Task id = '.$lines[$i]->id.' -->';
for ($k = 0; $k < $level; $k++) print "&nbsp;&nbsp;&nbsp;"; for ($k = 0; $k < $level; $k++) print '<div class="marginleftonly">';
print $taskstatic->getNomUrl(1, 'withproject', 'time'); print $taskstatic->getNomUrl(1, 'withproject', 'time');
// Label task // Label task
print '<br>'; print '<br>';
for ($k = 0; $k < $level; $k++) print "&nbsp;&nbsp;&nbsp;"; print '<span class="opacitymedium">'.$taskstatic->label.'</span>';
//print $taskstatic->getNomUrl(0, 'withproject', 'time'); for ($k = 0; $k < $level; $k++) print "</div>";
print $taskstatic->label;
//print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n"; print "</td>\n";
// TASK extrafields // TASK extrafields
@ -1732,7 +1725,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
*/ */
function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array()) function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array())
{ {
global $conf, $db, $user, $bc, $langs; global $conf, $db, $user, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic; global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
$numlines = count($lines); $numlines = count($lines);
@ -1840,16 +1833,12 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
// Ref // Ref
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<!-- Task id = '.$lines[$i]->id.' -->'; print '<!-- Task id = '.$lines[$i]->id.' -->';
for ($k = 0; $k < $level; $k++) print "&nbsp;&nbsp;&nbsp;"; for ($k = 0; $k < $level; $k++) print '<div class="marginleftonly">';
print $taskstatic->getNomUrl(1, 'withproject', 'time'); print $taskstatic->getNomUrl(1, 'withproject', 'time');
// Label task // Label task
print '<br>'; print '<br>';
for ($k = 0; $k < $level; $k++) print "&nbsp;&nbsp;&nbsp;"; print '<span class="opacitymedium">'.$taskstatic->label.'</span>';
//print $taskstatic->getNomUrl(0, 'withproject', 'time'); for ($k = 0; $k < $level; $k++) print "</div>";
print $taskstatic->label;
//print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n"; print "</td>\n";
// Planned Workload // Planned Workload
@ -1917,7 +1906,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
$alttitle = $langs->trans("AddHereTimeSpentForWeek", $weekNb); $alttitle = $langs->trans("AddHereTimeSpentForWeek", $weekNb);
$tableCell = '<td align="center" class="hide">'; $tableCell = '<td class="center hide weekend">';
$placeholder = ''; $placeholder = '';
if ($alreadyspent) if ($alreadyspent)
{ {
@ -2029,7 +2018,7 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
*/ */
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array()) function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $status = -1, $listofoppstatus = array(), $hiddenfields = array())
{ {
global $langs, $conf, $user, $bc; global $langs, $conf, $user;
global $theme_datacolor; global $theme_datacolor;
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';

View File

@ -298,12 +298,14 @@ td.onholidaymorning, td.onholidayafternoon {
td.onholidayallday { td.onholidayallday {
background-color: #f4eede; background-color: #f4eede;
} }
/*
td.leftborder, td.hide0 { td.leftborder, td.hide0 {
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
} }
td.leftborder, td.hide6 { td.leftborder, td.hide6 {
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
} }
*/
td.rightborder { td.rightborder {
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
} }