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 img_picto('', 'bank_account', 'class="paddingright"'); - $form->select_comptes(($error ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, ($i <= $maxtab ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100'); + $form->select_comptes(($error ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, '', isModEnabled('multicurrency') ? 1 : 0, 'minwidth100'); print ''; print ''; print img_picto('', 'bank_account', 'class="paddingright"'); - $form->select_comptes(($error ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, ($i <= $maxtab ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100'); + $form->select_comptes(($error ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, '', isModEnabled('multicurrency') ? 1 : 0, 'minwidth100'); print "\n"; // Payment mode diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 775de1c495b..ea02857c09d 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -505,12 +505,16 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''."\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; + // Fields title label // -------------------------------------------------------------------- print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; } foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); @@ -525,17 +529,19 @@ foreach ($object->fields as $key => $val) { } if (!empty($arrayfields['t.'.$key]['checked'])) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + $totalarray['nbfield']++; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; } print ''."\n"; @@ -554,8 +560,8 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar // Loop on record // -------------------------------------------------------------------- $i = 0; -$totalarray = array(); $savnbfield = $totalarray['nbfield']; +$totalarray = array(); $totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 8c4a194737a..fd4b38b5f66 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -106,6 +106,7 @@ class CashControl extends CommonObject * @var int Object Id */ public $id; + public $label; public $opening; public $status; public $year_close; @@ -127,6 +128,11 @@ class CashControl extends CommonObject * @var integer|string $date_modification */ public $date_modification; + /** + * @var integer|string $date_modification + * @deprecated + */ + public $tms; /** * @var integer|string $date_valid diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 9135f2d2eb5..9cc169ebd28 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -611,19 +611,19 @@ if ($action == 'new') { print '
'; print '
'; - print ''; 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 ''; @@ -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 '\n"; + $totalarray = array(); + $totalarray['nbfield'] = 0; + print ''; if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.ref']['checked'])) { print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "d.ref", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['user']['checked'])) { print_liste_field_titre($arrayfields['user']['label'], $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.date_debut']['checked'])) { print_liste_field_titre($arrayfields['d.date_debut']['label'], $_SERVER["PHP_SELF"], "d.date_debut", "", $param, 'align="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.date_fin']['checked'])) { print_liste_field_titre($arrayfields['d.date_fin']['label'], $_SERVER["PHP_SELF"], "d.date_fin", "", $param, 'align="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.date_valid']['checked'])) { print_liste_field_titre($arrayfields['d.date_valid']['label'], $_SERVER["PHP_SELF"], "d.date_valid", "", $param, 'align="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.date_approve']['checked'])) { print_liste_field_titre($arrayfields['d.date_approve']['label'], $_SERVER["PHP_SELF"], "d.date_approve", "", $param, 'align="center"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.total_ht']['checked'])) { print_liste_field_titre($arrayfields['d.total_ht']['label'], $_SERVER["PHP_SELF"], "d.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.total_vat']['checked'])) { print_liste_field_titre($arrayfields['d.total_vat']['label'], $_SERVER["PHP_SELF"], "d.total_tva", "", $param, 'align="right"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.total_ttc']['checked'])) { print_liste_field_titre($arrayfields['d.total_ttc']['label'], $_SERVER["PHP_SELF"], "d.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder); + $totalarray['nbfield']++; } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -704,15 +717,19 @@ if ($resql) { print $hookmanager->resPrint; if (!empty($arrayfields['d.date_create']['checked'])) { print_liste_field_titre($arrayfields['d.date_create']['label'], $_SERVER["PHP_SELF"], "d.date_create", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.tms']['checked'])) { print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!empty($arrayfields['d.fk_statut']['checked'])) { print_liste_field_titre($arrayfields['d.fk_statut']['label'], $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder); + $totalarray['nbfield']++; } if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + $totalarray['nbfield']++; } print "\n"; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index fee0f95834b..43723e9a269 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -116,6 +116,7 @@ class Job extends CommonObject ); public $rowid; public $ref; + public $label; public $description; public $date_creation; public $tms; @@ -844,6 +845,9 @@ class Job extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable + return ''; // There is no status on job profile for the moment + + /* if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); @@ -862,6 +866,7 @@ class Job extends CommonObject } return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + */ } /** diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index d880ba1ad0d..ba3276f3bff 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -372,7 +372,7 @@ class Tasks extends DolibarrApi */ // /** - // * Update a task to given project + // * Update a task of a given project // * // * @param int $id Id of project to update // * @param int $taskid Id of task to update diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index f9b0c011019..a18f085b0ec 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1800,7 +1800,7 @@ class Project extends CommonObject // Loop on each task, to clone it foreach ($tasksarray as $tasktoclone) { - $result_clone = $taskstatic->createFromClone($user, $tasktoclone->id, $clone_project_id, $tasktoclone->fk_parent, $move_date, true, false, $clone_task_file, true, false); + $result_clone = $taskstatic->createFromClone($user, $tasktoclone->id, $clone_project_id, $tasktoclone->fk_task_parent, $move_date, true, false, $clone_task_file, true, false); if ($result_clone <= 0) { $this->error .= $taskstatic->error; $error++; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 0be9390cc4f..c57c28ede13 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -135,11 +135,6 @@ class Task extends CommonObjectLine public $comments = array(); - /** - * @var float budget_amount - */ - public $budget_amount; - /** * @var array */ @@ -150,12 +145,34 @@ class Task extends CommonObjectLine */ public $statuts_short; + + // Properties to store project informations + public $projectref; + public $projectstatus; + public $projectlabel; + public $opp_amount; + public $opp_percent; + public $fk_opp_status; + public $usage_bill_time; + public $public; + + // Properties to store thirdparty of project information + public $socid; + public $thirdparty_id; + public $thirdparty_name; + public $thirdparty_email; + + + /** + * @var float budget_amount + */ + public $budget_amount; + /** * @var float project_budget_amount */ public $project_budget_amount; - public $oldcopy; /** @@ -845,24 +862,24 @@ class Task extends CommonObjectLine * Return list of tasks for all projects or for one particular project * Sort order is on project, then on position of task, and last on start date of first level task * - * @param User $usert Object user to limit tasks affected to a particular user - * @param User $userp Object user to limit projects of a particular user and public projects - * @param int $projectid Project id - * @param int $socid Third party id - * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists - * @param string $filteronproj Filter on project ref or label - * @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only) - * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...') - * @param string $filteronprojuser Filter on user that is a contact of project - * @param string $filterontaskuser Filter on user assigned to task + * @param User $usert Object user to limit tasks affected to a particular user + * @param User $userp Object user to limit projects of a particular user and public projects + * @param int $projectid Project id + * @param int $socid Third party id + * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists + * @param string $filteronproj Filter on project ref or label + * @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only) + * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...') + * @param string $filteronprojuser Filter on user that is a contact of project + * @param string $filterontaskuser Filter on user assigned to task * @param Extrafields $extrafields Show additional column from project or task - * @param int $includebilltime Calculate also the time to bill and billed - * @param array $search_array_options Array of search - * @param int $loadextras Fetch all Extrafields on each task - * @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @return array|string Array of tasks + * @param int $includebilltime Calculate also the time to bill and billed + * @param array $search_array_options Array of search filters. Not Used yet. + * @param int $loadextras Fetch all Extrafields on each task + * @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @return array|string Array of tasks */ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array(), $loadextras = 0, $loadRoleMode = 1, $sortfield = '', $sortorder = '') { @@ -1039,8 +1056,8 @@ class Task extends CommonObjectLine $tasks[$i] = new Task($this->db); $tasks[$i]->id = $obj->taskid; $tasks[$i]->ref = $obj->taskref; - $tasks[$i]->fk_project = $obj->projectid; - $tasks[$i]->projectref = $obj->ref; + $tasks[$i]->fk_project = $obj->projectid; + $tasks[$i]->projectref = $obj->ref; $tasks[$i]->projectlabel = $obj->plabel; $tasks[$i]->projectstatus = $obj->projectstatus; @@ -1053,9 +1070,8 @@ class Task extends CommonObjectLine $tasks[$i]->label = $obj->label; $tasks[$i]->description = $obj->description; - $tasks[$i]->fk_parent = $obj->fk_task_parent; // deprecated $tasks[$i]->fk_task_parent = $obj->fk_task_parent; - $tasks[$i]->duration = $obj->duration_effective; + $tasks[$i]->duration_effective = $obj->duration_effective; $tasks[$i]->planned_workload = $obj->planned_workload; if ($includebilltime) { diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index cccba86b584..705594953b7 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -288,19 +288,17 @@ if (!empty($search_timespend)) { $morewherefilterarray[] = natural_search('t.duration_effective', $search_timespend, 1, 1); } -if (!empty($search_progresscalc)) { - $filterprogresscalc = 'if '.natural_search('round(100 * $line->duration / $line->planned_workload,2)', $search_progresscalc, 1, 1).'{return 1;} else {return 0;}'; -} else { - $filterprogresscalc = ''; -} - if (!empty($search_progressdeclare)) { $morewherefilterarray[] = natural_search('t.progress', $search_progressdeclare, 1, 1); } - +if (!empty($search_progresscalc)) { + $morewherefilterarray[] = '(planned_workload IS NULL OR planned_workload = 0 OR '.natural_search('ROUND(100 * duration_effective / planned_workload, 2)', $search_progresscalc, 1, 1).')'; + //natural_search('round(100 * $line->duration_effective / $line->planned_workload,2)', $filterprogresscalc, 1, 1).' {return 1;} else {return 0;}'; +} if ($search_task_budget_amount) { $morewherefilterarray[]= natural_search('t.budget_amount', $search_task_budget_amount, 1, 1); } +//var_dump($morewherefilterarray); $morewherefilter = ''; if (count($morewherefilterarray) > 0) { @@ -903,14 +901,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } - // Filter on categories + // Filter on assigned users $moreforfilter = ''; - if (count($tasksarray) > 0) { - $moreforfilter .= '
'; - $moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"'); - $moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', $langs->trans("TasksAssignedTo"), null, 0, '', ''); - $moreforfilter .= '
'; - } + $moreforfilter .= '
'; + $moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"'); + $moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', $langs->trans("TasksAssignedTo"), null, 0, '', ''); + $moreforfilter .= '
'; if ($moreforfilter) { print '
'; print $moreforfilter; @@ -1128,7 +1124,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third if (count($tasksarray) > 0) { // Show all lines in taskarray (recursive function to go down on tree) $j = 0; $level = 0; - $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected); + $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, '', ($object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected); } else { $colspan = count($arrayfields); if ($object->usage_bill_time) { diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index c6ee16c5128..022fc1e7f80 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -114,8 +114,10 @@ class Stripe extends CommonObject $obj = $this->db->fetch_object($result); $tokenstring = $obj->tokenstring; - $tmparray = json_decode($tokenstring); - $key = empty($tmparray->stripe_user_id) ? '' : $tmparray->stripe_user_id; + if ($tokenstring) { + $tmparray = json_decode($tokenstring); + $key = empty($tmparray->stripe_user_id) ? '' : $tmparray->stripe_user_id; + } } else { $tokenstring = ''; } @@ -124,6 +126,7 @@ class Stripe extends CommonObject } dol_syslog("No dedicated Stripe Connect account available for entity ".$conf->entity); + return $key; }
'; - print ''; print ''; - // External ref - /* Ext ref are not visible field on standard usage - print ''; } - print ''; - print ''; - */ - - print ''; // Number of bank checks - print ''; - print ''; - /*print '';*/ - print '
'; + print ''; if ($action != 'editdate') { print ''; } print '
'; print $langs->trans('Date'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'
'; - print '
'; + + print ''; if ($action == 'editdate') { print '
'; print ''; @@ -638,51 +638,43 @@ if ($action == 'new') { print '
'; - - print ''; - if ($action != 'editrefext') print ''; - print '
'; - print $langs->trans('RefExt'); - print 'id.'">'.img_edit($langs->trans('SetRefExt'),1).'
'; - print '
'; - if ($action == 'editrefext') - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } - else - { - print $object->ref_ext; + // External ref - Ext ref are not visible field on standard usage + if (getDolGlobalString('MAIN_SHOW_EXTREF')) { + print '
'; + print ''; + if ($action != 'editrefext') { + print ''; + } + print '
'; + print $langs->trans('RefExt'); + print 'id).'">'.img_edit($langs->trans('SetRefExt'), 1).'
'; + print '
'; + if ($action == 'editrefext') { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + } else { + print $object->ref_ext; + } + print '
'.$langs->trans('Account').''; + print '
'.$langs->trans('Account').''; print $accountstatic->getNomUrl(1); print '
'.$langs->trans('NbOfCheques').''; + print '
'.$langs->trans('NbOfCheques').''; print $object->nbcheque; print '
'.$langs->trans('Total').''; - print price($object->amount); + print '
'.$langs->trans('Total').''; + print ''.price($object->amount).''; print '
'.$langs->trans('Status').''; - print $object->getLibStatut(4); - 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 '
'; - if ($lines[$i]->progress != '' && $lines[$i]->duration) { + if ($lines[$i]->progress != '' && $lines[$i]->duration_effective) { print getTaskProgressView($taskstatic, false, false); } 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 "