From 0ad68c180d2b27672e2ede014f9b76700d3737ef Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Sun, 15 Mar 2020 21:49:35 +0100 Subject: [PATCH 001/222] fix:Show units of products in stocks and hide total units if content is of diffents units --- htdocs/product/stock/card.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index d0a1fc5db76..b9a5c430b92 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -509,6 +509,7 @@ else print_liste_field_titre("Product", "", "p.ref", "&id=".$id, "", "", $sortfield, $sortorder); print_liste_field_titre("Label", "", "p.label", "&id=".$id, "", "", $sortfield, $sortorder); print_liste_field_titre("Units", "", "ps.reel", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); + if(!empty($conf->global->PRODUCT_USE_UNITS)) print_liste_field_titre("Unit","", "p.fk_unit","&id=".$id,"",'align="left"',$sortfield,$sortorder); print_liste_field_titre("AverageUnitPricePMPShort", "", "p.pmp", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); print_liste_field_titre("EstimatedStockValueShort", "", "", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); if (empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -530,6 +531,7 @@ else $sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.pmp as ppmp, p.price, p.price_ttc, p.entity,"; $sql .= " ps.reel as value"; + if(!empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ",fk_unit"; $sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE ps.fk_product = p.rowid"; $sql .= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) @@ -573,6 +575,7 @@ else $productstatic->type = $objp->type; $productstatic->entity = $objp->entity; $productstatic->status_batch = $objp->tobatch; + $productstatic->fk_unit=$objp->fk_unit; print $productstatic->getNomUrl(1, 'stock', 16); print ''; @@ -585,6 +588,13 @@ else print ''; $totalunit += $objp->value; + if(!empty($conf->global->PRODUCT_USE_UNITS)) { + // Units + print ''; + if(is_null($productstatic->fk_unit))$productstatic->fk_unit=1; + print $langs->trans($productstatic->getLabelOfUnit()); + print ''; + } // Price buy PMP print ''.price(price2num($objp->ppmp, 'MU')).''; @@ -620,15 +630,24 @@ else print ""; } - print ""; - $i++; - } - $db->free($resql); + if ($user->rights->stock->creer) { + print ''; + print $langs->trans("StockCorrection"); + print ""; + } + if(!empty($conf->global->PRODUCT_USE_UNITS)) { + if ($i == 0) $units = $productstatic->fk_unit; + elseif($productstatic->fk_unit !== $units) $sameunits = false; + } + print ""; + $i++; + } + $db->free($resql); print ''.$langs->trans("Total").''; - print ''; - $valtoshow = price2num($totalunit, 'MS'); - print empty($valtoshow) ? '0' : $valtoshow; + print ''; + $valtoshow=price2num($totalunit, 'MS'); + if(empty($conf->global->PRODUCT_USE_UNITS) || $sameunits) print empty($valtoshow)?'0':$valtoshow; print ''; print ' '; print ''.price(price2num($totalvalue, 'MT')).''; From 1f83e5ac5485878e6dcf54717fc82e7902fa2b96 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 15 Mar 2020 21:30:46 +0000 Subject: [PATCH 002/222] Fixing style errors. --- htdocs/product/stock/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b9a5c430b92..47d8775b163 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -509,7 +509,7 @@ else print_liste_field_titre("Product", "", "p.ref", "&id=".$id, "", "", $sortfield, $sortorder); print_liste_field_titre("Label", "", "p.label", "&id=".$id, "", "", $sortfield, $sortorder); print_liste_field_titre("Units", "", "ps.reel", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); - if(!empty($conf->global->PRODUCT_USE_UNITS)) print_liste_field_titre("Unit","", "p.fk_unit","&id=".$id,"",'align="left"',$sortfield,$sortorder); + if(!empty($conf->global->PRODUCT_USE_UNITS)) print_liste_field_titre("Unit", "", "p.fk_unit", "&id=".$id, "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("AverageUnitPricePMPShort", "", "p.pmp", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); print_liste_field_titre("EstimatedStockValueShort", "", "", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); if (empty($conf->global->PRODUIT_MULTIPRICES)) { From c9bdefbbe0dc3ee046d4c92f53591375cc2226ef Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Fri, 20 Mar 2020 19:08:24 +0100 Subject: [PATCH 003/222] fix: delete redundant test+fix condition test+display units type if products in warehouse of same nature --- htdocs/product/stock/card.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 47d8775b163..af0703a119e 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -628,16 +628,13 @@ else print ''; print $langs->trans("StockCorrection"); print ""; - } - - if ($user->rights->stock->creer) { print ''; print $langs->trans("StockCorrection"); print ""; } if(!empty($conf->global->PRODUCT_USE_UNITS)) { if ($i == 0) $units = $productstatic->fk_unit; - elseif($productstatic->fk_unit !== $units) $sameunits = false; + elseif($productstatic->fk_unit != $units) $sameunits = false; } print ""; $i++; @@ -649,7 +646,9 @@ else $valtoshow=price2num($totalunit, 'MS'); if(empty($conf->global->PRODUCT_USE_UNITS) || $sameunits) print empty($valtoshow)?'0':$valtoshow; print ''; - print ' '; + print ''; + if(empty($conf->global->PRODUCT_USE_UNITS) && $sameunits) print $langs->trans($productstatic->getLabelOfUnit()); + print ''; print ''.price(price2num($totalvalue, 'MT')).''; if (empty($conf->global->PRODUIT_MULTIPRICES)) { From bcbccf0c83f05d123054d47e69a1a5bb8beeaa76 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 24 Mar 2020 10:32:31 +0100 Subject: [PATCH 004/222] Start working on bom cost --- htdocs/bom/bom_card.php | 3 +++ htdocs/bom/class/bom.class.php | 14 ++++++++++++++ htdocs/bom/tpl/objectline_create.tpl.php | 5 +++++ htdocs/bom/tpl/objectline_title.tpl.php | 9 ++++++--- htdocs/bom/tpl/objectline_view.tpl.php | 5 +++++ 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 81b5f858c9b..c4146660053 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -68,6 +68,7 @@ if (empty($action) && empty($id) && empty($ref)) $action = 'view'; // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +$object->calculateCosts(); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); @@ -523,6 +524,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $keyforbreak = 'duration'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + print 'Coût total'.price($object->total_cost).''; + // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index b53e2a7bc88..5e25ef7fb14 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -912,6 +912,7 @@ class BOM extends CommonObject else { $this->lines = $result; + $this->calculateCosts(); return $this->lines; } } @@ -991,6 +992,19 @@ class BOM extends CommonObject return $error; } + + public function calculateCosts() { + include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + $this->total_cost = 0; + foreach ($this->lines as &$line) { + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($line->fk_product); + + $line->unit_cost = $tmpproduct->cost_price; // TODO : add option to work with cost_price or pmp + $line->total_cost = price2num($line->qty * $line->unit_cost); + $this->total_cost += $line->total_cost; + } + } } diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 445466a27a1..66bcf0cece5 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -133,6 +133,11 @@ print ''; print ''; print ''; +$coldisplay++; +print ''; +print ' '; +print ''; + $coldisplay += $colspan; print ''; print ''; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 138a0b9aa58..ce440dbaab6 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -60,13 +60,16 @@ if ($conf->global->PRODUCT_USE_UNITS) } // Qty frozen -print ''.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).''; +print ''.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).''; // Disable stock change -print ''.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).''; +print ''.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).''; // Efficiency -print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; +print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; + +// Cost +print ''.$langs->trans('CostPrice').''; print ''; // No width to allow autodim diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 16aa5382f53..ad2c2d3e4c6 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -103,6 +103,11 @@ $coldisplay++; echo $line->efficiency; print ''; +print ''; +$coldisplay++; +echo price($line->total_cost); +print ''; + if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines' ) { print ''; $coldisplay++; From 46a4184f15fc38607e2bb4aeeb1413cb1e8821df Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 24 Mar 2020 19:50:01 +0100 Subject: [PATCH 005/222] NEW : Project task list, add column selector and extrafields --- htdocs/core/lib/project.lib.php | 293 +++++++++++++++++------------ htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/class/task.class.php | 16 +- htdocs/projet/tasks.php | 252 +++++++++++++------------ htdocs/projet/tasks/list.php | 65 ++++++- 5 files changed, 379 insertions(+), 248 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a8af4262d58..2092cfc2b12 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -354,13 +354,17 @@ function project_admin_prepare_head() * @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 $showbilltime Add the column 'TimeToBill' and 'TimeBilled' + * @param array $arrayfields Array with displayed coloumn information * @return int Nb of tasks shown */ -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, $arrayfields=array()) { - global $user, $langs, $conf, $db; + global $user, $langs, $conf, $db, $hookmanager; global $projectstatic, $taskstatic; + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label($taskstatic->table_element); + $lastprojectid = 0; $projectsArrayId = explode(',', $projectsListId); @@ -375,7 +379,6 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } $lines = array_values($lines); } - $numlines = count($lines); // We declare counter as global because we want to edit them into recursive call @@ -487,44 +490,56 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } // Ref of task - print ''; - if ($showlineingray) - { - print ''.img_object('', 'projecttask').' '.$lines[$i]->ref.''; + if (count($arrayfields)>0 && !empty($arrayfields['t.ref']['checked'])) { + print ''; + if ($showlineingray) { + print '' . img_object('', 'projecttask') . ' ' . $lines[$i]->ref . ''; + } else { + print $taskstatic->getNomUrl(1, 'withproject'); + } + print ''; } - else - { - print $taskstatic->getNomUrl(1, 'withproject'); - } - print ''; // Title of task - print ""; - if ($showlineingray) print ''; - //else print ''; - for ($k = 0; $k < $level; $k++) - { - print ''; + + if (count($arrayfields)>0 && !empty($arrayfields['t.description']['checked'])) { + print ""; + print $lines[$i]->description; + print "\n"; } - if ($showlineingray) print ''; - //else print ''; - print "\n"; // Date start - print ''; - print dol_print_date($lines[$i]->date_start, 'dayhour'); - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.dateo']['checked'])) { + print ''; + print dol_print_date($lines[$i]->date_start, 'dayhour'); + print ''; + } // Date end - print ''; - print dol_print_date($lines[$i]->date_end, 'dayhour'); - if ($taskstatic->hasDelay()) print img_warning($langs->trans("Late")); - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.datee']['checked'])) { + print ''; + print dol_print_date($lines[$i]->date_end, 'dayhour'); + if ($taskstatic->hasDelay()) + print img_warning($langs->trans("Late")); + print ''; + } $plannedworkloadoutputformat = 'allhourmin'; $timespentoutputformat = 'allhourmin'; @@ -532,79 +547,88 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if (!empty($conf->global->PROJECT_TIMES_SPENT_FORMAT)) $timespentoutputformat = $conf->global->PROJECT_TIME_SPENT_FORMAT; // Planned Workload (in working hours) - print ''; - $fullhour = convertSecondToTime($lines[$i]->planned_workload, $plannedworkloadoutputformat); - $workingdelay = convertSecondToTime($lines[$i]->planned_workload, 'all', 86400, 7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks - if ($lines[$i]->planned_workload != '') - { - print $fullhour; - // TODO Add delay taking account of working hours per day and working day per week - //if ($workingdelay != $fullhour) print '
('.$workingdelay.')'; + if (count($arrayfields)>0 && !empty($arrayfields['t.planned_workload']['checked'])) { + print ''; + $fullhour = convertSecondToTime($lines[$i]->planned_workload, $plannedworkloadoutputformat); + $workingdelay = convertSecondToTime($lines[$i]->planned_workload, 'all', 86400, 7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks + if ($lines[$i]->planned_workload != '') { + print $fullhour; + // TODO Add delay taking account of working hours per day and working day per week + //if ($workingdelay != $fullhour) print '
('.$workingdelay.')'; + } + //else print '--:--'; + print ''; } - //else print '--:--'; - print ''; // Time spent - print ''; - if ($showlineingray) print ''; - else print ''; - if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration, $timespentoutputformat); - else print '--:--'; - if ($showlineingray) print ''; - else print ''; - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.duration_effective']['checked'])) { + print ''; + if ($showlineingray) + print ''; + else print ''; + if ($lines[$i]->duration) + print convertSecondToTime($lines[$i]->duration, $timespentoutputformat); + else print '--:--'; + if ($showlineingray) + print ''; + else print ''; + print ''; + } // Progress calculated (Note: ->duration is time spent) - print ''; - if ($lines[$i]->planned_workload || $lines[$i]->duration) - { - if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload, 2).' %'; - else print ''.$langs->trans('WorkloadNotDefined').''; + if (count($arrayfields)>0 && !empty($arrayfields['t.progress_calculated']['checked'])) { + print ''; + if ($lines[$i]->planned_workload || $lines[$i]->duration) { + if ($lines[$i]->planned_workload) + print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload, 2) . ' %'; + else print '' . $langs->trans('WorkloadNotDefined') . ''; + } + print ''; } - print ''; // Progress declared - print ''; - if ($lines[$i]->progress != '') - { - print getTaskProgressBadge($taskstatic); + if (count($arrayfields)>0 && !empty($arrayfields['t.progress']['checked'])) { + print ''; + if ($lines[$i]->progress != '') { + print getTaskProgressBadge($taskstatic); + } + print ''; } - print ''; // resume - print ''; - if ($lines[$i]->progress != '' && $lines[$i]->duration) { - print getTaskProgressView($taskstatic, false, false); - } - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.progress_summary']['checked'])) { + print ''; + if ($lines[$i]->progress != '' && $lines[$i]->duration) { + print getTaskProgressView($taskstatic, false, false); + } + print ''; + } if ($showbilltime) { // Time not billed - print ''; - if ($lines[$i]->usage_bill_time) - { - print convertSecondToTime($lines[$i]->tobill, 'allhourmin'); - $total_projectlinesa_tobill += $lines[$i]->tobill; - } - else - { - print ''.$langs->trans("NA").''; - } - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.tobill']['checked'])) { + print ''; + if ($lines[$i]->usage_bill_time) { + print convertSecondToTime($lines[$i]->tobill, 'allhourmin'); + $total_projectlinesa_tobill += $lines[$i]->tobill; + } else { + print '' . $langs->trans("NA") . ''; + } + print ''; + } // Time billed - print ''; - if ($lines[$i]->usage_bill_time) - { - print convertSecondToTime($lines[$i]->billed, 'allhourmin'); - $total_projectlinesa_billed += $lines[$i]->billed; - } - else - { - print ''.$langs->trans("NA").''; - } - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.billed']['checked'])) { + print ''; + if ($lines[$i]->usage_bill_time) { + print convertSecondToTime($lines[$i]->billed, 'allhourmin'); + $total_projectlinesa_billed += $lines[$i]->billed; + } else { + print '' . $langs->trans("NA") . ''; + } + print ''; + } } // Contacts of task @@ -628,6 +652,15 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; } + // Extra fields + $extrafieldsobjectkey=$taskstatic->table_element; + $obj=$lines[$i]; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$lines[$i]); + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Tick to drag and drop if ($addordertick) { @@ -641,7 +674,7 @@ 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); + if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, $filterprogresscalc, $showbilltime, $arrayfields); $level--; } @@ -663,17 +696,23 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; print ''.$langs->trans("Total").''; if ($showproject) print ''; - print ''; - print ''; - print ''; - print ''; - print convertSecondToTime($total_projectlinesa_planned, 'allhourmin'); - print ''; - print ''; - if ($projectidfortotallink > 0) print ''; - print convertSecondToTime($total_projectlinesa_spent, 'allhourmin'); - if ($projectidfortotallink > 0) print ''; - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.label']['checked'])) print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.dateo']['checked'])) print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.datee']['checked'])) print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.planned_workload']['checked'])) { + print ''; + print convertSecondToTime($total_projectlinesa_planned, 'allhourmin'); + print ''; + } + if (count($arrayfields)>0 && !empty($arrayfields['t.duration_effective']['checked'])) { + print ''; + if ($projectidfortotallink > 0) + print ''; + print convertSecondToTime($total_projectlinesa_spent, 'allhourmin'); + if ($projectidfortotallink > 0) + print ''; + print ''; + } if ($total_projectlinesa_planned) { $totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2); @@ -698,33 +737,45 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } } - print ''; - if ($total_projectlinesa_planned) print $totalCalculatedProgress.' %'; - print ''; - print ''; - if ($total_projectlinesa_planned) print ''.$totalAverageDeclaredProgress.' %'; - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.progress_calculated']['checked'])) { + print ''; + if ($total_projectlinesa_planned) + print $totalCalculatedProgress . ' %'; + print ''; + } + if (count($arrayfields)>0 && !empty($arrayfields['t.progress']['checked'])) { + print ''; + if ($total_projectlinesa_planned) + print '' . $totalAverageDeclaredProgress . ' %'; + print ''; + } // resume - print ''; - if ($total_projectlinesa_planned) { - print ''; - print '
'; - print '
'; - print '
'; - print ''; - } - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.progress_summary']['checked'])) { + print ''; + if ($total_projectlinesa_planned) { + print ''; + print '
'; + print '
'; + print '
'; + print ''; + } + print ''; + } if ($showbilltime) { - print ''; - print convertSecondToTime($total_projectlinesa_tobill, 'allhourmin'); - print ''; - print ''; - print convertSecondToTime($total_projectlinesa_billed, 'allhourmin'); - print ''; + if (count($arrayfields)>0 && !empty($arrayfields['t.tobill']['checked'])) { + print ''; + print convertSecondToTime($total_projectlinesa_tobill, 'allhourmin'); + print ''; + } + if (count($arrayfields)>0 && !empty($arrayfields['t.billed']['checked'])) { + print ''; + print convertSecondToTime($total_projectlinesa_billed, 'allhourmin'); + print ''; + } } // Contacts of task if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 94e440f9ab9..90020935390 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -265,3 +265,4 @@ InvoiceToUse=Draft invoice to use NewInvoice=New invoice OneLinePerTask=One line per task OneLinePerPeriod=One line per period +RefTaskParent=Ref. Parent Task diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 613daa18ab0..7bb3f55242d 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -740,11 +740,12 @@ class Task extends CommonObject * @param string $filterontaskuser Filter on user assigned to task * @param array $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 * @return array 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) + 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()) { - global $conf; + global $conf, $hookmanager; $tasks = array(); @@ -756,6 +757,7 @@ class Task extends CommonObject $sql .= " p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus, p.usage_bill_time,"; $sql .= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,"; $sql .= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,"; + $sql .= " t.description, "; $sql .= " s.rowid as thirdparty_id, s.nom as thirdparty_name, s.email as thirdparty_email,"; $sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount"; if (!empty($extrafields->attributes['projet']['label'])) @@ -850,12 +852,21 @@ class Task extends CommonObject if ($filteronproj) $sql .= natural_search(array("p.ref", "p.title"), $filteronproj); if ($filteronprojstatus && $filteronprojstatus != '-1') $sql .= " AND p.fk_statut IN (".$filteronprojstatus.")"; if ($morewherefilter) $sql .= $morewherefilter; + // Add where from extra fields + $extrafieldsobjectkey='projet_task'; + $extrafieldsobjectprefix='efpt.'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; + // Add where from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook + $sql .= $hookmanager->resPrint; if ($includebilltime) { $sql .= " GROUP BY p.rowid, p.ref, p.title, p.public, p.fk_statut, p.usage_bill_time,"; $sql .= " t.datec, t.dateo, t.datee, t.tms,"; $sql .= " t.rowid, t.ref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut,"; $sql .= " t.dateo, t.datee, t.planned_workload, t.rang,"; + $sql .= " t.description, "; $sql .= " s.rowid, s.nom, s.email,"; $sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount"; if (!empty($extrafields->attributes['projet']['label'])) @@ -868,6 +879,7 @@ class Task extends CommonObject } } + $sql .= " ORDER BY p.ref, t.rang, t.dateo"; //print $sql;exit; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index b125ed7306e..7082e68d97d 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -52,6 +52,7 @@ $cancel = GETPOST('cancel', 'alpha'); $search_user_id = GETPOST('search_user_id', 'int'); $search_taskref = GETPOST('search_taskref'); $search_tasklabel = GETPOST('search_tasklabel'); +$search_taskdescription=GETPOST('search_taskdescription'); $search_dtstartday = GETPOST('search_dtstartday'); $search_dtstartmonth = GETPOST('search_dtstartmonth'); $search_dtstartyear = GETPOST('search_dtstartyear'); @@ -63,6 +64,8 @@ $search_timespend = GETPOST('search_timespend'); $search_progresscalc = GETPOST('search_progresscalc'); $search_progressdeclare = GETPOST('search_progressdeclare'); +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'projecttasklist'; + //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects $object = new Project($db); @@ -78,6 +81,7 @@ if ($id > 0 || !empty($ref)) $extrafields->fetch_name_optionals_label($object->table_element); } $extrafields->fetch_name_optionals_label($taskstatic->table_element); +$search_array_options = $extrafields->getOptionalsFromPost($taskstatic->table_element, '', 'search_'); // Security check $socid = 0; @@ -96,37 +100,38 @@ $planned_workloadhour = (GETPOST('planned_workloadhour', 'int') ?GETPOST('planne $planned_workloadmin = (GETPOST('planned_workloadmin', 'int') ?GETPOST('planned_workloadmin', 'int') : 0); $planned_workload = $planned_workloadhour * 3600 + $planned_workloadmin * 60; +// Definition of fields for list $arrayfields = array( - 't.ref'=>array('label'=>$langs->trans("RefTask"), 'checked'=>1, 'position'=>80), - 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>80), - 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), - 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), - 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1), - 'p.title'=>array('label'=>$langs->trans("ProjectLabel"), 'checked'=>0), - 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>0), - 'p.fk_statut'=>array('label'=>$langs->trans("ProjectStatus"), 'checked'=>1), - 't.planned_workload'=>array('label'=>$langs->trans("PlannedWorkload"), 'checked'=>1, 'position'=>102), - 't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>103), - 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>104), - 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>105), - 't.tobill'=>array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>110), - 't.billed'=>array('label'=>$langs->trans("TimeBilled"), 'checked'=>0, 'position'=>111), - 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - //'t.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 't.ref'=>array('label'=>$langs->trans("RefTask"), 'checked'=>1, 'position'=>1), + 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>2), + 't.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0, 'position'=>3), + 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>4), + 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>5), + 't.planned_workload'=>array('label'=>$langs->trans("PlannedWorkload"), 'checked'=>1, 'position'=>6), + 't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>7), + 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>8), + 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>9), + 't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>10), + 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), ); -// Extra fields project -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) +if ($object->usage_bill_time) { + $arrayfields['t.tobill']=array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>11); + $arrayfields['t.billed']=array('label'=>$langs->trans("TimeBilled"), 'checked'=>0, 'position'=>12); +} + +// Extra fields +if (is_array($extrafields->attributes[$taskstatic->table_element]['label']) && count($extrafields->attributes[$taskstatic->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) + foreach ($extrafields->attributes[$taskstatic->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) - $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + if (!empty($extrafields->attributes[$taskstatic->table_element]['list'][$key])) + $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$taskstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$taskstatic->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$taskstatic->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$taskstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$taskstatic->table_element]['perms'][$key])); } } -$object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; /* * Actions @@ -204,7 +209,6 @@ if (!empty($search_progressdeclare)) { $morewherefilterarray[] = natural_search('t.progress', $search_progressdeclare, 1, 1); } - $morewherefilter = ''; if (count($morewherefilterarray) > 0) { $morewherefilter = ' AND '.implode(' AND ', $morewherefilterarray); @@ -332,21 +336,18 @@ $projectstatic = new Project($db); $taskstatic = new Task($db); $userstatic = new User($db); -$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - $title = $langs->trans("Project").' - '.$langs->trans("Tasks").' - '.$object->ref.' '.$object->name; if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->ref.' '.$object->name.' - '.$langs->trans("Tasks"); $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("", $title, $help_url); + if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); $res = $object->fetch_optionals(); - // To verify role of users //$userAccess = $object->restrictedProjectArea($user,'read'); $userWrite = $object->restrictedProjectArea($user, 'write'); @@ -359,8 +360,25 @@ if ($id > 0 || !empty($ref)) $head = project_prepare_head($object); dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); - $param = ''; - if ($search_user_id > 0) $param .= '&search_user_id='.dol_escape_htmltag($search_user_id); + $param = 'id='.$object->id; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($search_user_id) $param .= '&search_user_id='.urlencode($search_user_id); + if ($search_taskref) $param .= '&search_taskref='.urlencode($search_taskref); + if ($search_tasklabel) $param .= '&search_tasklabel='.urlencode($search_tasklabel); + if ($search_taskdescription) $param .= '&search_taskdescription='.urlencode($search_taskdescription); + if ($search_dtstartday) $param .= '&search_dtstartday='.urlencode($search_dtstartday); + if ($search_dtstartmonth) $param .= '&search_dtstartmonth='.urlencode($search_dtstartmonth); + if ($search_dtstartyear) $param .= '&search_dtstartyear='.urlencode($search_dtstartyear); + if ($search_dtendday) $param .= '&search_dtendday='.urlencode($search_dtendday); + if ($search_dtendmonth) $param .= '&search_dtendmonth='.urlencode($search_dtendmonth); + if ($search_dtendyear) $param .= '&search_dtendyear='.urlencode($search_dtendyear); + if ($search_planedworkload) $param .= '&search_planedworkload='.urlencode($search_planedworkload); + if ($search_timespend) $param .= '&search_timespend='.urlencode($search_timespend); + if ($search_progresscalc) $param .= '&search_progresscalc='.urlencode($search_progresscalc); + if ($search_progressdeclare) $param .= '&search_progressdeclare='.urlencode($search_progressdeclare); + if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); + // Add $param from extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Project card @@ -425,25 +443,6 @@ if ($id > 0 || !empty($ref)) else print $langs->trans('PrivateProject'); print ''; - /*if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) - { - // Opportunity status - print ''.$langs->trans("OpportunityStatus").''; - $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); - if ($code) print $langs->trans("OppStatus".$code); - print ''; - - // Opportunity percent - print ''.$langs->trans("OpportunityProbability").''; - if (strcmp($object->opp_percent,'')) print price($object->opp_percent,'',$langs,1,0).' %'; - print ''; - - // Opportunity Amount - print ''.$langs->trans("OpportunityAmount").''; - if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,1,0,0,$conf->currency); - print ''; - }*/ - // Date start - end print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start, 'day'); @@ -618,27 +617,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third } elseif ($id > 0 || !empty($ref)) { + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + /* * Projet card in view mode */ - // Definition of fields for list - $arrayfields = array(); - $arrayfields['t.task_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1); - $arrayfields['t.task_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1); - $arrayfields['t.task_date_start'] = array('label'=>$langs->trans("DateStart"), 'checked'=>1); - $arrayfields['t.task_date_end'] = array('label'=>$langs->trans("DateEnd"), 'checked'=>1); - // Extra fields - if (is_array($extrafields->attributes[$taskstatic->table_element]['label']) && count($extrafields->attributes[$taskstatic->table_element]['label']) > 0) - { - foreach ($extrafields->attributes[$taskstatic->table_element]['label'] as $key => $val) - { - if (!empty($extrafields->attributes[$taskstatic->table_element]['list'][$key])) - $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$taskstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$taskstatic->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$taskstatic->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$taskstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$taskstatic->table_element]['perms'][$key])); - } - } - $arrayfields = dol_sort_array($arrayfields, 'position'); - print '
'; // Link to create task @@ -654,7 +638,6 @@ elseif ($id > 0 || !empty($ref)) $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam); - print '
'; if ($optioncss != '') print ''; print ''; @@ -674,7 +657,7 @@ elseif ($id > 0 || !empty($ref)) // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him). $filteronthirdpartyid = $socid; - $tasksarray = $taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0, '', -1, $morewherefilter, 0, 0, array(), 1); + $tasksarray = $taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0, '', -1, $morewherefilter, 0, 0, $extrafields, 1, $search_array_options); // We load also tasks limited to a particular user $tmpuser = new User($db); if ($search_user_id > 0) $tmpuser->fetch($search_user_id); @@ -704,64 +687,90 @@ elseif ($id > 0 || !empty($ref)) print ''; } - $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - print '
'; print ''; // Fields title search print ''; - print ''; + if (!empty($arrayfields['t.ref']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.label']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.description']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.dateo']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.datee']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.planned_workload']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.duration_effective']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.progress_calculated']['checked'])) { + print ''; + } + + if (!empty($arrayfields['t.progress']['checked'])) { + print ''; + } // progress resume not searchable print ''; if ($object->usage_bill_time) { - print ''; + if (!empty($arrayfields['t.tobill']['checked'])) { + print ''; + } - print ''; + if (!empty($arrayfields['t.billed']['checked'])) { + print ''; + } } - if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print ''; + if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print ''; + + $extrafieldsobjectkey=$taskstatic->table_element; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Action column print ''; // print ''; - print_liste_field_titre("RefTask", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, ''); - print_liste_field_titre("LabelTask", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, ''); - print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("PlannedWorkload", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("TimeSpent", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("ProgressCalculated", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("ProgressDeclared", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("TaskProgressSummary", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['t.ref']['checked'])) print_liste_field_titre($arrayfields['t.ref']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, ''); + if (!empty($arrayfields['t.label']['checked'])) print_liste_field_titre($arrayfields['t.label']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, ''); + if (!empty($arrayfields['t.description']['checked'])) print_liste_field_titre($arrayfields['t.description']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, ''); + if (!empty($arrayfields['t.dateo']['checked'])) print_liste_field_titre($arrayfields['t.dateo']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['t.datee']['checked'])) print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['t.planned_workload']['checked'])) print_liste_field_titre($arrayfields['t.planned_workload']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['t.duration_effective']['checked'])) print_liste_field_titre($arrayfields['t.duration_effective']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['t.progress_calculated']['checked'])) print_liste_field_titre($arrayfields['t.progress_calculated']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['t.progress']['checked'])) print_liste_field_titre($arrayfields['t.progress']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['t.progress_summary']['checked'])) print_liste_field_titre($arrayfields['t.progress_summary']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center '); if ($object->usage_bill_time) { - print_liste_field_titre("TimeToBill", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("TimeBilled", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['t.tobill']['checked'])) print_liste_field_titre($arrayfields['t.tobill']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['t.billed']['checked'])) print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); } - if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', '', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch '); + if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', $param, $sortfield, $sortorder); + // 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); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; 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)); + $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields); } else { diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 09135733e9e..aa4bfad01f1 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -56,6 +56,7 @@ $search_project_title = GETPOST('search_project_title'); $search_task_ref = GETPOST('search_task_ref'); $search_task_label = GETPOST('search_task_label'); $search_task_description = GETPOST('search_task_description'); +$search_task_ref_parent = GETPOST('search_task_ref_parent'); $search_project_user = GETPOST('search_project_user'); $search_task_user = GETPOST('search_task_user'); @@ -109,8 +110,10 @@ $fieldstosearchall = array( if (empty($user->socid)) $fieldstosearchall['t.note_private'] = "NotePrivate"; $arrayfields = array( + 't.fk_task_parent'=>array('label'=>$langs->trans("RefTaskParent"), 'checked'=>0, 'position'=>70), 't.ref'=>array('label'=>$langs->trans("RefTask"), 'checked'=>1, 'position'=>80), 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>80), + 't.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0, 'position'=>80), 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1), @@ -169,6 +172,7 @@ if (empty($reshook)) $search_task_ref = ""; $search_task_label = ""; $search_task_description = ""; + $search_task_ref_parent = ""; $search_task_user = -1; $search_project_user = -1; $search_sday = ''; @@ -262,7 +266,8 @@ $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,"; $sql .= " s.nom as name, s.rowid as socid,"; $sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,"; -$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut"; +$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut, "; +$sql .= " t.description, t.fk_task_parent"; // We'll need these fields in order to filter by categ if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_project"; // Add sum fields @@ -302,6 +307,8 @@ if ($search_project_ref) $sql .= natural_search('p.ref', $search_project_ref); if ($search_project_title) $sql .= natural_search('p.title', $search_project_title); if ($search_task_ref) $sql .= natural_search('t.ref', $search_task_ref); if ($search_task_label) $sql .= natural_search('t.label', $search_task_label); +if ($search_task_description) $sql .= natural_search('t.description', $search_task_description); +if ($search_task_ref_parent) $sql .= ' AND t.fk_task_parent IN (SELECT ipt.rowid FROM '.MAIN_DB_PREFIX.'projet_task as ipt WHERE '.natural_search('ipt.ref', $search_task_ref_parent, 0, 1).')'; if ($search_societe) $sql .= natural_search('s.nom', $search_societe); $sql .= dolSqlDateFilter('t.dateo', $search_sday, $search_smonth, $search_syear); $sql .= dolSqlDateFilter('t.datee', $search_eday, $search_emonth, $search_eyear); @@ -385,8 +392,10 @@ if ($socid) $param .= '&socid='.urlencode($socid); if ($search_all != '') $param .= '&search_all='.urlencode($search_all); if ($search_project_ref != '') $param .= '&search_project_ref='.urlencode($search_project_ref); if ($search_project_title != '') $param .= '&search_project_title='.urlencode($search_project_title); -if ($search_ref != '') $param .= '&search_ref='.urlencode($search_ref); -if ($search_label != '') $param .= '&search_label='.urlencode($search_label); +if ($search_task_ref != '') $param .= '&search_task_ref='.urlencode($search_ref); +if ($search_task_label != '') $param .= '&search_task_label='.urlencode($search_label); +if ($search_task_description != '') $param .= '&search_task_description='.urlencode($search_description); +if ($search_task_ref_parent != '') $param .= '&search_task_ref_parent='.urlencode($search_task_ref_parent); if ($search_societe != '') $param .= '&search_societe='.urlencode($search_societe); if ($search_projectstatus != '') $param .= '&search_projectstatus='.urlencode($search_projectstatus); if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all', 'none'))) $param .= '&search_opp_status='.urlencode($search_opp_status); @@ -491,6 +500,12 @@ print '
'; print '
'; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; - $formother->select_year($search_dtstartyear ? $search_dtstartyear : -1, 'search_dtstartyear', 1, 20, 5); - print ''; + print ''; + print ''; - print ''; - print ''; - $formother->select_year($search_dtendyear ? $search_dtendyear : -1, 'search_dtendyear', 1, 20, 5); - print ''; + print ''; + print ''; + $formother->select_year($search_dtstartyear ? $search_dtstartyear : -1, 'search_dtstartyear', 1, 20, 5); + print ''; - print ''; - print ''; + print ''; + print ''; + $formother->select_year($search_dtendyear ? $search_dtendyear : -1, 'search_dtendyear', 1, 20, 5); + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - print ''; + print ''; - print ''; + print ''; @@ -772,29 +781,36 @@ elseif ($id > 0 || !empty($ref)) print '
'.$langs->trans("Project").'
'."\n"; print ''; +if (!empty($arrayfields['t.fk_task_parent']['checked'])) +{ + print ''; +} if (!empty($arrayfields['t.ref']['checked'])) { print ''; } +//Task Description +if (!empty($arrayfields['t.description']['checked'])) +{ + print ''; +} // Start date if (!empty($arrayfields['t.dateo']['checked'])) { @@ -581,17 +603,19 @@ print ''; print "\n"; print ''; +if (!empty($arrayfields['t.fk_task_parent']['checked'])) print_liste_field_titre($arrayfields['t.fk_task_parent']['label'], $_SERVER["PHP_SELF"], "t.fk_task_parent", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.ref']['checked'])) print_liste_field_titre($arrayfields['t.ref']['label'], $_SERVER["PHP_SELF"], "t.ref", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.label']['checked'])) print_liste_field_titre($arrayfields['t.label']['label'], $_SERVER["PHP_SELF"], "t.label", "", $param, "", $sortfield, $sortorder); -if (!empty($arrayfields['t.dateo']['checked'])) print_liste_field_titre($arrayfields['t.dateo']['label'], $_SERVER["PHP_SELF"], "t.dateo", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.description']['checked'])) print_liste_field_titre($arrayfields['t.description']['label'], $_SERVER["PHP_SELF"], "t.description", "", $param, "", $sortfield, $sortorder); +if (!empty($arrayfields['t.dateo']['checked'])) print_liste_field_titre($arrayfields['t.dateo']['label'], $_SERVER["PHP_SELF"], "t.dateo", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['t.datee']['checked'])) print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "t.datee", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER["PHP_SELF"], "p.title", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['t.planned_workload']['checked'])) print_liste_field_titre($arrayfields['t.planned_workload']['label'], $_SERVER["PHP_SELF"], "t.planned_workload", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['t.duration_effective']['checked'])) print_liste_field_titre($arrayfields['t.duration_effective']['label'], $_SERVER["PHP_SELF"], "t.duration_effective", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['t.progress_calculated']['checked'])) print_liste_field_titre($arrayfields['t.progress_calculated']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center '); +if (!empty($arrayfields['t.planned_workload']['checked'])) print_liste_field_titre($arrayfields['t.planned_workload']['label'], $_SERVER["PHP_SELF"], "t.planned_workload", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.duration_effective']['checked'])) print_liste_field_titre($arrayfields['t.duration_effective']['label'], $_SERVER["PHP_SELF"], "t.duration_effective", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.progress_calculated']['checked'])) print_liste_field_titre($arrayfields['t.progress_calculated']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center '); if (!empty($arrayfields['t.progress']['checked'])) print_liste_field_titre($arrayfields['t.progress']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['t.progress_summary']['checked'])) print_liste_field_titre($arrayfields['t.progress_summary']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['t.tobill']['checked'])) print_liste_field_titre($arrayfields['t.tobill']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); @@ -622,12 +646,14 @@ while ($i < min($num, $limit)) $object->id = $obj->id; $object->ref = $obj->ref; $object->label = $obj->label; + $object->description = $obj->description; $object->fk_statut = $obj->fk_statut; $object->progress = $obj->progress; $object->datee = $db->jdate($obj->date_end); // deprecated $object->date_end = $db->jdate($obj->date_end); $object->planned_workload = $obj->planned_workload; $object->duration_effective = $obj->duration_effective; + $object->fk_task_parent = $obj->fk_task_parent; $projectstatic->id = $obj->projectid; @@ -642,6 +668,23 @@ while ($i < min($num, $limit)) { print ''; + // Ref Parent + if (!empty($arrayfields['t.fk_task_parent']['checked'])) { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Ref if (!empty($arrayfields['t.ref']['checked'])) { @@ -659,6 +702,14 @@ while ($i < min($num, $limit)) print ''; if (!$i) $totalarray['nbfield']++; } + // Description + if (!empty($arrayfields['t.description']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Date start if (!empty($arrayfields['t.dateo']['checked'])) { From e9ee78ab8fe7dd0fa9fc4e049be4ddb33856c777 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 25 Mar 2020 11:19:35 +0100 Subject: [PATCH 006/222] NEW hook on product load stats --- htdocs/product/class/product.class.php | 81 +++++++++++++++++++++----- 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 96b2165c65a..adb23d38f75 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2445,8 +2445,7 @@ class Product extends CommonObject public function load_stats_propale($socid = 0) { // phpcs:enable - global $conf; - global $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_customers, COUNT(DISTINCT p.rowid) as nb,"; $sql .= " COUNT(pd.rowid) as nb_rows, SUM(pd.qty) as qty"; @@ -2497,6 +2496,11 @@ class Product extends CommonObject } } + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid); + $reshook = $hookmanager->executeHooks('loadStatsPropale', $parameters, $this, $action); + if ($reshook > 0) $this->stats_propale = $hookmanager->resArray['stats_propale']; + return 1; } else @@ -2517,8 +2521,7 @@ class Product extends CommonObject public function load_stats_proposal_supplier($socid = 0) { // phpcs:enable - global $conf; - global $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT p.fk_soc) as nb_suppliers, COUNT(DISTINCT p.rowid) as nb,"; $sql .= " COUNT(pd.rowid) as nb_rows, SUM(pd.qty) as qty"; @@ -2544,6 +2547,12 @@ class Product extends CommonObject $this->stats_proposal_supplier['nb'] = $obj->nb; $this->stats_proposal_supplier['rows'] = $obj->nb_rows; $this->stats_proposal_supplier['qty'] = $obj->qty ? $obj->qty : 0; + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid); + $reshook = $hookmanager->executeHooks('loadStatsProposalSupplier', $parameters, $this, $action); + if ($reshook > 0) $this->stats_proposal_supplier = $hookmanager->resArray['stats_proposal_supplier']; + return 1; } else @@ -2566,7 +2575,7 @@ class Product extends CommonObject public function load_stats_commande($socid = 0, $filtrestatut = '', $forVirtualStock = 0) { // phpcs:enable - global $conf, $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,"; $sql .= " COUNT(cd.rowid) as nb_rows, SUM(cd.qty) as qty"; @@ -2643,7 +2652,10 @@ class Product extends CommonObject $this->stats_commande['qty'] -= $adeduire; } } - + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); + $reshook = $hookmanager->executeHooks('loadStatsCommande', $parameters, $this, $action); + if ($reshook > 0) $this->stats_commande = $hookmanager->resArray['stats_commande']; return 1; } else @@ -2665,7 +2677,7 @@ class Product extends CommonObject public function load_stats_commande_fournisseur($socid = 0, $filtrestatut = '', $forVirtualStock = 0) { // phpcs:enable - global $conf, $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_suppliers, COUNT(DISTINCT c.rowid) as nb,"; $sql .= " COUNT(cd.rowid) as nb_rows, SUM(cd.qty) as qty"; @@ -2696,6 +2708,12 @@ class Product extends CommonObject $this->stats_commande_fournisseur['nb'] = $obj->nb; $this->stats_commande_fournisseur['rows'] = $obj->nb_rows; $this->stats_commande_fournisseur['qty'] = $obj->qty ? $obj->qty : 0; + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); + $reshook = $hookmanager->executeHooks('loadStatsCommandeFournisseur', $parameters, $this, $action); + if ($reshook > 0) $this->stats_commande_fournisseur = $hookmanager->resArray['stats_commande_fournisseur']; + return 1; } else @@ -2718,7 +2736,7 @@ class Product extends CommonObject public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '') { // phpcs:enable - global $conf, $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT e.fk_soc) as nb_customers, COUNT(DISTINCT e.rowid) as nb,"; $sql .= " COUNT(ed.rowid) as nb_rows, SUM(ed.qty) as qty"; @@ -2775,6 +2793,12 @@ class Product extends CommonObject } } } + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock, 'filterShipmentStatus' => $filterShipmentStatus); + $reshook = $hookmanager->executeHooks('loadStatsSending', $parameters, $this, $action); + if ($reshook > 0) $this->stats_expedition = $hookmanager->resArray['stats_expedition']; + return 1; } else @@ -2796,7 +2820,7 @@ class Product extends CommonObject public function load_stats_reception($socid = 0, $filtrestatut = '', $forVirtualStock = 0) { // phpcs:enable - global $conf, $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_suppliers, COUNT(DISTINCT cf.rowid) as nb,"; $sql .= " COUNT(fd.rowid) as nb_rows, SUM(fd.qty) as qty"; @@ -2823,6 +2847,12 @@ class Product extends CommonObject $this->stats_reception['nb'] = $obj->nb; $this->stats_reception['rows'] = $obj->nb_rows; $this->stats_reception['qty'] = $obj->qty ? $obj->qty : 0; + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); + $reshook = $hookmanager->executeHooks('loadStatsReception', $parameters, $this, $action); + if ($reshook > 0) $this->stats_reception = $hookmanager->resArray['stats_reception']; + return 1; } else @@ -2844,7 +2874,7 @@ class Product extends CommonObject public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirtualStock = 0) { // phpcs:enable - global $conf, $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT m.fk_soc) as nb_customers, COUNT(DISTINCT m.rowid) as nb,"; $sql .= " COUNT(mp.rowid) as nb_rows, SUM(mp.qty) as qty, role"; @@ -2910,6 +2940,11 @@ class Product extends CommonObject if ($this->stats_mrptoconsume['qty'] < 0) $this->stats_mrptoconsume['qty'] = 0; if ($this->stats_mrptoproduce['qty'] < 0) $this->stats_mrptoproduce['qty'] = 0; + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); + $reshook = $hookmanager->executeHooks('loadStatsInProduction', $parameters, $this, $action); + if ($reshook > 0) $this->stats_mrptoproduce = $hookmanager->resArray['stats_mrptoproduce']; + return 1; } else @@ -2929,8 +2964,7 @@ class Product extends CommonObject public function load_stats_contrat($socid = 0) { // phpcs:enable - global $conf; - global $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,"; $sql .= " COUNT(cd.rowid) as nb_rows, SUM(cd.qty) as qty"; @@ -2980,6 +3014,12 @@ class Product extends CommonObject } } } + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid); + $reshook = $hookmanager->executeHooks('loadStatsContrat', $parameters, $this, $action); + if ($reshook > 0) $this->stats_contrat = $hookmanager->resArray['stats_contrat']; + return 1; } else @@ -2999,7 +3039,7 @@ class Product extends CommonObject public function load_stats_facture($socid = 0) { // phpcs:enable - global $db, $conf, $user; + global $db, $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; $sql .= " COUNT(fd.rowid) as nb_rows, SUM(".$db->ifsql('f.type != 2', 'fd.qty', 'fd.qty * -1').") as qty"; @@ -3049,6 +3089,12 @@ class Product extends CommonObject } } } + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid); + $reshook = $hookmanager->executeHooks('loadStatsFacture', $parameters, $this, $action); + if ($reshook > 0) $this->stats_facture = $hookmanager->resArray['stats_facture']; + return 1; } else @@ -3068,8 +3114,7 @@ class Product extends CommonObject public function load_stats_facture_fournisseur($socid = 0) { // phpcs:enable - global $conf; - global $user; + global $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_suppliers, COUNT(DISTINCT f.rowid) as nb,"; $sql .= " COUNT(fd.rowid) as nb_rows, SUM(fd.qty) as qty"; @@ -3098,6 +3143,12 @@ class Product extends CommonObject $this->stats_facture_fournisseur['nb'] = $obj->nb; $this->stats_facture_fournisseur['rows'] = $obj->nb_rows; $this->stats_facture_fournisseur['qty'] = $obj->qty ? $obj->qty : 0; + + $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid); + $reshook = $hookmanager->executeHooks('loadStatsFactureFournisseur', $parameters, $this, $action); + if ($reshook > 0) $this->stats_facture_fournisseur = $hookmanager->resArray['stats_facture_fournisseur']; + return 1; } else From 8662c864d2ba4e489a8203216cbf4b5f7fe9ad61 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 25 Mar 2020 12:14:42 +0100 Subject: [PATCH 007/222] remove not use column from arrayfields --- htdocs/projet/tasks.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 7082e68d97d..9c459d2191d 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -112,8 +112,6 @@ $arrayfields = array( 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>8), 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>9), 't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>10), - 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), ); if ($object->usage_bill_time) { $arrayfields['t.tobill']=array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>11); From 3e4b788316b6b23632ab23b9726bb1f40f098f12 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 25 Mar 2020 21:23:55 +0100 Subject: [PATCH 008/222] Update receiptprinter.php with CUPS --- htdocs/admin/receiptprinter.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 96c00f48312..78b82f42b82 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -1,7 +1,8 @@ - * Copyright (C) 2015 Frederic France - * Copyright (C) 2016 Juanjo Menent +/* Copyright (C) 2013-2016 Laurent Destailleur + * Copyright (C) 2015 Frederic France + * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2020 Andreu Bisquerra Gaya * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -355,7 +356,7 @@ if ($mode == 'config' && $user->admin) { print ''; print ''; print ''; - //print ''; + print ''; print '
'; + print ''; + print ''; @@ -503,6 +518,13 @@ if (!empty($arrayfields['t.label']['checked'])) print ''; print ''; + print ''; + print '
'; + if (!empty($object->fk_task_parent)) { + $object_parent = new Task($db); + $result = $object_parent->fetch($object->fk_task_parent); + if ($result < 0) { + setEventMessage($object_parent->error, 'errors'); + } else { + print $object_parent->getNomUrl(1, 'withproject'); + if ($object_parent->hasDelay()) + print img_warning("Late"); + } + } + print ''; + print $object->description; + print '
'.$langs->trans("CONNECTOR_NETWORK_PRINT").':'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'
'.$langs->trans("CONNECTOR_FILE_PRINT").':'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'
'.$langs->trans("CONNECTOR_WINDOWS_PRINT").':'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'
'.$langs->trans("CONNECTOR_JAVA").':'.$langs->trans("CONNECTOR_JAVA_HELP").'
'.$langs->trans("CONNECTOR_CUPS_PRINT").':'.$langs->trans("CONNECTOR_CUPS_PRINT_HELP").'
'; dol_fiche_end(); From eef3a1795e8faed80710fd1d960d5f827cb72f59 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 25 Mar 2020 21:30:33 +0100 Subject: [PATCH 009/222] Update dolreceiptprinter.class.php with CUPS --- htdocs/core/class/dolreceiptprinter.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index d241c2a8c5a..468cdf050bc 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -104,6 +104,7 @@ require_once DOL_DOCUMENT_ROOT.'/includes/mike42/escpos-php/autoload.php'; use Mike42\Escpos\PrintConnectors\FilePrintConnector; use Mike42\Escpos\PrintConnectors\NetworkPrintConnector; use Mike42\Escpos\PrintConnectors\WindowsPrintConnector; +use Mike42\Escpos\PrintConnectors\CupsPrintConnector; use Mike42\Escpos\PrintConnectors\DummyPrintConnector; use Mike42\Escpos\CapabilityProfile; use Mike42\Escpos\Printer; @@ -119,7 +120,7 @@ class dolReceiptPrinter extends Printer const CONNECTOR_FILE_PRINT = 2; const CONNECTOR_NETWORK_PRINT = 3; const CONNECTOR_WINDOWS_PRINT = 4; - //const CONNECTOR_JAVA = 5; + const CONNECTOR_CUPS_PRINT = 5; /** * @var DoliDB Database handler. @@ -262,7 +263,7 @@ class dolReceiptPrinter extends Printer $row['fk_type_name'] = 'CONNECTOR_WINDOWS_PRINT'; break; case 5: - $row['fk_type_name'] = 'CONNECTOR_JAVA'; + $row['fk_type_name'] = 'CONNECTOR_CUPS_PRINT'; break; default: $row['fk_type_name'] = 'CONNECTOR_UNKNOWN'; @@ -343,6 +344,7 @@ class dolReceiptPrinter extends Printer 2 => $langs->trans('CONNECTOR_FILE_PRINT'), 3 => $langs->trans('CONNECTOR_NETWORK_PRINT'), 4 => $langs->trans('CONNECTOR_WINDOWS_PRINT'), + 5 => $langs->trans('CONNECTOR_CUPS_PRINT'), ); $this->resprint = Form::selectarray($htmlname, $options, $selected); @@ -839,6 +841,9 @@ class dolReceiptPrinter extends Printer break; case 4: $this->connector = new WindowsPrintConnector($parameter); + break; + case 5: + $this->connector = new CupsPrintConnector($parameter); break; default: $this->connector = 'CONNECTOR_UNKNOWN'; From d420656c3f124b481634188dbf8010bc1c90930f Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 25 Mar 2020 21:32:58 +0100 Subject: [PATCH 010/222] Update langs --- htdocs/langs/en_US/receiptprinter.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index 3df49b9fe67..b0b60c60840 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -15,10 +15,12 @@ CONNECTOR_DUMMY=Dummy Printer CONNECTOR_NETWORK_PRINT=Network Printer CONNECTOR_FILE_PRINT=Local Printer CONNECTOR_WINDOWS_PRINT=Local Windows Printer +CONNECTOR_CUPS_PRINT=Cups Printer CONNECTOR_DUMMY_HELP=Fake Printer for test, does nothing CONNECTOR_NETWORK_PRINT_HELP=10.x.x.x:9100 CONNECTOR_FILE_PRINT_HELP=/dev/usb/lp0, /dev/usb/lp1 CONNECTOR_WINDOWS_PRINT_HELP=LPT1, COM1, smb://FooUser:secret@computername/workgroup/Receipt Printer +CONNECTOR_CUPS_PRINT_HELP=CUPS printer name, example: HPRT_TP805L PROFILE_DEFAULT=Default Profile PROFILE_SIMPLE=Simple Profile PROFILE_EPOSTEP=Epos Tep Profile From 21b98a7c4c6ff502ed5e7438bffca37d9f3e8e21 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 26 Mar 2020 08:24:20 +0100 Subject: [PATCH 011/222] set as global --- htdocs/core/lib/project.lib.php | 5 +---- htdocs/core/tpl/extrafields_list_search_title.tpl.php | 3 ++- htdocs/projet/tasks.php | 1 + htdocs/projet/tasks/list.php | 2 -- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 2092cfc2b12..5a54b45c770 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -360,10 +360,7 @@ function project_admin_prepare_head() function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0, $arrayfields=array()) { global $user, $langs, $conf, $db, $hookmanager; - global $projectstatic, $taskstatic; - - $extrafields = new ExtraFields($db); - $extrafields->fetch_name_optionals_label($taskstatic->table_element); + global $projectstatic, $taskstatic, $extrafields; $lastprojectid = 0; diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php index c6d3776cfe4..9b06fc37eff 100644 --- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php @@ -8,6 +8,7 @@ if (empty($conf) || ! is_object($conf)) } if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; +if (!isset($disablesortlink)) $disablesortlink=0; // Loop to show all columns of extrafields for the title line if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... @@ -30,7 +31,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ { $tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key]; - print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'" data-titlekey="'.$key.'"':'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', 0, $tooltip)."\n"; + print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'" data-titlekey="'.$key.'"':'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n"; } } } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 9c459d2191d..a95d7162a87 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -796,6 +796,7 @@ elseif ($id > 0 || !empty($ref)) } if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', $param, $sortfield, $sortorder); // Extra fields + $disablesortlink=1; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index aa4bfad01f1..f55bcb36e9b 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -925,13 +925,11 @@ while ($i < min($num, $limit)) print "\n"; - //print projectLinesa(); } $i++; } // Show total line -//include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['totalplannedworkloadfield']) || isset($totalarray['totalprogress_calculatedfield']) || isset($totalarray['totaltobill']) || isset($totalarray['totalbilled'])) { From 208049a8f2ce3ce0794793b2284cf9a80b517a72 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 26 Mar 2020 07:27:10 +0000 Subject: [PATCH 012/222] Fixing style errors. --- htdocs/core/lib/project.lib.php | 2 +- htdocs/projet/class/task.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 5a54b45c770..0d4ba126df9 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -357,7 +357,7 @@ function project_admin_prepare_head() * @param array $arrayfields Array with displayed coloumn information * @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()) +function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0, $arrayfields = array()) { global $user, $langs, $conf, $db, $hookmanager; global $projectstatic, $taskstatic, $extrafields; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 2e13a551e97..f3457b2481f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -746,7 +746,7 @@ class Task extends CommonObject * @param array $search_array_options Array of search * @return array 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()) + 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()) { global $conf, $hookmanager; From f7762f11db84c2b3b8a600fc92e8640458d3959d Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Thu, 26 Mar 2020 09:13:56 +0100 Subject: [PATCH 013/222] Fix change multicurrency line in supplier proposal --- .../class/supplier_proposal.class.php | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index d1d3b08bc2d..695b7d63e4a 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -14,6 +14,7 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -595,12 +596,12 @@ class SupplierProposal extends CommonObject //var_dump($this->line->fk_fournprice);exit; // Multicurrency - $this->line->fk_multicurrency = $this->fk_multicurrency; - $this->line->multicurrency_code = $this->multicurrency_code; + $this->line->fk_multicurrency = $this->fk_multicurrency; + $this->line->multicurrency_code = $this->multicurrency_code; $this->line->multicurrency_subprice = $pu_ht_devise; - $this->line->multicurrency_total_ht = $multicurrency_total_ht; - $this->line->multicurrency_total_tva = $multicurrency_total_tva; - $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; + $this->line->multicurrency_total_ht = $multicurrency_total_ht; + $this->line->multicurrency_total_tva = $multicurrency_total_tva; + $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; // Mise en option de la ligne if (empty($qty) && empty($special_code)) $this->line->special_code = 3; @@ -708,6 +709,10 @@ class SupplierProposal extends CommonObject $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } + if ($conf->multicurrency->enabled && $pu_ht_devise > 0) { + $pu = 0; + } + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -719,6 +724,7 @@ class SupplierProposal extends CommonObject $multicurrency_total_ht = $tabprice[16]; $multicurrency_total_tva = $tabprice[17]; $multicurrency_total_ttc = $tabprice[18]; + $pu_ht_devise = $tabprice[19]; //Fetch current line from the database and then clone the object and set it in $oldline property $line = new SupplierProposalLine($this->db); @@ -784,11 +790,11 @@ class SupplierProposal extends CommonObject } } - // Multicurrency - $this->line->multicurrency_subprice = price2num($pu * $this->multicurrency_tx); - $this->line->multicurrency_total_ht = $multicurrency_total_ht; - $this->line->multicurrency_total_tva = $multicurrency_total_tva; - $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; + // Multicurrency + $this->line->multicurrency_subprice = $pu_ht_devise; + $this->line->multicurrency_total_ht = $multicurrency_total_ht; + $this->line->multicurrency_total_tva = $multicurrency_total_tva; + $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; $result = $this->line->update(); if ($result > 0) From cef65a3c8f404e980a71ac417e7d4d2c02e16e82 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 26 Mar 2020 09:20:14 +0100 Subject: [PATCH 014/222] FIX hook name and useless inithook --- htdocs/product/class/product.class.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index adb23d38f75..a4f60d48dcd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2496,9 +2496,8 @@ class Product extends CommonObject } } - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid); - $reshook = $hookmanager->executeHooks('loadStatsPropale', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsCustomerProposal', $parameters, $this, $action); if ($reshook > 0) $this->stats_propale = $hookmanager->resArray['stats_propale']; return 1; @@ -2548,9 +2547,8 @@ class Product extends CommonObject $this->stats_proposal_supplier['rows'] = $obj->nb_rows; $this->stats_proposal_supplier['qty'] = $obj->qty ? $obj->qty : 0; - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid); - $reshook = $hookmanager->executeHooks('loadStatsProposalSupplier', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsSupplierProposal', $parameters, $this, $action); if ($reshook > 0) $this->stats_proposal_supplier = $hookmanager->resArray['stats_proposal_supplier']; return 1; @@ -2652,9 +2650,9 @@ class Product extends CommonObject $this->stats_commande['qty'] -= $adeduire; } } - $hookmanager->initHooks(array('productdao')); + $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); - $reshook = $hookmanager->executeHooks('loadStatsCommande', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsCustomerOrder', $parameters, $this, $action); if ($reshook > 0) $this->stats_commande = $hookmanager->resArray['stats_commande']; return 1; } @@ -2709,9 +2707,8 @@ class Product extends CommonObject $this->stats_commande_fournisseur['rows'] = $obj->nb_rows; $this->stats_commande_fournisseur['qty'] = $obj->qty ? $obj->qty : 0; - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); - $reshook = $hookmanager->executeHooks('loadStatsCommandeFournisseur', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsSupplierOrder', $parameters, $this, $action); if ($reshook > 0) $this->stats_commande_fournisseur = $hookmanager->resArray['stats_commande_fournisseur']; return 1; @@ -2794,7 +2791,6 @@ class Product extends CommonObject } } - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock, 'filterShipmentStatus' => $filterShipmentStatus); $reshook = $hookmanager->executeHooks('loadStatsSending', $parameters, $this, $action); if ($reshook > 0) $this->stats_expedition = $hookmanager->resArray['stats_expedition']; @@ -2848,7 +2844,6 @@ class Product extends CommonObject $this->stats_reception['rows'] = $obj->nb_rows; $this->stats_reception['qty'] = $obj->qty ? $obj->qty : 0; - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); $reshook = $hookmanager->executeHooks('loadStatsReception', $parameters, $this, $action); if ($reshook > 0) $this->stats_reception = $hookmanager->resArray['stats_reception']; @@ -2940,7 +2935,6 @@ class Product extends CommonObject if ($this->stats_mrptoconsume['qty'] < 0) $this->stats_mrptoconsume['qty'] = 0; if ($this->stats_mrptoproduce['qty'] < 0) $this->stats_mrptoproduce['qty'] = 0; - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid, 'filtrestatut' => $filtrestatut, 'forVirtualStock' => $forVirtualStock); $reshook = $hookmanager->executeHooks('loadStatsInProduction', $parameters, $this, $action); if ($reshook > 0) $this->stats_mrptoproduce = $hookmanager->resArray['stats_mrptoproduce']; @@ -3015,9 +3009,8 @@ class Product extends CommonObject } } - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid); - $reshook = $hookmanager->executeHooks('loadStatsContrat', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsContract', $parameters, $this, $action); if ($reshook > 0) $this->stats_contrat = $hookmanager->resArray['stats_contrat']; return 1; @@ -3090,9 +3083,8 @@ class Product extends CommonObject } } - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid); - $reshook = $hookmanager->executeHooks('loadStatsFacture', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsCustomerInvoice', $parameters, $this, $action); if ($reshook > 0) $this->stats_facture = $hookmanager->resArray['stats_facture']; return 1; @@ -3144,9 +3136,8 @@ class Product extends CommonObject $this->stats_facture_fournisseur['rows'] = $obj->nb_rows; $this->stats_facture_fournisseur['qty'] = $obj->qty ? $obj->qty : 0; - $hookmanager->initHooks(array('productdao')); $parameters = array('socid' => $socid); - $reshook = $hookmanager->executeHooks('loadStatsFactureFournisseur', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('loadStatsSupplierInvoice', $parameters, $this, $action); if ($reshook > 0) $this->stats_facture_fournisseur = $hookmanager->resArray['stats_facture_fournisseur']; return 1; From 4624fd244512a26e16d0c15a0014f34bc2c9e679 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Thu, 26 Mar 2020 09:23:19 +0100 Subject: [PATCH 015/222] Fix add mulitcurrency line in supplier proposal --- htdocs/supplier_proposal/card.php | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2c23f578fb4..1956099b406 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -11,6 +11,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -715,7 +716,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } } - elseif ((GETPOST('price_ht') !== '' || GETPOST('price_ttc') !== '') && empty($error)) // Free product. // $price_ht is already set + elseif ((GETPOST('price_ht') !== '' || GETPOST('price_ttc') !== '' || GETPOST('multicurrency_price_ht') != '') && empty($error)) // Free product. // $price_ht is already set { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -745,8 +746,31 @@ if (empty($reshook)) $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_supplier, $fk_unit); - //$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit); + $result = $object->addline( + $desc, + $pu_ht, + $qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + $remise_percent, + $price_base_type, + $pu_ttc, + $info_bits, + $type, + -1, // rang + 0, // special_code + GETPOST('fk_parent_line'), + $fournprice, + $buyingprice, + $label, + $array_options, + $ref_supplier, + $fk_unit, + '', // origin + 0, // origin_id + $pu_ht_devise); } From 1e13dbe2708e4f266558d72f93df24ae4f6fb411 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Thu, 26 Mar 2020 09:29:35 +0100 Subject: [PATCH 016/222] fix non numeric error --- htdocs/supplier_proposal/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 1956099b406..18913db2f7c 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -863,10 +863,10 @@ if (empty($reshook)) if (GETPOST('price_ht') != '') { - $price_base_type = 'HT'; $ht = price2num(GETPOST('price_ht')); } - else + + if (GETPOST('price_ttc') != '') { $reg = array(); $vatratecleaned = $vat_rate; @@ -878,9 +878,9 @@ if (empty($reshook)) $ttc = price2num(GETPOST('price_ttc')); $ht = $ttc / (1 + ($vatratecleaned / 100)); - $price_base_type = 'HT'; } + $price_base_type = 'HT'; $pu_ht_devise = GETPOST('multicurrency_subprice'); // Add buying price From 38029abcb14a9cd09023bb6bf199d78d9affd2b1 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 26 Mar 2020 08:34:27 +0000 Subject: [PATCH 017/222] Fixing style errors. --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 695b7d63e4a..ab451b02177 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -712,7 +712,7 @@ class SupplierProposal extends CommonObject if ($conf->multicurrency->enabled && $pu_ht_devise > 0) { $pu = 0; } - + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; From 7d72fc70c783404696b8ab91d3adc237de3cfec9 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Thu, 26 Mar 2020 11:36:53 +0000 Subject: [PATCH 018/222] New tree-view for sub-categories --- htdocs/categories/viewcat.php | 164 +++++++++++++++++++++++++--------- 1 file changed, 121 insertions(+), 43 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c7242077da4..ad82b7c4438 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -51,7 +51,6 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myo $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); @@ -196,7 +195,6 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' } - /* * View */ @@ -204,18 +202,21 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' $form = new Form($db); $formother = new FormOther($db); +$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); +$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); $helpurl = ''; -llxHeader("", $langs->trans("Categories"), $helpurl); +llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); -if ($type == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoryShort"); -elseif ($type == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoryShort"); -elseif ($type == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersCategoryShort"); -elseif ($type == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoryShort"); -elseif ($type == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort"); -elseif ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans("AccountsCategoriesShort"); -elseif ($type == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort"); -elseif ($type == Categorie::TYPE_USER) $title = $langs->trans("UsersCategoriesShort"); -else $title = $langs->trans("Category"); +if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; } +elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; } +elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; } +elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; } +elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; } +elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; } +elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; } +elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; } +elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; } +else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; } $head = categories_prepare_head($object, $type); @@ -304,55 +305,133 @@ if (! empty($user->rights->categorie->creer)) print "
"; } + +/* + * Sub-category tree view of this category + */ + +print '
'; +print ''; + +print ''; +print ''; +print ''; +print ''; +print ''; + $cats = $object->get_filles(); if ($cats < 0) { dol_print_error($db, $cats->error, $cats->errors); } +else if(count($cats) < 1) +{ + print ''; + print ''; + print ''; +} else { - print "
"; - print "
'.$langs->trans("SubCats").''; + +if (!empty($conf->use_javascript_ajax)) +{ + print ''; +} + +print '
'.$langs->trans("NoSubCat").'
\n"; - print ""; - print "\n"; - if (count($cats) > 0) + + // Define data (format for treeview) + $data = array(); + $data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); + foreach ($fulltree as $key => $val) { - foreach ($cats as $cat) + $categstatic->id = $val['id']; + $categstatic->ref = $val['label']; + $categstatic->color = $val['color']; + $categstatic->type = $type; + $desc = dol_htmlcleanlastbr($val['description']); + + $counter = 0; + + if($conf->global->CATEGORY_SHOW_COUNTS) { - print "\t".''."\n"; - print "\t\t".'\n"; - print "\t\t".'\n"; + // we need only a count of the elements, so it is enough to consume only the id's from the database + $elements = $type == Categorie::TYPE_ACCOUNT + ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account" + : $categstatic->getObjectsInCateg($type, 1); - /* - if ($cat->visible == 1) - { - print "\t\t\n"; - } - else - { - print "\t\t\n"; - } - */ - - print "\t\n"; + $counter = is_countable($elements) ? count($elements) : 0; } + + $color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"'; + + $entry = '
".$langs->trans("SubCats").''; - if ($user->rights->categorie->creer) + $categstatic = new Categorie($db); + + $fulltree = $categstatic->get_full_arbo($typetext, $object->id, 1); + + // Load possible missing includes + if($conf->global->CATEGORY_SHOW_COUNTS) { - print ""; - print img_picto($langs->trans("Create"), 'filenew'); - print ""; + if ($type == Categorie::TYPE_MEMBER) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + if ($type == Categorie::TYPE_ACCOUNT) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + if ($type == Categorie::TYPE_PROJECT) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + if ($type == Categorie::TYPE_USER) require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; } - print "
'; - print "".$cat->label.""; - print "'.$cat->description."".$langs->trans("ContentsVisibleByAllShort")."".$langs->trans("ContentsNotVisibleByAllShort")."
'; + $entry .= ''; + + $entry .= ''; + + $entry .= ''; + + $entry .= ''; + + $entry .= ''; + $entry .= '
'; + $entry .= ''.$categstatic->getNomUrl(1, '', 60).''; + $entry .= ''.$counter.''; + $entry .= ''.img_view().''; + $entry .= '
'; + + $data[] = array('rowid' => $val['rowid'], 'fk_menu' => $val['fk_parent'], 'entry' => $entry); + } + + if ((count($data) - 1)) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; + print ''; + print ''; + + // $data[0] is the current shown category, to don'T show the current category use $data[1] instead + tree_recur($data, $data[1], 0); + + print ''; + print ''; } else { - print ''.$langs->trans("NoSubCat").''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''.$langs->trans("NoCategoryYet").' 
'; + print ''; + print ''; } - print "\n"; } +print ""; +print "
"; // List of mass actions available $arrayofmassactions = array( @@ -363,7 +442,6 @@ $arrayofmassactions = array( ); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); - // List of products or services (type is type of category) if ($type == Categorie::TYPE_PRODUCT) { From 2bf054364d7fa89ca5d34f52c1c08b42d0c4987f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 26 Mar 2020 11:48:45 +0000 Subject: [PATCH 019/222] Fixing style errors. --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index ad82b7c4438..513d411d188 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -335,7 +335,7 @@ if ($cats < 0) { dol_print_error($db, $cats->error, $cats->errors); } -else if(count($cats) < 1) +elseif(count($cats) < 1) { print ''; print ''.$langs->trans("NoSubCat").''; From f7ecc9d60cfdb37bf5e673877c843a71668dfa44 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Thu, 26 Mar 2020 15:22:24 +0100 Subject: [PATCH 020/222] Fix:The column "print $langs->trans("StockCorrection");" is now duplicated. --- htdocs/product/stock/card.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index af0703a119e..6d74d396306 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -628,9 +628,6 @@ else print ''; print $langs->trans("StockCorrection"); print ""; - print ''; - print $langs->trans("StockCorrection"); - print ""; } if(!empty($conf->global->PRODUCT_USE_UNITS)) { if ($i == 0) $units = $productstatic->fk_unit; From 2f94db6ffe753cc8df43d6b709f0177057d9106b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2020 19:46:36 +0100 Subject: [PATCH 021/222] FIX Translation of tooltips of extrafields --- htdocs/core/class/commonobject.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e1246d8bc3f..eb0f0eac94b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6679,9 +6679,10 @@ abstract class CommonObject if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list elseif ($mode == 'view' && empty($visibility)) continue; if (empty($perms)) continue; - // Load language if required - if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { + $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + } $colspan = ''; if (is_array($params) && count($params) > 0) { @@ -6780,8 +6781,8 @@ abstract class CommonObject { $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key]; } - $labeltoshow = $langs->trans($label); + $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); $out .= 'attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' *'; } else { if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; - $out .= '"'; - $out .= '>'; - if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + $out .= '">'; + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; } $out .= ''; From 4a012c13b2553da3a1704531b9b6c18075d25105 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2020 19:46:36 +0100 Subject: [PATCH 022/222] FIX Translation of tooltips of extrafields --- htdocs/core/class/commonobject.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c193ae977dc..0d3ab9162dd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6638,9 +6638,10 @@ abstract class CommonObject if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list elseif ($mode == 'view' && empty($visibility)) continue; if (empty($perms)) continue; - // Load language if required - if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { + $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + } $colspan = ''; if (is_array($params) && count($params) > 0) { @@ -6739,8 +6740,8 @@ abstract class CommonObject { $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key]; } - $labeltoshow = $langs->trans($label); + $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); $out .= 'attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' *'; } else { if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; - $out .= '"'; - $out .= '>'; - if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + $out .= '">'; + if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow); else $out .= $labeltoshow; } $out .= ''; From a02e3e1e61641e13796b5082d79b739bdbf41cc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2020 20:05:17 +0100 Subject: [PATCH 023/222] Fix duplicate tooltip --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0a0496d0923..47634408a97 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1591,9 +1591,9 @@ class ExtraFields if ($type == 'date') $out.=' (YYYY-MM-DD)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ - if (! empty($help) && $keyprefix != 'search_options_') { + /*if (! empty($help) && $keyprefix != 'search_options_') { $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); - } + }*/ return $out; } From 9379f6fa9d3ff43da33d1e88e5e1ae0174e8ad12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Mar 2020 20:05:17 +0100 Subject: [PATCH 024/222] Fix duplicate tooltip --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 57debc1311b..cf439f210be 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1577,9 +1577,9 @@ class ExtraFields if ($type == 'date') $out.=' (YYYY-MM-DD)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ - if (! empty($help) && $keyprefix != 'search_options_') { + /*if (! empty($help) && $keyprefix != 'search_options_') { $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); - } + }*/ return $out; } From 354cb8c1b061855ac296e4e13830e45cc88b112c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 01:59:17 +0100 Subject: [PATCH 025/222] Work on Kanban view for modules --- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/modules.php | 402 +++++++++--------- htdocs/core/modules/DolibarrModules.class.php | 61 +++ htdocs/theme/eldy/info-box.inc.php | 11 + 4 files changed, 279 insertions(+), 197 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 531e53ac459..08ddbd4ad6a 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -290,7 +290,7 @@ $text=''; if ($mode == 'desc') { - if ($moduledesc) $text.=$moduledesc.'

'; + if ($moduledesc) $text .= '
'.$moduledesc.'


'; $text.=''.$langs->trans("Version").': '.$version; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 72eb8240c10..4056bca0ee3 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -552,7 +552,7 @@ if ($mode == 'common') if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Show list of modules - + //$conf->global->MAIN_USE_KANBAN_FOR_MODULES=1; $oldfamily = ''; foreach ($orders as $key => $value) @@ -637,8 +637,12 @@ if ($mode == 'common') $familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label']; print load_fiche_titre($familytext, '', ''); - print '
'; - print ''."\n"; + if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + print '
'; + } else { + print '
'; + print '
'."\n"; + } $atleastoneforfamily = 0; } @@ -651,9 +655,6 @@ if ($mode == 'common') $oldfamily = $familykey; } - - - // Version (with picto warning or not) $version = $objMod->getVersion(0); $versiontrans = ''; @@ -669,212 +670,221 @@ if ($mode == 'common') $imginfo = "info_black"; } - print ''."\n"; - if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print ''; + if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + // Output Kanban + print $objMod->getKanbanView(); + } else { + print ''."\n"; + if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print ''; - // Picto + Name of module - print ' \n"; - - // Desc - print '\n"; - - // Help - print ''; - - // Version - print '\n"; - - // Activate/Disable and Setup (2 columns) - if (!empty($conf->global->$const_name)) // If module is already activated - { - $disableSetup = 0; - - // Link enable/disabme - print ''."\n"; + else + { + print img_object($alttext, 'generic', 'class="valignmiddle"'); + } + print ' '.$objMod->getName().''; + print "\n"; - // Link config - if (!empty($objMod->config_page_url) && !$disableSetup) - { - $backtourlparam = ''; - if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later - if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature; - if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version; - if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status; - $backtourl = $_SERVER["PHP_SELF"].$backtourlparam; + // Desc + print '\n"; - if (is_array($objMod->config_page_url)) - { - print '\n"; - } - elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) - { - print ''; - } - else - { - print ''; - } - } - else - { - print ''; - } - } - else // Module not yet activated - { - // Link enable/disable - print ''; + + // Version + print '\n"; + + // Activate/Disable and Setup (2 columns) + if (!empty($conf->global->$const_name)) // If module is already activated + { + $disableSetup = 0; + + // Link enable/disabme + print '\n"; + else + { + if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { + print 'warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">'; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } + else { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } + } + print ''."\n"; - // Link config - print ''; + // Link config + if (!empty($objMod->config_page_url) && !$disableSetup) + { + $backtourlparam = ''; + if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later + if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature; + if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version; + if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status; + $backtourl = $_SERVER["PHP_SELF"].$backtourlparam; + + if (is_array($objMod->config_page_url)) + { + print '\n"; + } + elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) + { + print ''; + } + else + { + print ''; + } + } + else + { + print ''; + } + } + else // Module not yet activated + { + // Link enable/disable + print '\n"; + + // Link config + print ''; + } + + print "\n"; } - - print "\n"; } if ($oldfamily) { - print "
'.++$linenum.'
'.++$linenum.''; - $alttext = ''; - //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); - //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); - if (!empty($objMod->picto)) - { - if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1); - else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"'); - } - else - { - print img_object($alttext, 'generic', 'class="valignmiddle"'); - } - print ' '.$objMod->getName().''; - print "'; - print nl2br($objMod->getDesc()); - print "'; - //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); - print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; - print ''; - print $versiontrans; - if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - if (!empty($objMod->url_last_version)) { - $newversion = getURLContent($objMod->url_last_version); - if (isset($newversion['content'])) { - if (version_compare($newversion['content'], $versiontrans) > 0) { - print " ".$newversion['content'].""; - } - } - } - } - print "'; - if (!empty($arrayofwarnings[$modName])) + // Picto + Name of module + print ' '; + $alttext = ''; + //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); + //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); + if (!empty($objMod->picto)) { - print ''."\n"; + if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1); + else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"'); } - if (!empty($objMod->disabled)) - { - print $langs->trans("Disabled"); - } - elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) - { - if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used"); - else { - print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium'); - //print $langs->trans("Required"); - } - if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; - } - else - { - if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { - print 'warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">'; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } - else { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } - } - print ''; + print nl2br($objMod->getDesc()); + print "'; - $i = 0; - foreach ($objMod->config_page_url as $page) - { - $urlpage = $page; - if ($i++) - { - print ''.img_picto(ucfirst($page), "setup").''; - // print ''.ucfirst($page).' '; - } - else - { - if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) - { - $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); - print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; - } - else - { - $urltouse = $urlpage; - print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; - } - } - } - print "'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').''; - if (!empty($objMod->always_enabled)) - { - // Should never happened - } - elseif (!empty($objMod->disabled)) - { - print $langs->trans("Disabled"); - } - else - { - // Module qualified for activation - $warningmessage = ''; + // Help + print ''; + //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); + print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; + print ''; + print $versiontrans; + if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + if (!empty($objMod->url_last_version)) { + $newversion = getURLContent($objMod->url_last_version); + if (isset($newversion['content'])) { + if (version_compare($newversion['content'], $versiontrans) > 0) { + print " ".$newversion['content'].""; + } + } + } + } + print "'; if (!empty($arrayofwarnings[$modName])) + { + print ''."\n"; + } + if (!empty($objMod->disabled)) { - print ''."\n"; - foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) - { - if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry))) - { - $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code); - } - } + print $langs->trans("Disabled"); } - if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext)) + elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) { - print ''."\n"; - foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry) - { - $keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule)); - if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on - { - foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage) - { - if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry))) - { - $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName()); - $warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName(); - if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name; - if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName(); - } - } - } - } + if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used"); + else { + print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium'); + //print $langs->trans("Required"); + } + if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; } - print ''."\n"; - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print "\n"; - } - print "'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').''; + $i = 0; + foreach ($objMod->config_page_url as $page) + { + $urlpage = $page; + if ($i++) + { + print ''.img_picto(ucfirst($page), "setup").''; + // print ''.ucfirst($page).' '; + } + else + { + if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) + { + $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); + print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; + } + else + { + $urltouse = $urlpage; + print ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; + } + } + } + print "'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').''; + if (!empty($objMod->always_enabled)) + { + // Should never happened + } + elseif (!empty($objMod->disabled)) + { + print $langs->trans("Disabled"); + } + else + { + // Module qualified for activation + $warningmessage = ''; + if (!empty($arrayofwarnings[$modName])) + { + print ''."\n"; + foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) + { + if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry))) + { + $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code); + } + } + } + if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext)) + { + print ''."\n"; + foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry) + { + $keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule)); + if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on + { + foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage) + { + if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry))) + { + $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName()); + $warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName(); + if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name; + if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName(); + } + } + } + } + } + print ''."\n"; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print "\n"; + } + print "'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'
\n"; - print '
'; + if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + print ''; + } else { + print "\n"; + print ''; + } } dol_fiche_end(); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 278e53eef6e..c14a789d3c5 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2256,4 +2256,65 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { return $this->_remove(array(), $options); } + + + /** + * Return Kanban view of a module + * + * @return string HTML code of Kanban view + */ + public function getKanbanView() + { + global $conf, $langs; + + // Define imginfo + $imginfo = "info"; + if ($this->isCoreOrExternalModule() == 'external') + { + $imginfo = "info_black"; + } + + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this))); + + // Activate/Disable and Setup (2 columns) + if (!empty($conf->global->$const_name)) // If module is already activated + { + $disableSetup = 0; + + } else { + + + } + + print ' +
+
+ '; + + $alttext = ''; + //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); + //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); + if (!empty($this->picto)) + { + if (preg_match('/^\//i', $this->picto)) print img_picto($alttext, $this->picto, 'class="inline-block valignmiddle width50"', 1); + else print img_object($alttext, $this->picto, 'class="inline-block valignmiddle width50"'); + } + else + { + print img_object($alttext, 'generic', 'class="inline-block valignmiddle width50"'); + } + + print ' +
+ '.$this->getName().' + '.nl2br($this->getDesc()).''; + + print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; + + print ' + '.$this->getVersion(1).' +
+
+
'; + } } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 033637759c9..88357f02404 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -316,6 +316,13 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES height: 0; } +.info-box-module { + min-width: 350px; + max-width: 350px; +} +.info-box-module .info-box-content { + height: 7em; +} /* Disabled. This break the responsive on smartphone .box{ overflow: visible; @@ -327,4 +334,8 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .box-flex-container { margin: 0 0 0 0 !important; } + + .info-box-module { + width: 280px; + } } From e1611a836619e84311c8be216b059026d3bb5996 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 27 Mar 2020 06:16:24 +0100 Subject: [PATCH 026/222] Typo --- htdocs/compta/recap-compta.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 37bf3d36d70..3f2112537b1 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -83,7 +83,7 @@ $form = new Form($db); $userstatic = new User($db); $title = $langs->trans("ThirdParty").' - '.$langs->trans("Summary"); -if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.' - '.$langs->trans("Symmary"); +if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.' - '.$langs->trans("Summary"); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); From 96481c3d521327e359890ff8d37c57e5b617b2cc Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 27 Mar 2020 09:42:45 +0100 Subject: [PATCH 027/222] FIX ordered stock already in $stock --- htdocs/product/stock/replenish.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 2ad465bdedb..ae5c936ef1e 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -702,7 +702,10 @@ while ($i < ($limit ? min($num, $limit) : $num)) //depending on conf, use either physical stock or //virtual stock to compute the stock to buy value - $stocktobuy = max(max($desiredstock, $alertstock) - $stock - $ordered, 0); + + if(empty($usevirtualstock)) $stocktobuy = max(max($desiredstock, $alertstock) - $stock - $ordered, 0); + else $stocktobuy = max(max($desiredstock, $alertstock) - $stock, 0); //ordered is already in $stock in virtual mode + $disabled = ''; if ($ordered > 0) { From fd3d13cfcfb6ef52d0c48ba8eb4b81ff53d6bf31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 11:15:38 +0100 Subject: [PATCH 028/222] Look and feel v11 --- htdocs/bom/bom_list.php | 5 +++-- htdocs/modulebuilder/template/myobject_list.php | 3 ++- htdocs/mrp/mo_list.php | 5 +++-- htdocs/theme/md/style.css.php | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index e33394edcf7..f8ecfa11996 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''."\n"; +print '
'."\n"; // Fields title search @@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 6697fd15da1..9930dabb83f 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -409,7 +409,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -509,6 +509,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index e14053075cb..6a4abe24019 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -398,7 +398,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -418,7 +418,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -498,6 +498,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 33b9635bb68..ad5dd0a42a4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2949,7 +2949,6 @@ table.paddingtopbottomonly tr td { background: rgb() !important; } tr.liste_titre_filter td.liste_titre { - border-bottom: 1px solid #FDFFFF; padding-top: 4px; padding-bottom: 3px; } From 4f83eb59cd7f0c5c73655d1d0e02041d0c90d072 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 11:52:08 +0100 Subject: [PATCH 029/222] FIX Use getNomURL instead of hard coded link. Fix limit. --- htdocs/product/stock/index.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 58997d4384d..dc4d9b0717b 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -70,13 +70,14 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print "

"; } +$max = 15; -$sql = "SELECT e.ref as label, e.rowid, e.statut"; +$sql = "SELECT e.rowid, e.ref as label, e.lieu, e.statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= $db->order('e.statut', 'DESC'); -$sql.= $db->plimit(15, 0); +$sql.= $db->plimit($max + 1, 0); $result = $db->query($sql); @@ -92,20 +93,31 @@ if ($result) if ($num) { - $entrepot=new Entrepot($db); + $warehouse=new Entrepot($db); - while ($i < $num) + while ($i < min($max, $num)) { $objp = $db->fetch_object($result); + $warehouse->id = $objp->rowid; + $warehouse->statut = $objp->status; + $warehouse->label = $objp->label; + $warehouse->lieu = $objp->lieu; + print ''; - print "rowid\">".img_object($langs->trans("ShowStock"), "stock")." ".$objp->label."\n"; - print ''.$entrepot->LibStatut($objp->statut, 5).''; + print ''; + print $warehouse->getNomUrl(1); + print ''."\n"; + print ''.$warehouse->getLibStatut(5).''; print "\n"; $i++; } $db->free($result); } + if ($num > $max) { + print ''.$langs->trans("More").'...'; + } + print ""; print ''; } From 259f23e96bc47092bb80d0767be28361d4874fe9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 11:15:38 +0100 Subject: [PATCH 030/222] Look and feel v11 --- htdocs/bom/bom_list.php | 5 +++-- htdocs/modulebuilder/template/myobject_list.php | 3 ++- htdocs/mrp/mo_list.php | 5 +++-- htdocs/theme/md/style.css.php | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 12602f9744a..446d629f090 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''."\n"; +print '
'."\n"; // Fields title search @@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 46f347618f4..827eb430b84 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -409,7 +409,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -509,6 +509,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 1b7849992a0..d2c2bdcf0ef 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -398,7 +398,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'."\n"; +print '
'."\n"; // Fields title search @@ -418,7 +418,7 @@ foreach ($object->fields as $key => $val) elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } - elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print ''; + elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } @@ -498,6 +498,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right'; + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0293513109d..e800689b15d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2886,7 +2886,6 @@ table.paddingtopbottomonly tr td { background: rgb() !important; } tr.liste_titre_filter td.liste_titre { - border-bottom: 1px solid #FDFFFF; padding-top: 4px; padding-bottom: 3px; } From 3a9cc532d70f040138d7d6b0da99b1d284b3c5b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 11:52:08 +0100 Subject: [PATCH 031/222] FIX Use getNomURL instead of hard coded link. Fix limit. --- htdocs/product/stock/index.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 35e16e5c840..beeb7155a51 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -70,13 +70,14 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print "

"; } +$max = 15; -$sql = "SELECT e.ref as label, e.rowid, e.statut"; +$sql = "SELECT e.rowid, e.ref as label, e.lieu, e.statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= $db->order('e.statut', 'DESC'); -$sql.= $db->plimit(15, 0); +$sql.= $db->plimit($max + 1, 0); $result = $db->query($sql); @@ -92,20 +93,31 @@ if ($result) if ($num) { - $entrepot=new Entrepot($db); + $warehouse=new Entrepot($db); - while ($i < $num) + while ($i < min($max, $num)) { $objp = $db->fetch_object($result); + $warehouse->id = $objp->rowid; + $warehouse->statut = $objp->status; + $warehouse->label = $objp->label; + $warehouse->lieu = $objp->lieu; + print ''; - print "rowid\">".img_object($langs->trans("ShowStock"), "stock")." ".$objp->label."\n"; - print ''.$entrepot->LibStatut($objp->statut, 5).''; + print ''; + print $warehouse->getNomUrl(1); + print ''."\n"; + print ''.$warehouse->getLibStatut(5).''; print "\n"; $i++; } $db->free($result); } + if ($num > $max) { + print ''.$langs->trans("More").'...'; + } + print ""; print ''; } From 975f061b431e8597ad061de79cffb628b033c27a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 12:06:18 +0100 Subject: [PATCH 032/222] Fix popup --- htdocs/product/stock/index.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index dc4d9b0717b..fd85bcfd5b0 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -45,6 +45,7 @@ $result=restrictedArea($user, 'stock'); */ $producttmp=new Product($db); +$warehouse=new Entrepot($db); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("Stocks"), $help_url); @@ -93,8 +94,6 @@ if ($result) if ($num) { - $warehouse=new Entrepot($db); - while ($i < min($max, $num)) { $objp = $db->fetch_object($result); @@ -108,7 +107,9 @@ if ($result) print ''; print $warehouse->getNomUrl(1); print ''."\n"; - print ''.$warehouse->getLibStatut(5).''; + print ''; + print $warehouse->getLibStatut(5); + print ''; print "\n"; $i++; } @@ -134,7 +135,7 @@ print '
'; // Latest movements $max=10; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; -$sql.= " e.ref as stock, e.rowid as entrepot_id,"; +$sql.= " e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,"; $sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -178,6 +179,12 @@ if ($resql) $producttmp->status_sell = $objp->tosell; $producttmp->status_buy = $objp->tobuy; + $warehouse->id = $objp->warehouse_id; + $warehouse->ref = $objp->warehouse_ref; + $warehouse->statut = $objp->warehouse_status; + $warehouse->label = $objp->warehouse_label; + $warehouse->lieu = $objp->lieu; + print ''; print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; print ''; @@ -189,9 +196,9 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->sellby), 'day').''; print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; } - print ''; - print img_object($langs->trans("ShowWarehouse"), "stock").' '.$objp->stock; - print "\n"; + print ''; + print $warehouse->getNomUrl(1); + print "\n"; print ''; if ($objp->qty > 0) print '+'; print $objp->qty.''; @@ -202,6 +209,8 @@ if ($resql) print ""; print '
'; +} else { + dol_print_error($db); } //print ''; From f512e0d161fc113dcfd9ff07d31b916f61e2ce4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 12:06:18 +0100 Subject: [PATCH 033/222] Fix popup --- htdocs/product/stock/index.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index beeb7155a51..93c6e65ad49 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -45,6 +45,7 @@ $result=restrictedArea($user, 'stock'); */ $producttmp=new Product($db); +$warehouse=new Entrepot($db); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("Stocks"), $help_url); @@ -93,8 +94,6 @@ if ($result) if ($num) { - $warehouse=new Entrepot($db); - while ($i < min($max, $num)) { $objp = $db->fetch_object($result); @@ -108,7 +107,9 @@ if ($result) print ''; print $warehouse->getNomUrl(1); print ''."\n"; - print ''.$warehouse->getLibStatut(5).''; + print ''; + print $warehouse->getLibStatut(5); + print ''; print "\n"; $i++; } @@ -134,7 +135,7 @@ print '
'; // Last movements $max=10; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; -$sql.= " e.ref as stock, e.rowid as entrepot_id,"; +$sql.= " e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,"; $sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -178,6 +179,12 @@ if ($resql) $producttmp->status_sell = $objp->tosell; $producttmp->status_buy = $objp->tobuy; + $warehouse->id = $objp->warehouse_id; + $warehouse->ref = $objp->warehouse_ref; + $warehouse->statut = $objp->warehouse_status; + $warehouse->label = $objp->warehouse_label; + $warehouse->lieu = $objp->lieu; + print ''; print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; print ''; @@ -189,9 +196,9 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->sellby), 'day').''; print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; } - print ''; - print img_object($langs->trans("ShowWarehouse"), "stock").' '.$objp->stock; - print "\n"; + print ''; + print $warehouse->getNomUrl(1); + print "\n"; print ''; if ($objp->qty > 0) print '+'; print $objp->qty.''; @@ -202,6 +209,8 @@ if ($resql) print ""; print '
'; +} else { + dol_print_error($db); } //print ''; From 497b0e4ecc5c28a58931c05987c66da0900d07d4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 27 Mar 2020 15:30:05 +0100 Subject: [PATCH 034/222] NEW filter by product on supplier order let's get the next replenishment date and order's informations on front-end for selected products --- htdocs/fourn/class/api_supplier_orders.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index cb2e27b1a97..c569e84c795 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -90,13 +90,14 @@ class SupplierOrders extends DolibarrApi * @param int $limit Limit for list * @param int $page Page number * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} + * @param string $product_ids Product ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $status Filter by order status : draft | validated | approved | running | received_start | received_end | cancelled | refused * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @return array Array of order objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '') { global $db, $conf; @@ -115,8 +116,11 @@ class SupplierOrders extends DolibarrApi if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale + if (!empty($product_ids)) $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseurdet as cd"; // We need this table joined to the select in order to filter by product + $sql.= ' WHERE t.entity IN ('.getEntity('supplier_order').')'; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; + if (!empty($product_ids)) $sql.= " AND cd.fk_commande = t.rowid AND cd.fk_product IN (".$product_ids.")"; if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale From c27592bad2b82ad6523033f3b542c883b57fc7e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 16:02:58 +0100 Subject: [PATCH 035/222] Clean deprecated params on all fetch_optionals() --- htdocs/asset/card.php | 2 +- htdocs/comm/propal/card.php | 4 +- htdocs/commande/card.php | 6 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/orderstoinvoice.php | 2 +- htdocs/compta/facture/card.php | 10 +-- .../facture/class/facture-rec.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contrat/card.php | 12 +-- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/class/commonobject.class.php | 73 ++++++++++++++++++- htdocs/core/class/html.form.class.php | 31 +++++++- htdocs/core/lib/functions.lib.php | 3 +- .../doc/doc_generic_project_odt.modules.php | 2 +- htdocs/expedition/card.php | 6 +- .../class/expensereport.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/commande/card.php | 4 +- htdocs/fourn/facture/card.php | 16 ++-- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 +- .../install/mysql/tables/llx_object_lang.sql | 4 +- htdocs/langs/en_US/main.lang | 3 +- htdocs/langs/en_US/orders.lang | 1 + htdocs/livraison/card.php | 11 +-- htdocs/product/stock/list.php | 2 +- htdocs/reception/card.php | 10 ++- htdocs/reception/class/reception.class.php | 2 +- htdocs/reception/index.php | 6 +- htdocs/reception/list.php | 18 ++--- htdocs/societe/card.php | 13 ++-- htdocs/societe/contact.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/theme/eldy/global.inc.php | 6 +- 33 files changed, 184 insertions(+), 81 deletions(-) diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index b4ff4ebac68..b0ab945f543 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -203,7 +203,7 @@ if (($id || $ref) && $action == 'edit') // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $res = $object->fetch_optionals($object->id); + $res = $object->fetch_optionals(); $head = asset_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic'); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 279f72896f5..7533abcb893 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -726,7 +726,7 @@ if (empty($reshook)) $originLine = new $lineClassName($db); if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0) { - $originLine->fetch_optionals($lineId); + $originLine->fetch_optionals(); $desc = $originLine->desc; $pu_ht = $originLine->subprice; $qty = $originLine->qty; @@ -1523,7 +1523,7 @@ if ($action == 'create') $dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice); // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; if (!empty($conf->multicurrency->enabled)) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 10ba69601c1..93bab6e674d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -385,7 +385,7 @@ if (empty($reshook)) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } @@ -1362,7 +1362,7 @@ if (empty($reshook)) $originLine = new $lineClassName($db); if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0) { - $originLine->fetch_optionals($lineId); + $originLine->fetch_optionals(); $desc = $originLine->desc; $pu_ht = $originLine->subprice; $qty = $originLine->qty; @@ -1549,7 +1549,7 @@ if ($action == 'create' && $usercancreate) $objectsrc->fetch_thirdparty(); // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; $projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b1b7b3c8fe5..b2d1c09bd25 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1381,7 +1381,7 @@ class Commande extends CommonOrder $this->origin_id = $object->id; // get extrafields from original line - $object->fetch_optionals($object->id); + $object->fetch_optionals(); $e = new ExtraFields($this->db); $element_extrafields = $e->fetch_name_optionals_label($this->table_element); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index a473ccbb993..764b31ad0f6 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -287,7 +287,7 @@ if (($action == 'create' || $action == 'add') && !$error) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index fced3c4d84a..55b16368469 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1608,7 +1608,7 @@ if (empty($reshook)) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } @@ -1749,7 +1749,7 @@ if (empty($reshook)) $line->origin = $object->origin; $line->origin_id = $line->id; $line->fk_prev_id = $line->id; - $line->fetch_optionals($line->id); + $line->fetch_optionals(); $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note // Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée @@ -2555,7 +2555,7 @@ if (empty($reshook)) $originLine = new $lineClassName($db); if (intval($fromElementid) > 0 && $originLine->fetch($lineId) > 0) { - $originLine->fetch_optionals($lineId); + $originLine->fetch_optionals(); $desc = $originLine->desc; $pu_ht = $originLine->subprice; $qty = $originLine->qty; @@ -2810,7 +2810,7 @@ if ($action == 'create') $remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); //Replicate extrafields - $expesrc->fetch_optionals($expeoriginid); + $expesrc->fetch_optionals(); $object->array_options = $expesrc->array_options; } else @@ -2828,7 +2828,7 @@ if ($action == 'create') } // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; } } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index fdffc320880..524d553effd 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -677,7 +677,7 @@ class FactureRec extends CommonInvoice $line->price = $objp->price; $line->remise = $objp->remise; - $line->fetch_optionals($line->id); + $line->fetch_optionals(); // Multicurrency $line->fk_multicurrency = $objp->fk_multicurrency; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7f499149034..606d84b256b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1317,7 +1317,7 @@ class Facture extends CommonInvoice $this->origin_id = $object->id; // get extrafields from original line - $object->fetch_optionals($object->id); + $object->fetch_optionals(); foreach ($object->array_options as $options_key => $value) $this->array_options[$options_key] = $value; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4e0e5cb5865..9bcae25badd 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -317,7 +317,7 @@ if (empty($reshook)) $array_options = array(); // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } @@ -1128,12 +1128,12 @@ if ($action == 'create') $classname = ucfirst($subelement); $objectsrc = new $classname($db); - $objectsrc->fetch(GETPOST('originid')); + $objectsrc->fetch($originid); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) $objectsrc->fetch_lines(); $objectsrc->fetch_thirdparty(); // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; $projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); @@ -1703,7 +1703,8 @@ else // Display lines extrafields if (is_array($extralabelslines) && count($extralabelslines) > 0) { $line = new ContratLigne($db); - $line->fetch_optionals($objp->rowid); + $line->id = $objp->rowid; + $line->fetch_optionals(); print $line->showOptionals($extrafields, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1); } } @@ -1793,7 +1794,8 @@ else if (is_array($extralabelslines) && count($extralabelslines) > 0) { $line = new ContratLigne($db); - $line->fetch_optionals($objp->rowid); + $line->id = $objp->rowid; + $line->fetch_optionals(); print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1); } } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 17e063244df..419296b7341 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -744,7 +744,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index eb0f0eac94b..12eb1c62e8c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -87,6 +87,11 @@ abstract class CommonObject */ public $array_options = array(); + /** + * @var mixed Array to store alternative languages values of object + */ + public $array_languages = null; // Value is array() when load already tried + /** * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked */ @@ -5041,6 +5046,72 @@ abstract class CommonObject } + /* Functions for data in other language */ + + + /** + * Function to get alternative languages of a data into $this->array_languages + * This method is NOT called by method fetch of objects but must be called separately. + * + * @return int <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded + */ + public function fetchValueForAlternateLanguages() + { + // To avoid SQL errors. Probably not the better solution though + if (!$this->element) { + return 0; + } + if (! ($this->id > 0)) { + return 0; + } + + $this->array_languages = array(); + + $element = $this->element; + if ($element == 'categorie') $element = 'categories'; // For compatibility + + // Request to get translation values for object + $sql = "SELECT rowid, property, lang , value"; + $sql .= " FROM ".MAIN_DB_PREFIX."object_lang"; + $sql .= " WHERE type_object = '".$element."'"; + $sql .= " AND fk_object = ".$this->id; + + //dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG); // Too verbose + $resql = $this->db->query($sql); + if ($resql) + { + $numrows = $this->db->num_rows($resql); + if ($numrows) + { + $tab = $this->db->fetch_array($resql); + + foreach ($tab as $key => $value) + { + // we can add this attribute to object + if (preg_match('/date/', $key)) + { + $this->array_languages[$key] = $this->db->jdate($value); + } + else + { + $this->array_languages[$key] = $value; + } + } + } + + $this->db->free($resql); + + if ($numrows) return $numrows; + else return 0; + } + else + { + dol_print_error($this->db); + return -1; + } + } + + /* Functions for extrafields */ @@ -5059,6 +5130,7 @@ abstract class CommonObject global $extrafields; if (empty($rowid)) $rowid = $this->id; + if (empty($rowid)) $rowid = $this->rowid; // To avoid SQL errors. Probably not the better solution though if (!$this->table_element) { @@ -5110,7 +5182,6 @@ abstract class CommonObject $resql = $this->db->query($sql); if ($resql) { - $this->array_options = array(); $numrows = $this->db->num_rows($resql); if ($numrows) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1a42c9816b9..37897738c38 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -323,21 +323,44 @@ class Form * @param object $object Object * @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) + * @param string $check Same coe than $check parameter of GETPOST() + * @param string $morecss More CSS * @return string HTML code for the edit of alternative language */ - public function widgetForTranslation($fieldname, $object, $perm, $typeofdata = 'string') + public function widgetForTranslation($fieldname, $object, $perm, $typeofdata = 'string', $check = '', $morecss = '') { global $conf, $langs; $result = ''; if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) { - $result ='
'; + $langcode = $conf->global->PDF_USE_ALSO_LANGUAGE_CODE; - $s=picto_from_langcode($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); + $result .='
'; + $s=img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); $result .= $s; - $result .= '
'; + + $result .=''; + $result .= ''; } return $result; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e623e92e1c7..09c7c3f420e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3127,11 +3127,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } else { $pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto); - //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', - 'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note', + 'filter', 'file-code', 'grip', 'grip_title', 'language', 'list', 'listlight', 'note', 'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 488938a725b..9cfc52fc1de 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -190,7 +190,7 @@ class doc_generic_project_odt extends ModelePDFProjects require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); $extrafields->fetch_name_optionals_label($task->table_element, true); - $task->fetch_optionals($task->id); + $task->fetch_optionals(); $resarray = $this->fill_substitutionarray_with_extrafields($task, $resarray, $extrafields, 'task', $outputlangs); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d539835d309..485e8733ffa 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1574,8 +1574,8 @@ if ($action == 'create') $expLine = new ExpeditionLigne($db); $srcLine = new OrderLine($db); - $srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline - //$line->fetch_optionals($line->id); + $srcLine->id = $line->id; + $srcLine->fetch_optionals(); // fetch extrafields also available in orderline $line->array_options = array_merge($line->array_options, $srcLine->array_options); print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); @@ -2460,7 +2460,7 @@ elseif ($id || $ref) if (!empty($conf->stock->enabled)) $colspan++; $line = $lines[$i]; - $line->fetch_optionals($line->id); + $line->fetch_optionals(); if ($action == 'editline' && $line->id == $line_id) { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index d78ac9e6261..5b15863cc28 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -399,7 +399,7 @@ class ExpenseReport extends CommonObject // get extrafields so they will be clone //foreach($this->lines as $line) - //$line->fetch_optionals($line->rowid); + //$line->fetch_optionals(); // Load source object $objFrom = clone $this; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7738538fb6b..118e21a841c 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1183,7 +1183,7 @@ class Fichinter extends CommonObject // get extrafields so they will be clone foreach ($this->lines as $line) - $line->fetch_optionals($line->rowid); + $line->fetch_optionals(); // Load source object $objFrom = clone $this; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 302cf3b47b7..164b3d2152b 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1192,7 +1192,7 @@ if (empty($reshook)) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); $array_option = $lines[$i]->array_options; } @@ -1514,7 +1514,7 @@ if ($action == 'create') $objectsrc->fetch_thirdparty(); // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; $projectid = (!empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 329ee266362..dba8f430a08 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -905,6 +905,12 @@ if (empty($reshook)) $objectsrc->fetch($originid); $objectsrc->fetch_thirdparty(); + if (!empty($object->origin) && !empty($object->origin_id)) + { + $object->linkedObjectsIds[$object->origin] = $object->origin_id; + } + + // Add also link with order if object is reception if ($object->origin == 'reception') { $objectsrc->fetchObjectLinked(); @@ -913,14 +919,10 @@ if (empty($reshook)) { foreach ($objectsrc->linkedObjectsIds['order_supplier'] as $key => $value) { - $object->linked_objects['order_supplier'] = $value; + $object->linkedObjectsIds['order_supplier'] = $value; } } } - elseif (!empty($object->origin) && !empty($object->origin_id)) - { - $object->linkedObjectsIds[$object->origin] = $object->origin_id; - } $id = $object->create($user); @@ -950,7 +952,7 @@ if (empty($reshook)) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { - $lines[$i]->fetch_optionals($lines[$i]->rowid); + $lines[$i]->fetch_optionals(); } // Dates @@ -1750,7 +1752,7 @@ if ($action == 'create') $datedue = ($datetmp == '' ?-1 : $datetmp); // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; } else diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 892c2a94f5f..fade1208c9c 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -122,7 +122,7 @@ create table llx_object_lang ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_object integer DEFAULT 0 NOT NULL, - type_object varchar(32) NOT NULL, + type_object varchar(32) NOT NULL, -- value found into $object->element property varchar(32) NOT NULL, lang varchar(5) DEFAULT 0 NOT NULL, value text, diff --git a/htdocs/install/mysql/tables/llx_object_lang.sql b/htdocs/install/mysql/tables/llx_object_lang.sql index 9bbc296d27c..cc4352f3acc 100644 --- a/htdocs/install/mysql/tables/llx_object_lang.sql +++ b/htdocs/install/mysql/tables/llx_object_lang.sql @@ -23,8 +23,8 @@ create table llx_object_lang ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_object integer DEFAULT 0 NOT NULL, - type_object varchar(32) NOT NULL, -- 'thirdparty', 'contact', '...' - property varchar(32) NOT NULL, + type_object varchar(32) NOT NULL, -- value found into $object->element: 'thirdparty', 'contact', '...' + property varchar(32) NOT NULL, -- name of property lang varchar(5) DEFAULT 0 NOT NULL, value text, import_key varchar(14) DEFAULT NULL diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 867f73af887..e5233479571 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1021,4 +1021,5 @@ StatisticsOn=Statistics on SelectYourGraphOptionsFirst=Select your graph options to build a graph Measures=Measures XAxis=X-Axis -YAxis=Y-Axis \ No newline at end of file +YAxis=Y-Axis +StatusOfRefMustBe=Status of %s must be %s diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 505fd0a97db..ad91e1eef63 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -146,6 +146,7 @@ PDFEratostheneDescription=A complete order model PDFEdisonDescription=A simple order model PDFProformaDescription=A complete Proforma invoice template CreateInvoiceForThisCustomer=Bill orders +CreateInvoiceForThisSupplier=Bill orders NoOrdersToInvoice=No orders billable CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders. OrderCreation=Order creation diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index b879f3d740f..8102db49f28 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -515,9 +515,8 @@ else // View // Other attributes if ($action == 'create_delivery') { // copy from expedition - $expeditionExtrafields = new Extrafields($db); - $expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element); - if ($expedition->fetch_optionals($object->origin_id) > 0) { + $extrafields->fetch_name_optionals_label($expedition->table_element); + if ($expedition->fetch_optionals() > 0) { $object->array_options = array_merge($object->array_options, $expedition->array_options); } } @@ -625,12 +624,14 @@ else // View $colspan = 2; $mode = ($object->statut == 0) ? 'edit' : 'view'; - $object->lines[$i]->fetch_optionals($object->lines[$i]->id); + $object->lines[$i]->fetch_optionals(); + if ($action == 'create_delivery') { $srcLine = new ExpeditionLigne($db); $extrafields->fetch_name_optionals_label($srcLine->table_element); - $srcLine->fetch_optionals($expedition->lines[$i]->id); + $srcLine->id = $expedition->lines[$i]->id; + $srcLine->fetch_optionals(); $object->lines[$i]->array_options = array_merge($object->lines[$i]->array_options, $srcLine->array_options); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 0b145c7ca10..39f42575e25 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -369,7 +369,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''."\n"; +print '
'."\n"; // Fields title search // -------------------------------------------------------------------- diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 83a28d55f48..c67dc9a3aeb 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1175,8 +1175,9 @@ if ($action == 'create') $extrafields->fetch_name_optionals_label($srcLine->table_element); $extrafields->fetch_name_optionals_label($line->table_element); - $srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline - $line->fetch_optionals($object->id); + $srcLine->id = $line->id; + $srcLine->fetch_optionals(); // fetch extrafields also available in orderline + $line->fetch_optionals(); $line->array_options = array_merge($line->array_options, $srcLine->array_options); @@ -1231,7 +1232,7 @@ elseif ($id || $ref) $soc = new Societe($db); $soc->fetch($object->socid); - $res = $object->fetch_optionals($object->id); + $res = $object->fetch_optionals(); $head = reception_prepare_head($object); dol_fiche_head($head, 'reception', $langs->trans("Reception"), -1, 'reception'); @@ -1986,7 +1987,8 @@ elseif ($id || $ref) { $colspan = empty($conf->productbatch->enabled) ? 8 : 9; $line = new CommandeFournisseurDispatch($db); - $line->fetch_optionals($lines[$i]->id); + $line->id = $lines[$i]->id; + $line->fetch_optionals(); if ($action == 'editline' && $lines[$i]->id == $line_id) { diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0381892d9e3..2814b7e1d11 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -477,7 +477,7 @@ class Reception extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); $extrafields->fetch_name_optionals_label($this->table_element, true); - $this->fetch_optionals($this->id); + $this->fetch_optionals(); /* * Lines diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 769f67db44b..b10c2ffe295 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -122,7 +122,7 @@ if ($resql) } } else { - print ''; + print ''; } print "
'.$langs->trans("None").'
'.$langs->trans("None").'

"; @@ -196,7 +196,7 @@ else dol_print_error($db); /* - * Supplier orders to process + * Open pruchase orders to process */ $sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut as status, c.billed as billed, s.nom as name, s.rowid as socid"; @@ -221,7 +221,7 @@ if ($resql) print '
'; print ''; print ''; - print ''; + print ''; while ($i < $num) { $obj = $db->fetch_object($resql); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index de558a6bee4..7b2ce169d33 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -$langs->loadLangs(array("sendings", "receptions", "deliveries", 'companies', 'bills')); +$langs->loadLangs(array("sendings", "receptions", "deliveries", 'companies', 'bills', 'orders')); $socid = GETPOST('socid', 'int'); $massaction = GETPOST('massaction', 'alpha'); @@ -172,7 +172,7 @@ if (empty($reshook)) $rcp = new Reception($db); // On ne facture que les réceptions validées if ($rcp->fetch($id_reception) <= 0 || $rcp->statut != 1) { - $errors[] = $langs->trans('StatusMustBeValidate', $rcp->ref); + $errors[] = $langs->trans('StatusOfRefMustBe', $rcp->ref, $langs->transnoentities("StatusSupplierOrderValidatedShort")); $error++; continue; } @@ -184,12 +184,12 @@ if (empty($reshook)) if (!empty($object->rowid))$object->fetchObjectLinked(); $rcp->fetchObjectLinked(); - if (count($rcp->linkedObjectsIds['order_supplier']) > 0) + if (count($rcp->linkedObjectsIds['reception']) > 0) { - foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value) + foreach ($rcp->linkedObjectsIds['reception'] as $key => $value) { - if (empty($object->linkedObjectsIds['order_supplier']) || !in_array($value, $object->linkedObjectsIds['order_supplier']))//Dont try to link if already linked - $object->add_object_linked('order_supplier', $value); // add supplier order linked object + if (empty($object->linkedObjectsIds['reception']) || !in_array($value, $object->linkedObjectsIds['reception']))//Dont try to link if already linked + $object->add_object_linked('reception', $value); // add supplier order linked object } } } @@ -216,11 +216,11 @@ if (empty($reshook)) $object->origin_id = $id_reception; $rcp->fetchObjectLinked(); - if (count($rcp->linkedObjectsIds['order_supplier']) > 0) + if (count($rcp->linkedObjectsIds['reception']) > 0) { - foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value) + foreach ($rcp->linkedObjectsIds['reception'] as $key => $value) { - $object->linked_objects['order_supplier'] = $value; + $object->linked_objects['reception'] = $value; } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 22da0cd0545..b3fb0f4c0b7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1193,7 +1193,7 @@ else print '
'.$langs->trans("SuppliersOrdersToProcess").'
'.$langs->trans("SuppliersOrdersToProcess").' '.$num.'
'; // Name, firstname - print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; print ''; - print $form->widgetForTranslation("name", $object, $permissiontoadd); + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alpahnohtml', 'minwidth300'); print ''; if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { @@ -1304,10 +1304,11 @@ else print ''; - print ''; // Zip / Town @@ -1315,9 +1316,9 @@ else print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; // Country diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index c961b04d8ce..2b362268c4b 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -141,7 +141,7 @@ llxHeader('', $title, $help_url); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -if (!empty($object->id)) $res = $object->fetch_optionals($object->id, null); +if (!empty($object->id)) $res = $object->fetch_optionals(); //if ($res < 0) { dol_print_error($db); exit; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2c23f578fb4..9d50d98e243 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1106,7 +1106,7 @@ if ($action == 'create') $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); // Replicate extrafields - $objectsrc->fetch_optionals($originid); + $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; if (!empty($conf->multicurrency->enabled)) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2be4ec32f0b..26117632dcd 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -638,10 +638,10 @@ body[class*="colorblind-"] .text-success{ color : } -.editfielda span.fa-pencil-alt, .editfielda span.fa-trash { +.editfielda span.fa-pencil-alt, .editfielda span.fa-trash, .editfieldlang { color: #ccc !important; } -.editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover { +.editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover, .editfieldlang:hover { color: var(--colortexttitle) !important; } @@ -2819,7 +2819,7 @@ div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border } div .tdtop { vertical-align: top !important; - /* padding-top: 8px !important; */ + padding-top: 10px !important; padding-bottom: 2px !important; padding-bottom: 0px; } From b33552fb6f0c3a251100c9131faba9fd35265dae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 16:13:53 +0100 Subject: [PATCH 036/222] Fix phpcs --- htdocs/core/modules/DolibarrModules.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index c14a789d3c5..9ea058de919 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2280,10 +2280,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!empty($conf->global->$const_name)) // If module is already activated { $disableSetup = 0; - } else { - - + // TODO } print ' From a4797634d545ed2f542d06593dada9f85ff60709 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 19:08:39 +0100 Subject: [PATCH 037/222] FIX Bad position of total in column --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 4 ++-- htdocs/don/card.php | 6 +++--- htdocs/fourn/facture/card.php | 2 +- htdocs/fourn/facture/paiement.php | 6 +++--- htdocs/product/card.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7533abcb893..262493c9383 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1675,7 +1675,7 @@ if ($action == 'create') $langs->load("projects"); print ''; print ''; print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 93bab6e674d..372e64e4e43 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1741,7 +1741,7 @@ if ($action == 'create' && $usercancreate) $langs->load("projects"); print ''; print ''; print ''; @@ -2107,7 +2107,7 @@ if ($action == 'create' && $usercancreate) $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref .= ''; $morehtmlref .= ''; } else { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index bba65463bb6..faa6693bce8 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -445,7 +445,7 @@ if ($action == 'create') if (!empty($conf->projet->enabled)) { print "\n"; } @@ -579,7 +579,7 @@ if (!empty($id) && $action == 'edit') $langs->load('projects'); print ''; } @@ -652,7 +652,7 @@ if (!empty($id) && $action != 'edit') $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref.=''; $morehtmlref.=''; } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index dba8f430a08..0f724ef534e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2079,7 +2079,7 @@ if ($action == 'create') $langs->load('projects'); print ''; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f45160b427e..a907bcd6bb0 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -918,7 +918,7 @@ if (empty($action) || $action == 'list') $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print '
'; + print '
'; if ($object->particulier || $private) { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; @@ -1204,7 +1204,7 @@ else } print '
'; print $form->editfieldkey('Address', 'address', '', $object, 0); print ''; - print $form->widgetForTranslation("address", $object, $permissiontoadd); + print $form->widgetForTranslation("address", $object, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent'); print '
'.$form->editfieldkey('Town', 'town', '', $object, 0).''; + print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); - print $form->widgetForTranslation("town", $object, $permissiontoadd); + print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent'); print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print '
".$langs->trans("Project").""; - $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "
'.$langs->trans('Project').''; - $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print '
'.$langs->trans('Project').''; - $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print '
'."\n"; + print '
'."\n"; // Lines for filters fields print ''; @@ -1019,9 +1019,9 @@ if (empty($action) || $action == 'list') // Amount print ''; - $totalarray['pos'][$totalarray['nbfield']] = 'amount'; - $totalarray['val']['amount'] += $objp->pamount; if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'amount'; + $totalarray['val']['amount'] += $objp->pamount; // Ref invoice /*$invoicesupplierstatic->ref=$objp->ref_supplier; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d9e0295c7a2..b2cab72a0a1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1487,7 +1487,7 @@ else // Default warehouse print ''; /* print "".''; print ''; print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3e9c1a2b0ca..9b389bccb5b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1734,7 +1734,7 @@ if ($action == 'create' && $usercancreate) $langs->load("projects"); print ''; print ''; print ''; @@ -2100,7 +2100,7 @@ if ($action == 'create' && $usercancreate) $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref .= ''; $morehtmlref .= ''; } else { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index bba65463bb6..faa6693bce8 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -445,7 +445,7 @@ if ($action == 'create') if (!empty($conf->projet->enabled)) { print "\n"; } @@ -579,7 +579,7 @@ if (!empty($id) && $action == 'edit') $langs->load('projects'); print ''; } @@ -652,7 +652,7 @@ if (!empty($id) && $action != 'edit') $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); $morehtmlref.=''; $morehtmlref.=''; } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 329ee266362..703a97fe11a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2077,7 +2077,7 @@ if ($action == 'create') $langs->load('projects'); print ''; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 19fed7a3387..ed5a7d244f5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -916,7 +916,7 @@ if (empty($action) || $action == 'list') $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
'; - print '
'.price($objp->pamount).'
'.$langs->trans("DefaultWarehouse").''; print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); - print ' '.$langs->trans("AddWarehouse").''; + print ' '; print '
'.$langs->trans("StockLimit").''; From 4207d94f53c7687d4ef5fd8155f12ffa129c6d0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 19:08:39 +0100 Subject: [PATCH 038/222] FIX Bad position of total in column Conflicts: htdocs/fourn/facture/paiement.php --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 4 ++-- htdocs/don/card.php | 6 +++--- htdocs/fourn/facture/card.php | 2 +- htdocs/fourn/facture/paiement.php | 4 ++-- htdocs/product/card.php | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index ad3af8c799d..1f5927f260a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1675,7 +1675,7 @@ if ($action == 'create') $langs->load("projects"); print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print '
'.$langs->trans("Project").''; - $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); + $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500'); print ' id).'">'; print '
".$langs->trans("Project").""; - $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "
'.$langs->trans('Project').''; - $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1); + $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print '
'.$langs->trans('Project').''; - $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); + $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print '
'."\n"; + print '
'."\n"; // Lines for filters fields print ''; @@ -1018,7 +1018,7 @@ if (empty($action) || $action == 'list') // Amount print ''; if (!$i) $totalarray['nbfield']++; - $totalarray['pos'][7] = 'amount'; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'amount'; $totalarray['val']['amount'] += $objp->pamount; // Ref invoice diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 01da1eb741f..f4e959a9459 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1440,7 +1440,7 @@ else // Default warehouse print ''; /* print "".''."\n"; + print ''."\n"; print ''; - print ''; + print ''; + print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; - print ''; + print ''; + print ''; // Email / Web - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 26117632dcd..2854d3582bd 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -175,6 +175,14 @@ input, select { margin-bottom:1px; margin-top:1px; } +input.button { + background: var(--butactionbg); + border-collapse: collapse; + border: none; +} +input.button:focus { + border-bottom: 0; +} input.button.massactionconfirmed { margin: 4px; } diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index 81a6aa3b4c5..45afe673248 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -143,8 +143,31 @@ div.mainmenu.generic4::before { content: "\f249"; } +/* Define color of some picto */ + +.fa-phone, .fa-fax { + opacity: 0.5; + color: #440; +} +.fa-at, .fa-external-link-alt { + opacity: 0.5; + color: #304; +} +.fa-trash { + color: #666; +} +.fa-trash:hover:before { + color: #800; +} +.fa-play { + color: #444; +} +.fa-unlink { + color: #555; +} /* Define square Dolibarr logo in pure CSS */ + .fa-dolibarr-css{ color: #235481; background: currentColor; From d5b107211f01ebfa86a399604aebb80834dba4b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2020 15:20:26 +0100 Subject: [PATCH 046/222] Look and feel v12 --- htdocs/admin/accountant.php | 30 ++++---- htdocs/admin/company.php | 81 +++++++++------------ htdocs/admin/delais.php | 2 +- htdocs/admin/limits.php | 26 +++---- htdocs/core/class/html.formprojet.class.php | 6 +- htdocs/core/lib/functions.lib.php | 3 + htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/activity/index.php | 10 +-- htdocs/projet/activity/perday.php | 4 +- htdocs/projet/activity/permonth.php | 4 +- htdocs/projet/activity/perweek.php | 4 +- htdocs/projet/graph_opportunities.inc.php | 16 ++-- htdocs/projet/index.php | 14 ++-- htdocs/theme/eldy/global.inc.php | 7 +- htdocs/theme/md/style.css.php | 4 + 15 files changed, 107 insertions(+), 105 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 83c143e4955..b5a6e2e3dfe 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -110,56 +110,60 @@ print ''; print ''; print '
'.price($objp->pamount).'
'.$langs->trans("DefaultWarehouse").''; print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); - print ' '.$langs->trans("AddWarehouse").''; + print ' '; print '
'.$langs->trans("StockLimit").''; From 235210b3bcef9364f92c35927e8f7a9633d95e98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2020 19:26:45 +0100 Subject: [PATCH 039/222] Look and feel v12 --- htdocs/expensereport/index.html | 0 htdocs/fichinter/index.html | 0 htdocs/fichinter/index.php | 12 ++++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 htdocs/expensereport/index.html delete mode 100644 htdocs/fichinter/index.html diff --git a/htdocs/expensereport/index.html b/htdocs/expensereport/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fichinter/index.html b/htdocs/fichinter/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 6bde087fa61..8929da904f3 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -122,16 +122,24 @@ if ($resql) $i++; } $db->free($resql); + + include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; + print '
'; print ''; print ''."\n"; - $listofstatus = array(0, 1, 2); + $listofstatus = array(0, 1, 3); $bool = false; foreach ($listofstatus as $status) { $dataseries[] = array($fichinterstatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool]) ? (int) $vals[$status.$bool] : 0)); if ($status == 3 && !$bool) $bool = true; else $bool = false; + + if ($status == Fichinter::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0; + if ($status == Fichinter::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1; + if ($status == Fichinter::STATUS_BILLED) $colorseries[$status] = $badgeStatus4; + if ($status == Fichinter::STATUS_CLOSED) $colorseries[$status] = $badgeStatus6; } if ($conf->use_javascript_ajax) { @@ -140,13 +148,13 @@ if ($resql) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); + $dolgraph->SetDataColor(array_values($colorseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); $dolgraph->draw('idgraphstatus'); print $dolgraph->show($total ? 0 : 1); - $data = array('series'=>$dataseries); print ''; } From cb7342d4c8a03c87dbc67930a0a789583be063cf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 27 Mar 2020 20:07:18 +0100 Subject: [PATCH 040/222] FIX product purchase prices Fix get datas but don't fix cleandata :( @eldy --- htdocs/product/class/api_products.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 1e189026366..0cf6b344abf 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -796,11 +796,11 @@ class Products extends DolibarrApi } if ($result) { - $this->productsupplier->fetch($id, $ref); - $this->productsupplier->list_product_fournisseur_price($id, '', '', 0, 0); + $product_fourn = new ProductFournisseur($this->db); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0); } - return $this->_cleanObjectDatas($this->productsupplier); + return $this->_cleanObjectDatas($product_fourn_list); } /** From 815ae3cb0969eddd3ba56720a275450d7d0ce282 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Fri, 27 Mar 2020 21:51:34 +0000 Subject: [PATCH 041/222] Ability to add new tabs on company admin section I have added the option to add a tab from a module to the main company setup section. I need this ability so thought that others might too. --- htdocs/core/lib/admin.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7d3658d4f97..dd7313f1d0b 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1781,7 +1781,8 @@ function company_admin_prepare_head() $h++; complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); - + complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'add'); + return $head; } From 0db7c2bf215b68cde64f3b552f793fbfbc47115f Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 27 Mar 2020 23:19:56 +0100 Subject: [PATCH 042/222] TakePOS CSS fix in action buttons --- htdocs/takepos/css/pos.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 7d4fd9be051..5f0006d24fe 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -153,7 +153,7 @@ button.actionbutton { vertical-align: middle; text-align: center; overflow: visible; /* removes extra width in IE */ - width:33%; + width: calc(33% - 2px); height: calc(25% - 2px); margin: 1px; border-width: 0; From f93bdf6b22efebbdac98b78663e7c43804d56b61 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Fri, 27 Mar 2020 23:09:40 +0000 Subject: [PATCH 043/222] Fix so company_admin tabs do not show in Societe fix --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index eac9f404188..1047081d0d4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -402,7 +402,7 @@ function societe_admin_prepare_head() // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'societe_admin'); $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsThirdParties"); @@ -414,7 +414,7 @@ function societe_admin_prepare_head() $head[$h][2] = 'attributes_contacts'; $h++; - complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'societe_admin', 'remove'); return $head; } From 6f07b87cdeffc6bd93f47f094270ceb2def847d0 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Fri, 27 Mar 2020 23:22:02 +0000 Subject: [PATCH 044/222] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index dd7313f1d0b..27a846ab5fa 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1782,7 +1782,6 @@ function company_admin_prepare_head() complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'add'); - return $head; } From ec83f18944e2e216d06a356d5250149d3c799cb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2020 13:38:25 +0100 Subject: [PATCH 045/222] Move more icon definition into CSS --- htdocs/admin/company.php | 64 ++++++++----------- htdocs/core/class/stats.class.php | 2 +- htdocs/core/lib/functions.lib.php | 19 +----- htdocs/core/lib/project.lib.php | 2 +- htdocs/cron/list.php | 12 ++-- htdocs/salaries/class/salariesstats.class.php | 1 + htdocs/societe/card.php | 16 ++--- htdocs/theme/eldy/global.inc.php | 8 +++ htdocs/theme/eldy/main_menu_fa_icons.inc.php | 23 +++++++ 9 files changed, 77 insertions(+), 70 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b5ec2969f39..7707e5971f4 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -451,27 +451,33 @@ print ''."\n"; // Phone print ''; print ''."\n"; // Fax print ''; print ''."\n"; // Email print ''; print ''."\n"; // Web print ''; print ''."\n"; // Barcode if (!empty($conf->barcode->enabled)) { - print ''; print ''; } @@ -480,15 +486,16 @@ if (!empty($conf->barcode->enabled)) { print ''; @@ -497,15 +504,16 @@ print ''; print ''; @@ -524,35 +532,15 @@ print ''; print ''; print "\n"; -// Facebook -print ''; -print ''."\n"; - -// Twitter -print ''; -print ''."\n"; - -// LinkedIn -print ''; -print ''."\n"; - -// Instagram -print ''; -print ''."\n"; - -// Youtube -print ''; -print ''."\n"; - -// Github -print ''; -print ''."\n"; +$listofnetworks = array('facebook'=>'facebook', 'twitter'=>'twitter', 'linkedin'=>'linkedin', 'instagram'=>'instagram', 'youtube'=>'youtube', 'github'=>'github'); +foreach($listofnetworks as $networkkey => $networkicon) { + print ''; + print ''."\n"; +} print "
'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'
'; +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); print '
'; +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); print '
'; +print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); print '
'; +print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); print '
'; + print '
'; + print ''; + print ''; print '
'; print '
'; print ''; -print '
'; +print '
'; if (!empty($mysoc->logo_mini)) { - print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - print '
'; + print '
'; print ''; + print '
'; } + print ''; } else { - print ''; + print ''; } print '
'; print '
'; print '
'; print ''; -print '
'; +print '
'; if (!empty($mysoc->logo_squarred_mini)) { - print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { - print '
'; + print '
'; print ''; + print '
'; } + print ''; } else { - print ''; + print ''; } print '
'; print '
'.$langs->trans("SocialNetworksInformation").''.$langs->trans("Value").'
'; -print '
'; -print '
'; -print '
'; -print '
'; -print '
'; -print '
'; + print ''; + $networkconst = 'MAIN_INFO_SOCIETE_'.strtoupper($networkkey).'_URL'; + print ''; + print '
"; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 26de63f10cc..9620612cb2e 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -198,7 +198,7 @@ abstract class Stats // $data = array('xval'=>array(0=>xlabel,1=>yval1,2=>yval2...),...) for ($i = 0; $i < 12; $i++) { - $data[$i][] = $datay[$endyear][($i + $sm) % 12]['label']; // set label + $data[$i][] = isset($datay[$endyear][($i + $sm) % 12]['label']) ? $datay[$endyear][($i + $sm) % 12]['label'] : $datay[$endyear][($i + $sm) % 12][0]; // set label $year = $startyear; while ($year <= $endyear) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 09c7c3f420e..2fcb814eccc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3131,6 +3131,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', 'filter', 'file-code', 'grip', 'grip_title', 'language', 'list', 'listlight', 'note', + 'object_phoning', 'object_phoning_fax', 'object_email', 'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', @@ -3153,7 +3154,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', - 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', + 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'globe'=>'external-link-alt', + 'object_phoning'=>'phone', 'object_phoning_fax'=>'fax', 'object_email'=>'at', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'object_bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch', 'object_list'=>'list-alt', 'object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', @@ -3193,10 +3195,6 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $facolor = '#444'; } - elseif ($pictowithouttext == 'delete') { - $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; - $facolor = '#444'; - } elseif ($pictowithouttext == 'edit') { $facolor = '#444'; $fakey = 'fa-pencil-alt'; @@ -3238,18 +3236,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-sign-out-alt'; $marginleftonlyshort = 0; } - elseif ($pictowithouttext == 'unlink') { - $fakey = 'fa-unlink'; - $facolor = '#555'; - } elseif ($pictowithouttext == 'playdisabled') { $fakey = 'fa-play'; $facolor = '#ccc'; } - elseif ($pictowithouttext == 'play') { - $fakey = 'fa-play'; - $facolor = '#444'; - } elseif ($pictowithouttext == 'jabber') { $fakey = 'fa-comment-o'; } @@ -3261,12 +3251,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ elseif (!empty($arrayconvpictotofa[$pictowithouttext])) { $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; - //$facolor = '#444'; $marginleftonlyshort = 0; } else { $fakey = 'fa-'.$pictowithouttext; - //$facolor = '#444'; $marginleftonlyshort = 0; } @@ -3538,7 +3526,6 @@ function img_delete($titlealt = 'default', $other = 'class="pictodelete"') if ($titlealt == 'default') $titlealt = $langs->trans('Delete'); return img_picto($titlealt, 'delete.png', $other); - //return ''; } /** diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a8af4262d58..e5550f9ddd0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1073,7 +1073,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; } - print '
'; print $projectstatic->getNomUrl(1, '', 0, ''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 0b73d95a140..e9afad3b48b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -550,15 +550,15 @@ if ($num > 0) $backtourl = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '')); if ($user->rights->cron->create) { - print "rowid."&action=edit".($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').$param; + print 'trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."  "; } if ($user->rights->cron->delete) { print 'trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'), 'delete')."  "; + print "\" title=\"".dol_escape_htmltag($langs->trans('CronDelete'))."\">".img_picto($langs->trans('CronDelete'), 'delete', '', false, 0, 0, '', 'marginleftonly')."   "; } else { - print "trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'), 'delete')."   "; + print "trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'), 'delete', '', false, 0, 0, '', 'marginleftonly')."   "; } if ($user->rights->cron->execute) { @@ -567,12 +567,12 @@ if ($num > 0) print (empty($conf->global->CRON_KEY) ? '' : '&securitykey='.$conf->global->CRON_KEY); print ($sortfield ? '&sortfield='.$sortfield : ''); print ($sortorder ? '&sortorder='.$sortorder : ''); - print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play").''; + print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play", '', false, 0, 0, '', 'marginleftonly').''; } else { - print ''.img_picto($langs->trans('JobDisabled'), "playdisabled").''; + print ''.img_picto($langs->trans('JobDisabled'), "playdisabled", '', false, 0, 0, '', 'marginleftonly').''; } } else { - print ''.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled").''; + print ''.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled", '', false, 0, 0, '', 'marginleftonly').''; } if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { diff --git a/htdocs/salaries/class/salariesstats.class.php b/htdocs/salaries/class/salariesstats.class.php index 41449cca0cd..37e950b1bbe 100644 --- a/htdocs/salaries/class/salariesstats.class.php +++ b/htdocs/salaries/class/salariesstats.class.php @@ -126,6 +126,7 @@ class SalariesStats extends Stats $res=$this->_getAmountByMonth($year, $sql, $format); //var_dump($res);print '
'; + return $res; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b3fb0f4c0b7..dc6b9db0eac 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1345,17 +1345,17 @@ else } // Phone / Fax - print '
'.img_picto('', 'object_phoning').' '.$form->editfieldkey('Phone', 'phone', '', $object, 0).'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''.img_picto('', 'object_phoning').'
'.img_picto('', 'object_phoning_fax').' '.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.$form->editfieldkey('Fax', 'fax', '', $object, 0).''.img_picto('', 'object_phoning_fax').'
'.img_picto('', 'object_email').' '.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).'
'.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', '', $object, 0).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).''.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).''.img_picto('', 'globe').'
'; -print ''."\n"; +print ''."\n"; // Name -print ''."\n"; // Address -print ''."\n"; -print ''."\n"; -print ''."\n"; // Country -print ''."\n"; -print ''."\n"; -print ''; print ''."\n"; -print ''; print ''."\n"; -print ''; print ''."\n"; // Web -print ''; print ''."\n"; // Code -print ''."\n"; // Note -print ''; print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 7707e5971f4..222cc292ace 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -695,26 +695,24 @@ print "
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; +print '
'; print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>
'; +print '
'; print '
'; +print '
'; print '
'; +print '
'; print '
'; +print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; +print '
'; $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); print '
'; +print '
'; +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); print '
'; +print '
'; +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); print '
'; +print '
'; +print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); print '
'; +print '
'; +print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); print '
'; +print '
'; print '
'; +print '
'; print '
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; print ""; print '\n"; print ""; print '\n"; print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").''.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; -print ""; -print ""; -if ($mysoc->country_code == 'FR') print "\n"; -print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; +$tooltiphelp = ''; +if ($mysoc->country_code == 'FR') $tooltiphelp = ''.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR").""; +print ""; print "
'; -print ""; -print ""; -if ($mysoc->country_code == 'FR') print "\n"; -print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; +$tooltiphelp = ''; +if ($mysoc->country_code == 'FR') $tooltiphelp = "".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."\n"; +print ""; print "
"; @@ -728,40 +726,35 @@ if ($mysoc->useLocalTax(1)) print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print '\n"; - - print ""; + print ""; print '\n"; print "
'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."'; - print ''; - print ""; - $example = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); - print ($example != "LocalTax1IsUsedExample" ? "\n" : ""); + print '
'; + $tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); + $tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."\n" : ""); + print ""; if (!isOnlyOneLocalTax(1)) { - print '
'; } $opcions = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
: '; + print '
: '; $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); - print '
'.$langs->trans("CalcLocaltax").': '; + print '
: '; print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); - print '
"; + print ""; print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); - print ($example != "LocalTax1IsNotUsedExample" ? "\n" : ""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; + $tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); + $tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."\n" : ""); + print ""; print "
"; } @@ -771,38 +764,34 @@ if ($mysoc->useLocalTax(2)) print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; - // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print '\n"; - - print ""; + print ""; print '\n"; print "
'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."'; - print ''; - print ""; - $example = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); - print ($example != "LocalTax2IsUsedExample" ? "\n" : ""); + print '
'; + print ""; + $tooltiphelp = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); + $tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."\n" : ""); if (!isOnlyOneLocalTax(2)) { - print '
'; } - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
: '; + print '
: '; $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); - print '
: '; + print '
: '; print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); - print '
"; + print ""; print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); - print ($example != "LocalTax2IsNotUsedExample" ? "\n" : ""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; + print "
"; + $tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); + $tooltiphelp = ($tooltiphelp != "LocalTax2IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."\n" : ""); + print ""; + print "
"; print "
"; } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 5b756c21017..1944f140ef3 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -207,7 +207,7 @@ llxHeader(); print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup'); -print ''.$langs->transnoentities("DelaysOfToleranceDesc", img_warning()); +print ''.$langs->transnoentities("DelaysOfToleranceDesc", img_warning('default', '', 'pictowarning nopaddingleft')); print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."
\n"; print "
\n"; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 8bc356e18d9..6f52d6dfd12 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -207,29 +207,29 @@ if (empty($mysoc->country_code)) else { // Show examples - print ''.$langs->trans("ExamplesWithCurrentSetup").":
\n"; + print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); // Always show vat rates with vat 0 $s=2/7;$qty=1;$vat=0; $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); + print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=1;$vat=0; $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); + print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=2;$vat=0; $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); + print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; // Add vat rates examples specific to country $vat_rates=array(); @@ -261,10 +261,10 @@ else { $s=10/3; $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); + print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; } } } @@ -276,17 +276,17 @@ else $s=10/3;$qty=1;$vat=10; $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); + print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=2;$vat=10; $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); + print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; } // Important: can debug rounding, to simulate the rounded total diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 433dd020c1d..9b541cc9c3a 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -375,7 +375,11 @@ class FormProjets } if (! empty($show_empty)) { $out.= ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2fcb814eccc..1b16f2a2ca5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3195,6 +3195,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $facolor = '#444'; } + elseif ($pictowithouttext == 'delete') { + $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; + } elseif ($pictowithouttext == 'edit') { $facolor = '#444'; $fakey = 'fa-pencil-alt'; diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 94e440f9ab9..ead6dbf0ade 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -240,6 +240,7 @@ LatestModifiedProjects=Latest %s modified projects OtherFilteredTasks=Other filtered tasks NoAssignedTasks=No assigned tasks found (assign project/tasks to the current user from the top select box to enter time on it) ThirdPartyRequiredToGenerateInvoice=A third party must be defined on project to be able to invoice it. +ChooseANotYetAssignedTask=Choose a task not yet assigned to you # Comments trans AllowCommentOnTask=Allow user comments on tasks AllowCommentOnProject=Allow user comments on projects diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 7f61b9d49ab..63115350bbc 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -85,16 +85,14 @@ $morehtml .= '