diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 5956cbf4a3a..f045705c833 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -319,12 +319,12 @@ for ($i = 1 ; $i < $MAXLINES; $i++) { print '
';
- print '
'; print ''; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 3f0d1931b10..be6ffd999cd 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -79,8 +79,6 @@ class RemiseCheque extends CommonObject public function __construct($db) { $this->db = $db; - $this->next_id = 0; - $this->previous_id = 0; } /** @@ -810,47 +808,6 @@ class RemiseCheque extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Charge les proprietes ref_previous et ref_next - * - * @return int <0 if KO, 0 if OK - */ - public function load_previous_next_id() - { - // phpcs:enable - global $conf; - - $this->errno = 0; - - $sql = "SELECT MAX(rowid)"; - $sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql .= " WHERE rowid < ".((int) $this->id); - $sql .= " AND entity = ".$conf->entity; - - $result = $this->db->query($sql); - if (!$result) { - $this->errno = -1035; - } - $row = $this->db->fetch_row($result); - $this->previous_id = $row[0]; - - $sql = "SELECT MIN(rowid)"; - $sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql .= " WHERE rowid > ".((int) $this->id); - $sql .= " AND entity = ".$conf->entity; - - $result = $this->db->query($sql); - if (!$result) { - $this->errno = -1035; - } - $row = $this->db->fetch_row($result); - $this->next_id = $row[0]; - - return $this->errno; - } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set the creation date diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 18f351fb0c5..3685e174058 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9930,13 +9930,17 @@ function printCommonFooter($zone = 'private') * Split a string with 2 keys into key array. * For example: "A=1;B=2;C=2" is exploded into array('A'=>1,'B'=>2,'C'=>3) * - * @param string $string String to explode - * @param string $delimiter Delimiter between each couple of data. Example: ';' or '[\n;]+' or '(\n\r|\r|\n|;)' - * @param string $kv Delimiter between key and value - * @return array Array of data exploded + * @param string|null $string String to explode + * @param string $delimiter Delimiter between each couple of data. Example: ';' or '[\n;]+' or '(\n\r|\r|\n|;)' + * @param string $kv Delimiter between key and value + * @return array Array of data exploded */ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=') { + if (is_null($string)) { + return array(); + } + if (preg_match('/^\[.*\]$/sm', $delimiter) || preg_match('/^\(.*\)$/sm', $delimiter)) { // This is a regex string $newdelimiter = $delimiter; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d7728725fec..a81602f5f20 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -590,13 +590,13 @@ function project_admin_prepare_head() * @param int $projectsListId List of id of project allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project) - * @param string $filterprogresscalc filter text + * @param string $dummy Not used. * @param string $showbilltime Add the column 'TimeToBill' and 'TimeBilled' * @param array $arrayfields Array with displayed coloumn information * @param array $arrayofselected Array with selected fields * @return int Nb of tasks shown */ -function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0, $arrayfields = array(), $arrayofselected = array()) +function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $dummy = '', $showbilltime = 0, $arrayfields = array(), $arrayofselected = array()) { global $user, $langs, $conf, $db, $hookmanager; global $projectstatic, $taskstatic, $extrafields; @@ -604,17 +604,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $lastprojectid = 0; $projectsArrayId = explode(',', $projectsListId); - if ($filterprogresscalc !== '') { - foreach ($lines as $key => $line) { - if (!empty($line->planned_workload) && !empty($line->duration)) { - $filterprogresscalc = str_replace(' = ', ' == ', $filterprogresscalc); - if (!eval($filterprogresscalc)) { - unset($lines[$key]); - } - } - } - $lines = array_values($lines); - } + $numlines = count($lines); // We declare counter as global because we want to edit them into recursive call @@ -699,7 +689,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $taskstatic->date_end = $lines[$i]->date_end; $taskstatic->datee = $lines[$i]->date_end; // deprecated $taskstatic->planned_workload = $lines[$i]->planned_workload; - $taskstatic->duration_effective = $lines[$i]->duration; + $taskstatic->duration_effective = $lines[$i]->duration_effective; $taskstatic->budget_amount = $lines[$i]->budget_amount; // Action column @@ -819,8 +809,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } else { print ''; } - if ($lines[$i]->duration) { - print convertSecondToTime($lines[$i]->duration, $timespentoutputformat); + if ($lines[$i]->duration_effective) { + print convertSecondToTime($lines[$i]->duration_effective, $timespentoutputformat); } else { print '--:--'; } @@ -832,12 +822,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ' | ';
}
- // Progress calculated (Note: ->duration is time spent)
+ // Progress calculated (Note: ->duration_effective is time spent)
if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_calculated']['checked'])) {
$s = ''; $shtml = '';
- if ($lines[$i]->planned_workload || $lines[$i]->duration) {
+ if ($lines[$i]->planned_workload || $lines[$i]->duration_effective) {
if ($lines[$i]->planned_workload) {
- $s = round(100 * $lines[$i]->duration / $lines[$i]->planned_workload, 2).' %';
+ $s = round(100 * $lines[$i]->duration_effective / $lines[$i]->planned_workload, 2).' %';
$shtml = $s;
} else {
$s = $langs->trans('WorkloadNotDefined');
@@ -861,7 +851,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// resume
if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_summary']['checked'])) {
print ''; - if ($lines[$i]->progress != '' && $lines[$i]->duration) { + if ($lines[$i]->progress != '' && $lines[$i]->duration_effective) { print getTaskProgressView($taskstatic, false, false); } print ' | '; @@ -974,15 +964,15 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($level >= 0) { // Call sublevels $level++; if ($lines[$i]->id) { - projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, $filterprogresscalc, $showbilltime, $arrayfields); + projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, '', $showbilltime, $arrayfields); } $level--; } - $total_projectlinesa_spent += $lines[$i]->duration; + $total_projectlinesa_spent += $lines[$i]->duration_effective; $total_projectlinesa_planned += $lines[$i]->planned_workload; if ($lines[$i]->planned_workload) { - $total_projectlinesa_spent_if_planned += $lines[$i]->duration; + $total_projectlinesa_spent_if_planned += $lines[$i]->duration_effective; } if ($lines[$i]->planned_workload) { $total_projectlinesa_declared_if_planned += $lines[$i]->planned_workload * $lines[$i]->progress / 100; @@ -1627,10 +1617,10 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if (!empty($arrayfields['timeconsumed']['checked'])) { // Time spent by everybody print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user - if ($lines[$i]->duration) { + // $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user + if ($lines[$i]->duration_effective) { print ''; - print convertSecondToTime($lines[$i]->duration, 'allhourmin'); + print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin'); print ''; } else { print '--:--'; @@ -2026,10 +2016,10 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ if (!empty($arrayfields['timeconsumed']['checked'])) { // Time spent by everybody print ' | '; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user - if ($lines[$i]->duration) { + // $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user + if ($lines[$i]->duration_effective) { print ''; - print convertSecondToTime($lines[$i]->duration, 'allhourmin'); + print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin'); print ''; } else { print '--:--'; @@ -2320,10 +2310,10 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & // Time spent by everybody print ' | '; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user - if ($lines[$i]->duration) { + // $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user + if ($lines[$i]->duration_effective) { print ''; - print convertSecondToTime($lines[$i]->duration, 'allhourmin'); + print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin'); print ''; } else { print '--:--'; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index fd79cbc3e7a..59518af9cca 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -665,36 +665,49 @@ if ($resql) { print " | |||||||||||||||||||||||||||||||||