From f3460eae482ca6c8a382b85704463336fd52fc3e Mon Sep 17 00:00:00 2001 From: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com> Date: Tue, 21 May 2024 20:01:36 +0200 Subject: [PATCH 01/98] FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710) --- htdocs/product/stock/replenish.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 66ad0889b31b0..e3f274764888a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -273,6 +273,7 @@ } else { $id = $result; } + $i++; } else { $order->socid = $suppliersid[$i]; $order->fetch_thirdparty(); From 26e09f85d2c0ac57ec4a6344a040ab43e1ca0d32 Mon Sep 17 00:00:00 2001 From: Yannis Hoareau <93135242+YannisHoareau@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:52:29 +0200 Subject: [PATCH 02/98] FIX: Unsigned propal having signing date (#29825) * FIX propal dates: setting sign date only if signed * FIX propal dates: clearing sign date when reopenning a propal * FIX propal dates: reworked + not clearing sign date Not clearing the sign date anymore because of 17.0 configuration that allow the user to choose if he wants to keep the previous sign date or the current date. * FIX propal dates: move comma to fix sql syntax error * FIX propal dates: add SQL request to update database This SQL request is meant to set the sign date and the signing user to null to match the fix * Update 15.0.0-16.0.0.sql --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/class/propal.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2998753192595..a33d0864a6c6d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2629,7 +2629,10 @@ public function closeProposal($user, $status, $note = '', $notrigger = 0) $newprivatenote = dol_concatdesc($this->note_private, $note); $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id; + $sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."'"; + if ($status == self::STATUS_SIGNED) { + $sql .= ", date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id; + } $sql .= " WHERE rowid = ".((int) $this->id); $resql = $this->db->query($sql); From 7249e3a4d184d01d8a02a4c013fe49aa7e1637bb Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 6 Jun 2024 15:33:35 +0200 Subject: [PATCH 03/98] FIX init total amounts in margin module (#29854) --- htdocs/margin/agentMargins.php | 4 +++- htdocs/margin/customerMargins.php | 3 +++ htdocs/margin/productMargins.php | 3 +++ htdocs/margin/tabs/productMargins.php | 4 ++-- htdocs/margin/tabs/thirdpartyMargins.php | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index f369f1889c2a9..e0687a59811f4 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -226,7 +226,9 @@ $param .= "&enddateyear=".urlencode($enddateyear); } - +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; dol_syslog('margin::agentMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 93850b8ec10c2..9009b9f8800c7 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -297,6 +297,9 @@ } } +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; dol_syslog('margin::customerMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 32cb3c9292dd6..bd8ab22755946 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -247,6 +247,9 @@ } } +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; dol_syslog('margin::productMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 1bda53b5c5df6..e01252d2addb0 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -75,8 +75,8 @@ $form = new Form($db); $totalMargin = 0; -$marginRate = 0; -$markRate = 0; +$marginRate = ''; +$markRate = ''; if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 3202dcb93ce07..dfb080126d05c 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -93,6 +93,9 @@ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; if ($socid > 0) { $object = new Societe($db); $object->fetch($socid); From bd2313354303baa47dcb8c58a942f6d95a6f34c7 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 6 Jun 2024 15:36:52 +0200 Subject: [PATCH 04/98] FIX group by qty in product margin tab (#29853) --- htdocs/margin/tabs/productMargins.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index e01252d2addb0..99c55de1e8053 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -164,7 +164,7 @@ $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (!empty($socid)) { - $sql .= " AND f.fk_soc = $socid"; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " AND d.buy_price_ht IS NOT NULL"; // We should not use this here. Option ForceBuyingPriceIfNull should have effect only when inserting data. Once data is recorded, it must be used as it is for report. @@ -198,7 +198,7 @@ print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&id=".$object->id, '', $sortfield, $sortorder, 'left '); print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&id=".$object->id, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "buying_price", "", "&id=".$object->id, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", "&id=".$object->id, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "qty", "", "&id=".$object->id, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&id=".$object->id, '', $sortfield, $sortorder, 'right '); if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&id=".$object->id, '', $sortfield, $sortorder, 'right '); From a3e7151633a0d098e0263b4b68cb25cff8647daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= <85104766+Kazimir42@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:20:25 +0200 Subject: [PATCH 05/98] fix restrictedArea on selectobject (#29882) --- htdocs/core/ajax/selectobject.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index c8c3e13ea3d2b..c4010731ccba4 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -84,7 +84,11 @@ $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); // Add a security test to avoid to get content of all tables -restrictedArea($user, $objecttmp->element, $id); +if (!empty($objecttmp->module)) { + restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); +}else { + restrictedArea($user, $objecttmp->element, $id); +} $arrayresult = $form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1); From ee75ffe823f3a36360d51eb2c386e6b49d76aa91 Mon Sep 17 00:00:00 2001 From: UltraViolet33 <93035200+UltraViolet33@users.noreply.github.com> Date: Fri, 7 Jun 2024 18:06:31 +0200 Subject: [PATCH 06/98] FIX update date_echeance of supplier invoices when we update invoice date in the past (#29886) When we update the date of supplier invoices in the past, the date_echeance was not updated if the new calculated date_echeance is before the current date_echeance. The same goes if we update the payment term of supplier invoice, the date echeance is not updated if the new calculted date_echeance is before the current date_echeance. With this PR, when we update the supplier invoice date or payment term, the date_echeance is updated even if the new calculated date_echeance is before the current date_echeance. Co-authored-by: Ulysse Valdenaire --- htdocs/fourn/facture/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a941819759254..f3c153271d5c0 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -389,9 +389,8 @@ } if (!$error) { - $old_date_echeance = $object->date_echeance; $new_date_echeance = $object->calculate_date_lim_reglement(); - if ($new_date_echeance > $old_date_echeance) { + if ($new_date_echeance) { $object->date_echeance = $new_date_echeance; } if ($object->date_echeance < $object->date) { @@ -455,7 +454,7 @@ $object->date = $newdate; $date_echence_calc = $object->calculate_date_lim_reglement(); - if (!empty($object->date_echeance) && $object->date_echeance < $date_echence_calc) { + if (!empty($object->date_echeance)) { $object->date_echeance = $date_echence_calc; } if ($object->date_echeance && $object->date_echeance < $object->date) { From 72a2a96063dae6a50e2ee56516f6716d43e341fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Jun 2024 23:46:21 +0200 Subject: [PATCH 07/98] Fix travis --- htdocs/core/ajax/selectobject.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index c4010731ccba4..37a0e6e32e368 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -85,9 +85,9 @@ // Add a security test to avoid to get content of all tables if (!empty($objecttmp->module)) { - restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); -}else { - restrictedArea($user, $objecttmp->element, $id); + restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); +} else { + restrictedArea($user, $objecttmp->element, $id); } $arrayresult = $form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1); From 040e9083da39a03bcbb0eddbc74ae78ebbf64866 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 7 Jun 2024 23:56:14 +0200 Subject: [PATCH 08/98] Fix : expense report reapproval email, wrong date format + missing parameter (#29874) --- htdocs/expensereport/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 0201dfdd7f668..44cd66ff0c553 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -502,8 +502,7 @@ // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $link = ''.$link.''; - $dateRefusEx = explode(" ", $object->date_refuse); - $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link); + $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", dol_print_date($object->date_refuse, 'day'), $object->detail_refuse, $expediteur->getFullName($langs), get_date_range($object->date_debut, $object->date_fin, '', $langs), $link); // Rebuild pdf /* From 5989ee9cf03fbcc3d8f41a1661d3d8dd4f4f6ec7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 8 Jun 2024 00:09:30 +0200 Subject: [PATCH 09/98] Fix : SQL error on stock transfer deletion (#29902) --- .../stock/stocktransfer/class/stocktransfer.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index a2f6707ad4012..e5d0f8eb197ba 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -57,6 +57,15 @@ class StockTransfer extends CommonObject */ public $isextrafieldmanaged = 1; + /** + * @var int Name of subtable line + */ + public $table_element_line = 'stocktransfer_stocktransferline'; + + /** + * @var int Field with ID of parent key if this object has a parent + */ + public $fk_element = 'fk_stocktransfer'; /** * @var array List of child tables. To know object to delete on cascade. From b0e825c1230827e8462c89cc4c408c73d9324f2e Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:01:22 +0200 Subject: [PATCH 10/98] FIX: PHP 8 warning on output of successful cronjob (#29922) --- htdocs/cron/class/cronjob.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b89d7ea3cb7e3..569364a4dfd6e 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1275,7 +1275,7 @@ public function run_jobs($userlogin) $error++; } else { dol_syslog(get_class($this)."::run_jobs END"); - $this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n").$errmsg, 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1); + $this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n"), 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1); $this->lastresult = var_export($result, true); $retval = $this->lastresult; } From 956d1b025a4a4096e143ba226c7f943058d5b749 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 8 Jun 2024 23:35:01 +0200 Subject: [PATCH 11/98] Fix : product price by quantity was removing default price (#29899) --- htdocs/product/price.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index d93fdbe9b1701..8ef9398cefe1e 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -503,7 +503,9 @@ if ($action == 'activate_price_by_qty') { // Activating product price by quantity add a new price line with price_by_qty set to 1 $level = GETPOST('level', 'int'); - $ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1); + $basePrice = ($object->price_base_type == 'HT') ? $object->price : $object->price_ttc; + $basePriceMin = ($object->price_base_type == 'HT') ? $object->price_min : $object->price_min_ttc; + $ret = $object->updatePrice($basePrice, $object->price_base_type, $user, $object->tva_tx, $basePriceMin, $level, $object->tva_npr, 1); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -513,7 +515,9 @@ if ($action == 'disable_price_by_qty') { // Disabling product price by quantity add a new price line with price_by_qty set to 0 $level = GETPOST('level', 'int'); - $ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0); + $basePrice = ($object->price_base_type == 'HT') ? $object->price : $object->price_ttc; + $basePriceMin = ($object->price_base_type == 'HT') ? $object->price_min : $object->price_min_ttc; + $ret = $object->updatePrice($basePrice, $object->price_base_type, $user, $object->tva_tx, $basePriceMin, $level, $object->tva_npr, 0); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); From c5bb1856c2f0806d7da4a9f7ea44a71e29a3b831 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sat, 15 Jun 2024 15:02:19 +0200 Subject: [PATCH 12/98] FIX modification date from label in accounting bookkeeping list (#30038) --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 0ec53018a215d..56a9a0916cf24 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -919,7 +919,7 @@ print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print ''; print '
'; - print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; } From cbba014355f6395468670ea6d7f021697b581446 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:27:54 +0200 Subject: [PATCH 13/98] =?UTF-8?q?fk=5Fproduct=20could=20be=20=3D=20-1=20th?= =?UTF-8?q?en=20line=20added=20is=20not=20linked=20to=20selected=20pr?= =?UTF-8?q?=E2=80=A6=20(#30013)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fk_product could be = -1 then line added is not linked to selected product * more clear conditions * idprod could be set if prev dropdown menu was used --- htdocs/projet/tasks/time.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 58995267410f3..99eb3b01b3636 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -499,8 +499,9 @@ if (getDolGlobalInt('PROJECT_USE_REAL_COST_FOR_TIME_INVOICING')) { // We set unit price to 0 to force the use of the rate saved during recording $pu_ht = 0; - } else { + } elseif ($idprod <= 0) { // We want to sell all the time spent with the last hourly rate of user + // -> but what about choice user selected ? add idprod test $pu_ht = $fuser->thm; } @@ -520,7 +521,7 @@ $localtax2line = $localtax2; // If a particular product/service was defined for the task - if (!empty($fk_product) && $fk_product !== $idprod) { + if (!empty($fk_product) && ($fk_product > 0) && ($fk_product !== $idprod)) { if (!array_key_exists($fk_product, $product_data_cache)) { $result = $tmpproduct->fetch($fk_product); if ($result < 0) { From 9c6a1eac945b1acadaa024384df66e039dbe4cf0 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Mon, 24 Jun 2024 23:47:34 +0200 Subject: [PATCH 14/98] fix: bad errors variable for error return (#30145) * fix: bad errors variable for error return * fix: bad errors variable for error return * Update contrat.class.php fix review --- htdocs/contrat/class/contrat.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 65e5249bf82b9..3718c2740e029 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1621,7 +1621,8 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $contractline->id = $contractlineid; $result = $contractline->insertExtraFields(); if ($result < 0) { - $this->error[] = $contractline->error; + $this->errors = array_merge($this->errors, $contractline->errors); + $this->error = $contractline->error; $error++; } } From fdf5fe0f267fb40a8cda945d801bf48dea674cf6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 29 Jun 2024 19:28:30 +0200 Subject: [PATCH 15/98] FIX broken pdf preview when multicompany sharing (#30188) * FIX broken pdf preview when multicompany sharing * Update html.formmail.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.formmail.class.php | 7 ++++--- htdocs/core/tpl/card_presend.tpl.php | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index aa35fa988d12c..c3139bb3c7834 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -844,8 +844,9 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove foreach ($listofpaths as $key => $val) { $relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val))); - if ($conf->entity > 1) { - $relativepathtofile = str_replace('/'.$conf->entity.'/', '/', $relativepathtofile); + $entity = (isset($this->param['object_entity']) ? $this->param['object_entity'] : $conf->entity); + if ($entity > 1) { + $relativepathtofile = str_replace('/'.$entity.'/', '/', $relativepathtofile); } // Try to extract data from full path $formfile_params = array(); @@ -855,7 +856,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove // Preview of attachment $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; - $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4], 0, ($entity == 1 ? '' : 'entity='.((int) $entity)); if (!$this->withfilereadonly) { $out .= ' '; //$out.= ' '.img_delete($langs->trans("Delete").''; diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 039f4e2a96a68..9f8b7ab95b7c8 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -387,6 +387,7 @@ $formmail->param['id'] = $object->id; $formmail->param['returnurl'] = $_SERVER["PHP_SELF"].'?id='.$object->id; $formmail->param['fileinit'] = array($file); + $formmail->param['object_entity'] = $object->entity; // Show form print $formmail->get_form(); From 42d9b384d4400272f5a00648ee898c0d27de1c5a Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Sat, 29 Jun 2024 19:29:14 +0200 Subject: [PATCH 16/98] FIX: Bad calculation of $nbtotalofrecord (#30183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/user/group/list.php | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index d0998329fa0e6..11b5165f48b18 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -174,6 +174,9 @@ // Build and execute select // -------------------------------------------------------------------- $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; + +$sqlfields = $sql; + $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; @@ -190,11 +193,29 @@ } $sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec, g.tms"; +// Count total nb of records +$nbtotalofrecords = ''; +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0 + $page = 0; + $offset = 0; + } + $db->free($resql); +} + // Complete request and execute it with limit $sql .= $db->order($sortfield, $sortorder); -if ($limit) { - $sql .= $db->plimit($limit + 1, $offset); -} $resql = $db->query($sql); if (!$resql) { @@ -204,9 +225,6 @@ $num = $db->num_rows($resql); - -$nbtotalofrecords = $num; - $i = 0; From 2e6af8782385775dbfc58e96a37f9a582d96ce8e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 29 Jun 2024 19:30:06 +0200 Subject: [PATCH 17/98] FIX User List - Function is show in wrong column when module HRM enabled (#30186) --- htdocs/user/list.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index c7a10b2c3cb45..e5ca8d9cf729e 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2021 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2016 Marcos García +/* Copyright (C) 2002-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2021 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2016 Marcos García * * 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 @@ -134,9 +134,9 @@ 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(isModEnabled('api') && $user->admin)), 'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45), - 'u.ref_employee'=>array('label'=>"RefEmployee", 'checked'=>-1, 'position'=>60, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)), - 'u.national_registration_number'=>array('label'=>"NationalRegistrationNumber", 'checked'=>-1, 'position'=>61, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)), - 'u.job'=>array('label'=>"PostOrFunction", 'checked'=>-1, 'position'=>50), + 'u.ref_employee'=>array('label'=>"RefEmployee", 'checked'=>-1, 'position'=>50, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)), + 'u.national_registration_number'=>array('label'=>"NationalRegistrationNumber", 'checked'=>-1, 'position'=>51, 'enabled'=>(isModEnabled('hrm') && $permissiontoreadhr)), + 'u.job'=>array('label'=>"PostOrFunction", 'checked'=>-1, 'position'=>60), 'u.salary'=>array('label'=>"Salary", 'checked'=>-1, 'position'=>80, 'enabled'=>(isModEnabled('salaries') && $user->hasRight("salaries", "readall")), 'isameasure'=>1), 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), @@ -897,10 +897,6 @@ print_liste_field_titre($arrayfields['u.entity']['label'], $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } -if (!empty($arrayfields['u.job']['checked'])) { - print_liste_field_titre($arrayfields['u.job']['label'], $_SERVER['PHP_SELF'], "u.job", $param, "", "", $sortfield, $sortorder); - $totalarray['nbfield']++; -} if (!empty($arrayfields['u.ref_employee']['checked'])) { print_liste_field_titre("RefEmployee", $_SERVER['PHP_SELF'], "u.ref_employee", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; @@ -909,6 +905,10 @@ print_liste_field_titre("NationalRegistrationNumber", $_SERVER['PHP_SELF'], "u.national_registration_number", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } +if (!empty($arrayfields['u.job']['checked'])) { + print_liste_field_titre($arrayfields['u.job']['label'], $_SERVER['PHP_SELF'], "u.job", $param, "", "", $sortfield, $sortorder); + $totalarray['nbfield']++; +} if (!empty($arrayfields['u.salary']['checked'])) { print_liste_field_titre("Salary", $_SERVER['PHP_SELF'], "u.salary", $param, "", "", $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; From 6cd3d7943d95f9cbbd5cf2200654e7add2e2f7fd Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sat, 29 Jun 2024 19:31:08 +0200 Subject: [PATCH 18/98] FIX orders to bill menu (#30179) * FIX orders to bill menu * only fix url menu * FIX orders supplier to bill menu --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 6e03224a30630..dcaead425efc2 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1494,7 +1494,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen if (isModEnabled('commande')) { $langs->load("orders"); if (isModEnabled('facture')) { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&search_billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); } @@ -1503,7 +1503,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen if (isModEnabled('supplier_invoice')) { if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { $langs->load("supplier"); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&search_billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); } } From 5e7f43f9d01c45036aa2c9e56f0ea47c68a50133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 11:28:09 +0200 Subject: [PATCH 19/98] Update eventorganization.lang (#30198) --- htdocs/langs/en_US/eventorganization.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 88b83d6d1bbff..f0ea1354e7230 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -114,6 +114,7 @@ EventType = Event type LabelOfBooth=Booth label LabelOfconference=Conference label ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet +EventRegistrationAreClosed=Event registration are closed DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s MaxNbOfAttendeesReached=The maximum number of participants has been reached From 082e7d4d4b9ea95f4f1d7a48c9408fcaf5e22d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 11:29:03 +0200 Subject: [PATCH 20/98] fix syntax error in branch 19.0 (#30201) * fix syntax error in branch 19.0 * Update stocktransfer.class.php --- htdocs/core/class/html.formmail.class.php | 2 +- .../stock/stocktransfer/class/stocktransfer.class.php | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c3139bb3c7834..971343d9c1975 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -856,7 +856,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove // Preview of attachment $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; - $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4], 0, ($entity == 1 ? '' : 'entity='.((int) $entity)); + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4], 0, ($entity == 1 ? '' : 'entity='.((int) $entity))); if (!$this->withfilereadonly) { $out .= ' '; //$out.= ' '.img_delete($langs->trans("Delete").''; diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 6aaa15f6401bb..aa8fcbc954557 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -63,12 +63,7 @@ class StockTransfer extends CommonObject public $isextrafieldmanaged = 1; /** - * @var int Name of subtable line - */ - public $table_element_line = 'stocktransfer_stocktransferline'; - - /** - * @var int Field with ID of parent key if this object has a parent + * @var string Field with ID of parent key if this object has a parent */ public $fk_element = 'fk_stocktransfer'; From 6ad4ebc81c6d5c415013e90b343e350230012b2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 12:16:41 +0200 Subject: [PATCH 21/98] Start implementation of STOCK_USE_WAREHOUSE_USAGE. --- htdocs/install/mysql/tables/llx_entrepot.sql | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql index 4b93106e0d46b..3c2cff0f3a020 100644 --- a/htdocs/install/mysql/tables/llx_entrepot.sql +++ b/htdocs/install/mysql/tables/llx_entrepot.sql @@ -37,7 +37,7 @@ create table llx_entrepot fax varchar(20), -- fax number barcode varchar(180) DEFAULT NULL, -- barcode fk_barcode_type integer DEFAULT NULL, -- barcode type - warehouse_usage integer DEFAULT 1, -- 1=internal, 2=external (virtual warehouse or stock out of company) + warehouse_usage integer DEFAULT 1, -- 1=internal, 2=external (virtual warehouse or stock out of company). Need STOCK_USE_WAREHOUSE_USAGE opton. statut tinyint DEFAULT 1, -- 1 open, 0 close fk_user_author integer, model_pdf varchar(255), diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 7e2f9fb290356..339469e0012ec 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -508,7 +508,7 @@ print ''.$langs->trans("Description").''.dol_htmlentitiesbr($object->description).''; // Warehouse usage - if (getDolGlobalInt("MAIN_FEATURES_LEVEL")) { + if (getDolGlobalInt("STOCK_USE_WAREHOUSE_USAGE")) { $labelusagestring = $object->fields['warehouse_usage']['arrayofkeyval'][empty($object->warehouse_usage) ? 1 : $object->warehouse_usage]; $labelusage = $labelusagestring ? $langs->trans($labelusagestring) : 'Unknown'; print ''.$langs->trans("WarehouseUsage").''.dol_htmlentitiesbr($labelusage).''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 4994a46251920..895643a98c906 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -175,7 +175,7 @@ class Entrepot extends CommonObject //'fk_user_author' =>array('type'=>'integer', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-2, 'position'=>82), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 300), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 301), - 'warehouse_usage' => array('type' => 'integer', 'label' => 'WarehouseUsage', 'enabled' => 'getDolGlobalInt("MAIN_FEATURES_LEVEL")', 'visible' => 1, 'position' => 400, 'default' => 1, 'arrayofkeyval' => array(1 => 'InternalWarehouse', 2 => 'ExternalWarehouse')), + 'warehouse_usage' => array('type' => 'integer', 'label' => 'WarehouseUsage', 'enabled' => 'getDolGlobalInt("STOCK_USE_WAREHOUSE_USAGE")', 'visible' => 1, 'position' => 400, 'default' => 1, 'arrayofkeyval' => array(1 => 'InternalWarehouse', 2 => 'ExternalWarehouse')), //'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000), //'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>1010), 'statut' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 500, 'css' => 'minwidth50'), @@ -195,13 +195,20 @@ class Entrepot extends CommonObject /** * Warehouse open and only operations for stock transfers/corrections allowed (not for customer shipping and supplier dispatch). + * Used when ENTREPOT_EXTRA_STATUS is on; */ const STATUS_OPEN_INTERNAL = 2; + + /** + * Warehouse that must be include for stock calculation (default) + */ + const USAGE_INTERNAL = 1; + /** - * Warehouse open and any operations are allowed, but warehouse is not included into calculation of stock. + * Warehouse that must be excluded for stock calculation (scrapping stock, virtual warehouses, ...) */ - const STATUS_OPENEXT_ALL = 3; // TODO Implement this + const USAGE_EXTTERNAL = 2; From 6c02ba9f9209f61c1262a2b1f0509babb79e111d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 12:19:34 +0200 Subject: [PATCH 22/98] Doc --- htdocs/install/mysql/tables/llx_entrepot.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql index 3c2cff0f3a020..99487c5cb1222 100644 --- a/htdocs/install/mysql/tables/llx_entrepot.sql +++ b/htdocs/install/mysql/tables/llx_entrepot.sql @@ -38,7 +38,7 @@ create table llx_entrepot barcode varchar(180) DEFAULT NULL, -- barcode fk_barcode_type integer DEFAULT NULL, -- barcode type warehouse_usage integer DEFAULT 1, -- 1=internal, 2=external (virtual warehouse or stock out of company). Need STOCK_USE_WAREHOUSE_USAGE opton. - statut tinyint DEFAULT 1, -- 1 open, 0 close + statut tinyint DEFAULT 1, -- 1 open, 0 close. If option ENTREPOT_EXTRA_STATUS is set, value 2 means open for internal move only/close for external mode. fk_user_author integer, model_pdf varchar(255), import_key varchar(14), From 6031f8437bbb97b9f3547afdba4ce3c6f3781696 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sun, 30 Jun 2024 12:36:59 +0200 Subject: [PATCH 23/98] FIX: pos: invoice date incorrectly set beacause of timezome mismatches (reverts #36e91da) (#30184) --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 64688ef537a89..6b98c197df72c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -473,7 +473,7 @@ function fail($message) // If we add a line and no invoice yet, we create the invoice if (($action == "addline" || $action == "freezone") && $placeid == 0) { $invoice->socid = getDolGlobalString($constforcompanyid); - $invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved. + $invoice->date = dol_now(); // Invoice::create() needs a GMT timestamp $invoice->module_source = 'takepos'; $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity; From a51e71941bd064ac112e19e6aac340540a4a9f71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 14:52:27 +0200 Subject: [PATCH 24/98] Fix syntax error --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index b68bfaa1da92f..87f4b22fc3f4f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -871,7 +871,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove // Preview of attachment $out .= img_mime($listofnames[$key]).$listofnames[$key]; - $out .= ' '.$formfile->showPreview(array(), $formfile_params[2], $formfile_params[4], 0, ($entity == 1 ? '' : 'entity='.((int) $entity)); + $out .= ' '.$formfile->showPreview(array(), $formfile_params[2], $formfile_params[4], 0, ($entity == 1 ? '' : 'entity='.((int) $entity))); if (!$this->withfilereadonly) { $out .= ' '; //$out.= ' '.img_delete($langs->trans("Remove"), 'id="removedfile_'.$key.'" name="removedfile_'.$key.'"', 'removedfile input-nobottom').''; From a967f948507e8e64f8ca1faffd48f248209a14b6 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sun, 30 Jun 2024 15:01:19 +0200 Subject: [PATCH 25/98] FIX force rounding mode 0 for expense report (#30191) --- htdocs/core/class/commonobject.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2259634973a2e..2a561f1404a3a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3855,6 +3855,12 @@ public function update_price($exclspec = 0, $roundingadjust = 'auto', $nodatabas $fieldup = 'pu_ht'; } if ($this->element == 'expensereport') { + // force rounding mode to 1 + // otherwise when you set MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 + // you have 2 lines with same TTC amounts (6,2 Unit price TTC and VAT rate 20%) + // on the first line you got 5,17 on HT total + // when you got 5,16 on HT total and 1,04 on VAT total to get 6,20 on TTT total (see #30051) + $forcedroundingmode = '0'; $fieldup = 'value_unit'; $base_price_type = 'TTC'; } From 9f54e7f3899e1730203440c32ea15f9bb2761ee3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:01:29 +0200 Subject: [PATCH 26/98] doc --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2259634973a2e..4608b5171d4c3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3901,7 +3901,7 @@ public function update_price($exclspec = 0, $roundingadjust = 'auto', $nodatabas while ($i < $num) { $obj = $this->db->fetch_object($resql); - // Note: There is no check on detail line and no check on total, if $forcedroundingmode = 'none' + // Note: There is no check on detail line and no check on total, if $forcedroundingmode = '0' $parameters = array('fk_element' => $obj->rowid); $reshook = $hookmanager->executeHooks('changeRoundingMode', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks From 4dfef24f2fed6f45954962ad7af16e8b9ca0fa34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:03:52 +0200 Subject: [PATCH 27/98] Doc --- htdocs/core/class/commonobject.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 22667bcd6bd10..a30a3b6ea5190 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3855,11 +3855,9 @@ public function update_price($exclspec = 0, $roundingadjust = 'auto', $nodatabas $fieldup = 'pu_ht'; } if ($this->element == 'expensereport') { - // force rounding mode to 1 - // otherwise when you set MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 - // you have 2 lines with same TTC amounts (6,2 Unit price TTC and VAT rate 20%) - // on the first line you got 5,17 on HT total - // when you got 5,16 on HT total and 1,04 on VAT total to get 6,20 on TTT total (see #30051) + // Force rounding mode to '0', otherwise when you set MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1, you may have lines with different totals. + // For example, if you have 2 lines with same TTC amounts (6,2 Unit price TTC and VAT rate 20%), on the first line you got 5,17 on HT total + // and 5,16 on HT total and 1,04 on VAT total to get 6,20 on TTT total on second line (see #30051). $forcedroundingmode = '0'; $fieldup = 'value_unit'; $base_price_type = 'TTC'; From 3d1cf7920604bd698f961de03f6c361ba8e780f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:05:50 +0200 Subject: [PATCH 28/98] Typo --- htdocs/langs/en_US/eventorganization.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index f0ea1354e7230..3c881e7555738 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -114,7 +114,7 @@ EventType = Event type LabelOfBooth=Booth label LabelOfconference=Conference label ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet -EventRegistrationAreClosed=Event registration are closed +EventRegistrationAreClosed=Event registrations are closed DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s MaxNbOfAttendeesReached=The maximum number of participants has been reached From e025c543f7d9e46397005be5d20f29f89968deae Mon Sep 17 00:00:00 2001 From: Christian Humpel <78662388+Humml87@users.noreply.github.com> Date: Sun, 30 Jun 2024 15:11:57 +0200 Subject: [PATCH 29/98] Fix: Api MRP ProduceAndConsume if MoLine option "disable_stock_change" is true (#30181) * Fix: Api MRP ProduceAndConsume if MoLine option "disable_stock_change" is true. * fix typo --- htdocs/mrp/class/api_mos.class.php | 50 ++++++++++++++++-------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 8b8dc404fefb8..ac2c2e6c03952 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -681,7 +681,7 @@ public function produceAndConsumeAll($id, $request_data = null) * { * "objectid": "123", -- rowid of MoLine * "qty": "2", - * "fk_warehouse": "789" + * "fk_warehouse": "789" -- "0" or empty, if stock change is disabled. * } * ], * "arraytoproduce": [ @@ -785,12 +785,14 @@ public function produceAndConsume($id, $request_data = null) } $qtytoprocess = $value["qty"]; - if (isset($value["fk_warehouse"])) { // If there is a warehouse to set - if (!($value["fk_warehouse"] > 0)) { // If there is no warehouse set. - throw new RestException(500, "Field fk_warehouse required in " . $arrayname); + if ($molinetoprocess->disable_stock_change == false) { + if (isset($value["fk_warehouse"])) { // If there is a warehouse to set + if (!($value["fk_warehouse"] > 0)) { // If there is no warehouse set. + throw new RestException(500, "Field fk_warehouse required in " . $arrayname); + } } + $fk_warehousetoprocess = $value["fk_warehouse"]; } - $fk_warehousetoprocess = $value["fk_warehouse"]; $pricetoproduce = 0; if (isset($value["pricetoproduce"])) { // If there is a price to produce set. @@ -802,37 +804,39 @@ public function produceAndConsume($id, $request_data = null) $pos = 0; $idstockmove = 0; - // Record stock movement - $id_product_batch = 0; - $stockmove->origin_type = 'mo'; - $stockmove->origin_id = $this->mo->id; - if ($arrayname == "arraytoconsume") { - if ($qtytoprocess >= 0) { - $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + if ($molinetoprocess->disable_stock_change == false) { + // Record stock movement + $id_product_batch = 0; + $stockmove->origin_type = 'mo'; + $stockmove->origin_id = $this->mo->id; + if ($arrayname == "arraytoconsume") { + if ($qtytoprocess >= 0) { + $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } else { + $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } } else { - $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + if ($qtytoprocess >= 0) { + $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, $pricetoproduce, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } else { + $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } } - } else { - if ($qtytoprocess >= 0) { - $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, $pricetoproduce, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); - } else { - $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $molinetoprocess->fk_product, $fk_warehousetoprocess, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + if ($idstockmove <= 0) { + throw new RestException(500, $stockmove->error); } } - if ($idstockmove <= 0) { - throw new RestException(500, $stockmove->error); - } // Record consumption $moline = new MoLine($this->db); $moline->fk_mo = $this->mo->id; $moline->position = $pos; $moline->fk_product = $tmpproduct->id; - $moline->fk_warehouse = $fk_warehousetoprocess; + $moline->fk_warehouse = $idstockmove > 0 ? $fk_warehousetoprocess : null; $moline->qty = $qtytoprocess; $moline->batch = ''; $moline->fk_mrp_production = $molinetoprocess->id; - $moline->fk_stock_movement = $idstockmove; + $moline->fk_stock_movement = $idstockmove > 0 ? $idstockmove : null; $moline->fk_user_creat = DolibarrApiAccess::$user->id; if ($arrayname == "arraytoconsume") { From 3f8a5cd3a58b18e56be1b99db18720f2c5d8788e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:16:13 +0200 Subject: [PATCH 30/98] Ignore spellcheck --- dev/tools/codespell/codespell-ignore.txt | 2 ++ dev/tools/codespell/codespell-lines-ignore.txt | 15 --------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index c7d468951b68a..ce94b38e2fdd6 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -5,6 +5,8 @@ provid # PostgreSQL postgresql +# Name of contributores +noe # Inside email ba blacklist diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 83085c5c99f60..9029f7b01622d 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -282,21 +282,6 @@ * @param string[] $TWeek array of week numbers * @param string[] $TWeek array of week numbers (week 1 must be '01') * @param array $TWeek Array of week numbers - * Copyright (C) 2019 Tim Otte - * Copyright (C) 2019 Tim Otte - * Copyright (C) 2019 Tim Otte - * Copyright (C) 2020 Thibault FOUCART - * Copyright (C) 2020-2021 Udo Tamm - * Copyright (C) 2021 Noé Cendrier - * Copyright (C) 2021 Noé Cendrier - * Copyright (C) 2021 Noé Cendrier - * Copyright (C) 2021 Noé Cendrier - * Copyright (C) 2022 Udo Tamm - * Copyright (C) 2022 Udo Tamm - * Copyright (C) 2022-2023 Udo Tamm - * Copyright (C) 2023 Udo Tamm - * Copyright (C) 2024 Noé Cendrier - * add german links 2020 Udo Tamm $TFirstDays = getFirstDayOfEachWeek($TWeek, $year); $TFirstDays[reset($TWeek)] = '01'; //first day of month $TLastDays = getLastDayOfEachWeek($TWeek, $year); From d2318c6874faa223dfd9df0fa25edc7d6ce9d422 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:17:59 +0200 Subject: [PATCH 31/98] Test --- dev/tools/codespell/codespell-ignore.txt | 1 + htdocs/admin/ticket.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index ce94b38e2fdd6..66c2ca5e6344e 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -7,6 +7,7 @@ postgresql # Name of contributores noe +udo # Inside email ba blacklist diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index f85e3c1028674..86e723de58522 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -23,7 +23,7 @@ /** * \file htdocs/admin/ticket.php * \ingroup ticket - * \brief Page to setup module ticket + * \brief Page to setup the module ticket */ // Load Dolibarr environment From 10ecc23df9c83bb8e362db058b79385c2bdb854c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:20:08 +0200 Subject: [PATCH 32/98] Exclude contributor name from spellcheck --- dev/tools/codespell/codespell-ignore.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 66c2ca5e6344e..6fc432481d11d 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -7,7 +7,8 @@ postgresql # Name of contributores noe -udo +Udo +Tim # Inside email ba blacklist From 4ba6b0d2f032b45465020a8aca3452e8970904bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:26:31 +0200 Subject: [PATCH 33/98] Clean language --- dev/tools/codespell/codespell-ignore.txt | 12 +++++++++++- .../prelevement/class/bonprelevement.class.php | 2 +- .../class/commonstickergenerator.class.php | 18 +++++++++--------- .../expensereport/doc/pdf_standard.modules.php | 15 --------------- htdocs/install/mysql/tables/llx_const.sql | 6 +++--- 5 files changed, 24 insertions(+), 29 deletions(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 6fc432481d11d..fde71bfed923e 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -1,7 +1,9 @@ # List of words codespell will ignore # one per line, case-sensitive (when not lowercase) + # PROVid provid + # PostgreSQL postgresql @@ -9,6 +11,7 @@ postgresql noe Udo Tim + # Inside email ba blacklist @@ -36,28 +39,35 @@ thead ue whitelist ws + # Thirdparty should be Third party or Third-party but ignoring it because it's omnipresent thirdparty + # Code string ect tempdate sav files' + # Used as array key seeked tweek + # Used as key marge + # moral (var name) mor + # Strings used as keys for translation uptodate reenable + # Function - rename to devalidate ? unvalidate + # Some french strings somme -caracteres cas sur Datas diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 677c71d31dee7..0ff56583c744b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -2342,7 +2342,7 @@ public function EnregEmetteur($type = 'direct-debit') fwrite($this->file, substr($this->raison_sociale . " ", 0, 24)); - // Reference de la remise creancier D1 sur 7 caracteres + // Ref of thirdparty on 7 characters fwrite($this->file, substr($this->reference_remise . " ", 0, 7)); diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 9e32529e9b19b..76ca7efff3bf7 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -85,15 +85,15 @@ abstract class CommonStickerGenerator extends CommonDocGenerator protected $_Y_Space = 0; // NX Nombre d'etiquettes sur la largeur de la page protected $_X_Number = 0; - // NY Nombre d'etiquettes sur la hauteur de la page + // NY Number of labels on the height of a page protected $_Y_Number = 0; - // Largeur de chaque etiquette + // width of label protected $_Width = 0; - // Hauteur de chaque etiquette + // Height of label protected $_Height = 0; - // Hauteur des caracteres + // Height of characters protected $_Char_Size = 10; - // Hauteur par default d'une ligne + // Height by default of a line protected $_Line_Height = 10; // Type of metric.. Will help to calculate good values protected $_Metric = 'mm'; @@ -145,11 +145,11 @@ abstract public function addSticker(&$pdf, $outputlangs, $param); // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Methode qui permet de modifier la taille des caracteres - * Cela modiera aussi l'espace entre chaque ligne + * Method to modify the size of characters + * This will also modify the space between lines * - * @param TCPDF $pdf PDF reference - * @param int $pt point + * @param TCPDF $pdf PDF reference + * @param int $pt Point * @return void */ public function Set_Char_Size(&$pdf, $pt) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 8b6233c40dc86..16fc1284e34f7 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -411,21 +411,6 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - //$nblineFollowComment = 1; - // Search number of lines coming to know if there is enough room - // if ($i < ($nblines - 1)) // If it's not last line - // { - // //Fetch current description to know on which line the next one should be placed - // $follow_comment = $object->lines[$i]->comments; - // $follow_type = $object->lines[$i]->type_fees_code; - - // //on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres) - // $nbLineCommentNeed = dol_nboflines_bis($follow_comment,52,$outputlangs->charset_output); - // $nbLineTypeNeed = dol_nboflines_bis($follow_type,4,$outputlangs->charset_output); - - // $nblineFollowComment = max($nbLineCommentNeed, $nbLineTypeNeed); - // } - //$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Add space between lines $nexY += ($pdf->getFontSize() * 1.3); // Add space between lines diff --git a/htdocs/install/mysql/tables/llx_const.sql b/htdocs/install/mysql/tables/llx_const.sql index 96594bb60b4a2..7ca1946808ecd 100644 --- a/htdocs/install/mysql/tables/llx_const.sql +++ b/htdocs/install/mysql/tables/llx_const.sql @@ -28,14 +28,14 @@ create table llx_const rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id - value text NOT NULL, -- max 65535 caracteres - type varchar(64) DEFAULT 'string', -- null or 'encrypted' if param has been encrypted + value text NOT NULL, -- max 65535 characters + type varchar(64) DEFAULT 'string', -- null or 'encrypted' if param has been encrypted visible tinyint DEFAULT 1 NOT NULL, note text, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=innodb; --- +-- -- List of codes for the field entity -- -- 0 : common constant From b833e0c9ef712d40c066d2b7fd48a6a5179ff439 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:28:00 +0200 Subject: [PATCH 34/98] Fix typo --- htdocs/admin/notification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 276ee1daa05c6..d6b2b267c3ce3 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Bahfir Abbes - * Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * Copyright (C) 2022 Anthony Berton * * This program is free software; you can redistribute it and/or modify From b532e3b0a33cfbd630b985a0cf8bd7b3420c0b98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:32:18 +0200 Subject: [PATCH 35/98] Test --- dev/tools/codespell/codespell-ignore.txt | 4 ++-- htdocs/fourn/facture/paiement.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index fde71bfed923e..afd92cfec61f1 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -9,8 +9,8 @@ postgresql # Name of contributores noe -Udo -Tim +udo +tim # Inside email ba diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 377dd9a34cad3..e2f2a99836d9a 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -32,7 +32,7 @@ /** * \file htdocs/fourn/facture/paiement.php * \ingroup fournisseur,facture - * \brief Payment page for supplier invoices + * \brief Payment page for supplier/purchase invoices */ // Load Dolibarr environment From 0d4452bad2943cb3fc32673e34bcb1313ec5f449 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:40:19 +0200 Subject: [PATCH 36/98] Clean code --- htdocs/core/class/discount.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 29e663f4e278d..a126258d3a482 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -232,7 +232,7 @@ public function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_sourc */ public function create($user) { - global $conf, $langs; + global $conf; // Clean parameters $this->amount_ht = price2num($this->amount_ht); @@ -372,6 +372,7 @@ public function delete($user) $sql .= " AND fk_invoice_supplier IS NULL)"; // Not used as credit note and not used as deposit dol_syslog(get_class($this)."::delete Delete discount", LOG_DEBUG); + require_once DOL_DOCUMENT_ROOT. '/core/class/commoninvoice.class.php'; $result = $this->db->query($sql); if ($result) { @@ -741,7 +742,6 @@ public function getNomUrl($withpicto, $option = 'invoice') */ public function initAsSpecimen() { - $this->fk_soc = 1; $this->socid = 1; $this->amount_ht = 10; $this->amount_tva = 1.96; From fd501a56056bda98db9418321a26ec36c0ec0fcf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jun 2024 15:59:51 +0200 Subject: [PATCH 37/98] Doc --- ChangeLog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5a318f78619b2..2777680bc0f3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,27 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 21.0.0 compared to 20.0 ***** + +For users: +---------- + + + +For developers: +--------------- + + + +WARNING: +-------- + +The following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Prepare your module for deprecation of triggers code XXX_INSERT to support also XXX_CREATE. +* More class properties (with old name in french) are now deprecated in favor of the property name in english. + + + ***** ChangeLog for 20.0.0 compared to 19.0 ***** For users: From e32bd4db1e69df51b4d9e382fd00feef91ae5479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 19:36:23 +0200 Subject: [PATCH 38/98] add missing token (#30207) --- htdocs/admin/mails.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index bdf459ea83dcf..c1d953db125ef 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -1,9 +1,10 @@ - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2016 Jonathan TISSEAU - * Copyright (C) 2023 Anthony Berton +/* Copyright (C) 2007-2020 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2016 Jonathan TISSEAU + * Copyright (C) 2023 Anthony Berton + * Copyright (C) 2024 Frédéric France * * 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 @@ -981,16 +982,16 @@ function change_smtp_auth_method() { if (!getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') != 'mail' || !$linuxlike) { if (function_exists('fsockopen') && $port && $server) { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } } else { //print ''.$langs->trans("DoTestServerAvailability").''; } - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; if (isModEnabled('fckeditor')) { - print ''.$langs->trans("DoTestSendHTML").''; + print ''.$langs->trans("DoTestSendHTML").''; } } From 977e7a18e2faa14c5ce2617af107d79f71489d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 19:38:43 +0200 Subject: [PATCH 39/98] fix phpstan for 20.0 (#30205) --- .../stock/stocktransfer/class/stocktransfer.class.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index dad116c1d0e22..463b65ad54870 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -52,17 +52,6 @@ class StockTransfer extends CommonObject */ public $table_element_line = 'stocktransfer_stocktransferline'; - /** - * @var int Does this object support multicompany module ? - * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table - */ - public $ismultientitymanaged = 0; - - /** - * @var int Does object support extrafields ? 0=No, 1=Yes - */ - public $isextrafieldmanaged = 1; - /** * @var string Field with ID of parent key if this object has a parent */ From 4b275dc148e1343c6b0f9e83bd22ed4ab0fa8f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 19:39:01 +0200 Subject: [PATCH 40/98] add phpdoc (#30208) * add phpdoc * add phpdoc * add phpdoc * add phpdoc * clean phpdoc --- .../accountancy/class/bookkeeping.class.php | 20 ------ htdocs/asset/class/asset.class.php | 1 - htdocs/asset/class/assetmodel.class.php | 1 - htdocs/bom/class/bom.class.php | 5 -- htdocs/bookcal/class/availabilities.class.php | 1 - htdocs/bookcal/class/calendar.class.php | 1 - htdocs/comm/mailing/class/mailing.class.php | 10 --- htdocs/comm/propal/class/propal.class.php | 5 -- .../cashcontrol/class/cashcontrol.class.php | 9 --- .../sociales/class/chargesociales.class.php | 15 ---- htdocs/contrat/class/contrat.class.php | 15 ---- htdocs/core/class/commonobject.class.php | 10 +-- .../core/class/emailsenderprofile.class.php | 5 -- htdocs/delivery/class/delivery.class.php | 5 -- .../class/emailcollector.class.php | 5 -- .../class/emailcollectoraction.class.php | 5 -- .../class/emailcollectorfilter.class.php | 5 -- .../class/conferenceorboothattendee.class.php | 1 - htdocs/expedition/class/expedition.class.php | 5 -- .../class/fournisseur.commande.class.php | 5 -- .../class/fournisseur.facture-rec.class.php | 2 - htdocs/hrm/class/evaluation.class.php | 1 - htdocs/hrm/class/evaluationdet.class.php | 1 - htdocs/hrm/class/job.class.php | 1 - htdocs/hrm/class/position.class.php | 1 - htdocs/hrm/class/skill.class.php | 1 - htdocs/hrm/class/skillrank.class.php | 1 - .../class/knowledgerecord.class.php | 1 - htdocs/loan/class/loan.class.php | 15 ---- .../template/class/myobject.class.php | 5 -- htdocs/mrp/class/mo.class.php | 6 -- .../partnership/class/partnership.class.php | 1 - htdocs/product/class/product.class.php | 10 --- .../inventory/class/inventory.class.php | 10 --- .../stock/class/mouvementstock.class.php | 18 ++++- .../class/stocktransfer.class.php | 68 +++++++++++-------- .../stocktransfer/stocktransfer_card.php | 10 +-- htdocs/reception/class/reception.class.php | 5 -- .../class/recruitmentcandidature.class.php | 3 - .../class/recruitmentjobposition.class.php | 1 - htdocs/societe/class/societe.class.php | 14 ---- htdocs/societe/class/societeaccount.class.php | 5 -- .../class/supplier_proposal.class.php | 11 --- htdocs/ticket/class/cticketcategory.class.php | 5 -- htdocs/webhook/class/target.class.php | 1 - .../class/webportalpartnership.class.php | 3 - htdocs/website/class/website.class.php | 10 --- htdocs/website/class/websitepage.class.php | 10 --- .../workstation/class/workstation.class.php | 5 -- htdocs/zapier/class/hook.class.php | 5 -- 50 files changed, 68 insertions(+), 291 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2085243b89101..2e76e68de62c0 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -184,11 +184,6 @@ class BookKeeping extends CommonObject */ public $linesexport = array(); - /** - * @var integer|string date of movement validated & lock - */ - public $date_validation; - /** * @var integer|string date of movement who are noticed like exported */ @@ -3164,26 +3159,11 @@ class BookKeepingLine extends CommonObjectLine */ public $piece_num; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string $date_modification; - */ - public $date_modification; - /** * @var integer|string $date_export; */ public $date_export; - /** - * @var integer|string $date_validation; - */ - public $date_validation; - /** * @var integer|string $date_lim_reglement; */ diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 6e15a35a283c4..1d8d0d04ce18b 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -138,7 +138,6 @@ class Asset extends CommonObject public $supplier_invoice_id; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $last_main_doc; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 0e457761f9d2e..5faaa71b710b1 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -111,7 +111,6 @@ class AssetModel extends CommonObject public $asset_type; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $last_main_doc; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 1099a9d0ff700..b7eaba7420955 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -154,11 +154,6 @@ class BOM extends CommonObject */ public $description; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var integer|string date_valid */ diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 7a93c574f9fe7..355485b9e9fec 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -129,7 +129,6 @@ class Availabilities extends CommonObject public $description; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $last_main_doc; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 7759ad8919e55..09c6287b6b540 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -133,7 +133,6 @@ class Calendar extends CommonObject public $description; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $import_key; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 8bda4d4ed1877..519373f9f9203 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -138,16 +138,6 @@ class Mailing extends CommonObject */ public $joined_file4; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var int date validate - */ - public $date_validation; - /** * @var int|null date sending */ diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 3547fc205a089..e60effb1ba364 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -149,11 +149,6 @@ class Propal extends CommonObject */ public $datec; - /** - * @var integer|'' $date_creation; - */ - public $date_creation; - /** * @deprecated * @see $date_validation diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index f4f8970dc8dc7..9621224c0c4c2 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -110,17 +110,8 @@ class CashControl extends CommonObject public $cheque; public $card; - /** - * @var integer|string date_creation - */ - public $date_creation; public $fk_user_creat; - /** - * @var integer|string $date_modification - */ - public $date_modification; - /** * @var integer|string $date_valid */ diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 65c070e076a14..78a2f180dd6b3 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -74,21 +74,6 @@ class ChargeSociales extends CommonObject public $periode; public $period; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string $date_modification - */ - public $date_modification; - - /** - * @var integer|string $date_validation - */ - public $date_validation; - /** * @deprecated Use label instead */ diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 633034c27f447..ffa89264f8725 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -153,21 +153,6 @@ class Contrat extends CommonObject */ public $user_cloture; - /** - * @var integer|string Date of creation - */ - public $date_creation; - - /** - * @var integer|string Date of last modification. Not filled until you call ->info() - */ - public $date_modification; - - /** - * @var integer|string Date of validation - */ - public $date_validation; - /** * @var integer|string Date when contract was signed */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a30a3b6ea5190..f1ee8051c7624 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -655,17 +655,17 @@ abstract class CommonObject // Dates /** - * @var integer|string|null Object creation date + * @var integer|''|null Object creation date */ public $date_creation; /** - * @var integer|string|null Object last validation date + * @var integer|''|null Object last validation date */ public $date_validation; /** - * @var integer|string|null Object last modification date + * @var integer|''|null Object last modification date */ public $date_modification; @@ -677,14 +677,14 @@ abstract class CommonObject public $tms; /** - * @var int|string|null + * @var int|''|null * @deprecated Use $date_modification instead. * @see $date_modification */ private $date_update; /** - * @var integer|string|null Object closing date + * @var integer|''|null Object closing date */ public $date_cloture; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index e2b85f3e79c54..668a3fa1e7687 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -116,11 +116,6 @@ class EmailSenderProfile extends CommonObject public $email; - /** - * @var integer|string date_creation - */ - public $date_creation; - public $private; public $signature; public $position; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 345ab2cce7977..8894b2ff420bd 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -93,11 +93,6 @@ class Delivery extends CommonObject */ public $date_delivery; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var integer|string date_valid */ diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index edfa9909d3a69..4139a23a52ef4 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -178,11 +178,6 @@ class EmailCollector extends CommonObject */ public $status; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var int ID */ diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index d0e0e80ad2817..0f94f355175c1 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -89,11 +89,6 @@ class EmailCollectorAction extends CommonObject public $type; public $actionparam; - /** - * @var integer|string date_creation - */ - public $date_creation; - public $fk_user_creat; public $fk_user_modif; public $position; diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index c5f0b3b981540..1d5913a2dc9f5 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -90,11 +90,6 @@ class EmailCollectorFilter extends CommonObject public $type; public $rulevalue; - /** - * @var integer|string date_creation - */ - public $date_creation; - public $fk_user_creat; public $fk_user_modif; public $import_key; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b7632a2f4047f..231f7c733f03d 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -130,7 +130,6 @@ class ConferenceOrBoothAttendee extends CommonObject public $amount; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $last_main_doc; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 6f140ec0b5914..70faf74ad626a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -181,11 +181,6 @@ class Expedition extends CommonObject */ public $date_shipping; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var integer|string date_valid */ diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 600e47fb86ac7..aff021633ffd0 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -138,11 +138,6 @@ class CommandeFournisseur extends CommonOrder */ public $date; - /** - * @var int Date of the purchase order creation - */ - public $date_creation; - /** * @var int Date of the purchase order validation */ diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 6de584c44031a..2b371543150e4 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -164,8 +164,6 @@ class FactureFournisseurRec extends CommonInvoice /* Override fields in CommonObject public $entity; - public $date_creation; - public $date_modification; public $total_ht; public $total_tva; public $total_ttc; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index be26c8531992c..1822ac9201f74 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -117,7 +117,6 @@ class Evaluation extends CommonObject public $description; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $import_key; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 6c6bbfdc15969..db331a97d16ca 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -116,7 +116,6 @@ class EvaluationLine extends CommonObjectLine 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,), ); public $rowid; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $fk_skill; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 72e83fffbd114..b4be3b78db39c 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -108,7 +108,6 @@ class Job extends CommonObject public $ref; public $label; public $description; - public $date_creation; public $deplacement; public $fk_user_creat; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 7d257e5d41c80..b0320806d4e9a 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -111,7 +111,6 @@ class Position extends CommonObject public $rowid; public $ref; public $description; - public $date_creation; public $fk_contrat; public $fk_user; public $fk_job; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 659de91bb318f..227bc399beee2 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -115,7 +115,6 @@ class Skill extends CommonObject public $rowid; public $label; public $description; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $required_level; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 3f647aff86322..9deb22d9d60b2 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -110,7 +110,6 @@ class SkillRank extends CommonObject public $fk_skill; public $rank; public $fk_object; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $objecttype; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index cd89f83ccace9..4fbdade785058 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -112,7 +112,6 @@ class KnowledgeRecord extends CommonObject public $rowid; public $ref; public $entity; - public $date_creation; public $last_main_doc; public $fk_user_creat; public $fk_user_modif; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 3807e9caa5a20..f3834c443565f 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -70,21 +70,6 @@ class Loan extends CommonObject public $accountancy_account_insurance; public $accountancy_account_interest; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string date_modification - */ - public $date_modification; - - /** - * @var integer|string date_validation - */ - public $date_validation; - public $insurance_amount; /** diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index c0885aa4a2ee4..215811738717a 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -169,11 +169,6 @@ class MyObject extends CommonObject */ public $status; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var int ID */ diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 565339953d228..38ab5e1d7b314 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -140,11 +140,6 @@ class Mo extends CommonObject */ public $note_private; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var integer|string date_validation */ @@ -2101,7 +2096,6 @@ class MoLine extends CommonObjectLine public $role; public $fk_mrp_production; public $fk_stock_movement; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $import_key; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 0355ae0e9e882..2c326d529038a 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -125,7 +125,6 @@ class Partnership extends CommonObject public $fk_type; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $last_main_doc; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8fa39941e4ffa..137c9e3d33297 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -461,16 +461,6 @@ class Product extends CommonObject public $imgWidth; public $imgHeight; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string date_modification - */ - public $date_modification; - //! Id du fournisseur public $product_fourn_id; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index c1c7772f37a3d..b1a7860a1f1f2 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -144,16 +144,6 @@ class Inventory extends CommonObject */ public $status; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string date_validation - */ - public $date_validation; - /** * @var int ID */ diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 1c74f32d5531e..1c21110d1ccb9 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -75,6 +75,9 @@ class MouvementStock extends CommonObject */ public $type; + /** + * @var null|int|'' datem date + */ public $datem = ''; public $price; @@ -114,14 +117,27 @@ class MouvementStock extends CommonObject public $line_id_oject_src; public $line_id_oject_origin; - + /** + * @var string inventory code + */ public $inventorycode; + + /** + * @var string batch reference + */ public $batch; public $line_id_object_src; public $line_id_object_origin; + /** + * @var null|int|'' eatby date + */ public $eatby; + + /** + * @var null|int|'' sellby date + */ public $sellby; diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index dad116c1d0e22..fc5182409baf4 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -1,8 +1,8 @@ * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -53,18 +53,7 @@ class StockTransfer extends CommonObject public $table_element_line = 'stocktransfer_stocktransferline'; /** - * @var int Does this object support multicompany module ? - * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table - */ - public $ismultientitymanaged = 0; - - /** - * @var int Does object support extrafields ? 0=No, 1=Yes - */ - public $isextrafieldmanaged = 1; - - /** - * @var string Field with ID of parent key if this object has a parent + * @var string Field name which stores ID of parent key if this object has a parent */ public $fk_element = 'fk_stocktransfer'; @@ -87,16 +76,34 @@ class StockTransfer extends CommonObject */ public $ref_customer; - /** * @var string String with name of icon for stocktransfer. Must be the part after the 'object_' into object_stocktransfer.png */ public $picto = 'stock'; + /** + * @var null|int|'' outgoing date (sql date) + */ public $date_prevue_depart; + + /** + * @var null|int|'' incoming date (sql date) + */ public $date_prevue_arrivee; + + /** + * @var null|int|'' effective outgoing date (sql date) + */ public $date_reelle_depart; + + /** + * @var null|int|'' effective incoming date (sql date) + */ public $date_reelle_arrivee; + + /** + * @var string origin type + */ public $origin_type; @@ -165,18 +172,19 @@ class StockTransfer extends CommonObject public $rowid; public $ref; public $label; - public $socid; - public $fk_soc; // deprecated - public $fk_project; public $description; - public $note_public; - public $note_private; - public $date_creation; + + /** + * @var int ID of thirparty + */ + public $socid; + + /** + * @var int ID of thirparty + * @deprecated + */ + public $fk_soc; public $lead_time_for_warning; - public $fk_user_creat; - public $fk_user_modif; - public $import_key; - public $model_pdf; public $status; /** @@ -184,7 +192,14 @@ class StockTransfer extends CommonObject */ public $lines; + /** + * @var int ID of warehouse source + */ public $fk_warehouse_source; + + /** + * @var int ID of warehouse destination + */ public $fk_warehouse_destination; // END MODULEBUILDER PROPERTIES @@ -316,8 +331,7 @@ public function createFromClone(User $user, $fromid) $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 15ccc7da44851..40d143ac4d736 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -1,7 +1,7 @@ - * Copyright (C) ---Put here your own copyright and developer email--- - * Copyright (C) 2024 MDW +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -297,7 +297,7 @@ if (empty($error)) { $object->setStatut($object::STATUS_TRANSFERED, $id); $object->status = $object::STATUS_TRANSFERED; - $object->date_reelle_depart = date('Y-m-d'); + $object->date_reelle_depart = dol_now(); $object->update($user); setEventMessage('StockStransferDecremented'); } @@ -351,7 +351,7 @@ if (empty($error)) { $object->setStatut($object::STATUS_CLOSED, $id); $object->status = $object::STATUS_CLOSED; - $object->date_reelle_arrivee = date('Y-m-d'); + $object->date_reelle_arrivee = dol_now(); $object->update($user); setEventMessage('StockStransferIncrementedShort'); } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ed7f393d56e37..d07fe14075416 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -111,11 +111,6 @@ class Reception extends CommonObject */ public $date_reception; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var integer|string date_validation */ diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 7fa4a473d5c72..20c93e62c432a 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -130,9 +130,6 @@ class RecruitmentCandidature extends CommonObject public $ref; public $fk_recruitmentjobposition; public $description; - public $note_public; - public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $fk_user; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 6b2223d4982eb..43e7f4cf9c399 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -175,7 +175,6 @@ class RecruitmentJobPosition extends CommonObject public $description; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $last_main_doc; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4fa68a62c2c57..14893c241351e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -561,14 +561,6 @@ class Societe extends CommonObject */ public $name_bis; - //Log data - - /** - * Date of last update - * @var integer|string - */ - public $date_modification; - /** * User that made last update * @var User @@ -576,12 +568,6 @@ class Societe extends CommonObject */ public $user_modification; - /** - * Date of creation - * @var integer|string - */ - public $date_creation; - /** * User that created the thirdparty * @var User diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 5be7b51d847bd..24526d5037083 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -153,11 +153,6 @@ class SocieteAccount extends CommonObject public $date_previous_login; public $note_private; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var int ID */ diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 73807ea617dee..8fb7061c0c9fd 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -124,23 +124,12 @@ class SupplierProposal extends CommonObject */ public $datec; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @deprecated * @see $date_validation */ public $datev; - /** - * @var integer|string date_validation - */ - public $date_validation; - - public $user_author_id; /** diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 617dbcbeceb34..56a5bb4bb610e 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -133,11 +133,6 @@ class CTicketCategory extends CommonObject */ public $status; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var int ID */ diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index cd97896dac50c..a0351bf99ebb9 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -114,7 +114,6 @@ class Target extends CommonObject public $description; public $note_public; public $note_private; - public $date_creation; public $fk_user_creat; public $fk_user_modif; public $import_key; diff --git a/htdocs/webportal/class/webportalpartnership.class.php b/htdocs/webportal/class/webportalpartnership.class.php index e6ed01916d038..e7bdc7033d331 100644 --- a/htdocs/webportal/class/webportalpartnership.class.php +++ b/htdocs/webportal/class/webportalpartnership.class.php @@ -125,9 +125,6 @@ class WebPortalPartnership extends Partnership //public $ref; //public $entity; //public $fk_type; - //public $note_public; - //public $note_private; - //public $date_creation; //public $fk_user_creat; //public $fk_user_modif; //public $last_main_doc; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index dd3d8eb48df68..ab436589eebcc 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -84,16 +84,6 @@ class Website extends CommonObject */ public $status; - /** - * @var integer date_creation - */ - public $date_creation; - - /** - * @var integer date_modification - */ - public $date_modification; - /** * @var integer Default home page */ diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index b631ac199ed1e..3bb31c456b3b1 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -105,16 +105,6 @@ class WebsitePage extends CommonObject */ public $status; - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string date_modification - */ - public $date_modification; - public $fk_user_creat; public $fk_user_modif; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 57326018dc723..9cdc0b530407f 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -137,11 +137,6 @@ class Workstation extends CommonObject */ public $type; // HUMAN, MACHINE, ... - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var int User ID */ diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index cd743d99badcb..1e1abdcb13d12 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -214,11 +214,6 @@ class Hook extends CommonObject */ public $status; - /** - * @var integer|string date_creation - */ - public $date_creation; - /** * @var int ID */ From 96afcaa476dd77dd0ecc765ba13cb8ecfdaadfeb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 30 Jun 2024 21:02:50 +0200 Subject: [PATCH 41/98] Better comments (#30200) * Fix language * Fix language * Fix language * Fix language * Fix language * Fix language * Fix language * CI Missing language key * Update eventorganization.lang --------- Co-authored-by: Laurent Destailleur --- htdocs/accountancy/admin/account.php | 2 +- htdocs/accountancy/admin/accountmodel.php | 2 +- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/accountancy/admin/fiscalyear_card.php | 4 ++-- htdocs/accountancy/admin/journals_list.php | 2 +- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/export.php | 2 +- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/accountancy/closure/index.php | 2 +- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/index.php | 2 +- .../accountancy/journal/expensereportsjournal.php | 4 ++-- htdocs/accountancy/journal/purchasesjournal.php | 12 ++++++------ htdocs/accountancy/journal/sellsjournal.php | 14 +++++++------- htdocs/accountancy/journal/variousjournal.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/adherents/agenda.php | 4 ++-- htdocs/adherents/card.php | 2 +- htdocs/adherents/index.php | 2 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/messaging.php | 4 ++-- htdocs/adherents/note.php | 2 +- htdocs/adherents/partnership.php | 4 ++-- htdocs/adherents/subscription.php | 2 +- htdocs/adherents/subscription/card.php | 6 +++--- htdocs/adherents/subscription/list.php | 2 +- htdocs/adherents/type.php | 2 +- htdocs/adherents/type_ldap.php | 2 +- htdocs/admin/agenda_other.php | 2 +- htdocs/admin/company.php | 2 +- htdocs/admin/company_socialnetworks.php | 2 +- htdocs/admin/defaultvalues.php | 2 +- htdocs/admin/dict.php | 2 +- htdocs/admin/emailcollector_card.php | 4 ++-- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/expensereport_rules.php | 2 +- htdocs/admin/index.php | 2 +- htdocs/admin/invoice_situation.php | 2 +- htdocs/admin/ldap.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/modules.php | 4 ++-- htdocs/admin/system/modules.php | 2 +- htdocs/admin/translation.php | 2 +- htdocs/admin/webhook.php | 2 +- htdocs/admin/website.php | 2 +- htdocs/admin/website_options.php | 2 +- htdocs/asset/accountancy_codes.php | 4 ++-- htdocs/asset/agenda.php | 4 ++-- htdocs/asset/card.php | 4 ++-- htdocs/asset/depreciation.php | 4 ++-- htdocs/asset/depreciation_options.php | 4 ++-- htdocs/asset/disposal.php | 4 ++-- htdocs/asset/document.php | 4 ++-- htdocs/asset/list.php | 2 +- htdocs/asset/model/accountancy_codes.php | 4 ++-- htdocs/asset/model/agenda.php | 4 ++-- htdocs/asset/model/card.php | 4 ++-- htdocs/asset/model/depreciation_options.php | 4 ++-- htdocs/asset/model/list.php | 2 +- htdocs/asset/model/note.php | 6 +++--- htdocs/asset/note.php | 6 +++--- htdocs/asset/tpl/accountancy_codes_edit.tpl.php | 2 +- htdocs/asset/tpl/accountancy_codes_view.tpl.php | 2 +- htdocs/asset/tpl/depreciation_options_edit.tpl.php | 2 +- htdocs/asset/tpl/depreciation_options_view.tpl.php | 2 +- htdocs/asset/tpl/depreciation_view.tpl.php | 2 +- htdocs/barcode/printsheet.php | 2 +- htdocs/bom/bom_agenda.php | 4 ++-- htdocs/bom/bom_card.php | 4 ++-- htdocs/bom/bom_document.php | 4 ++-- htdocs/bom/bom_list.php | 2 +- htdocs/bom/bom_net_needs.php | 6 +++--- htdocs/bom/bom_note.php | 8 ++++---- htdocs/bom/tpl/objectline_create.tpl.php | 2 +- htdocs/bom/tpl/objectline_edit.tpl.php | 2 +- htdocs/bom/tpl/objectline_title.tpl.php | 2 +- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- htdocs/bookcal/admin/setup.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 4 ++-- htdocs/bookcal/availabilities_card.php | 4 ++-- htdocs/bookcal/availabilities_contact.php | 4 ++-- htdocs/bookcal/availabilities_document.php | 4 ++-- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/availabilities_note.php | 6 +++--- htdocs/bookcal/calendar_agenda.php | 4 ++-- htdocs/bookcal/calendar_card.php | 4 ++-- htdocs/bookcal/calendar_contact.php | 4 ++-- htdocs/bookcal/calendar_document.php | 4 ++-- htdocs/bookcal/calendar_list.php | 2 +- htdocs/bookcal/calendar_note.php | 6 +++--- htdocs/categories/card.php | 2 +- htdocs/categories/edit.php | 2 +- htdocs/categories/index.php | 2 +- htdocs/categories/viewcat.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/comm/action/document.php | 2 +- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/info.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/comm/card.php | 2 +- htdocs/comm/index.php | 2 +- htdocs/comm/mailing/card.php | 4 ++-- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/index.php | 2 +- htdocs/comm/mailing/list.php | 2 +- htdocs/comm/mailing/note.php | 6 +++--- htdocs/comm/propal/agenda.php | 4 ++-- htdocs/comm/propal/card.php | 6 +++--- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/comm/propal/note.php | 4 ++-- htdocs/commande/agenda.php | 4 ++-- htdocs/commande/card.php | 10 +++++----- htdocs/commande/contact.php | 2 +- htdocs/commande/document.php | 2 +- htdocs/commande/index.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/commande/list_det.php | 2 +- htdocs/commande/note.php | 4 ++-- htdocs/compta/accounting-files.php | 2 +- htdocs/compta/bank/annuel.php | 2 +- htdocs/compta/bank/bankentries_list.php | 2 +- htdocs/compta/bank/card.php | 2 +- htdocs/compta/bank/categ.php | 2 +- htdocs/compta/bank/document.php | 2 +- htdocs/compta/bank/graph.php | 2 +- htdocs/compta/bank/list.php | 2 +- htdocs/compta/bank/releve.php | 4 ++-- htdocs/compta/bank/treso.php | 2 +- htdocs/compta/bank/various_payment/card.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_card.php | 4 ++-- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/compta/charges/index.php | 2 +- htdocs/compta/deplacement/card.php | 2 +- htdocs/compta/facture/agenda-rec.php | 4 ++-- htdocs/compta/facture/agenda.php | 4 ++-- htdocs/compta/facture/card-rec.php | 8 ++++---- htdocs/compta/facture/card.php | 8 ++++---- htdocs/compta/facture/invoicetemplate_list.php | 4 ++-- htdocs/compta/facture/list.php | 2 +- htdocs/compta/facture/note.php | 2 +- htdocs/compta/index.php | 2 +- htdocs/compta/localtax/card.php | 2 +- htdocs/compta/localtax/clients.php | 2 +- htdocs/compta/localtax/index.php | 2 +- htdocs/compta/paiement.php | 2 +- htdocs/compta/paiement/card.php | 4 ++-- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/compta/paiement/info.php | 2 +- htdocs/compta/paiement/list.php | 2 +- htdocs/compta/prelevement/card.php | 2 +- htdocs/compta/prelevement/factures.php | 2 +- htdocs/compta/prelevement/fiche-rejet.php | 2 +- htdocs/compta/prelevement/fiche-stat.php | 2 +- htdocs/compta/recap-compta.php | 4 ++-- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/resultat/index.php | 2 +- htdocs/compta/sociales/card.php | 4 ++-- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/sociales/note.php | 2 +- htdocs/compta/sociales/payments.php | 2 +- htdocs/compta/tva/card.php | 4 ++-- htdocs/compta/tva/clients.php | 2 +- htdocs/compta/tva/index.php | 2 +- htdocs/compta/tva/list.php | 2 +- htdocs/compta/tva/quadri_detail.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contact/card.php | 4 ++-- htdocs/contact/consumption.php | 2 +- htdocs/contact/document.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contact/note.php | 4 ++-- htdocs/contact/project.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/contrat/card.php | 6 +++--- htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/contrat/messaging.php | 4 ++-- htdocs/contrat/note.php | 4 ++-- htdocs/contrat/services_list.php | 2 +- htdocs/core/ajax/onlineSign.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/security.lib.php | 2 +- htdocs/core/modules/import/import_csv.modules.php | 2 +- htdocs/core/modules/import/import_xlsx.modules.php | 2 +- .../modules/movement/doc/pdf_standard.modules.php | 2 +- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- htdocs/core/tpl/extrafields_add.tpl.php | 2 +- htdocs/core/tpl/extrafields_edit.tpl.php | 2 +- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- htdocs/core/tpl/formlayoutai.tpl.php | 2 +- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- htdocs/core/tpl/objectline_title.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 2 +- htdocs/cron/list.php | 2 +- htdocs/delivery/card.php | 6 +++--- htdocs/don/card.php | 2 +- htdocs/don/index.php | 2 +- htdocs/don/list.php | 2 +- htdocs/don/note.php | 2 +- htdocs/don/paiement/list.php | 2 +- htdocs/ecm/file_note.php | 2 +- htdocs/ecm/index.php | 2 +- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/index_medias.php | 2 +- .../eventorganization/conferenceorbooth_card.php | 4 ++-- .../conferenceorbooth_contact.php | 4 ++-- .../conferenceorbooth_document.php | 4 ++-- .../eventorganization/conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 4 ++-- .../conferenceorboothattendee_list.php | 2 +- .../conferenceorboothattendee_note.php | 6 +++--- htdocs/expedition/card.php | 6 +++--- htdocs/expedition/index.php | 2 +- htdocs/expedition/list.php | 2 +- htdocs/expedition/note.php | 2 +- htdocs/expedition/shipment.php | 2 +- htdocs/expensereport/card.php | 10 +++++----- htdocs/expensereport/document.php | 2 +- htdocs/expensereport/index.php | 2 +- htdocs/expensereport/list.php | 2 +- htdocs/expensereport/note.php | 2 +- htdocs/expensereport/payment/list.php | 2 +- htdocs/fichinter/agenda.php | 4 ++-- htdocs/fichinter/card.php | 6 +++--- htdocs/fichinter/index.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/fichinter/note.php | 2 +- htdocs/fourn/card.php | 2 +- htdocs/fourn/commande/card.php | 8 ++++---- htdocs/fourn/commande/index.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/commande/note.php | 2 +- htdocs/fourn/facture/card-rec.php | 8 ++++---- htdocs/fourn/facture/card.php | 8 ++++---- htdocs/fourn/facture/list-rec.php | 4 ++-- htdocs/fourn/facture/list.php | 2 +- htdocs/fourn/facture/note.php | 4 ++-- htdocs/fourn/facture/paiement.php | 2 +- htdocs/fourn/paiement/card.php | 4 ++-- htdocs/fourn/paiement/info.php | 2 +- htdocs/fourn/paiement/list.php | 2 +- htdocs/fourn/product/list.php | 2 +- htdocs/fourn/recap-fourn.php | 2 +- htdocs/holiday/card.php | 2 +- htdocs/holiday/card_group.php | 2 +- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/holiday/view_log.php | 2 +- htdocs/hrm/core/tpl/objectline_title.tpl.php | 2 +- htdocs/hrm/core/tpl/objectline_view.tpl.php | 2 +- htdocs/hrm/establishment/card.php | 2 +- htdocs/hrm/establishment/info.php | 4 ++-- htdocs/hrm/evaluation_agenda.php | 4 ++-- htdocs/hrm/evaluation_card.php | 4 ++-- htdocs/hrm/evaluation_contact.php | 4 ++-- htdocs/hrm/evaluation_document.php | 4 ++-- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/evaluation_note.php | 6 +++--- htdocs/hrm/index.php | 4 ++-- htdocs/hrm/job_agenda.php | 4 ++-- htdocs/hrm/job_card.php | 4 ++-- htdocs/hrm/job_document.php | 4 ++-- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/job_note.php | 6 +++--- htdocs/hrm/position.php | 4 ++-- htdocs/hrm/position_agenda.php | 4 ++-- htdocs/hrm/position_card.php | 6 +++--- htdocs/hrm/position_document.php | 4 ++-- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/position_note.php | 6 +++--- htdocs/hrm/skill_agenda.php | 4 ++-- htdocs/hrm/skill_card.php | 6 +++--- htdocs/hrm/skill_document.php | 4 ++-- htdocs/hrm/skill_list.php | 2 +- htdocs/hrm/skill_note.php | 6 +++--- htdocs/hrm/skill_tab.php | 4 ++-- htdocs/imports/import.php | 2 +- htdocs/install/inc.php | 2 +- htdocs/intracommreport/card.php | 4 ++-- htdocs/intracommreport/list.php | 2 +- .../knowledgemanagement/knowledgerecord_agenda.php | 4 ++-- .../knowledgemanagement/knowledgerecord_card.php | 4 ++-- .../knowledgerecord_contact.php | 4 ++-- .../knowledgerecord_document.php | 4 ++-- .../knowledgemanagement/knowledgerecord_list.php | 2 +- .../knowledgemanagement/knowledgerecord_note.php | 6 +++--- htdocs/langs/en_US/eventorganization.lang | 4 ++-- htdocs/loan/list.php | 2 +- htdocs/loan/note.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/customerMargins.php | 2 +- htdocs/margin/productMargins.php | 2 +- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- htdocs/master.inc.php | 4 ++-- htdocs/modulebuilder/template/admin/setup.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 4 ++-- htdocs/modulebuilder/template/myobject_card.php | 4 ++-- htdocs/modulebuilder/template/myobject_contact.php | 4 ++-- .../modulebuilder/template/myobject_document.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/modulebuilder/template/myobject_note.php | 6 +++--- htdocs/mrp/index.php | 2 +- htdocs/mrp/mo_agenda.php | 4 ++-- htdocs/mrp/mo_card.php | 6 +++--- htdocs/mrp/mo_document.php | 4 ++-- htdocs/mrp/mo_list.php | 2 +- htdocs/mrp/mo_movements.php | 6 +++--- htdocs/mrp/mo_note.php | 6 +++--- htdocs/mrp/mo_production.php | 6 +++--- htdocs/multicurrency/multicurrency_rate.php | 4 ++-- htdocs/opensurvey/card.php | 2 +- htdocs/opensurvey/index.php | 2 +- htdocs/opensurvey/list.php | 2 +- htdocs/partnership/partnership_agenda.php | 4 ++-- htdocs/partnership/partnership_card.php | 4 ++-- htdocs/partnership/partnership_contact.php | 4 ++-- htdocs/partnership/partnership_document.php | 4 ++-- htdocs/partnership/partnership_list.php | 2 +- htdocs/partnership/partnership_note.php | 6 +++--- htdocs/product/agenda.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/composition/card.php | 2 +- htdocs/product/document.php | 2 +- htdocs/product/index.php | 2 +- htdocs/product/inventory/card.php | 4 ++-- htdocs/product/inventory/inventory.php | 4 ++-- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/messaging.php | 4 ++-- htdocs/product/note.php | 2 +- htdocs/product/price.php | 2 +- htdocs/product/price_suppliers.php | 2 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stats/bom.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stats/commande.php | 2 +- htdocs/product/stats/commande_fournisseur.php | 2 +- htdocs/product/stats/contrat.php | 2 +- htdocs/product/stats/expedition.php | 2 +- htdocs/product/stats/facture.php | 2 +- htdocs/product/stats/facture_fournisseur.php | 2 +- htdocs/product/stats/facturerec.php | 2 +- htdocs/product/stats/mo.php | 2 +- htdocs/product/stats/propal.php | 2 +- htdocs/product/stats/reception.php | 2 +- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/index.php | 2 +- htdocs/product/stock/list.php | 4 ++-- htdocs/product/stock/movement_card.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/product.php | 2 +- htdocs/product/stock/productlot_card.php | 6 +++--- htdocs/product/stock/productlot_document.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/product/stock/productlot_note.php | 6 +++--- htdocs/product/stock/replenish.php | 2 +- .../product/stock/stats/commande_fournisseur.php | 2 +- htdocs/product/stock/stats/expedition.php | 2 +- htdocs/product/stock/stats/mo.php | 2 +- htdocs/product/stock/stats/reception.php | 2 +- htdocs/product/stock/stockatdate.php | 2 +- .../stock/stocktransfer/stocktransfer_agenda.php | 4 ++-- .../stock/stocktransfer/stocktransfer_card.php | 4 ++-- .../stock/stocktransfer/stocktransfer_document.php | 4 ++-- .../stock/stocktransfer/stocktransfer_list.php | 2 +- .../stock/stocktransfer/stocktransfer_note.php | 6 +++--- htdocs/product/stock/tpl/extrafields_add.tpl.php | 2 +- htdocs/product/traduction.php | 2 +- htdocs/projet/activity/index.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/projet/comment.php | 2 +- htdocs/projet/contact.php | 2 +- htdocs/projet/document.php | 2 +- htdocs/projet/element.php | 2 +- htdocs/projet/ganttview.php | 2 +- htdocs/projet/index.php | 2 +- htdocs/projet/list.php | 2 +- htdocs/projet/note.php | 4 ++-- htdocs/projet/tasks.php | 4 ++-- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 4 ++-- htdocs/public/agenda/agendaexport.php | 2 +- htdocs/public/company/new.php | 2 +- htdocs/public/demo/index.php | 2 +- htdocs/public/eventorganization/attendee_new.php | 2 +- htdocs/public/members/new.php | 2 +- htdocs/public/onlinesign/newonlinesign.php | 2 +- htdocs/public/partnership/new.php | 2 +- htdocs/public/project/new.php | 2 +- htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- htdocs/public/ticket/create_ticket.php | 2 +- htdocs/public/ticket/list.php | 2 +- htdocs/public/ticket/view.php | 2 +- htdocs/reception/card.php | 6 +++--- htdocs/reception/document.php | 2 +- htdocs/reception/index.php | 2 +- htdocs/reception/list.php | 2 +- htdocs/reception/note.php | 4 ++-- .../recruitment/recruitmentcandidature_agenda.php | 4 ++-- htdocs/recruitment/recruitmentcandidature_card.php | 4 ++-- .../recruitmentcandidature_document.php | 4 ++-- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentcandidature_note.php | 6 +++--- .../recruitment/recruitmentjobposition_agenda.php | 4 ++-- .../recruitmentjobposition_applications.php | 4 ++-- htdocs/recruitment/recruitmentjobposition_card.php | 4 ++-- .../recruitmentjobposition_document.php | 4 ++-- htdocs/recruitment/recruitmentjobposition_list.php | 4 ++-- htdocs/recruitment/recruitmentjobposition_note.php | 6 +++--- htdocs/resource/agenda.php | 4 ++-- htdocs/resource/card.php | 2 +- htdocs/resource/contact.php | 2 +- htdocs/resource/document.php | 2 +- htdocs/resource/element_resource.php | 2 +- htdocs/resource/list.php | 2 +- htdocs/resource/note.php | 6 +++--- htdocs/salaries/card.php | 2 +- htdocs/salaries/document.php | 2 +- htdocs/salaries/info.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/salaries/payments.php | 2 +- htdocs/salaries/virement_request.php | 2 +- htdocs/societe/agenda.php | 4 ++-- htdocs/societe/card.php | 2 +- htdocs/societe/consumption.php | 2 +- htdocs/societe/contact.php | 2 +- htdocs/societe/document.php | 2 +- htdocs/societe/index.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/societe/messaging.php | 4 ++-- htdocs/societe/note.php | 4 ++-- htdocs/societe/notify/card.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/price.php | 2 +- htdocs/societe/project.php | 2 +- htdocs/societe/societecontact.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/supplier_proposal/card.php | 8 ++++---- htdocs/supplier_proposal/index.php | 2 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/supplier_proposal/note.php | 4 ++-- htdocs/takepos/ajax/ajax.php | 2 +- htdocs/ticket/card.php | 6 +++--- htdocs/ticket/index.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/user/agenda_extsites.php | 2 +- htdocs/user/bank.php | 2 +- htdocs/user/card.php | 2 +- htdocs/user/clicktodial.php | 2 +- htdocs/user/document.php | 2 +- htdocs/user/group/card.php | 4 ++-- htdocs/user/group/list.php | 2 +- htdocs/user/group/perms.php | 2 +- htdocs/user/home.php | 4 ++-- htdocs/user/ldap.php | 2 +- htdocs/user/list.php | 2 +- htdocs/user/messaging.php | 4 ++-- htdocs/user/note.php | 4 ++-- htdocs/user/param_ihm.php | 2 +- htdocs/user/perms.php | 2 +- htdocs/variants/card.php | 4 ++-- htdocs/variants/list.php | 2 +- .../tpl/productattributevalueline_create.tpl.php | 2 +- .../tpl/productattributevalueline_edit.tpl.php | 2 +- .../tpl/productattributevalueline_title.tpl.php | 2 +- .../tpl/productattributevalueline_view.tpl.php | 2 +- htdocs/webhook/target_card.php | 4 ++-- htdocs/webhook/target_list.php | 2 +- htdocs/webportal/admin/configcss.php | 2 +- htdocs/webportal/admin/setup.php | 2 +- htdocs/webportal/admin/setup_theme.php | 2 +- htdocs/webportal/class/controller.class.php | 2 +- .../class/html.formcardwebportal.class.php | 4 ++-- .../class/html.formlistwebportal.class.php | 2 +- htdocs/website/websiteaccount_card.php | 4 ++-- htdocs/workstation/workstation_agenda.php | 4 ++-- htdocs/workstation/workstation_card.php | 4 ++-- htdocs/workstation/workstation_document.php | 4 ++-- htdocs/workstation/workstation_list.php | 2 +- htdocs/workstation/workstation_note.php | 6 +++--- 503 files changed, 737 insertions(+), 737 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 2eea530e96e3a..cee3ee55a99b5 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -103,7 +103,7 @@ $accounting = new AccountingAccount($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('accountancyadminaccount')); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index ffb1fc8076737..0f5b8213ab923 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -88,7 +88,7 @@ } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admin')); // This page is a generic page to edit dictionaries diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 1891b492296f5..3e3a85c672e4b 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -72,7 +72,7 @@ $search_country_id = GETPOST('search_country_id', 'int'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admin')); // This page is a generic page to edit dictionaries diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index d1ba74b8b5694..0a2901ceca7a7 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -58,7 +58,7 @@ '1' => 'CloseFiscalYear' ); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Fiscalyear($db); $hookmanager->initHooks(array('fiscalyearlist')); diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 7e1d4fc7f87e1..16792a057475f 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -51,12 +51,12 @@ $error = 0; -// Initialize technical objects +// Initialize a technical objects $object = new Fiscalyear($db); $extrafields = new ExtraFields($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // List of status static $tmpstatus2label = array( diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 475d9f4220e3a..6b201fe8e13f6 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -82,7 +82,7 @@ $search_country_id = GETPOST('search_country_id', 'int'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admin')); // This page is a generic page to edit dictionaries diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 0267803229863..fc21dd6945e63 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -82,7 +82,7 @@ $sortfield = "t.numero_compte"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new BookKeeping($db); $hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 2a5d2b96fe825..4d8d804c479e6 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -153,7 +153,7 @@ $sortfield = "t.piece_num,t.rowid"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new BookKeeping($db); $hookmanager->initHooks(array('bookkeepingexport')); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index f7456e719a30c..b3b42d9312530 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -158,7 +158,7 @@ $sortfield = "t.piece_num,t.rowid"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new BookKeeping($db); $hookmanager->initHooks(array('bookkeepinglist')); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index eb6f0b3282dae..7f9d5a12b5292 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -133,7 +133,7 @@ $sortfield = "t.doc_date,t.rowid"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new BookKeeping($db); $formfile = new FormFile($db); $hookmanager->initHooks(array($context_default)); diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 025430976cc6b..1dd8002ce9341 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -49,7 +49,7 @@ accessforbidden(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('accountancyclosure')); $object = new BookKeeping($db); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index ccafecb446bba..a4b757ef95829 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -101,7 +101,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('accountancycustomerlist')); $formaccounting = new FormAccounting($db); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 1c2e3f9e20c6d..667a20347df4b 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -95,7 +95,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('accountancyexpensereportlist')); $formaccounting = new FormAccounting($db); diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 0577cac80fab9..714d863569293 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -33,7 +33,7 @@ // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy", "loans", "banks", "admin", "dict")); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('accountancyindex')); // Security check diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index dc3791c332748..775f1b2960fbf 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -81,7 +81,7 @@ $accountingaccount = new AccountingAccount($db); -// Get information of journal +// Get information of a journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; @@ -178,7 +178,7 @@ $compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); $compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); - // Define array to display all VAT rates that use this accounting account $compta_tva + // Define an array to display all VAT rates that use this accounting account $compta_tva if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) { $def_tva[$obj->rowid][$compta_tva][vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')] = (vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')); } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index b02727da2127e..6b19752351b33 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -84,7 +84,7 @@ $accountingaccount = new AccountingAccount($db); -// Get information of journal +// Get information of a journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; @@ -230,7 +230,7 @@ $compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); $compta_counterpart_tva_npr = getDolGlobalString('ACCOUNTING_COUNTERPART_VAT_NPR', 'NotDefined'); - // Define array to display all VAT rates that use this accounting account $compta_tva + // Define an array to display all VAT rates that use this accounting account $compta_tva if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) { $def_tva[$obj->rowid][$compta_tva][vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')] = (vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')); } @@ -408,7 +408,7 @@ $totalcredit = 0; $totaldebit = 0; - $db->begin(); // We accept transaction into loop so if we hang, we can continue transfer from last error + $db->begin(); // We accept transaction into loop, so if we hang, we can continue transfer from the last error $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -425,7 +425,7 @@ $date = dol_print_date($val["date"], 'day'); - // Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched + // Is it a replaced invoice? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched $replacedinvoice = 0; if ($invoicestatic->close_code == FactureFournisseur::CLOSECODE_REPLACED) { $replacedinvoice = 1; @@ -796,7 +796,7 @@ $date = dol_print_date($val["date"], 'day'); - // Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched + // Is it a replaced invoice? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched $replacedinvoice = 0; if ($invoicestatic->close_code == FactureFournisseur::CLOSECODE_REPLACED) { $replacedinvoice = 1; @@ -1049,7 +1049,7 @@ function writebookkeeping() { $date = dol_print_date($val["date"], 'day'); - // Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched + // Is it a replaced invoice? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched $replacedinvoice = 0; if ($invoicestatic->close_code == FactureFournisseur::CLOSECODE_REPLACED) { $replacedinvoice = 1; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 2b360c09ba1ac..46f986c08ac9a 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -86,7 +86,7 @@ $accountingaccount = new AccountingAccount($db); -// Get information of journal +// Get information of a journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; @@ -437,7 +437,7 @@ $totalcredit = 0; $totaldebit = 0; - $db->begin(); // We accept transaction into loop so if we hang, we can continue transfer from last error + $db->begin(); // We accept transaction into loop, so if we hang, we can continue transfer from the last error $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -453,7 +453,7 @@ $date = dol_print_date($val["date"], 'day'); - // Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched + // Is it a replaced invoice? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched $replacedinvoice = 0; if ($invoicestatic->close_code == Facture::CLOSECODE_REPLACED) { $replacedinvoice = 1; @@ -463,7 +463,7 @@ } } - // If not already into bookkeeping, we won't add it. If yes, do nothing (should not happen because creating replacement not possible if invoice is accounted) + // If not already into bookkeeping, we won't add it. If yes, do nothing (should not happen because creating a replacement is not possible if invoice is accounted) if ($replacedinvoice == 1) { $db->rollback(); continue; @@ -487,7 +487,7 @@ $bookkeeping->date_creation = $now; $bookkeeping->doc_type = 'customer_invoice'; $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add + $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are the source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; @@ -863,7 +863,7 @@ $date = dol_print_date($val["date"], 'day'); - // Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched + // Is it a replaced invoice? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched $replacedinvoice = 0; if ($invoicestatic->close_code == Facture::CLOSECODE_REPLACED) { $replacedinvoice = 1; @@ -1115,7 +1115,7 @@ function writebookkeeping() { $date = dol_print_date($val["date"], 'day'); - // Is it a replaced invoice ? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched + // Is it a replaced invoice? 0=not a replaced invoice, 1=replaced invoice not yet dispatched, 2=replaced invoice dispatched $replacedinvoice = 0; if ($invoicestatic->close_code == Facture::CLOSECODE_REPLACED) { $replacedinvoice = 1; diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 49194a41eb907..78a38fac98e37 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -44,7 +44,7 @@ $in_bookkeeping = 'notyet'; } -// Get information of journal +// Get information of a journal $object = new AccountingJournal($db); $result = $object->fetch($id_journal); if ($result > 0) { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 4d04a33b5d08a..b2262067683d8 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -98,7 +98,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('accountancysupplierlist')); $formaccounting = new FormAccounting($db); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 5c1a65c895cd5..286a66ea49333 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -72,13 +72,13 @@ // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $objcanvas = null; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('memberagenda', 'globalcard')); // Security check $result = restrictedArea($user, 'adherent', $id); -// Initialize technical objects +// Initialize a technical objects $object = new Adherent($db); $result = $object->fetch($id); if ($result > 0) { diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index a0b3925583704..bed2df3a64c06 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -90,7 +90,7 @@ $objcanvas->getCanvas('adherent', 'membercard', $canvas); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('membercard', 'globalcard')); // Fetch object diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 214060ad2d23a..bd08c3940263b 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -42,7 +42,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('membersindex')); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 13d956aa38a2d..0f969a97bbc6b 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -126,7 +126,7 @@ $object = new Adherent($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('memberlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/adherents/messaging.php b/htdocs/adherents/messaging.php index 091522a84325b..545b3f9b57c58 100644 --- a/htdocs/adherents/messaging.php +++ b/htdocs/adherents/messaging.php @@ -72,14 +72,14 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check $result = restrictedArea($user, 'adherent', $id); -// Initialize technical objects +// Initialize a technical objects $object = new Adherent($db); $result = $object->fetch($id); if ($result > 0) { diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 180eee496b218..b76a08e6d8266 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -91,7 +91,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 9edc0603ce2b8..d72825a11a6a1 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -51,7 +51,7 @@ $object->fetch($id); } -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $adht = new AdherentType($db); @@ -74,7 +74,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('partnership', 'read'); $permissiontoadd = $user->hasRight('partnership', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 62f8ae419685b..68db734ff14e1 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -82,7 +82,7 @@ $errmsg = ''; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('subscription')); // PDF diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index ad1f0633c96b3..fff3887421758 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -71,11 +71,11 @@ $action = ''; } -//include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +//include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' -//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once +//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'update' && !$cancel) { diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index c80b54be4823d..3d6488787d440 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -75,7 +75,7 @@ $sortfield = "c.dateadh"; } -// Initialize technical objects +// Initialize a technical objects $object = new Subscription($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('subscriptionlist')); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index c8807066da6ec..1e750b71289d2 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -92,7 +92,7 @@ $mail_valid = GETPOST("mail_valid", 'restricthtml'); $caneditamount = GETPOSTINT("caneditamount"); -// Initialize technical objects +// Initialize a technical objects $object = new AdherentType($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('membertypecard', 'globalcard')); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 88301150f13dd..78af4a6c48339 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -42,7 +42,7 @@ $object = new AdherentType($db); $object->fetch($id); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('membertypeldapcard', 'globalcard')); /* diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 2dcb16e474758..994537b515d02 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -204,7 +204,7 @@ * Miscellaneous */ -// Define array def of models +// Define an array def of models $def = array(); $sql = "SELECT nom"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index efac82e2ce897..b337a0922f8bb 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -59,7 +59,7 @@ $maxheightmini = $tmparraysize['maxheightmini']; $quality = $tmparraysize['quality']; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admincompany', 'globaladmin')); diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index e5178c97de182..887bf83120d73 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -43,7 +43,7 @@ } $listofnetworks = getArrayOfSocialNetworks(); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('adminsocialnetworkscompany', 'globaladmin')); /* diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 198c3cd2ba242..ff93e3f229a88 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -73,7 +73,7 @@ $key = GETPOST('key', 'alphanohtml'); $value = GETPOST('value', 'restricthtml'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admindefaultvalues', 'globaladmin')); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 6e42db441d771..00bdb4e644662 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -133,7 +133,7 @@ $search_country_id = $mysoc->country_id; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admin', 'dictionaryadmin')); $allowed = $user->admin; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index fdc44b83b7ae2..02bc1f00c8112 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -64,7 +64,7 @@ $operationid = GETPOSTINT('operationid'); -// Initialize technical objects +// Initialize a technical objects $object = new EmailCollector($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->emailcollector->dir_output.'/temp/massgeneration/'.$user->id; @@ -92,7 +92,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 7199bac6d5a8e..baf017ecfe6dd 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -64,7 +64,7 @@ //if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortorder) $sortorder="DESC"; -// Initialize technical objects +// Initialize a technical objects $object = new EmailCollector($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->emailcollector->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 87b87bca191e8..4e4ef01d9f042 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -35,7 +35,7 @@ // Load translation files required by the page $langs->loadLangs(array("admin", "other", "trips", "errors", "dict")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules')); $object = new ExpenseReportRule($db); diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index f4539b0f5d09c..8f908ad238b3d 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -34,7 +34,7 @@ accessforbidden(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('homesetup')); diff --git a/htdocs/admin/invoice_situation.php b/htdocs/admin/invoice_situation.php index 017b3461bb522..f394b606f7b36 100644 --- a/htdocs/admin/invoice_situation.php +++ b/htdocs/admin/invoice_situation.php @@ -39,7 +39,7 @@ // Load translation files required by the page $langs->loadLangs(array('admin', 'errors', 'other', 'bills')); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('situationinvoicesetup', 'globalsetup')); // Access control diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 314b64b150a72..89d6480e0d420 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -42,7 +42,7 @@ $action = GETPOST('action', 'aZ09'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('adminldap', 'globaladmin')); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 1173ebbf88300..2976bf969ff8c 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -60,7 +60,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new EmailSenderProfile($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->admin->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 56126f2f56bb5..cb695dfbe745a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -99,7 +99,7 @@ $sortorder = 'ASC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('emailtemplates')); diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 92be78f550fad..6136984ee5cc3 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -155,7 +155,7 @@ ksort($arrayofnatures); } - // Define array $categ with categ with at least one qualified module + // Define an array $categ with categ with at least one qualified module if ($modulequalified > 0) { $modules[$i] = $objMod; $filename[$i] = $modName; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index dd9909163a6b9..3d560a7a7244e 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -112,7 +112,7 @@ $dirins = DOL_DOCUMENT_ROOT.'/custom'; $urldolibarrmodules = 'https://www.dolistore.com/'; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('adminmodules', 'globaladmin')); // Increase limit of time. Works only if we are not in safe mode @@ -464,7 +464,7 @@ } ksort($arrayofnatures); - // Define array $categ with categ with at least one qualified module + // Define an array $categ with categ with at least one qualified module $filename[$i] = $modName; $modules[$modName] = $objMod; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 64a8cd089237a..aaccfab227813 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -52,7 +52,7 @@ $sortorder = "asc"; } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('moduleoverview')); $form = new Form($db); $object = new stdClass(); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 651d4faffcf14..e6d9a251fd96c 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -70,7 +70,7 @@ $sortorder = 'ASC,ASC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admintranslation', 'globaladmin')); diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 632a0963a6487..840864b06c517 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -30,7 +30,7 @@ // Translations $langs->loadLangs(array("admin", "webhook")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('webhooksetup', 'globalsetup')); // Access control diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index c61eefda37cd2..86362039daf40 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -67,7 +67,7 @@ $sortorder = 'ASC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('website')); // Name of SQL tables of dictionaries diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index e3d5c2958ad63..026735f2f93b0 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -51,7 +51,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admin')); $arrayofparameters = array('WEBSITE_USE_WEBSITE_ACCOUNTS'=>array('css'=>'minwidth200')); diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php index f68e835a1ff53..3a784387e0cf2 100644 --- a/htdocs/asset/accountancy_codes.php +++ b/htdocs/asset/accountancy_codes.php @@ -40,7 +40,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $assetaccountancycodes = new AssetAccountancyCodes($db); $assetdepreciationoptions = new AssetDepreciationOptions($db); @@ -51,7 +51,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id; } diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 1669e7b688f6c..e7a1aa062fe4e 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -68,7 +68,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; @@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id; } diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 24af02996b74f..75b72fb03a727 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -42,7 +42,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; @@ -67,7 +67,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('asset', 'read'); $permissiontoadd = $user->hasRight('asset', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/asset/depreciation.php b/htdocs/asset/depreciation.php index f20ccdbe7e7b7..26909d2628979 100644 --- a/htdocs/asset/depreciation.php +++ b/htdocs/asset/depreciation.php @@ -38,7 +38,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $assetdepreciationoptions = new AssetDepreciationOptions($db); $extrafields = new ExtraFields($db); @@ -48,7 +48,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id; } diff --git a/htdocs/asset/depreciation_options.php b/htdocs/asset/depreciation_options.php index 6202e4f2b6fd4..7fe8e940b4e4c 100644 --- a/htdocs/asset/depreciation_options.php +++ b/htdocs/asset/depreciation_options.php @@ -39,7 +39,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $assetdepreciationoptions = new AssetDepreciationOptions($db); $extrafields = new ExtraFields($db); @@ -49,7 +49,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id; } diff --git a/htdocs/asset/disposal.php b/htdocs/asset/disposal.php index 6ef7433061d8a..f97b1c5463db5 100644 --- a/htdocs/asset/disposal.php +++ b/htdocs/asset/disposal.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; @@ -46,7 +46,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id; } diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index bf585199df19d..64c3795dd8e9f 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -58,7 +58,7 @@ $sortfield = "name"; } -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; @@ -67,7 +67,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[$object->entity ? $object->entity : $conf->entity]."/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index d397d3c312cf3..e06bc80ff60ba 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -58,7 +58,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/asset/model/accountancy_codes.php b/htdocs/asset/model/accountancy_codes.php index 61db2261bb1cd..b19b5c0e88924 100644 --- a/htdocs/asset/model/accountancy_codes.php +++ b/htdocs/asset/model/accountancy_codes.php @@ -38,7 +38,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new AssetModel($db); $assetaccountancycodes = new AssetAccountancyCodes($db); $extrafields = new ExtraFields($db); @@ -48,7 +48,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id; } diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 247d52408bf77..97984569c3d28 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -68,7 +68,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new AssetModel($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output . '/temp/massgeneration/' . $user->id; @@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/model/" . $object->id; } diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index d0d413d543e06..762e676f98a72 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -44,7 +44,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new AssetModel($db); $assetdepreciationoptions = new AssetDepreciationOptions($db); $assetaccountancycodes = new AssetAccountancyCodes($db); @@ -71,7 +71,7 @@ } // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))); $permissiontoadd = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/asset/model/depreciation_options.php b/htdocs/asset/model/depreciation_options.php index 5beeb1a7a3303..5919450549a9e 100644 --- a/htdocs/asset/model/depreciation_options.php +++ b/htdocs/asset/model/depreciation_options.php @@ -39,7 +39,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new AssetModel($db); $assetdepreciationoptions = new AssetDepreciationOptions($db); $extrafields = new ExtraFields($db); @@ -49,7 +49,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id; } diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index b787fc95605c7..42ebf0f158c9e 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -56,7 +56,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new AssetModel($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/asset/model/note.php b/htdocs/asset/model/note.php index e704b6ae39027..fb1a8fbf9b3cd 100644 --- a/htdocs/asset/model/note.php +++ b/htdocs/asset/model/note.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new AssetModel($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output . '/temp/massgeneration/' . $user->id; @@ -46,7 +46,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1] . "/" . $object->id; } @@ -82,7 +82,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index a87f252acc95f..8fd2b0a61e4f5 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; @@ -46,7 +46,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id; } @@ -75,7 +75,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/asset/tpl/accountancy_codes_edit.tpl.php b/htdocs/asset/tpl/accountancy_codes_edit.tpl.php index d0bd4f0c4680d..43da58f395c1f 100644 --- a/htdocs/asset/tpl/accountancy_codes_edit.tpl.php +++ b/htdocs/asset/tpl/accountancy_codes_edit.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Show extrafields. It also show fields from hook formAssetAccountancyCode. Need to have following variables defined: + * Show extrafields. It also shows fields from hook formAssetAccountancyCode. Need to have the following variables defined: * $object (asset, assetmodel, ...) * $assetaccountancycodes * $action diff --git a/htdocs/asset/tpl/accountancy_codes_view.tpl.php b/htdocs/asset/tpl/accountancy_codes_view.tpl.php index b48f642c4c268..cb429c79399fd 100644 --- a/htdocs/asset/tpl/accountancy_codes_view.tpl.php +++ b/htdocs/asset/tpl/accountancy_codes_view.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Show extrafields. It also show fields from hook formAssetAccountancyCode. Need to have following variables defined: + * Show extrafields. It also shows fields from hook formAssetAccountancyCode. Need to have the following variables defined: * $object (asset, assetmodel, ...) * $assetaccountancycodes * $action diff --git a/htdocs/asset/tpl/depreciation_options_edit.tpl.php b/htdocs/asset/tpl/depreciation_options_edit.tpl.php index 2741da86c2b4b..b704725acadc3 100644 --- a/htdocs/asset/tpl/depreciation_options_edit.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_edit.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Show extrafields. It also show fields from hook formAssetAccountancyCode. Need to have following variables defined: + * Show extrafields. It also shows fields from hook formAssetAccountancyCode. Need to have the following variables defined: * $object (asset, assetmodel, ...) * $assetaccountancycodes * $action diff --git a/htdocs/asset/tpl/depreciation_options_view.tpl.php b/htdocs/asset/tpl/depreciation_options_view.tpl.php index c801d74505e59..a99d0ec3090d2 100644 --- a/htdocs/asset/tpl/depreciation_options_view.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_view.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Show extrafields. It also show fields from hook formAssetAccountancyCode. Need to have following variables defined: + * Show extrafields. It also shows fields from hook formAssetAccountancyCode. Need to have the following variables defined: * $object (asset, assetmodel, ...) * $assetaccountancycodes * $action diff --git a/htdocs/asset/tpl/depreciation_view.tpl.php b/htdocs/asset/tpl/depreciation_view.tpl.php index 424d989665f83..3480a91b0b5dd 100644 --- a/htdocs/asset/tpl/depreciation_view.tpl.php +++ b/htdocs/asset/tpl/depreciation_view.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Show extrafields. It also show fields from hook formAssetAccountancyCode. Need to have following variables defined: + * Show extrafields. It also shows fields from hook formAssetAccountancyCode. Need to have the following variables defined: * $object (asset, assetmodel, ...) * $assetaccountancycodes * $action diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 92581f000f052..16004ad8e9f91 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -70,7 +70,7 @@ } restrictedArea($user, 'barcode'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('printsheettools')); $parameters = array(); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index c4588e3151be1..4da795ce0d6f4 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -73,7 +73,7 @@ $sortorder = 'DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; @@ -83,7 +83,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = (!empty($conf->bom->multidir_output[$object->entity]) ? $conf->bom->multidir_output[$object->entity] : $conf->bom->dir_output)."/".$object->id; } diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index c5456de0a21af..cec3da13cd65a 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -52,7 +52,7 @@ $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); $hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); -// Initialize technical objects +// Initialize a technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; @@ -76,7 +76,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. if ($object->id > 0) { $object->calculateCosts(); } diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 00d7c81f38eff..80cbb2797255e 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -64,7 +64,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index bf1e2a87269ce..e0bc390b5c620 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -62,7 +62,7 @@ //if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortorder) $sortorder="DESC"; -// Initialize technical objects +// Initialize a technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index c2660ace0cb9a..52e2e0e13402f 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -43,11 +43,11 @@ $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); -// Initialize technical objects for hooks +// Initialize a technical objects for hooks $hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array // Massaction @@ -71,7 +71,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. if ($object->id > 0) { $object->calculateCosts(); } diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index 1ef9ffa73556b..143df51372b4b 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -37,11 +37,11 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); -// Initialize technical objects for hooks +// Initialize a technical objects for hooks $hookmanager->initHooks(array('bomnote', 'globalcard')); // Note that conf->hooks_modules contains array // Massactions @@ -56,7 +56,7 @@ //$result = restrictedArea($user, 'bom', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = (!empty($conf->bom->multidir_output[$object->entity]) ? $conf->bom->multidir_output[$object->entity] : $conf->bom->dir_output)."/".$object->id; } @@ -80,7 +80,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 84ff482d3a1e9..510372ae5722d 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -23,7 +23,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index e5686a86e9046..8394cb4c0ad4b 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 2511279573cd2..a357628eba0f1 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -20,7 +20,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 4b369f88f1956..1eb5af994551a 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/bookcal/admin/setup.php b/htdocs/bookcal/admin/setup.php index 817fffbd62578..f67819497c386 100644 --- a/htdocs/bookcal/admin/setup.php +++ b/htdocs/bookcal/admin/setup.php @@ -37,7 +37,7 @@ // Translations $langs->loadLangs(array("admin", "agenda")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bookcalsetup', 'globalsetup')); // Access control diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 88c0935c86db5..082c2f936983d 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -71,7 +71,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Availabilities($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -80,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index 068aa133be31d..bcb42c44e1254 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -46,7 +46,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Availabilities($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -71,7 +71,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. //avoid warning on missing/undef entity $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity); diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index cfd91d3b2f612..0b6c992de8b4a 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -38,7 +38,7 @@ $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Availabilities($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -47,7 +47,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 433d92b144f8e..27ecf64e92604 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -59,7 +59,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Availabilities($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -68,7 +68,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/availabilities/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index dd7d6df9b2ee2..e3565ce9da3b5 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -64,7 +64,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Availabilities($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index 3f7bf24edee26..fbac83db11f56 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Availabilities($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -46,7 +46,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -88,7 +88,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/bookcal/calendar_agenda.php b/htdocs/bookcal/calendar_agenda.php index 7ef31ec2c3e13..b9390ede6fcce 100644 --- a/htdocs/bookcal/calendar_agenda.php +++ b/htdocs/bookcal/calendar_agenda.php @@ -71,7 +71,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Calendar($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -80,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/bookcal/calendar_card.php b/htdocs/bookcal/calendar_card.php index 55884aecaeaea..f9ca47c6edc74 100644 --- a/htdocs/bookcal/calendar_card.php +++ b/htdocs/bookcal/calendar_card.php @@ -54,7 +54,7 @@ $dol_openinpopup = $tmpbacktopagejsfields[0]; } -// Initialize technical objects +// Initialize a technical objects $object = new Calendar($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -79,7 +79,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity); diff --git a/htdocs/bookcal/calendar_contact.php b/htdocs/bookcal/calendar_contact.php index 4eb679a97f3a2..5252a0f4d7c8a 100644 --- a/htdocs/bookcal/calendar_contact.php +++ b/htdocs/bookcal/calendar_contact.php @@ -40,7 +40,7 @@ $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Calendar($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -49,7 +49,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks diff --git a/htdocs/bookcal/calendar_document.php b/htdocs/bookcal/calendar_document.php index 32aaf416f35ad..cb4a379c5599b 100644 --- a/htdocs/bookcal/calendar_document.php +++ b/htdocs/bookcal/calendar_document.php @@ -61,7 +61,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Calendar($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -70,7 +70,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/calendar/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index a67858255bb72..6d70a8cf1592f 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -62,7 +62,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Calendar($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/bookcal/calendar_note.php b/htdocs/bookcal/calendar_note.php index 7eb44b892e2ef..f18872e6ae157 100644 --- a/htdocs/bookcal/calendar_note.php +++ b/htdocs/bookcal/calendar_note.php @@ -39,7 +39,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Calendar($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; @@ -48,7 +48,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bookcal->multidir_output[empty($object->entity) ? $conf->entity : $object->entity]."/".$object->id; } @@ -90,7 +90,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index a92b7c44efbac..16df2233d8032 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -91,7 +91,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categorycard')); $error = 0; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 7fc4d4c8a108a..f93254da64b24 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -72,7 +72,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categorycard')); $error = 0; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index a49c2a88bb58f..b96e8aca1759b 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -46,7 +46,7 @@ $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categoryindex')); if (!$user->hasRight('categorie', 'lire')) { diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 857812b890f1b..74a1f0c4cfe99 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -89,7 +89,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categorycard', 'globalcard')); /* diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 20be4780af266..8b70bb73c8091 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -135,7 +135,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('actioncard', 'globalcard')); $parameters = array('socid' => $socid); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9989d6874bbe1..f5d00194b95b8 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1321,7 +1321,7 @@ public function getActions($socid = 0, $fk_element = 0, $elementtype = '', $filt dol_syslog(get_class()."::getActions", LOG_DEBUG); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context if (!is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($this->db); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index fb8c8dd2417b3..8ba2928a9119c 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -62,7 +62,7 @@ $object->fetch_thirdparty(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('actioncard', 'globalcard')); // Get parameters diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index af345ae89f582..5e8568174269a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -168,7 +168,7 @@ // Load translation files required by the page $langs->loadLangs(array('agenda', 'other', 'commercial')); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agenda')); $result = restrictedArea($user, 'agenda', 0, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 0b16f28193e04..bfae8aa535a76 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -39,7 +39,7 @@ $id = GETPOSTINT('id'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('actioncard', 'globalcard')); // Security check diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 420ff107c5f07..7faf66f0f2d31 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -99,7 +99,7 @@ $showbirthday = empty($conf->use_javascript_ajax) ? (GETPOSTINT("search_showbirthday") ? GETPOSTINT("search_showbirthday") : GETPOSTINT("showbirthday")) : 1; $search_categ_cus = GETPOST("search_categ_cus", "intcomma", 3) ? GETPOST("search_categ_cus", "intcomma", 3) : 0; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new ActionComm($db); $hookmanager->initHooks(array('agendalist')); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 849f71c18fabf..5493734447add 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -186,7 +186,7 @@ // Load translation files required by the page $langs->loadLangs(array('users', 'agenda', 'other', 'commercial')); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agenda')); $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 30f0d61d41a6e..1ee52af1ccc58 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -183,7 +183,7 @@ // Load translation files required by the page $langs->loadLangs(array('users', 'agenda', 'other', 'commercial')); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agenda')); $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 2586f80790d82..162425c8037bf 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -119,7 +119,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartycomm', 'globalcard')); $now = dol_now(); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 8ce75b5cd6efc..95f218a4ab001 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager = new HookManager($db); $hookmanager->initHooks(array('commercialindex')); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index c4778c4cd3d8a..d1c654b91ba7d 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -51,7 +51,7 @@ $urlfrom = GETPOST('urlfrom'); $backtopageforcancel = GETPOST('backtopageforcancel'); -// Initialize technical objects +// Initialize a technical objects $object = new Mailing($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('mailingcard', 'globalcard')); @@ -60,7 +60,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) $object->substitutionarray = FormMail::getAvailableSubstitKey('emailing'); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index e2eab3e3e2ac9..3ea3c35eed1a1 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -71,7 +71,7 @@ $object = new Mailing($db); $result = $object->fetch($id); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ciblescard', 'globalcard')); $sqlmessage = ''; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index c7d446e184e6c..7d04bc5de6c17 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -32,7 +32,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('mailingindex')); // Load translation files required by the page diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index a1f3df49b1850..d317f33e8b027 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -61,7 +61,7 @@ $search_messtype = GETPOST("search_messtype", "alpha"); $filteremail = GETPOST('filteremail', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Mailing($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes diff --git a/htdocs/comm/mailing/note.php b/htdocs/comm/mailing/note.php index 6b7a5153bd70a..1b9a8bf39ba79 100644 --- a/htdocs/comm/mailing/note.php +++ b/htdocs/comm/mailing/note.php @@ -38,7 +38,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Mailing($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mailing->dir_output.'/temp/massgeneration/'.$user->id; @@ -47,7 +47,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mailing->multidir_output[$object->entity]."/".$object->id; } @@ -71,7 +71,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php index 657f2e639f964..cf73c2f803993 100644 --- a/htdocs/comm/propal/agenda.php +++ b/htdocs/comm/propal/agenda.php @@ -67,7 +67,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Propal($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; @@ -76,7 +76,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->propal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 4677c8895305a..397a6ac51df46 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -113,7 +113,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('propalcard', 'globalcard')); $usercanread = $user->hasRight("propal", "lire"); @@ -178,9 +178,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index cc1ffc5486e6e..f54ab4a438757 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager = new HookManager($db); $hookmanager->initHooks(array('proposalindex')); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d7d5aa122f1ce..15ef7de9d7a19 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -181,7 +181,7 @@ $diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Propal($db); $hookmanager->initHooks(array('propallist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index e412b5d10771a..00e2f40119fcc 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -54,7 +54,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('propalnote')); restrictedArea($user, 'propal', $object->id, 'propal'); @@ -74,7 +74,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/commande/agenda.php b/htdocs/commande/agenda.php index 79fc46673d1d9..b8d5e64e7a05f 100644 --- a/htdocs/commande/agenda.php +++ b/htdocs/commande/agenda.php @@ -67,7 +67,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Commande($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; @@ -76,7 +76,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->commande->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 04ad85e574376..07a30f516611d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -104,7 +104,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ordercard', 'globalcard')); $result = restrictedArea($user, 'commande', $id); @@ -116,7 +116,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' // Permissions / Rights $usercanread = $user->hasRight("commande", "lire"); @@ -180,11 +180,11 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 6a0e015b9031f..3b20df2931e55 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -45,7 +45,7 @@ if ($user->socid) { $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ordercontact', 'globalcard')); $result = restrictedArea($user, 'commande', $id, ''); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 06ada04a04fd7..ed2f577389e91 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -81,7 +81,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('orderdocument', 'globalcard')); $result = restrictedArea($user, 'commande', $id, ''); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 61be815d34d4b..115e7a7726c8e 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -45,7 +45,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('ordersindex')); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1202547aedaa5..cc77b1e36f405 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -148,7 +148,7 @@ $show_shippable_command = GETPOST('show_shippable_command', 'aZ09'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Commande($db); $hookmanager->initHooks(array('orderlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 9860cc003b4ba..03350ec89367b 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -154,7 +154,7 @@ $show_shippable_command = GETPOST('show_shippable_command', 'aZ09'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Commande($db); $hookmanager->initHooks(array('orderlistdetail')); $extrafields = new ExtraFields($db); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 32169870e0254..650db74072e4e 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -47,7 +47,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ordernote')); $result = restrictedArea($user, 'commande', $id, ''); @@ -74,7 +74,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index e20eeed6436fa..b836a10eea35c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -74,7 +74,7 @@ $action = GETPOST('action', 'aZ09'); $projectid = GETPOSTINT('projectid'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('comptafileslist', 'globallist')); // Load variable for pagination diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index ff8260fce9d6a..25b1cd431bc05 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -40,7 +40,7 @@ $id = GETPOST('account') ? GETPOST('account', 'alpha') : GETPOST('id'); $ref = GETPOST('ref'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bankannualreport', 'globalcard')); // Security check diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 7d9e42387a0ff..620ecbae80856 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -141,7 +141,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('banktransactionlist', $contextpage)); $extrafields = new ExtraFields($db); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 3b945e244bc98..26f60ad3e75ed 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -65,7 +65,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bankcard', 'globalcard')); // Security check diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 816b26b3ea481..eb18233865872 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -44,7 +44,7 @@ $label = GETPOST("label"); -// Initialize technical objects +// Initialize a technical objects $bankcateg = new BankCateg($db); diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 55f3f8457f186..3c38b99de6605 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -38,7 +38,7 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bankaccountdocuments', 'globalcard')); // Security check diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 97e362145aeed..1ff527ec2c823 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -36,7 +36,7 @@ $WIDTH = DolGraph::getDefaultGraphSizeForStats('width', 768); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 200); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bankstats', 'globalcard')); // Security check diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 64c4d7d5fc68d..b1bb5851e8930 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -91,7 +91,7 @@ $sortorder = 'ASC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Account($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('bankaccountlist')); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 3b9a882fffc6e..4dab4a912a048 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -62,7 +62,7 @@ $rel = GETPOST("rel", 'alphanohtml'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bankaccountstatement', 'globalcard')); if ($user->hasRight('banque', 'consolidate') && $action == 'dvnext' && !empty($dvid)) { @@ -101,7 +101,7 @@ $id = $object->id; // Force the search field on id of account } -// Initialize technical object to manage context to save list fields +// Initialize a technical object to manage context to save list fields $contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id); // Security check diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index c43d85e1f60ad..e9add12186edb 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -55,7 +55,7 @@ $vline = GETPOST('vline'); $page = GETPOSTISSET("page") ? GETPOST("page") : 0; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('banktreso', 'globalcard')); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 0eeab1735c328..20f9198c74f05 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -71,7 +71,7 @@ $object = new PaymentVarious($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('variouscard', 'globalcard')); $permissiontoadd = $user->hasRight('banque', 'modifier'); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 192f07814df2d..f264fd9b0b6ae 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -89,7 +89,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new PaymentVarious($db); $extrafields = new ExtraFields($db); //$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 33fb4950351f9..2f30749fddf67 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -86,11 +86,11 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('cashcontrolcard', 'globalcard')); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check if ($user->socid > 0) { // Protection if external user diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 984686af4d614..d5cdc5bc8323a 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -59,7 +59,7 @@ //if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortorder) $sortorder="DESC"; -// Initialize technical objects +// Initialize a technical objects $object = new CashControl($db); $extrafields = new ExtraFields($db); //$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 047f90e543f6f..05038d07ff0e4 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -41,7 +41,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('specialexpensesindex')); // Load translation files required by the page diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 04c50f82ffec3..b4aed3ce32e7c 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -50,7 +50,7 @@ $object = new Deplacement($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('tripsandexpensescard', 'globalcard')); $permissionnote = $user->hasRight('deplacement', 'creer'); // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php index 4931852fcbf74..93a623c309788 100644 --- a/htdocs/compta/facture/agenda-rec.php +++ b/htdocs/compta/facture/agenda-rec.php @@ -68,7 +68,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new FactureRec($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('invoicerecagenda', 'globalcard')); // Note that conf->hooks_modules contains array @@ -76,7 +76,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->facture->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/compta/facture/agenda.php b/htdocs/compta/facture/agenda.php index 4bbf9d8e8ac44..3f4b9823040d9 100644 --- a/htdocs/compta/facture/agenda.php +++ b/htdocs/compta/facture/agenda.php @@ -67,7 +67,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Facture($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->facture->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; @@ -76,7 +76,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->facture->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index ac7b1cddcbbbf..e6652acf31198 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -101,7 +101,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicereccard', 'globalcard')); $extrafields = new ExtraFields($db); @@ -184,11 +184,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Set note - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Mass actions /*$objectclass='MyObject'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 4d6ca31a36c0b..72238eab75e63 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -134,7 +134,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicecard', 'globalcard')); // Permissions @@ -212,11 +212,11 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) { diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 54102500e9e49..c4c228785202b 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -110,7 +110,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new FactureRec($db); $extrafields = new ExtraFields($db); @@ -121,7 +121,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicereclist')); // Fetch optionals attributes and labels diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 5660de4a1e283..87826db56ccd8 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -177,7 +177,7 @@ $now = dol_now(); $error = 0; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Facture($db); $hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index d7f9408ed0744..7ca76f6335279 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -71,7 +71,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 7094ad7a68d70..79d2d0cb5d0e3 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -73,7 +73,7 @@ $maxLatestEditCount = 5; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('invoiceindex')); diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 0a6e43cded575..3e939d40f1bf8 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -52,7 +52,7 @@ $object = new Localtax($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('localtaxvatcard', 'globalcard')); diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 16d1af4f5629d..0d883a5bb2327 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -211,7 +211,7 @@ $parameters["direction"] = 'sell'; $parameters["type"] = 'localtax'.$local; - // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 1c277b80f3f81..c7fcf9218f331 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -441,7 +441,7 @@ function pt($db, $sql, $date) $parameters["month"] = $m; $parameters["type"] = 'localtax'.$localTaxType; - // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index eb761f7aa887b..292b3e476f564 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -75,7 +75,7 @@ $ret = $object->fetch($facid); } -// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('paiementcard', 'globalcard')); $formquestion = array(); diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 5ab2997860837..17c8b73f075fe 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -55,11 +55,11 @@ } $object = new Paiement($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('paymentcard', 'globalcard')); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, $object->element, $object->id, 'paiement'); // This also test permission on read invoice diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index f1ec919283f77..40e9c1e7dd87e 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -96,7 +96,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('chequelist')); $object = new RemiseCheque($db); diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 476e650552d6e..0e55d526a34cc 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -40,7 +40,7 @@ $object = new Paiement($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, $object->element, $object->id, 'paiement', ''); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 45e93d5836ee8..106fe1d56f47c 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -116,7 +116,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('paymentlist')); $object = new Paiement($db); diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 3433fc9d144c4..d3d83f01f88a7 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -66,7 +66,7 @@ $object = new BonPrelevement($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 1dc1fd3d76d84..855f73a7d0056 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -65,7 +65,7 @@ $object = new BonPrelevement($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index febb51cdc1df2..a8ec234b5f8c9 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -65,7 +65,7 @@ $object = new BonPrelevement($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // Security check if ($user->socid > 0) { diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index b0fadbafd1baa..2a388467b36e9 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -56,7 +56,7 @@ $object = new BonPrelevement($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // Security check if ($user->socid > 0) { diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index ffd6498dbd727..bae9dceb7342e 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -48,7 +48,7 @@ $object->fetch($id); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('recapcomptacard', 'globalcard')); // Load variable for pagination @@ -75,7 +75,7 @@ //... ); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplierbalencelist', 'globalcard')); /* diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index c300817bfa46c..f1e5e79d0638c 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1525,7 +1525,7 @@ $parameters["mode"] = $modecompta; $parameters["date_start"] = $date_start; $parameters["date_end"] = $date_end; -// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addBalanceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index a2b35d82de3ff..dd06e2e285b52 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -983,7 +983,7 @@ $action = "balance"; $object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc); $parameters["mode"] = $modecompta; -// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addReportInfo', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 1c5034293939b..bfe0fb7d5a2b9 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -65,10 +65,10 @@ $actioncode = GETPOST('actioncode'); $fk_user = GETPOSTINT('userid') > 0 ? GETPOSTINT('userid') : 0; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('taxcard', 'globalcard')); -// Initialize technical objects +// Initialize a technical objects $object = new ChargeSociales($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->tax->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index d7ac5034db233..2c1288ac2ccb3 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -117,7 +117,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('sclist')); $object = new ChargeSociales($db); diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index 53c6fe187e64c..c1c4947b2e26b 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -68,7 +68,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index e5e7bd783915e..c758a83261e43 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -45,7 +45,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('specialexpensesindex')); // Load translation files required by the page diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 59560c1373dde..04e831dcf96f5 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -66,7 +66,7 @@ $datev = dol_mktime(12, 0, 0, GETPOSTINT("datevmonth"), GETPOSTINT("datevday"), GETPOSTINT("datevyear")); $datep = dol_mktime(12, 0, 0, GETPOSTINT("datepmonth"), GETPOSTINT("datepday"), GETPOSTINT("datepyear")); -// Initialize technical objects +// Initialize a technical objects $object = new Tva($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->tax->dir_output.'/temp/massgeneration/'.$user->id; @@ -80,7 +80,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('tax', 'charges', 'lire'); $permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 060072bdb95c0..1f57326572b24 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -413,7 +413,7 @@ $parameters["type"] = 'vat'; $object = array(&$x_coll, &$x_paye, &$x_both); - // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 994123bc0dbce..1d19bed301e4c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -391,7 +391,7 @@ function pt($db, $sql, $date) $parameters["month"] = $m; $parameters["type"] = 'vat'; - // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 4dbc0a50dcf63..576d7db852a87 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -99,7 +99,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('salestaxeslist')); $object = new Tva($db); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 441c6bee6cd2a..25ed645538a77 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -404,7 +404,7 @@ $parameters["type"] = 'vat'; $object = array(&$x_coll, &$x_paye, &$x_both); - // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 5ef2652268c8c..db3fc45d2b4a4 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -109,7 +109,7 @@ $sortorder = 'DESC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contactagenda', 'globalcard')); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 8417091ddd13d..b8aa8fe81e81b 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -64,7 +64,7 @@ $id = GETPOSTINT('id'); $socid = GETPOSTINT('socid'); -// Initialize technical object +// Initialize a technical object $object = new Contact($db); $extrafields = new ExtraFields($db); @@ -83,7 +83,7 @@ $objcanvas->getCanvas('contact', 'contactcard', $canvas); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contactcard', 'globalcard')); if ($id > 0) { diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 158229e620a90..888f90822ab1e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -86,7 +86,7 @@ // Load translation files required by the page $langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('consumptioncontact')); $result = restrictedArea($user, 'contact', $object->id, 'socpeople&societe'); diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index efc55ac0e5bfc..f4e2d3d6b03d0 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -85,7 +85,7 @@ $upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref); $modulepart = 'contact'; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contactdocument')); // Security check diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6f5796526dfa8..f50e643a8431f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -184,7 +184,7 @@ $urlfiche = ""; } -// Initialize technical object +// Initialize a technical object $object = new Contact($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array($contextpage)); diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 1f956e948216f..e979fa93103f8 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -53,7 +53,7 @@ $permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context // $hookmanager->initHooks(array('contactcard')); -> Name conflict with product/card.php $hookmanager->initHooks(array('contactnote')); @@ -68,7 +68,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 7fe377f1a960b..2112b4aa9f5dc 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -32,7 +32,7 @@ $id = GETPOSTINT('id'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projectcontact')); /* diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 4a14558c0e969..dbdb930bb6ab6 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -88,7 +88,7 @@ $result = $object->fetch($id, $ref); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendacontract', 'globalcard')); $permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d3fb03dffa419..3cdbac83901b3 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -82,7 +82,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contractcard', 'globalcard')); $object = new Contrat($db); @@ -151,9 +151,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { $date_start = ''; diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 2af94f7654c2b..d9310761e0211 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -51,7 +51,7 @@ $object = new Contrat($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contractcontactcard', 'globalcard')); $permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 28a1c9455e2a9..180c7bd891370 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -79,7 +79,7 @@ $upload_dir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $modulepart = 'contract'; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contractcard', 'globalcard')); $permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index e304f8833c79c..5a83982ed4f13 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -32,7 +32,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('contractindex')); // Load translation files required by the page diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 0ee1f2ae46103..10d5c288a3b05 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -146,7 +146,7 @@ $search_status = 1; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Contrat($db); $hookmanager->initHooks(array('contractlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index 335146bfce313..285ad325c2846 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -73,10 +73,10 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Contrat($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendacontract', 'globalcard')); // Security check diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 996eace982feb..7a7f441375ffe 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -45,7 +45,7 @@ if ($user->socid) { $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context //$hookmanager->initHooks(array('contractcard', 'globalcard')); -> Conflict with contrat\card.php $hookmanager->initHooks(array('contractnote')); @@ -67,7 +67,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 9dc62e8728aed..56bacf7159d96 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -108,7 +108,7 @@ $filter_opcloture = GETPOST('filter_opcloture', 'alpha'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new ContratLigne($db); $hookmanager->initHooks(array('contractservicelist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 08a9ad5c05e8e..6520b4639fe19 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -84,7 +84,7 @@ httponly_accessforbidden('Bad value for securitykey. Value provided ' . dol_escape_htmltag($SECUREKEY) . ' does not match expected value for ref=' . dol_escape_htmltag($ref), 403); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ajaxonlinesign')); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index b0b89cc56055f..afb5d48ba2c06 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1798,7 +1798,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr $sql = ''; if (isModEnabled('agenda')) { - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendadao')); // Recherche histo sur actioncomm diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 10485e8cb69ae..39fa548bce689 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14451,7 +14451,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show if (empty($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('main')); } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 5ff5b4968b570..17b06e5cdb9b5 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -1234,7 +1234,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho if (empty($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('main')); } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 1c5e913a9aa8b..a6631f0f4709f 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -363,7 +363,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); } - // Define array to convert fields ('c.ref', ...) into column index (1, ...) + // Define an array to convert fields ('c.ref', ...) into column index (1, ...) $arrayfield = array(); foreach ($sort_array_match_file_to_database as $key => $val) { $arrayfield[$val] = ($key - 1); diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 8702997ecfbd0..5ff8636bae3af 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -408,7 +408,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); } - // Define array to convert fields ('c.ref', ...) into column index (1, ...) + // Define an array to convert fields ('c.ref', ...) into column index (1, ...) $arrayfield = array(); foreach ($sort_array_match_file_to_database as $key => $val) { $arrayfield[$val] = ($key); diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 9f12209a783f9..319f8f39c3d2b 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -196,7 +196,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdluoid = GETPOSTINT('pdluoid'); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('movementlist')); $extrafields = new ExtraFields($this->db); diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 3ab7e76f35391..cbfee031cb370 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index fea9afd80dc20..39a029f148071 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 6065f64e18917..4c26b90462e8d 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php index e9a5d2838072f..dc28a6f2f4892 100644 --- a/htdocs/core/tpl/extrafields_add.tpl.php +++ b/htdocs/core/tpl/extrafields_add.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index e778f59919ec9..17ceda033d3c3 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index ac3fea2ca4a4e..c67230b4fdb7c 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Show extrafields. It also show fields from hook formObjectOptions. Need to have following variables defined: + * Show extrafields. It also shows fields from hook formObjectOptions. Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/core/tpl/formlayoutai.tpl.php b/htdocs/core/tpl/formlayoutai.tpl.php index d6a8a143eb0e7..1aac2783a9223 100644 --- a/htdocs/core/tpl/formlayoutai.tpl.php +++ b/htdocs/core/tpl/formlayoutai.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $conf * $formmail * $formwebsite (optional) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index ca5de5c0ef96b..8cd60aa4b7747 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -26,7 +26,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index fa58c7124e8c3..42f7f17a77e87 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -23,7 +23,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 6863dd024e5b4..bfbd31f21369a 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 29663b5e75517..31885a26d60f0 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -23,7 +23,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 824e987cfc46d..21e5d86d104f1 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -77,7 +77,7 @@ $object = new Cronjob($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('cronjoblist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 4ad6eb6947846..24c47fd1f5162 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -77,9 +77,9 @@ $extrafields->fetch_name_optionals_label($object->table_element_line); // Load object. Make an object->fetch -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('deliverycard', 'globalcard')); $error = 0; @@ -93,7 +93,7 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks // Delete Link $permissiondellink = $user->hasRight('expedition', 'delivery', 'supprimer'); // Used by the include of actions_dellink.inc.php -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' if ($action == 'add') { $db->begin(); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 49097ebbdc839..61d3370f30cd0 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -78,7 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array($object->element.'card', 'globalcard')); $upload_dir = $conf->don->dir_output; diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 57cf398b2a845..223f7bc487bbd 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -31,7 +31,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('donationindex')); $langs->load("donations"); diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 2d9767d1263ed..d016871b06a5a 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -68,7 +68,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Don($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->don->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/don/note.php b/htdocs/don/note.php index 6a74d2c9e0578..e22537e7dadfd 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -69,7 +69,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } if ($action == 'classin' && $user->hasRight('don', 'creer')) { diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 140eb4671d5b0..81668de176dae 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -102,7 +102,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $moreforfilter = GETPOST('moreforfilter', 'alpha'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('donationlist')); // Security check diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php index 580f8ab03ddfa..1406164aec751 100644 --- a/htdocs/ecm/file_note.php +++ b/htdocs/ecm/file_note.php @@ -119,7 +119,7 @@ * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' /* diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index e0c191e8e23e9..405fb76bc5d4b 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -89,7 +89,7 @@ $permissiontodelete = $user->hasRight('ecm', 'upload'); $permissiontodeletedir = $user->hasRight('ecm', 'setup'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ecmindexcard', 'globalcard')); /* diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index a46470e9d7a03..8c54ffad45f3f 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -93,7 +93,7 @@ * Actions */ -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ecmautocard', 'globalcard')); // Purge search criteria diff --git a/htdocs/ecm/index_medias.php b/htdocs/ecm/index_medias.php index c59cab0c05942..b435cc77e4752 100644 --- a/htdocs/ecm/index_medias.php +++ b/htdocs/ecm/index_medias.php @@ -103,7 +103,7 @@ $permissiontoadd = $permissiontouploadfile; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ecmmediascard', 'globalcard')); /* diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 5f00a49e9d658..5c00c56499d25 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -53,7 +53,7 @@ $ref = GETPOST('ref', 'alpha'); $withproject = GETPOSTINT('withproject'); -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBooth($db); $extrafields = new ExtraFields($db); $projectstatic = new Project($db); @@ -83,7 +83,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index b2ae4685c8913..bd7e7c087a5a9 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -54,7 +54,7 @@ $withproject = GETPOSTINT('withproject'); -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBooth($db); $extrafields = new ExtraFields($db); $projectstatic = new Project($db); @@ -67,7 +67,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check if ($user->socid > 0) { diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index da8471988d9f0..ab8cb6a96b8c6 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -71,7 +71,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBooth($db); $extrafields = new ExtraFields($db); $projectstatic = new Project($db); @@ -84,7 +84,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. if ($id > 0 || !empty($ref)) { $upload_dir = $conf->eventorganization->multidir_output[$object->entity ? $object->entity : $conf->entity]."/conferenceorbooth/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 43a6d1be07e92..4211eba558a73 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -70,7 +70,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBooth($db); $project = new Project($db); $extrafields = new ExtraFields($db); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 4e6074703a697..f400e55e38a38 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -54,7 +54,7 @@ $fk_project = GETPOSTINT('fk_project'); $withproject = 1; -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBoothAttendee($db); $extrafields = new ExtraFields($db); $projectstatic = new Project($db); @@ -105,7 +105,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Now we have loaded the attendee, we can force the project (in case value provided as parameter is wrong or value not provided) if ($object->fk_project > 0) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 04d491ef5da5d..262b1df7b51eb 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -78,7 +78,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBoothAttendee($db); $project = new Project($db); $projectstatic = new Project($db); diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 66caf29a24709..12cd4852d27a0 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -40,7 +40,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new ConferenceOrBoothAttendee($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id; @@ -54,7 +54,7 @@ //$result = restrictedArea($user, 'eventorganization', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->eventorganization->multidir_output[$object->entity]."/".$object->id; } @@ -74,7 +74,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } /* diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index a388a57cc6369..d7ed5a2c5e74f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -105,9 +105,9 @@ $extrafields->fetch_name_optionals_label($objectorder->table_element_line); // Load object. Make an object->fetch -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('expeditioncard', 'globalcard')); $date_delivery = dol_mktime(GETPOSTINT('date_deliveryhour'), GETPOSTINT('date_deliverymin'), 0, GETPOSTINT('date_deliverymonth'), GETPOSTINT('date_deliveryday'), GETPOSTINT('date_deliveryyear')); @@ -152,7 +152,7 @@ } } - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' // Actions to build doc $upload_dir = $conf->expedition->dir_output.'/sending'; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index e8adbfe755d49..7ad70bc9359a5 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -34,7 +34,7 @@ $socid = GETPOSTINT('socid'); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('sendingindex')); // Load translation files required by the page diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index e9569c98b4616..e1616338c6c97 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -101,7 +101,7 @@ $object = new Expedition($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('shipmentlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 1128bc9dbb680..11fabc52245c8 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -84,7 +84,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 717f7f36d21d8..c7580698fd0f6 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' // Security check if ($user->socid) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 6079b8d3b2aaa..d08d44b28758d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -110,9 +110,9 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('expensereportcard', 'globalcard')); $permissionnote = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_setnotes.inc.php @@ -213,11 +213,11 @@ } } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $user->hasRight('expensereport', 'creer')) { diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index c28c5251dc128..9ce6c27a8a1e9 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -73,7 +73,7 @@ $modulepart = 'trip'; // Load object -//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // Security check if ($user->socid) { diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 9e24d253e58e8..b9c0298cc2aff 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -35,7 +35,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('expensereportindex')); // Load translation files required by the page diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 59f035177771e..e6e1e44ba78e0 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -136,7 +136,7 @@ $search_user = -1; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new ExpenseReport($db); $hookmanager->initHooks(array('expensereportlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index 157403f4873a0..8096e685d9c82 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -80,7 +80,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 5efef914f43ea..e064cbb3508c7 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -114,7 +114,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('paymentexpensereportlist')); $object = new PaymentExpenseReport($db); diff --git a/htdocs/fichinter/agenda.php b/htdocs/fichinter/agenda.php index e348b888d5528..9e08562164a82 100644 --- a/htdocs/fichinter/agenda.php +++ b/htdocs/fichinter/agenda.php @@ -68,7 +68,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Fichinter($db); $extrafields = new ExtraFields($db); @@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals $permissiontoread = $user->hasRight("fichinter", "lire"); $permissiontoadd = $user->hasRight("fichinter", "creer"); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index dba6a24c4d7d3..42c4cc1867275 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -81,7 +81,7 @@ $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); $hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('interventioncard', 'globalcard')); $object = new Fichinter($db); @@ -148,9 +148,9 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $user->hasRight('ficheinter', 'creer')) { diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index ca8b9349c9e9a..d35cc71b350e4 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -37,7 +37,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('interventionindex')); // Load translation files required by the page diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 22fbbb869799d..58aae628c25ce 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -102,7 +102,7 @@ $sortfield = "f.ref"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Fichinter($db); $hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 1bae3398b59a7..98ec1fdb7fc38 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -60,7 +60,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 78404298d500b..a77a665440ae9 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -73,7 +73,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartysupplier', 'globalcard')); // Security check diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 1235ee651fb83..29185532aacd3 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -103,7 +103,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ordersuppliercard', 'globalcard')); $object = new CommandeFournisseur($db); @@ -205,11 +205,11 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' if ($action == 'setref_supplier' && $usercancreate) { $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier', 'alpha'), '', null, 'text', '', $user, 'ORDER_SUPPLIER_MODIFY'); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index da489614f4c05..ee6ca36224a7d 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -39,7 +39,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('orderssuppliersindex')); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bee99153ffe25..dd0559a162cbb 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -152,7 +152,7 @@ $sortorder = 'DESC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new CommandeFournisseur($db); $hookmanager->initHooks(array('supplierorderlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index e6f5c92e18296..bc6bd48941195 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -69,7 +69,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 9043bafe6d01a..f957c21f94081 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -102,7 +102,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplierinvoicereccard', 'globalcard')); $extrafields = new ExtraFields($db); @@ -160,11 +160,11 @@ include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; // Set note - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Create predefined invoice if ($action == 'add') { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a5ccd9c19e43a..d8c1344642175 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -91,7 +91,7 @@ $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); $hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicesuppliercard', 'globalcard')); $object = new FactureFournisseur($db); @@ -174,11 +174,11 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Link invoice to order if (GETPOST('linkedOrder') && empty($cancel) && $id > 0) { diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 5412be295ea90..a086d06e21215 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -110,7 +110,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new FactureFournisseurRec($db); $extrafields = new ExtraFields($db); @@ -121,7 +121,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplierinvoicereclist')); // Fetch optionals attributes and labels diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 43d8d30a00bec..457e7cae3914e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -144,7 +144,7 @@ $now = dol_now(); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new FactureFournisseur($db); $hookmanager->initHooks(array('supplierinvoicelist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 41b2b1f4d3414..36f26c68c2a88 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -45,7 +45,7 @@ if ($user->socid) { $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicesuppliernote')); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); @@ -67,7 +67,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } // Set label diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index e2f2a99836d9a..cbcfa796f6a3c 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -99,7 +99,7 @@ $object = new PaiementFourn($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('paymentsupplierlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index b846a944f2b8b..12cf826ad8ad6 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -50,11 +50,11 @@ // Initialize objects $object = new PaiementFourn($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplierpaymentcard', 'globalcard')); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); // This also test permission on read invoice diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php index 42e1a641e071c..c61cae315750a 100644 --- a/htdocs/fourn/paiement/info.php +++ b/htdocs/fourn/paiement/info.php @@ -41,7 +41,7 @@ $object = new PaiementFourn($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 2ceae859c94c0..b8be196ef9532 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -110,7 +110,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('paymentsupplierlist')); $object = new PaiementFourn($db); diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 6ed8503fc009a..556241e456ef2 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -74,7 +74,7 @@ $catid = GETPOST('catid', 'intcomma'); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('supplierpricelist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index 02419cea24cbb..f13edd0853ef1 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -39,7 +39,7 @@ } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplierbalencelist', 'globalcard')); /* diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index ca5c3e631bc70..688adfc8e85c9 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -92,7 +92,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('holidaycard', 'globalcard')); $cancreate = 0; diff --git a/htdocs/holiday/card_group.php b/htdocs/holiday/card_group.php index 9060ba7e1f8d5..7dfa390008f28 100644 --- a/htdocs/holiday/card_group.php +++ b/htdocs/holiday/card_group.php @@ -92,7 +92,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('holidaycard', 'globalcard')); $cancreate = 0; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 94b8c2a3164ed..8e0d49af54211 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -66,7 +66,7 @@ } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('defineholidaylist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 218fe17870df5..2938bf2610117 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -99,7 +99,7 @@ $search_status = GETPOST('search_status', 'intcomma'); $search_type = GETPOST('search_type', 'intcomma'); -// Initialize technical objects +// Initialize a technical objects $object = new Holiday($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('holidaylist')); // Note that conf->hooks_modules contains array diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 2187692b95a09..4deca221612e0 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -80,7 +80,7 @@ // Load translation files required by the page $langs->loadLangs(array('users', 'other', 'holiday')); -// Initialize technical objects +// Initialize a technical objects $object = new Holiday($db); $extrafields = new ExtraFields($db); //$diroutputmassaction = $conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; diff --git a/htdocs/hrm/core/tpl/objectline_title.tpl.php b/htdocs/hrm/core/tpl/objectline_title.tpl.php index f96fd3a72f8bd..1e2d2810f0909 100644 --- a/htdocs/hrm/core/tpl/objectline_title.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_title.tpl.php @@ -24,7 +24,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/hrm/core/tpl/objectline_view.tpl.php b/htdocs/hrm/core/tpl/objectline_view.tpl.php index a325e303a106a..f1873e5ce681d 100644 --- a/htdocs/hrm/core/tpl/objectline_view.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_view.tpl.php @@ -24,7 +24,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index c2168814a8de2..018ee9229f1c7 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -50,7 +50,7 @@ $object = new Establishment($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' $permissiontoread = $user->admin; $permissiontoadd = $user->admin; // Used by the include of actions_addupdatedelete.inc.php diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 9577341667521..c74f10234a88a 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -63,7 +63,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Establishment($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -72,7 +72,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 93a699e254559..1392da9083498 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -75,7 +75,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -84,7 +84,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 5cddbd523be06..2d09c8cb05e6d 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -53,7 +53,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -78,7 +78,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions $permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index c3a53411b3470..4f32b57c99d15 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -45,7 +45,7 @@ $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -54,7 +54,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // Permissions $permission = $user->hasRight('hrm', 'evaluation', 'write'); diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index a83905abff98d..bd9ea7c653c3f 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -65,7 +65,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -74,7 +74,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/evaluation/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 4f1bb1de9f8b5..b73e82956f9f1 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -70,7 +70,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 1e078be00d98b..297f99b87eb28 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -44,7 +44,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -54,7 +54,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -81,7 +81,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 5045bc0bf02cd..c3d40aee823fc 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -52,7 +52,7 @@ } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager = new HookManager($db); $hookmanager->initHooks('hrmindex'); @@ -445,7 +445,7 @@ print ''; -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $parameters = array('user' => $user); $reshook = $hookmanager->executeHooks('dashboardHRM', $parameters, $object); // Note that $action and $object may have been modified by hook diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index ffd2887b66732..10be7bc94c50b 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -73,7 +73,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -82,7 +82,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index be87900e2c0a7..c70f0c5305c5d 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -50,7 +50,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; @@ -75,7 +75,7 @@ } // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions $permissiontoread = $user->hasRight('hrm', 'all', 'read'); diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php index 2155f03308804..da1f0fccdb70d 100644 --- a/htdocs/hrm/job_document.php +++ b/htdocs/hrm/job_document.php @@ -63,7 +63,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index eb710892a9231..81f9f2b0c09ad 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -69,7 +69,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php index ff377cdbbe9a1..57d945e7a89f6 100644 --- a/htdocs/hrm/job_note.php +++ b/htdocs/hrm/job_note.php @@ -43,7 +43,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -53,7 +53,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -84,7 +84,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 8797dd4b77227..28bf2488c2863 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -74,7 +74,7 @@ $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Job($db); $objectposition = new Position($db); $extrafields = new ExtraFields($db); @@ -143,7 +143,7 @@ // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions $permissiontoread = $user->hasRight('hrm', 'all', 'read'); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 57560f901f332..3098eb87e2a90 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -75,7 +75,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -85,7 +85,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index ad28f36351a0c..2a667f4dad7d9 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -43,7 +43,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $id = GETPOSTINT('id'); -// Initialize technical objects +// Initialize a technical objects $form = new Form($db); $object = new Position($db); $res = $object->fetch($id); @@ -87,7 +87,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // $lineid = GETPOST('lineid', 'int'); -// Initialize technical objects +// Initialize a technical objects //$object = new Position($db); //$res = $object->fetch($id); /*if ($res < 0) { @@ -118,7 +118,7 @@ } // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. /* diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 539a8405f4a25..b149ba212eaeb 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -64,7 +64,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/position/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 864c14d5cba62..41a7207392106 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -69,7 +69,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Position($db); $extrafields = new ExtraFields($db); $userstatic = new User($db); diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index d3e8121b893d5..ec56ce7d407fe 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -42,7 +42,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -51,7 +51,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -82,7 +82,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 97a7a9ba97ff3..0940e223cce25 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -75,7 +75,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Skill($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -84,7 +84,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index d7b8e3d49ead6..587a3bb133788 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -50,7 +50,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new Skill($db); $extrafields = new ExtraFields($db); //$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -76,7 +76,7 @@ } // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions $permissiontoread = $user->hasRight('hrm', 'all', 'read'); @@ -526,7 +526,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; - // Initialize technical objects + // Initialize a technical objects $objectline = new Skilldet($db); // $diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; // $hookmanager->initHooks(array('skilldetlist')); // Note that conf->hooks_modules contains array diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php index 418208e046590..7e907414fb375 100644 --- a/htdocs/hrm/skill_document.php +++ b/htdocs/hrm/skill_document.php @@ -64,7 +64,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Skill($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/skill/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 8d73bb14783ea..164f5be221bec 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -70,7 +70,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Skill($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php index 4b2b4bfe42702..2888f12a798b6 100644 --- a/htdocs/hrm/skill_note.php +++ b/htdocs/hrm/skill_note.php @@ -42,7 +42,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Skill($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; @@ -51,7 +51,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -82,7 +82,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index ea6715d77345c..e9dc791e37615 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -66,7 +66,7 @@ $TAuthorizedObjects = array('job', 'user'); $skill = new SkillRank($db); -// Initialize technical objects +// Initialize a technical objects if (in_array($objecttype, $TAuthorizedObjects)) { if ($objecttype == 'job') { $object = new Job($db); @@ -80,7 +80,7 @@ $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array // Load object -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. if (method_exists($object, 'loadPersonalConf')) { $object->loadPersonalConf(); } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 00d059bc50483..4e9b3f5b783c3 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -148,7 +148,7 @@ $separator_used = str_replace('\t', "\t", $separator); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('imports')); diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 46111f46912c8..27a08a6f4ce7c 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -295,7 +295,7 @@ static function ($arg) { $conf->db->user = ''; } -// Define array of document root directories +// Define an array of document root directories $conf->file->dol_document_root = array(DOL_DOCUMENT_ROOT); if (!empty($dolibarr_main_document_root_alt)) { // dolibarr_main_document_root_alt contains several directories diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 8557b019fa6ef..edd0dd5ab9e30 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -65,7 +65,7 @@ "expedition" => $langs->trans("Expedition"), ); -// Initialize technical objects +// Initialize a technical objects $object = new IntracommReport($db); if ($id > 0) { $object->fetch($id); @@ -73,7 +73,7 @@ $form = new Form($db); $formother = new FormOther($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('intracommcard', 'globalcard')); $error = 0; diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 9c5741ac040ff..aef3a5fbbeaf5 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -82,7 +82,7 @@ } } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $object = new IntracommReport($db); $hookmanager->initHooks(array('intracommreportlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index c0617a8d80b69..9e880510f651b 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -71,7 +71,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new KnowledgeRecord($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id; @@ -80,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = (!empty($conf->knowledgemanagement->multidir_output[$object->entity]) ? $conf->knowledgemanagement->multidir_output[$object->entity] : $conf->knowledgemanagement->dir_output)."/".$object->id; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 045a60a49dc41..5b55a29cb5ffd 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -46,7 +46,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new KnowledgeRecord($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id; @@ -71,7 +71,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read'); diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index 461d88e13fcc4..26bf15731ab8f 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_contact.php +++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php @@ -39,7 +39,7 @@ $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new KnowledgeRecord($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id; @@ -48,7 +48,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index 135ef0108429a..8bc6eb40cef54 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -60,7 +60,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new KnowledgeRecord($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id; @@ -69,7 +69,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->knowledgemanagement->multidir_output[$object->entity ? $object->entity : $conf->entity]."/knowledgerecord/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 043ab6327b77f..adffaf0b8a334 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -69,7 +69,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new KnowledgeRecord($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 490b3ce5f34d4..a0773071f849c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -38,7 +38,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new KnowledgeRecord($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->knowledgemanagement->dir_output.'/temp/massgeneration/'.$user->id; @@ -47,7 +47,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->knowledgemanagement->multidir_output[$object->entity]."/".$object->id; } @@ -71,7 +71,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 3c881e7555738..f3d54d824f362 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -41,7 +41,7 @@ EVENTORGANIZATION_FILTERATTENDEES_TYPE = In the form to create/add an attendee, # Object OrganizedEvent=Organized event EventOrganizationConfOrBooth= Conference Or Booth -EventOrganizationConfOrBoothes=Conferences or Boothes +EventOrganizationConfOrBoothes=Conferences or Booths ManageOrganizeEvent = Manage the organization of an event ConferenceOrBooth = Conference Or Booth ConferenceOrBoothTab = Conference Or Booth @@ -78,7 +78,7 @@ ConferenceOrBoothFormatCode=Code of conference or booth mode ConferenceOrBoothFormatLabel=Label of conference or booth mode Attendees=Attendees ListOfAttendeesOfEvent=List of attendees of event projects -ListOfConfOrBoothOfEvent=List of conferences or boothes of event projects +ListOfConfOrBoothOfEvent=List of conferences or booths of event projects DownloadICSLink = Download ICS link EVENTORGANIZATION_SECUREKEY = Seed to secure the key for the public registration page to suggest a conference SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 8271a8869f970..51cf078a4f802 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -55,7 +55,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Loan($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->loan->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 62d84a1adbc22..a8c6cf0c37d19 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -65,7 +65,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3e3184520452a..250c39f5f31ec 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1160,7 +1160,7 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type, $stopcode = 1) header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); exit; } else { - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('main')); // Code for search criteria persistence. diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 33a6b0e72ceae..c484f01495e88 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -81,7 +81,7 @@ // Security check $result = restrictedArea($user, 'margins'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new User($db); $hookmanager->initHooks(array('marginagentlist')); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 1504b68dea84a..d2f327724f640 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -58,7 +58,7 @@ $enddate = dol_mktime(23, 59, 59, GETPOSTINT('enddatemonth'), GETPOSTINT('enddateday'), GETPOST('enddateyear')); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Societe($db); $hookmanager->initHooks(array('margincustomerlist')); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index ed286d71f229c..562540187cc76 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -71,7 +71,7 @@ $enddate = dol_mktime(23, 59, 59, GETPOSTINT('enddatemonth'), GETPOSTINT('enddateday'), GETPOST('enddateyear')); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Product($db); $hookmanager->initHooks(array('marginproductlist')); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 1232867ed3bed..5efcde97c7179 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -58,7 +58,7 @@ $object->fetch($socid); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartymargins', 'globalcard')); $result = restrictedArea($user, 'societe', $object->id, ''); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 2539d9748c141..0a03587ebb6cf 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -85,8 +85,8 @@ function is_countable($c) $conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug) $conf->file->instance_unique_id = empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; // Unique id of instance $conf->file->dol_main_url_root = $dolibarr_main_url_root; // Define url inside the config file -$conf->file->dol_document_root = array('main' => (string) DOL_DOCUMENT_ROOT); // Define array of document root directories ('/home/htdocs') -$conf->file->dol_url_root = array('main' => (string) DOL_URL_ROOT); // Define array of url root path ('' or '/dolibarr') +$conf->file->dol_document_root = array('main' => (string) DOL_DOCUMENT_ROOT); // Define an array of document root directories ('/home/htdocs') +$conf->file->dol_url_root = array('main' => (string) DOL_URL_ROOT); // Define an array of url root path ('' or '/dolibarr') if (!empty($dolibarr_main_document_root_alt)) { // dolibarr_main_document_root_alt can contains several directories $values = preg_split('/[;,]/', $dolibarr_main_document_root_alt); diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index eaaf8206e87c3..abfb0f90d6b37 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -61,7 +61,7 @@ // Translations $langs->loadLangs(array("admin", "mymodule@mymodule")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('mymodulesetup', 'globalsetup')); // Parameters diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index cd6bc38701e53..baf04bf9c70fa 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -118,7 +118,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; @@ -127,7 +127,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 037d3abc38c52..71192032e8c05 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -105,7 +105,7 @@ $dol_openinpopup = $tmpbacktopagejsfields[0]; } -// Initialize technical objects +// Initialize a technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; @@ -130,7 +130,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php index f7669ae118d48..6f1e63f280b04 100644 --- a/htdocs/modulebuilder/template/myobject_contact.php +++ b/htdocs/modulebuilder/template/myobject_contact.php @@ -68,7 +68,7 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; @@ -77,7 +77,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 5c36a55972340..85bebb0e65855 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -109,7 +109,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; @@ -119,7 +119,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 31bd7f40717a2..9ba9924f6b660 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -116,7 +116,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index c0edbbeffae22..283bf743067bb 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -89,7 +89,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; @@ -98,7 +98,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mymodule->multidir_output[empty($object->entity) ? $conf->entity : $object->entity]."/".$object->id; } @@ -140,7 +140,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index aa1b37d12ebcc..6028ceb5266c5 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -33,7 +33,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('mrpindex')); // Load translation files required by the page diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 5067cd662f026..8284c12ae2159 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -72,7 +72,7 @@ $sortorder = 'DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; @@ -82,7 +82,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mrp->multidir_output[$object->entity]."/".$object->id; } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index df1f9e6468366..306ba0edcb7cc 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -56,7 +56,7 @@ $lineid = GETPOSTINT('lineid'); $socid = GETPOSTINT("socid"); -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $objectbom = new BOM($db); @@ -83,7 +83,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. if (GETPOSTINT('fk_bom') > 0) { $objectbom->fetch(GETPOSTINT('fk_bom')); @@ -282,7 +282,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Action to move up and down lines of object - //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Action close produced if ($action == 'confirm_produced' && $confirm == 'yes' && $permissiontoadd) { diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 6afe0f356866a..31487c38a1f14 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -62,7 +62,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; @@ -72,7 +72,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 76caec517df66..d46925f00556c 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -68,7 +68,7 @@ //if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortorder) $sortorder="DESC"; -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 8131948235130..4eca847ceac3c 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -83,7 +83,7 @@ $sortorder = "DESC"; } -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; @@ -108,7 +108,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); @@ -235,7 +235,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Action to move up and down lines of object - //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' if ($action == 'set_thirdparty' && $permissiontoadd) { $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 9d24201da2e30..40d590c6ff94c 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -40,7 +40,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; @@ -50,7 +50,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mrp->multidir_output[empty($object->entity) ? $conf->entity : $object->entity]."/".$object->id; } @@ -75,7 +75,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 789dfe604cc65..e01db20309c3b 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -59,7 +59,7 @@ $collapse = GETPOST('collapse', 'aZ09comma'); -// Initialize technical objects +// Initialize a technical objects $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; @@ -86,7 +86,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); @@ -169,7 +169,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Action to move up and down lines of object - //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' if ($action == 'set_thirdparty' && $permissiontoadd) { $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 22791f2cb5586..984d9ae559487 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -81,13 +81,13 @@ $texte = ''; $newcardbutton = ''; -// Initialize technical objects +// Initialize a technical objects $object = new CurrencyRate($db); $form = new Form($db); $extrafields = new ExtraFields($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('EditorRatelist', 'globallist')); if (empty($action)) { diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index cc35972651348..b0e5f407dd9f7 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -56,7 +56,7 @@ exit; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('surveycard', 'globalcard')); $expiredate = dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear')); diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 0bbbbf8879967..b8cba8a84db22 100644 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -38,7 +38,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('opensurveyindex')); diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index e1cb682ea33a1..6b5f0e277a096 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -59,7 +59,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Opensurveysondage($db); $opensurvey_static = new Opensurveysondage($db); diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index f625010635e85..b56ca45d814bc 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -71,7 +71,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; @@ -80,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->partnership->multidir_output[$object->entity]."/".$object->id; } diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index f0cf3eb86343b..d8ff622ae65b7 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -45,7 +45,7 @@ $lineid = GETPOSTINT('lineid'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; @@ -71,7 +71,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('partnership', 'read'); diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 1f8c46b808352..ba58fa6e5f5a4 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -40,7 +40,7 @@ $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; @@ -49,7 +49,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals $permissiontoread = $user->hasRight('partnership', 'read'); $permission = $user->hasRight('partnership', 'write'); diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index 8dcfd23b29425..ce96c4f50bb53 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -60,7 +60,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; @@ -69,7 +69,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->partnership->multidir_output[$object->entity ? $object->entity : $conf->entity]."/partnership/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 09dd60c7d29d4..78454290d65fd 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -67,7 +67,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $adherent = new Adherent($db); diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index bfb9c735bb254..2753a8a4593ea 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -38,7 +38,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Partnership($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; @@ -52,7 +52,7 @@ //$result = restrictedArea($user, 'partnership', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->partnership->multidir_output[$object->entity]."/".$object->id; } @@ -90,7 +90,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index cacbe90dd327f..2ba9198484d3f 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -73,7 +73,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productagenda')); $object = new Product($db); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f362e851eb462..89370e2abc372 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -197,7 +197,7 @@ restrictedArea($user, 'produit|service', 0, 'product&product', '', '', $fieldtype); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productcard', 'globalcard')); // Permissions diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 8d3d1987c8a6b..dd7b728cb775a 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -53,7 +53,7 @@ $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productcompositioncard', 'globalcard')); $object = new Product($db); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 4749ea17b4721..3caedef6f8f55 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -58,7 +58,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productdocuments')); // Get parameters diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 277ccb978751e..45af0f4bffca9 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -47,7 +47,7 @@ // Load translation files required by the page $langs->loadLangs(array('products', 'stocks')); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('productindex')); // Initialize objects diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 7b9071f6fa619..2fc3e789ac5ab 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -48,7 +48,7 @@ $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } -// Initialize technical objects +// Initialize a technical objects $object = new Inventory($db); $extrafields = new ExtraFields($db); // no inventory docs yet @@ -76,7 +76,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index c5f36f8cc21a6..08ec41b6b46a0 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -64,7 +64,7 @@ $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } -// Initialize technical objects +// Initialize a technical objects $object = new Inventory($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; @@ -89,7 +89,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 6335bf3c68e28..5d7258f7c76fa 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -58,7 +58,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Inventory($db); $extrafields = new ExtraFields($db); // no inventory docs yet diff --git a/htdocs/product/list.php b/htdocs/product/list.php index fceb1781b519f..6132e5460d7e9 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -154,7 +154,7 @@ } } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $object = new Product($db); $hookmanager->initHooks(array('productservicelist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/product/messaging.php b/htdocs/product/messaging.php index fc9d8b66e79ce..73470d4801cbc 100644 --- a/htdocs/product/messaging.php +++ b/htdocs/product/messaging.php @@ -72,13 +72,13 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Product($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check diff --git a/htdocs/product/note.php b/htdocs/product/note.php index 623c88114cacf..b718f9894ec2b 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -77,7 +77,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 6be4f7efa8686..23203912b0ee3 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -80,7 +80,7 @@ $conf->global->PRODUIT_MULTIPRICES_LIMIT = 5; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productpricecard', 'globalcard')); if ($object->id > 0) { diff --git a/htdocs/product/price_suppliers.php b/htdocs/product/price_suppliers.php index 897e1ee83a15f..72f255afdcdd2 100644 --- a/htdocs/product/price_suppliers.php +++ b/htdocs/product/price_suppliers.php @@ -98,7 +98,7 @@ $sortorder = "ASC"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('pricesuppliercard', 'globalcard')); $object = new ProductFournisseur($db); diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index e471426e52dea..3558da356472c 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -96,7 +96,7 @@ $virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs. } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productreassortlist')); if ($user->socid) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 1472dafe6ce9e..f43993f4e19e2 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -128,7 +128,7 @@ $objcanvas->getCanvas('product', 'list', $canvas); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('reassortlotlist')); // Definition of array of fields for columns diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index fe6efca508f24..97a7928280e28 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -44,7 +44,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsbom')); $option = ''; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 8a6eca21ac8dd..bae4dde975762 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -66,7 +66,7 @@ $fieldvalue = ($id > 0 ? $id : $ref); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatscard', 'globalcard')); $tmp = dol_getdate(dol_now()); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 78854c359bc0b..3938a12ac3253 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -46,7 +46,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsorder')); // Load variable for pagination diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index fd0b1f092bf5f..6aae0d6e78b28 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -44,7 +44,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatssupplierorder')); $mesg = ''; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 71c3bc007ac0a..ad2f9d2299625 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -42,7 +42,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatscontract')); // Load variable for pagination diff --git a/htdocs/product/stats/expedition.php b/htdocs/product/stats/expedition.php index 457c35a611190..4ea3eb5e000c7 100644 --- a/htdocs/product/stats/expedition.php +++ b/htdocs/product/stats/expedition.php @@ -47,7 +47,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsexpedition')); // Load variable for pagination diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 8a584b73276a2..7c6570dbe2327 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -46,7 +46,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsinvoice')); $extrafields = new ExtraFields($db); diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index cbb1ad84c1274..69d7f08851322 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -46,7 +46,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatssupplierinvoice')); $option = ''; diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index 52bb03e7f9afa..69c1905031d57 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -47,7 +47,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsinvoice')); $showmessage = GETPOST('showmessage'); diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 1ae40f71f57b7..53ccc1dc88a4c 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -44,7 +44,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsmo')); // Load variable for pagination diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 87d171e704eb4..abfe0c64614b5 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -46,7 +46,7 @@ } $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatspropal')); // Load variable for pagination diff --git a/htdocs/product/stats/reception.php b/htdocs/product/stats/reception.php index 4648f93f5b47b..61b0bcfc9101a 100644 --- a/htdocs/product/stats/reception.php +++ b/htdocs/product/stats/reception.php @@ -46,7 +46,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatsreception')); // Load variable for pagination diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index f40e03d764264..3a1106b0e9ca0 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -45,7 +45,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productstatssupplierpropal')); // Load variable for pagination diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 339469e0012ec..b89e5f16929a1 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -76,7 +76,7 @@ //$result=restrictedArea($user,'stock', $id, 'entrepot&stock'); $result = restrictedArea($user, 'stock'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('warehousecard', 'stocklist', 'globalcard')); $object = new Entrepot($db); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 0329bbe0b9572..1c40346aa7688 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -33,7 +33,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('stockindex')); // Load translation files required by the page diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 9373a6d701430..931d53e18b216 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -68,7 +68,7 @@ // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; } -// Initialize technical objects +// Initialize a technical objects $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -79,7 +79,7 @@ $sortorder = "ASC"; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Entrepot($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index b5642d3870fbb..df89401e1c860 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -92,7 +92,7 @@ $pdluoid = GETPOSTINT('pdluoid'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new MouvementStock($db); $hookmanager->initHooks(array('movementlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 4e4c4500dc7b8..cf3158d86c51c 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -114,7 +114,7 @@ $pdluoid = GETPOSTINT('pdluoid'); -// Initialize technical objects +// Initialize a technical objects $object = new MouvementStock($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index d641db5799933..43d34310aafed 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -110,7 +110,7 @@ $objcanvas->getCanvas('stockproduct', 'card', $canvas); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('stockproductcard', 'globalcard')); $error = 0; diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index e842d88db523c..a904c7df52b48 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -53,7 +53,7 @@ $productid = GETPOSTINT('productid'); $ref = GETPOST('ref', 'alpha'); // ref is productid_batch -// Initialize technical objects +// Initialize a technical objects $object = new Productlot($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('productlotcard', 'globalcard')); // Note that conf->hooks_modules contains array @@ -88,7 +88,7 @@ } // Load object -//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id || $ref) { if ($ref) { $tmp = explode('_', $ref); @@ -105,7 +105,7 @@ } } -// Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks of modules. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('productlotcard', 'globalcard')); diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 08dc3b1b6a871..e594d612f73cf 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -56,7 +56,7 @@ } $result = restrictedArea($user, 'produit|service'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productlotdocuments')); // Get parameters diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 79e89258c99ac..3b96ffe24835b 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -65,7 +65,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $object = new Productlot($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->productbatch->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/product/stock/productlot_note.php b/htdocs/product/stock/productlot_note.php index 74c94602185dc..f0975155480bf 100644 --- a/htdocs/product/stock/productlot_note.php +++ b/htdocs/product/stock/productlot_note.php @@ -36,7 +36,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -// Initialize technical objects +// Initialize a technical objects $object = new Productlot($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->productlot->dir_output.'/temp/massgeneration/'.$user->id; @@ -45,7 +45,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->productlot->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -70,7 +70,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 7dd8856a43632..2335f4d391385 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -46,7 +46,7 @@ } $result = restrictedArea($user, 'produit|service'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('stockreplenishlist')); //checks if a product has been ordered diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index f09dfa47de6f0..52680fe20af60 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -50,7 +50,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('batchproductstatssupplierorder')); $showmessage = GETPOST('showmessage'); diff --git a/htdocs/product/stock/stats/expedition.php b/htdocs/product/stock/stats/expedition.php index b084b4bd2223e..31d1ee17f4641 100644 --- a/htdocs/product/stock/stats/expedition.php +++ b/htdocs/product/stock/stats/expedition.php @@ -50,7 +50,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('batchproductstatsexpedition')); $showmessage = GETPOST('showmessage'); diff --git a/htdocs/product/stock/stats/mo.php b/htdocs/product/stock/stats/mo.php index 1fb6eaf7a9457..5e26155ea5704 100644 --- a/htdocs/product/stock/stats/mo.php +++ b/htdocs/product/stock/stats/mo.php @@ -45,7 +45,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('batchproductstatsmo')); // Load variable for pagination diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index 33f993d2f5510..2d1f23edc7ce1 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -50,7 +50,7 @@ $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('batchproductstatsreception')); $showmessage = GETPOST('showmessage'); diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 0c16e56a89822..4475f326832b3 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -39,7 +39,7 @@ // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'orders')); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('stockatdate')); // Security check diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index bf0f3152d5a42..9f9ce23f60847 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -69,7 +69,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new StockTransfer($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stocktransfer->dir_output.'/temp/massgeneration/'.$user->id; @@ -78,7 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id; } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 40d143ac4d736..837e8bc5eedca 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -61,7 +61,7 @@ $batch = GETPOST('batch', 'alpha'); $code_inv = GETPOST('inventorycode', 'alphanohtml'); -// Initialize technical objects +// Initialize a technical objects $object = new StockTransfer($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stocktransfer->dir_output.'/temp/massgeneration/'.$user->id; @@ -86,7 +86,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('stocktransfer', 'stocktransfer', 'read'); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index 70150bdc028c5..7d6a138fea61f 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -59,7 +59,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new StockTransfer($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stocktransfer->dir_output.'/temp/massgeneration/'.$user->id; @@ -68,7 +68,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals //if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity?$object->entity:$conf->entity] . "/stocktransfer/" . dol_sanitizeFileName($object->id); if ($id > 0 || !empty($ref)) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index da87eb71191e7..7364c1e0c28cf 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -61,7 +61,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new StockTransfer($db); $extrafields = new ExtraFields($db); $diroutputmassaction = getMultidirOutput($object).'/temp/massgeneration/'.$user->id; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_note.php b/htdocs/product/stock/stocktransfer/stocktransfer_note.php index ccbfa8cfe9e4b..7f85f805c27d6 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_note.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_note.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new StockTransfer($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->stocktransfer->dir_output.'/temp/massgeneration/'.$user->id; @@ -51,7 +51,7 @@ //$result = restrictedArea($user, 'stocktransfer', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id; } @@ -65,7 +65,7 @@ * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' /* diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index d880e516500f2..757805e0130b3 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $action * $conf diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 899e0d0dbb421..ca9529267b49e 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -64,7 +64,7 @@ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('producttranslationcard', 'globalcard')); diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 2e257cf79bd4e..8b37500764692 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -39,7 +39,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('activityindex')); // Security check diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6b1edad2c2382..42ce3bd1748ba 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -78,7 +78,7 @@ $mine = GETPOST('mode') == 'mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projectcard', 'globalcard')); $object = new Project($db); @@ -162,7 +162,7 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' // Action setdraft object if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) { diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index cceb564e7e048..c4e98fb0ebfa3 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -54,7 +54,7 @@ accessforbidden(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projectcard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index db8b06f371c81..51c0113904b07 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -54,7 +54,7 @@ $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index c9190870ff1d3..577999144ac09 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -45,7 +45,7 @@ $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index f4a20b6020148..9ff27e0afcf7a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -180,7 +180,7 @@ $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index b88e9a899f77f..64db1dd61a616 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -43,7 +43,7 @@ $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 0a1d665780fb1..38e0070626748 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -34,7 +34,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('projectsindex')); // Load translation files required by the page diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4a51e6f1316e2..2ae144d002b3e 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -190,7 +190,7 @@ $search_status = (GETPOST('search_status', 'intcomma') != '' ? GETPOST('search_status', 'intcomma') : '0,1'); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Project($db); $hookmanager->initHooks(array('projectlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index c01c81de5257f..83f259d1287ba 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -40,7 +40,7 @@ $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } @@ -64,7 +64,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d770f23f4f5ff..cd51707d7ba17 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -113,7 +113,7 @@ $taskstatic = new Task($db); $extrafields = new ExtraFields($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { $object->fetchComments(); } @@ -142,7 +142,7 @@ $diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projecttaskscard', 'globalcard')); $progress = GETPOSTINT('progress'); diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 10750562add67..6251418aef53e 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -48,7 +48,7 @@ $project_ref = GETPOST('project_ref', 'alpha'); $planned_workload = ((GETPOSTINT('planned_workloadhour') != '' || GETPOSTINT('planned_workloadmin') != '') ? (GETPOSTINT('planned_workloadhour') > 0 ? GETPOSTINT('planned_workloadhour') * 3600 : 0) + (GETPOSTINT('planned_workloadmin') > 0 ? GETPOSTINT('planned_workloadmin') * 60 : 0) : ''); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projecttaskcommentcard', 'globalcard')); $object = new Task($db); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 85b6c5a03a7c3..e13ba57f2e59e 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -108,7 +108,7 @@ // Initialize context for list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'tasklist'; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Task($db); $hookmanager->initHooks(array('tasklist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index dfd36d12df799..92538636bc36c 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -104,7 +104,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index fbf8fdc1e45e6..fd8585c588dd2 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -55,7 +55,7 @@ $planned_workload = ((GETPOST('planned_workloadhour') != '' || GETPOST('planned_workloadmin') != '') ? (GETPOSTINT('planned_workloadhour') > 0 ? GETPOSTINT('planned_workloadhour') * 3600 : 0) + (GETPOSTINT('planned_workloadmin') > 0 ? GETPOSTINT('planned_workloadmin') * 60 : 0) : ''); $mode = GETPOST('mode', 'alpha'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projecttaskcard', 'globalcard')); $object = new Task($db); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ff04c97ef4902..4d020e03ac08d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -111,7 +111,7 @@ $childids = $user->getAllChildIds(1); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context //$object = new TaskTime($db); $hookmanager->initHooks(array('projecttasktime', 'globalcard')); @@ -1241,7 +1241,7 @@ if ($projectstatic->id > 0 || $allprojectforuser > 0) { - // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array + // Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('tasktimelist')); $formconfirm = ''; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 23a7673def226..284dfd6091ea7 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -172,7 +172,7 @@ function llxFooterVierge() exit; } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('agendaexport')); $reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $action and $object may have been modified by some diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index b6e84d2437bbd..15808c7681c08 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -87,7 +87,7 @@ $permissiontoadd = $user->hasRight('societe', 'creer'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 011f594a8c475..c4f4d32041cd7 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -53,7 +53,7 @@ httponly_accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page'); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $res = $hookmanager->initHooks(array('demo')); $demoprofiles = array(); diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index f8bacc3d940da..2eede71a81427 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -139,7 +139,7 @@ // Load translation files $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 8fc8e51457802..a94c09cf1192c 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -91,7 +91,7 @@ httponly_accessforbidden("Auto subscription form for public visitors has not been enabled"); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index d97cae4ef8eac..b38b114089626 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -168,7 +168,7 @@ httponly_accessforbidden($langs->trans('ErrorBadParameters')." - Bad value for source. Value not supported.", 400, 1); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('onlinesign')); $error = 0; diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index 9a1db3d88ccab..26500400ebc0a 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -79,7 +79,7 @@ httponly_accessforbidden("Auto subscription form for public visitors has not been enabled"); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 0b41a315145da..3fea349ceaeed 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -73,7 +73,7 @@ exit; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewleadcard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index d5abd93171615..160ae7da02fb0 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -94,7 +94,7 @@ // Load translation files $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 063c0508d20bd..70a87215f22f9 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -95,7 +95,7 @@ // Load translation files $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); $extrafields = new ExtraFields($db); diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index e4401520ca068..10b0cf496b1c3 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -79,7 +79,7 @@ $backtopage = ''; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('publicnewticketcard', 'globalcard')); $object = new Ticket($db); diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index db7a20b4f01a0..6413bb102d3e7 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -79,7 +79,7 @@ $object = new Ticket($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ticketpubliclist', 'globalcard')); if (!isModEnabled('ticket')) { diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 7be70ec70ee35..ff1da7c898bfd 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -227,7 +227,7 @@ $form = new Form($db); $formticket = new FormTicket($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('ticketpublicview', 'globalcard')); if (!getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE')) { diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 6b28afe31deae..4c06be7396b7d 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -112,9 +112,9 @@ $extrafields->fetch_name_optionals_label($objectorder->table_element_line); // Load object. Make an object->fetch -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('receptioncard', 'globalcard')); $date_delivery = dol_mktime(GETPOSTINT('date_deliveryhour'), GETPOSTINT('date_deliverymin'), 0, GETPOSTINT('date_deliverymonth'), GETPOSTINT('date_deliveryday'), GETPOSTINT('date_deliveryyear')); @@ -208,7 +208,7 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' // Reopen if ($action == 'reopen' && $permissiontoadd) { diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index e9a0ffa6738e5..a41a6ec838f76 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -88,7 +88,7 @@ $upload_dir = $conf->reception->dir_output."/".dol_sanitizeFileName($object->ref); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('receptiondocument')); // Security check diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 3665ae8d27fcd..dc960e9d256bc 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -32,7 +32,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('receptionindex')); $langs->loadLangs(array("orders", "receptions")); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index c7b9f2f615fc9..236f49c998714 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -101,7 +101,7 @@ $diroutputmassaction = $conf->reception->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; $object = new Reception($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('receptionlist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index d726fa6f81302..f80f3375ae5a8 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -61,7 +61,7 @@ } } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('receptionnote')); // Security check @@ -106,7 +106,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 8f685bb1b14cf..b3f3a36de152b 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -71,7 +71,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentCandidature($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -80,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 813f0b7467729..5e24742cd0c8e 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -45,7 +45,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentCandidature($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -70,7 +70,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('recruitment', 'recruitmentjobposition', 'read'); diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 741e0107a45d9..19aaae140d2be 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -59,7 +59,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentCandidature($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -68,7 +68,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentcandidature/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 2a31b345c4a09..41aa72806fb89 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -62,7 +62,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentCandidature($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index ba6660db5c483..33958bd0b3f90 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentCandidature($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -46,7 +46,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -70,7 +70,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index e433b72ba2bd2..05e5bf29db783 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -70,7 +70,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentJobPosition($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -79,7 +79,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index 3abda72c4eb37..9fda96d6a9579 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -44,7 +44,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentJobPosition($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -69,7 +69,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('recruitment', 'recruitmentjobposition', 'read'); diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index b8010fade97bd..416520f0ef26f 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -44,7 +44,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentJobPosition($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -69,7 +69,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $permissiontoread = $user->hasRight('recruitment', 'recruitmentjobposition', 'read'); diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 11e4fe7bb6252..5947bf30469fd 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -59,7 +59,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentJobPosition($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -68,7 +68,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".get_exdir(0, 0, 0, 1, $object); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 761483aaa9226..3138dabfd291c 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -58,7 +58,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentJobPosition($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -118,7 +118,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields['nbapplications'] = array('type'=>'integer', 'label'=>'Applications', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index fec6fdd4b97dd..4e19ed859105e 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new RecruitmentJobPosition($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id; @@ -51,7 +51,7 @@ //$result = restrictedArea($user, 'recruitment', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } @@ -75,7 +75,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 176f8afa85149..14bc13a2f4f69 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -75,7 +75,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('agendaresource')); @@ -83,7 +83,7 @@ $object = new Dolresource($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, 'resource', $object->id, 'resource'); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 9a8d99b203383..56c5706bc0911 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -66,7 +66,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, 'resource', $object->id, 'resource'); diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index a3feb378b4408..b6c674df6d388 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -44,7 +44,7 @@ $object = new Dolresource($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' // Security check if ($user->socid) { diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 4172ed23178a8..dfec333399e94 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -73,7 +73,7 @@ $object = new Dolresource($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $upload_dir = $conf->resource->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'resource'; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index e9f25d47d5743..df356f69b618b 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -326,7 +326,7 @@ if (($element_id || $element_ref) && $element == 'action') { require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('actioncard', 'globalcard')); $act = fetchObjectByElement($element_id, $element, $element_ref); diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 236383bbed5b3..7d0d4c506baba 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -52,7 +52,7 @@ // Initialize context for list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'resourcelist'; -// Initialize technical objects +// Initialize a technical objects $object = new Dolresource($db); $extrafields = new ExtraFields($db); diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php index 141a61d47b2ea..0808f5b4225f0 100644 --- a/htdocs/resource/note.php +++ b/htdocs/resource/note.php @@ -41,13 +41,13 @@ if ($user->socid) { $socid = $user->socid; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('resourcenote')); $object = new Dolresource($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $result = restrictedArea($user, 'resource', $object->id, 'resource'); @@ -64,7 +64,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index bbfacb0809737..6ab849a5b4128 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -82,7 +82,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); if ($id > 0 || !empty($ref)) { diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 297da859f332c..4739a32428957 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -79,7 +79,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('salarydoc', 'globalcard')); if ($id > 0 || !empty($ref)) { diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 41842b9d1d903..7fef435dff75c 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -58,7 +58,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('salaryinfo', 'globalcard')); $object = new Salary($db); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index df3717dabdb50..01370e984d81d 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -66,7 +66,7 @@ $sortorder = "DESC,DESC"; } -// Initialize technical objects +// Initialize a technical objects $object = new PaymentSalary($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 195494fe945fa..744b0b1af732c 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -67,7 +67,7 @@ $sortorder = "DESC,DESC"; } -// Initialize technical objects +// Initialize a technical objects $object = new PaymentSalary($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index e4aeb57fd4fc2..8ceca2cf1537e 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -83,7 +83,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('salaryinfo', 'globalcard')); $object = new Salary($db); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index bc37aa427500b..8ecf987e4a2a9 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -69,10 +69,10 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Societe($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ab5bf5d89c581..075670f105b21 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -134,7 +134,7 @@ $socialnetworks = getArrayOfSocialNetworks(); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartycard', 'globalcard')); if ($socid > 0) { diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 8a2afb5b05af2..27db52ca01611 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -91,7 +91,7 @@ $type_element = GETPOST('type_element') ? GETPOST('type_element') : ''; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('consumptionthirdparty', 'globalcard')); diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 21f2105d94a3d..1ef8690e8a780 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -87,7 +87,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartycontact', 'globalcard')); if ($object->fetch($socid) <= 0 && $action == 'view') { diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index abfa6495892db..edfc829ccda97 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -80,7 +80,7 @@ $courrier_dir = $conf->societe->multidir_output[$object->entity]."/courrier/".get_exdir($object->id, 0, 0, 0, $object, 'thirdparty'); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartydocument', 'globalcard')); $permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 83089a617ff12..42d439669994d 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -38,7 +38,7 @@ $langs->load("companies"); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager = new HookManager($db); $hookmanager->initHooks(array('thirdpartiesindex')); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index e31dd7ffa6157..91e3887a7de9f 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -203,7 +203,7 @@ $search_type = '4'; } } -// Initialize technical objects to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical objects to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Societe($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array($contextpage)); diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index f67ff9bd96f6b..e88d321480568 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -69,10 +69,10 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Societe($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 84ed41d27312b..ac7848bdf8628 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -50,7 +50,7 @@ // Permissions $permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartynote', 'globalcard')); // Security check @@ -72,7 +72,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 4bb53e3ea324c..720b03549f617 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -67,7 +67,7 @@ $object = new Societe($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartynotification', 'globalcard')); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index abf841b326095..1c2702a0d0473 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -77,7 +77,7 @@ // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartybancard', 'globalcard')); // Permissions diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 55d0091a80b0d..3aef346ed2589 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -64,7 +64,7 @@ // Initialize objects $object = new Societe($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('thirdpartycustomerprice', 'globalcard')); $error = 0; diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index bad74c4d9441b..2e3c84654bc4f 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -55,7 +55,7 @@ } $result = restrictedArea($user, 'societe', $socid, '&societe'); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projectthirdparty')); $object = new Societe($db); diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 6e6c37de5ec70..227de670c3860 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -71,7 +71,7 @@ // Initialize objects $object = new Societe($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('contactthirdparty', 'globalcard')); diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 21bdeab9e85af..ade8c4f3dca2a 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -72,7 +72,7 @@ } -// Initialize technical objects +// Initialize a technical objects $object = new Societe($db); $objectwebsiteaccount = new SocieteAccount($db); $extrafields = new ExtraFields($db); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 69d0853fbc898..a60bac93e123d 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -82,7 +82,7 @@ // Nombre de ligne pour choix de produit/service predefinis $NBLINES = 4; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplier_proposalcard', 'globalcard')); $object = new SupplierProposal($db); @@ -163,11 +163,11 @@ $action = ''; } - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 6bfc7547d7251..9ed352658f2d6 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -31,7 +31,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('suppliersproposalsindex')); // Load translation files required by the page diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 0f9e90cd6057a..5d39c3f3840ba 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -144,7 +144,7 @@ $diroutputmassaction = $conf->supplier_proposal->dir_output.'/temp/massgeneration/'.$user->id; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new SupplierProposal($db); $hookmanager->initHooks(array('supplier_proposallist')); $extrafields = new ExtraFields($db); diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 0a02922330e46..452e76c0d3405 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -46,7 +46,7 @@ } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('supplier_proposalnote')); $result = restrictedArea($user, 'supplier_proposal', $id, 'supplier_proposal'); @@ -69,7 +69,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index cb4b489206c79..eb2782f7be968 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -54,7 +54,7 @@ accessforbidden(); } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('takeposproductsearch')); // new context for product search hooks $pricelevel = 1; // default price level if PRODUIT_MULTIPRICES. TODO Get price level from thirdparty. diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 318dc8f3ba939..85e83794115c9 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -84,7 +84,7 @@ } -// Initialize technical object to manage hooks of ticket. Note that conf->hooks_modules contains array array +// Initialize a technical object to manage hooks of ticket. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ticketcard', 'globalcard')); $object = new Ticket($db); @@ -114,7 +114,7 @@ } // Load object -//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id || $track_id || $ref) { $res = $object->fetch($id, $ref, $track_id); if ($res >= 0) { @@ -656,7 +656,7 @@ $permissiondellink = $user->hasRight('ticket', 'write'); - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' // Actions to build doc include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 064e9add63079..f9410e9a237ad 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -34,7 +34,7 @@ $hookmanager = new HookManager($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('ticketsindex')); // Load translation files required by the page diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index d7ccf72867cf1..78355ae9d8a9b 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -85,7 +85,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Ticket($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->ticket->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 90c23716b33d8..c3fc53bea3f71 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -75,7 +75,7 @@ accessforbidden(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'useragenda', 'globalcard')); /* diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index c7dcfc05cc3cd..1a667909ad55b 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -58,7 +58,7 @@ $action = GETPOST("action", 'alpha'); $cancel = GETPOST('cancel', 'alpha'); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('usercardBank', 'globalcard')); // Security check diff --git a/htdocs/user/card.php b/htdocs/user/card.php index fbec74cf25a84..631681d9a46a6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -95,7 +95,7 @@ $socialnetworks = getArrayOfSocialNetworks(); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('usercard', 'globalcard')); $error = 0; diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 993472a16e2ad..0b67de7d1978d 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -41,7 +41,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'globalcard')); diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 0e1da051cb4f8..668890e0c91ea 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -108,7 +108,7 @@ $upload_dir = $conf->user->dir_output."/".$object->id; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'userdoc', 'globalcard')); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 098648b6ba5f2..51386fc3a0724 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -67,10 +67,10 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. $object->getrights(); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('groupcard', 'globalcard')); // Security check diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 774657348c131..98e79785fce15 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -60,7 +60,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new UserGroup($db); $extrafields = new ExtraFields($db); //$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 02c285106882c..58c254d2717f2 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -78,7 +78,7 @@ $entity = $conf->entity; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('groupperms', 'globalcard')); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 3db495eb65736..e14c062d08548 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -52,7 +52,7 @@ $companystatic = new Societe($db); $fuserstatic = new User($db); -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('userhome')); if (!isset($form) || !is_object($form)) { $form = new Form($db); @@ -323,7 +323,7 @@ print ''; -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $parameters = array('user' => $user); $reshook = $hookmanager->executeHooks('dashboardUsersGroups', $parameters, $object); // Note that $action and $object may have been modified by hook diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 4b957549df83d..45549a292486e 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -49,7 +49,7 @@ $object->fetch($id, '', '', 1); $object->getrights(); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'userldap', 'globalcard')); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index bcd8b1ffa9fb2..355265e10cc67 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -67,7 +67,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new User($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/user/messaging.php b/htdocs/user/messaging.php index 1bfd7af9359b3..eabf89a25b3f8 100644 --- a/htdocs/user/messaging.php +++ b/htdocs/user/messaging.php @@ -73,7 +73,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new User($db); if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref, '', 1); @@ -83,7 +83,7 @@ $object->getrights(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 08f55c75b5167..4fe5dd7e8de49 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -61,7 +61,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'usernote', 'globalcard')); @@ -74,7 +74,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 2b422ddd1fdc5..c0f7af5f52000 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -80,7 +80,7 @@ $form = new Form($db); $formadmin = new FormAdmin($db); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'userihm', 'globalcard')); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 36ed4646d1695..d553851236a2c 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -85,7 +85,7 @@ $entity = $conf->entity; -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('usercard', 'userperms', 'globalcard')); diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index fd58ad0b2c156..67afacc7de68f 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -54,9 +54,9 @@ $object = new ProductAttribute($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('productattributecard', 'globalcard')); $permissiontoread = $user->hasRight('variants', 'read'); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index a627c998cfcac..4893f798bfeb3 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -58,7 +58,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new ProductAttribute($db); //$extrafields = new ExtraFields($db); $diroutputmassaction = $conf->variants->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/variants/tpl/productattributevalueline_create.tpl.php b/htdocs/variants/tpl/productattributevalueline_create.tpl.php index 92bfc8c3b8847..0d5ee24fc8481 100644 --- a/htdocs/variants/tpl/productattributevalueline_create.tpl.php +++ b/htdocs/variants/tpl/productattributevalueline_create.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/variants/tpl/productattributevalueline_edit.tpl.php b/htdocs/variants/tpl/productattributevalueline_edit.tpl.php index ec99925f320c0..21b87469577cf 100644 --- a/htdocs/variants/tpl/productattributevalueline_edit.tpl.php +++ b/htdocs/variants/tpl/productattributevalueline_edit.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/variants/tpl/productattributevalueline_title.tpl.php b/htdocs/variants/tpl/productattributevalueline_title.tpl.php index b455c347bf9fa..3561cda1552c6 100644 --- a/htdocs/variants/tpl/productattributevalueline_title.tpl.php +++ b/htdocs/variants/tpl/productattributevalueline_title.tpl.php @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/variants/tpl/productattributevalueline_view.tpl.php b/htdocs/variants/tpl/productattributevalueline_view.tpl.php index 825c3639a3fd8..c8203f211da3a 100644 --- a/htdocs/variants/tpl/productattributevalueline_view.tpl.php +++ b/htdocs/variants/tpl/productattributevalueline_view.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Need to have following variables defined: + * Need to have the following variables defined: * $object (invoice, order, ...) * $conf * $langs diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index d868de4f7165c..c57e201af07f8 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -47,7 +47,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOSTINT('lineid'); -// Initialize technical objects +// Initialize a technical objects $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; @@ -72,7 +72,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions // There is several ways to check permission. diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 63591826abc66..1dd9d3fdd5cbb 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -66,7 +66,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/webportal/admin/configcss.php b/htdocs/webportal/admin/configcss.php index 8f68e8e81c897..9d8becba7e6df 100644 --- a/htdocs/webportal/admin/configcss.php +++ b/htdocs/webportal/admin/configcss.php @@ -31,7 +31,7 @@ // Translations $langs->loadLangs(array("admin", "hrm", "other", "website")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('webportalsetup', 'globalsetup')); // Parameters diff --git a/htdocs/webportal/admin/setup.php b/htdocs/webportal/admin/setup.php index b5d02d8065daa..1b6554be7e5da 100644 --- a/htdocs/webportal/admin/setup.php +++ b/htdocs/webportal/admin/setup.php @@ -32,7 +32,7 @@ // Translations $langs->loadLangs(array("admin", "webportal", "website")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('webportalsetup', 'globalsetup')); // Parameters diff --git a/htdocs/webportal/admin/setup_theme.php b/htdocs/webportal/admin/setup_theme.php index d8816aafb54f0..c7e62a6101a22 100644 --- a/htdocs/webportal/admin/setup_theme.php +++ b/htdocs/webportal/admin/setup_theme.php @@ -31,7 +31,7 @@ // Translations $langs->loadLangs(array("admin", "webportal", "website")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('webportalthemesetup', 'globalsetup')); // Parameters diff --git a/htdocs/webportal/class/controller.class.php b/htdocs/webportal/class/controller.class.php index ddc3ae103df97..61cab0ccecc0a 100644 --- a/htdocs/webportal/class/controller.class.php +++ b/htdocs/webportal/class/controller.class.php @@ -68,7 +68,7 @@ public function __construct() $this->db = $db; - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('webportalpage', 'webportal')); } diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index b167cfda4e00f..506202cde6147 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -176,7 +176,7 @@ public function init($elementEn, $id = 0, $permissiontoread = 0, $permissiontoad $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); - // Initialize technical objects + // Initialize a technical objects $object = new $objectclass($this->db); //$extrafields = new ExtraFields($db); $hookmanager->initHooks(array('webportal' . $elementEn . 'card', 'globalcard')); // Note that conf->hooks_modules contains array @@ -190,7 +190,7 @@ public function init($elementEn, $id = 0, $permissiontoread = 0, $permissiontoad } // Load object - include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check (enable the most restrictive one) if (!isModEnabled('webportal')) { diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index 043aac2df82c6..b90cc4fbef132 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -137,7 +137,7 @@ public function init($elementEn) // load module libraries dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); - // Initialize technical objects + // Initialize a technical objects $objectclass = 'WebPortal' . ucfirst($elementEn); $object = new $objectclass($this->db); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 399bbb983b519..729901f81f32c 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -40,7 +40,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new SocieteAccount($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array @@ -64,7 +64,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Security check //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index ed9d863cdaedc..d3f54e28c432e 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -74,7 +74,7 @@ $sortorder = 'DESC,DESC'; } -// Initialize technical objects +// Initialize a technical objects $object = new Workstation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id; @@ -84,7 +84,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = rtrim(getMultidirOutput($object, '', 1), '/'); } diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 9ad7fd7154b5d..3dbe5b841e769 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -59,7 +59,7 @@ $resources = GETPOST('resources', 'array:int'); //$lineid = GETPOST('lineid', 'int'); -// Initialize technical objects +// Initialize a technical objects $object = new Workstation($db); //$extrafields = new ExtraFields($db); @@ -85,7 +85,7 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. // Permissions $permissiontoread = $user->hasRight('workstation', 'workstation', 'read'); diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 5037da7083276..bb27fbda10d16 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -63,7 +63,7 @@ } //if (! $sortfield) $sortfield="position_name"; -// Initialize technical objects +// Initialize a technical objects $object = new Workstation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id; @@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = rtrim(getMultidirOutput($object, '', 1), '/'); diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 67e4ba8d2c280..11ad744f2ac8c 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -64,7 +64,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -// Initialize technical objects +// Initialize a technical objects $object = new Workstation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id; diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index a822c458f67b8..9f2d8d67b9aaa 100644 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -42,7 +42,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -// Initialize technical objects +// Initialize a technical objects $object = new Workstation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id; @@ -52,7 +52,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { $upload_dir = rtrim(getMultidirOutput($object, '', 1), '/'); } @@ -74,7 +74,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' } From f8a34e7489b366c3ccd4d0e44604277edcd2e743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 21:04:19 +0200 Subject: [PATCH 42/98] phpdoc (#30209) * phpdoc * phpdoc * phpdoc * phpdoc --- htdocs/commande/class/commande.class.php | 13 +++++++++---- htdocs/commande/index.php | 6 +++--- htdocs/delivery/class/delivery.class.php | 21 ++++++++++++--------- htdocs/expedition/index.php | 5 +++-- htdocs/mrp/class/api_mos.class.php | 15 ++++++++------- htdocs/mrp/class/mo.class.php | 6 ++++-- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 290dd95235c33..4952b0dfd50a9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -190,19 +190,19 @@ class Commande extends CommonOrder public $demand_reason_code; /** - * @var int Date of order + * @var null|int|'' Date of order */ public $date; /** - * @var int Date of order + * @var null|int|'' Date of order * @deprecated * @see $date */ public $date_commande; /** - * @var int Date expected of shipment (date of start of shipment, not the reception that occurs some days after) + * @var null|int|'' Date expected of shipment (date of start of shipment, not the reception that occurs some days after) */ public $delivery_date; @@ -363,7 +363,12 @@ class Commande extends CommonOrder * Shipment on process */ const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated - const STATUS_ACCEPTED = 2; // For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. + + /** + * For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. + * @deprecated + */ + const STATUS_ACCEPTED = 2; /** * Closed (Sent, billed or not) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 115e7a7726c8e..7644aaae32208 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * 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 @@ -344,7 +344,7 @@ } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; - $sql .= " AND c.fk_statut = ".((int) Commande::STATUS_ACCEPTED); + $sql .= " AND c.fk_statut = ".((int) Commande::STATUS_SHIPMENTONPROCESS); if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } @@ -360,7 +360,7 @@ print '
'; print ''; print ''; - print ''; + print ''; if ($num) { $i = 0; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 8894b2ff420bd..1d5aad2ee74a7 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -6,8 +6,8 @@ * Copyright (C) 2011-2023 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -89,12 +89,12 @@ class Delivery extends CommonObject public $ref_customer; /** - * @var integer|string Date really received + * @var int|'' Date really received */ public $date_delivery; /** - * @var integer|string date_valid + * @var int|'' date_valid */ public $date_valid; @@ -103,6 +103,9 @@ class Delivery extends CommonObject */ public $model_pdf; + /** + * @var int ID of order + */ public $commande_id; /** @@ -355,7 +358,7 @@ public function fetch($id) $this->label_incoterms = $obj->label_incoterms; $this->db->free($result); - if ($this->statut == 0) { + if ($this->status == 0) { $this->draft = 1; } @@ -509,7 +512,7 @@ public function valid($user, $notrigger = 0) // Set new ref and current status if (!$error) { $this->ref = $numref; - $this->statut = 1; + $this->status = 1; } dol_syslog(get_class($this)."::valid ok"); @@ -650,7 +653,7 @@ public function addline($origin_id, $qty, $array_options = []) */ public function deleteLine($lineid) { - if ($this->statut == 0) { + if ($this->status == 0) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."commandedet"; $sql .= " WHERE rowid = ".((int) $lineid); @@ -912,7 +915,7 @@ public function fetch_lines() */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->statut, $mode); + return $this->LibStatut($this->status, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -996,7 +999,7 @@ public function initAsSpecimen() $line->fk_product = reset($prodids); $line->qty_asked = 10; $line->qty_shipped = 9; - $line->ref = 'REFPROD'; + $line->product_ref = 'REFPROD'; $line->label = 'Specimen'; $line->description = 'Description'; $line->price = 100; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 7ad70bc9359a5..794483980293c 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2024 Frédéric France * * 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 @@ -216,7 +217,7 @@ } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('order').")"; -$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_ACCEPTED.")"; +$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")"; if ($socid > 0) { $sql .= " AND c.fk_soc = ".((int) $socid); } @@ -236,7 +237,7 @@ print ''; print ''; diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 5dc781d61105e..52129d6ea2cef 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2019 Maxime Kohlhaas +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Maxime Kohlhaas * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -412,7 +413,7 @@ public function produceAndConsumeAll($id, $request_data = null) $moline->fk_product = $value["objectid"]; $moline->fk_warehouse = $value["fk_warehouse"]; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'toproduce'; $moline->fk_mrp_production = ""; $moline->fk_stock_movement = $idstockmove; @@ -431,7 +432,7 @@ public function produceAndConsumeAll($id, $request_data = null) $moline->fk_product = $value["objectid"]; $moline->fk_warehouse = $value["fk_warehouse"]; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'toconsume'; $moline->fk_mrp_production = ""; $moline->fk_stock_movement = $idstockmove; @@ -457,7 +458,7 @@ public function produceAndConsumeAll($id, $request_data = null) $moline->fk_product = $value["objectid"]; $moline->fk_warehouse = $value["fk_warehouse"]; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; if ($arrayname == "arraytoconsume") { $moline->role = 'consumed'; } else { @@ -528,7 +529,7 @@ public function produceAndConsumeAll($id, $request_data = null) $moline->fk_product = $line->fk_product; $moline->fk_warehouse = $line->fk_warehouse; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'consumed'; $moline->fk_mrp_production = $line->id; $moline->fk_stock_movement = $idstockmove; @@ -588,7 +589,7 @@ public function produceAndConsumeAll($id, $request_data = null) $moline->fk_product = $line->fk_product; $moline->fk_warehouse = $line->fk_warehouse; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'produced'; $moline->fk_mrp_production = $line->id; $moline->fk_stock_movement = $idstockmove; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 38ab5e1d7b314..42e94c80cbe22 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -2092,12 +2092,14 @@ class MoLine extends CommonObjectLine public $qty_frozen; public $disable_stock_change; public $efficiency; + + /** + * @var string batch reference + */ public $batch; public $role; public $fk_mrp_production; public $fk_stock_movement; - public $fk_user_creat; - public $fk_user_modif; public $import_key; public $fk_parent_line; public $fk_unit; From 28513906445782b4603cc5c16a38492c17d3e4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 22:39:40 +0200 Subject: [PATCH 43/98] phpdoc (#30210) * phpdoc * phpdoc * phpdoc * phpdoc * phpdoc --- htdocs/don/card.php | 16 +++++++-------- htdocs/don/class/don.class.php | 37 +++++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 61d3370f30cd0..449b3ace26919 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * 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 @@ -630,7 +630,7 @@ print ''; // Amount - if ($object->statut == 0) { + if ($object->status == 0) { print "".''; } else { print ''; + print ''; + } + if (!empty($object->date_credit)) { + print ''; + } - print '
'; + print '
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("OrdersToProcess").' '; - print ''; + print ''; print ''.$num.''; print ''; print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Amount").''; @@ -947,22 +947,22 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); if (empty($reshook)) { // Re-open - if ($permissiontoadd && $object->statut == $object::STATUS_CANCELED) { + if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) { print ''.$langs->trans("ReOpen").''; } print ''; - if ($object->statut == $object::STATUS_DRAFT) { + if ($object->status == $object::STATUS_DRAFT) { print ''; } - if (($object->statut == $object::STATUS_DRAFT || $object->statut == $object::STATUS_VALIDATED) && $totalpaid == 0 && $object->paid == 0) { + if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && $totalpaid == 0 && $object->paid == 0) { print '"; } // Create payment - if ($object->statut == $object::STATUS_VALIDATED && $object->paid == 0 && $user->hasRight('don', 'creer')) { + if ($object->status == $object::STATUS_VALIDATED && $object->paid == 0 && $user->hasRight('don', 'creer')) { if ($remaintopay == 0) { print '
'.$langs->trans('DoPayment').'
'; } else { @@ -971,13 +971,13 @@ } // Classify 'paid' - if ($object->statut == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->hasRight('don', 'creer')) { + if ($object->status == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->hasRight('don', 'creer')) { print '"; } // Delete if ($user->hasRight('don', 'supprimer')) { - if ($object->statut == $object::STATUS_CANCELED || $object->statut == $object::STATUS_DRAFT) { + if ($object->status == $object::STATUS_CANCELED || $object->status == $object::STATUS_DRAFT) { print '"; } else { print '"; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 09c006f6f35ea..1d5f079f0cabb 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -62,13 +62,25 @@ class Don extends CommonObject public $picto = 'donation'; /** - * @var int|string Date of the donation + * @var int|'' Date of the donation */ public $date; + /** + * @var int|'' Date of creation + */ public $datec; + + /** + * @var int|'' Date of modification + */ public $datem; + /** + * @var int|'' date validation + */ + public $date_valid; + /** * amount of donation * @var double @@ -105,9 +117,15 @@ class Don extends CommonObject */ public $email; + /** + * @var string phone + */ public $phone; - public $phone_mobile; + /** + * @var string phone mobile + */ + public $phone_mobile; /** * @var string @@ -139,7 +157,6 @@ class Don extends CommonObject * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; - public $date_valid; /** * @var int payment mode id @@ -175,14 +192,14 @@ public function __construct($db) */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->statut, $mode); + return $this->LibStatut($this->status, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return the label of a given status * - * @param int $status Id statut + * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ @@ -519,7 +536,7 @@ public function update($user, $notrigger = 0) $sql .= ", email='".$this->db->escape(trim($this->email))."'"; $sql .= ", phone='".$this->db->escape(trim($this->phone))."'"; $sql .= ", phone_mobile='".$this->db->escape(trim($this->phone_mobile))."'"; - $sql .= ", fk_statut=".((int) $this->statut); + $sql .= ", fk_statut=".((int) $this->status); $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::Update", LOG_DEBUG); @@ -764,7 +781,7 @@ public function valid_promesse($id, $userid, $notrigger = 0) } if (!$error) { - $this->statut = 1; + $this->status = 1; $this->db->commit(); return 1; } else { @@ -791,7 +808,7 @@ public function setPaid($id, $modepayment = 0) $resql = $this->db->query($sql); if ($resql) { if ($this->db->affected_rows($resql)) { - $this->statut = 2; + $this->status = 2; $this->paid = 1; return 1; } else { @@ -818,7 +835,7 @@ public function set_cancel($id) $resql = $this->db->query($sql); if ($resql) { if ($this->db->affected_rows($resql)) { - $this->statut = -1; + $this->status = -1; return 1; } else { return 0; @@ -839,7 +856,7 @@ public function set_cancel($id) public function reopen($user, $notrigger = 0) { // Protection - if ($this->statut != self::STATUS_CANCELED) { + if ($this->status != self::STATUS_CANCELED) { return 0; } From 4e15085d79b110e400858b8b73525b865cdd593d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= <81741011+altairis-noe@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:21:14 +0200 Subject: [PATCH 44/98] NEW: add trigger for linking and unlinking invoices (#30182) * NEW: add trigger for linking and unlinking invoices * Update discount.class.php * Update discount.class.php * Update discount.class.php * trailing spaces --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/discount.class.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 29e663f4e278d..334849502e3e2 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2024 Alexandre Janniaux * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Noé Cendrier * * 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 @@ -427,11 +428,14 @@ public function delete($user) * * @param int $rowidline Invoice line id (To use discount into invoice lines) * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduce payment of invoice) + * @param int $notrigger 0 = launch triggers after, 1 = disable triggers * @return int<-3,1> Return integer <0 if KO, >0 if OK */ - public function link_to_invoice($rowidline, $rowidinvoice) + public function link_to_invoice($rowidline, $rowidinvoice, $notrigger = 0) { // phpcs:enable + global $user; + // Check parameters if (!$rowidline && !$rowidinvoice) { $this->error = 'ErrorBadParameters'; @@ -470,6 +474,14 @@ public function link_to_invoice($rowidline, $rowidinvoice) $this->fk_facture_line = $rowidline; $this->fk_facture = $rowidinvoice; } + if (!$notrigger) { + // Call trigger + $result = $this->call_trigger('DISCOUNT_MODIFY', $user); + if ($result < 0) { + return -2; + } + // End call triggers + } return 1; } else { $this->error = $this->db->error(); @@ -483,11 +495,14 @@ public function link_to_invoice($rowidline, $rowidinvoice) * Link the discount to a particular invoice line or a particular invoice. * Do not call this if discount is linked to a reconcialiated invoice * + * @param int $notrigger 0 = launch triggers after, 1 = disable triggers * @return int<-3,1> Return integer <0 if KO, >0 if OK */ - public function unlink_invoice() + public function unlink_invoice($notrigger = 0) { // phpcs:enable + global $user; + $sql = "UPDATE ".$this->db->prefix()."societe_remise_except"; if (!empty($this->discount_type)) { $sql .= " SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL"; @@ -499,6 +514,14 @@ public function unlink_invoice() dol_syslog(get_class($this)."::unlink_invoice", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { + if (!$notrigger) { + // Call trigger + $result = $this->call_trigger('DISCOUNT_MODIFY', $user); + if ($result < 0) { + return -2; + } + // End call triggers + } return 1; } else { $this->error = $this->db->error(); From 90918f0687dd45f42a9c5df3999e25ddfa62298b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2024 00:42:46 +0200 Subject: [PATCH 45/98] Fix fatal error --- htdocs/projet/activity/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 2e257cf79bd4e..bb9ef4a29c5f5 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -66,6 +66,7 @@ $month = $tmp['mon']; $year = $tmp['year']; +$form = new Form($db); $projectstatic = new Project($db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); // Return all projects I have permission on because I want my tasks and some of my task may be on a public projet that is not my project $taskstatic = new Task($db); From 07c6e36a3a34cdd0da62a8c9a9ba450d288ee965 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2024 01:22:04 +0200 Subject: [PATCH 46/98] Fix for #30170 --- htdocs/projet/activity/index.php | 47 +++++++++++++++++++++++++------- htdocs/projet/index.php | 15 +++++----- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index bb9ef4a29c5f5..7c3e8fade969f 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -31,17 +31,24 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -$search_project_user = GETPOSTINT('search_project_user'); -$mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0; -if ($search_project_user == $user->id) { - $mine = 1; -} +// Load translation files required by the page +$langs->loadLangs(array('projects', 'companies')); $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('activityindex')); +$action = GETPOST('action', 'aZ09'); +$search_project_user = GETPOST('search_project_user'); +$mine = (GETPOST('mode', 'aZ09') == 'mine' || $search_project_user == $user->id) ? 1 : 0; +if ($mine == 0 && $search_project_user === '') { + $search_project_user = getDolGlobalString('MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX'); +} +if ($search_project_user == $user->id) { + $mine = 1; +} + // Security check $socid = 0; if ($user->socid > 0) { @@ -52,8 +59,25 @@ accessforbidden(); } -// Load translation files required by the page -$langs->load("projects"); + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + if ($action == 'refresh_search_project_user') { + $search_project_user = GETPOSTINT('search_project_user'); + $tabparam = array("MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX" => $search_project_user); + + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + $result = dol_set_user_param($db, $conf, $user, $tabparam); + } +} /* @@ -88,9 +112,12 @@ $morehtml = ''; -$morehtml .= '
'; -$morehtml .= ''; +$morehtml .= ''; + +$morehtml .= ''; $morehtml .= ajax_combobox("search_project_user", array(), 0, 0, 'resolve', '-1', 'small'); diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 0a1d665780fb1..2795ec7988d2f 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -32,19 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +// Load translation files required by the page +$langs->loadLangs(array('projects', 'companies')); + $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('projectsindex')); -// Load translation files required by the page -$langs->loadLangs(array('projects', 'companies')); - $action = GETPOST('action', 'aZ09'); -$search_project_user = GETPOSTINT('search_project_user'); -$mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0; +$search_project_user = GETPOST('search_project_user'); +$mine = (GETPOST('mode', 'aZ09') == 'mine' || $search_project_user == $user->id) ? 1 : 0; if ($mine == 0 && $search_project_user === '') { - $search_project_user = (empty($user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX) ? '' : $user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX); + $search_project_user = getDolGlobalString('MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX'); } if ($search_project_user == $user->id) { $mine = 1; @@ -116,9 +116,10 @@ } $morehtml = ''; -$morehtml .= ''; +$morehtml .= ''; $morehtml .= ''; $morehtml .= ''; + $morehtml .= ''; print ''; @@ -236,7 +232,7 @@ $module = new $file($db); '@phan-var-force CommonNumRefGenerator $module'; - // Show modules according to features level + // Show modules according to feature level if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { continue; } @@ -251,7 +247,7 @@ print $module->info($langs); print ''; - // Show example of numbering model + // Show example of the numbering model print ''; } } else { - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index cc77b1e36f405..f40da96678630 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2166,7 +2166,7 @@ } else { // Show line of result $j = 0; - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index dd0559a162cbb..4a1e019334cce 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1747,7 +1747,7 @@ print ''; } } else { - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 2ae144d002b3e..7e320484e75fe 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1716,7 +1716,7 @@ // Show here line of result $j = 0; - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; } } else { - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; print ''; - // Prospect/Customer - print ''; - print ''; - - if ($conf->browser->layout == 'phone') { - print ''; + // Prospect/Customer/Supplier + $selected = $object->client; + $selectedcustomer = 0; + $selectedprospect = 0; + switch ($selected) { + case 1: + $selectedcustomer = 1; + break; + case 2: + $selectedprospect = 1; + break; + case 3: + $selectedprospect = 1; + $selectedcustomer = 1; + break; + default: + break; } - print ''; + print ''; + print ''; + print ''; - - if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) - || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { - // Supplier - print ''; - print ''; - - if ($conf->browser->layout == 'phone') { - print ''; - } + print ''; // Status print ''; } - // Prospect/Customer - print ''; - print ''; - if ($conf->browser->layout == 'phone') { - print ''; + // Prospect/Customer/Supplier + $selected = $object->client; + $selectedcustomer = 0; + $selectedprospect = 0; + switch ($selected) { + case 1: + $selectedcustomer = 1; + break; + case 2: + $selectedprospect = 1; + break; + case 3: + $selectedprospect = 1; + $selectedcustomer = 1; + break; + default: + break; } - print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - if ($conf->browser->layout == 'phone') { - print ''; - } - print ''; - print ''; } + print ''; + // Barcode if (isModEnabled('barcode')) { From 4cb64b5a60e2288e9e20c7963b87894e5a14651d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Jul 2024 19:05:50 +0200 Subject: [PATCH 65/98] fix phpstan (#30231) * fix phpstan * Update product.class.php * Update product.class.php --- htdocs/product/class/product.class.php | 2 +- htdocs/stripe/class/actions_stripe.class.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 137c9e3d33297..7f756c5566c08 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2380,7 +2380,7 @@ public function updatePrice($newprice, $newpricebase, $user, $newvat = null, $ne return -1; } - if ($newprice !== '' || $newprice === 0) { + if ($newprice === 0 || $newprice !== '') { if ($newpricebase == 'TTC') { $price_ttc = price2num($newprice, 'MU'); $price = (float) price2num($newprice) / (1 + ((float) $newvat / 100)); diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 51522e73b29d5..737eed4902335 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2011 Herve Prot - * Copyright (C) 2014 Philippe Grand - * Copyright (C) 2024 MDW +/* Copyright (C) 2009-2016 Regis Houssin + * Copyright (C) 2011 Herve Prot + * Copyright (C) 2014 Philippe Grand + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -41,7 +42,7 @@ class ActionsStripeconnect extends CommonHookActions */ public $db; - private $config = array(); + private $config = array(); // @phpstan-ignore-line /** From f8f2a833236a636ad3e8d2eba244c07f648090c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Jul 2024 19:06:24 +0200 Subject: [PATCH 66/98] Clean date (#30228) * clean date phpdoc * add phpdoc --- htdocs/fichinter/class/fichinter.class.php | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index be0fb963cdfa4..5f834543ccdc2 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -6,9 +6,9 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2020 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2023-2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2023-2024 William Mead + * Copyright (C) 2024 MDW * * 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 @@ -107,15 +107,26 @@ class Fichinter extends CommonObject public $author; /** - * Date creation record (datec) - * - * @var integer + * @var null|int|'' Date creation record (datec) */ public $datec; + /** + * @var null|int|'' Date record (datev) + */ public $datev; + /** + * @var null|int|'' Date record (dateo) + */ public $dateo; + /** + * @var null|int|'' Date record (datee) + */ public $datee; + + /** + * @var null|int|'' Date t record (datet) + */ public $datet; /** @@ -216,7 +227,7 @@ class Fichinter extends CommonObject /** * Date delivery - * @var string|int Delivery int + * @var null|int|'' Delivery int */ public $date_delivery; From ce507fc857a07ad68f9d4ae3fe945d59c192a7ce Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:06:52 +0200 Subject: [PATCH 67/98] Fix thirdparty Nature of thirdparty checkbox to make possible to click on label (#30229) Co-authored-by: Hystepik --- htdocs/societe/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 31d8b9f79f69d..4833746cf55b7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1382,17 +1382,17 @@ function formatCustomerSelection (selection) { $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); print ''; print ''; print ''; @@ -2126,17 +2126,17 @@ function init_supplier_categ() { $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); print ''; print ''; print ''; From 5f27830fbf4ef182c806e88cb093eea2069d7a6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2024 20:29:50 +0200 Subject: [PATCH 68/98] Enhance selction of nature of thirdparties --- htdocs/societe/card.php | 75 ++++++++++++++++++++++++++---- htdocs/theme/eldy/global.inc.php | 3 ++ htdocs/theme/eldy/info-box.inc.php | 13 ++++++ htdocs/theme/md/info-box.inc.php | 6 +++ 4 files changed, 87 insertions(+), 10 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4833746cf55b7..95b620c091d01 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1382,20 +1382,47 @@ function formatCustomerSelection (selection) { $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); print ''; print ''; print ''; + print ''; } -if (!empty($arrayfields['u.datelastlogin']['checked'])) { +if (!empty($arrayfields['u.datelastlogin']['checked']) && getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { print ''; } -if (!empty($arrayfields['u.datepreviouslogin']['checked'])) { +if (!empty($arrayfields['u.datepreviouslogin']['checked']) && getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { print ''; } // Extra fields @@ -931,11 +937,11 @@ print_liste_field_titre("Salary", $_SERVER['PHP_SELF'], "u.salary", $param, "", "", $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; } -if (!empty($arrayfields['u.datelastlogin']['checked'])) { +if (!empty($arrayfields['u.datelastlogin']['checked']) && getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { print_liste_field_titre("LastConnexion", $_SERVER['PHP_SELF'], "u.datelastlogin", $param, "", '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } -if (!empty($arrayfields['u.datepreviouslogin']['checked'])) { +if (!empty($arrayfields['u.datepreviouslogin']['checked']) && getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { print_liste_field_titre("PreviousConnexion", $_SERVER['PHP_SELF'], "u.datepreviouslogin", $param, "", '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } @@ -1298,14 +1304,14 @@ } // Date last login - if (!empty($arrayfields['u.datelastlogin']['checked'])) { + if (!empty($arrayfields['u.datelastlogin']['checked']) && getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { print ''; if (!$i) { $totalarray['nbfield']++; } } // Date previous login - if (!empty($arrayfields['u.datepreviouslogin']['checked'])) { + if (!empty($arrayfields['u.datepreviouslogin']['checked']) && getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { print ''; if (!$i) { $totalarray['nbfield']++; From e79f18a6366e5f9447627b55370c67a5f5259e15 Mon Sep 17 00:00:00 2001 From: Pichi1966 <57623859+josett225@users.noreply.github.com> Date: Tue, 2 Jul 2024 02:06:54 +0200 Subject: [PATCH 75/98] FIX ASSET: annual depreciation starting year (Again ;-)) #26084 (#30040) * FIX ASSET: annual depreciation starting year (Again ;-)) #26084 FIX Update asset.class.php This is an old issue that has been already fixed by https://github.com/Dolibarr/dolibarr/pull/26084 I tested it several times and it works. * Update asset.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/asset/class/asset.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index e2d93806ca352..a9763e4fcd6f6 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -863,7 +863,7 @@ public function calculationDepreciation() // Get fiscal period require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; - $dates = getDefaultDatesForTransfer(); + $dates = getCurrentPeriodOfFiscalYear($this->db, $conf, $this->date_start > $this->date_acquisition ? $this->date_start : $this->date_acquisition); $init_fiscal_period_start = $dates['date_start']; $init_fiscal_period_end = $dates['date_end']; if (empty($init_fiscal_period_start) || empty($init_fiscal_period_end)) { From 8cb4110e68952de27bc7095fba6e47286651f9d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 11:14:11 +0200 Subject: [PATCH 76/98] Debug v20 --- htdocs/compta/prelevement/factures.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 855f73a7d0056..7839429149434 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -323,16 +323,18 @@ $invoicetmpsupplier = new FactureFournisseur($db); } - while ($i < min($num, $limit)) { + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + $itemurl = ''; $partyurl = ''; - if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) { + if ($salaryBonPl && ($salarytmp instanceof Salary) && ($usertmp instanceof User)) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); $itemurl = $salarytmp->getNomUrl(1); $partyurl = $usertmp->getNomUrl(1); - } elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { + } elseif ($invoicetmpcustomer instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; } else { @@ -351,9 +353,15 @@ print $itemurl; print "\n"; - if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) { - print '\n"; } From 12f53a84814672abac73b1902f564be725f7b9da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 11:14:11 +0200 Subject: [PATCH 77/98] Debug v20 --- htdocs/compta/prelevement/factures.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 1dc1fd3d76d84..827e2e9fc0780 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -323,16 +323,18 @@ $invoicetmpsupplier = new FactureFournisseur($db); } - while ($i < min($num, $limit)) { + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + $itemurl = ''; $partyurl = ''; - if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) { + if ($salaryBonPl && ($salarytmp instanceof Salary) && ($usertmp instanceof User)) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); $itemurl = $salarytmp->getNomUrl(1); $partyurl = $usertmp->getNomUrl(1); - } elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { + } elseif ($invoicetmpcustomer instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; } else { @@ -351,9 +353,15 @@ print $itemurl; print "\n"; - if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) { - print '\n"; } From 6ebcf20b6d9c8148c1a0be3ab1a24c83a6887a07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 11:33:44 +0200 Subject: [PATCH 78/98] Fix phan --- htdocs/comm/action/class/cactioncomm.class.php | 5 ++--- htdocs/core/class/commonobject.class.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index f3db30adcc754..aaad9fa40d897 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -310,10 +310,10 @@ public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $ if ($typecalendar == 'module') { $module = preg_replace('/^[^@]+@/', '', $obj->module); $label = '   '.$label; - if (!isset($rep_code['AC_ALL_'.strtoupper($module)])) { // If first time for this module + if (!isset($TModule['id'][-1 * $idforallfornewmodule])) { // If first time for this module $idforallfornewmodule--; } - $TModule['id'][$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($module)); + $TModule['id'][-1 * $idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($module)); $TModule['code']['AC_ALL_'.strtoupper($module)] = '-- '.$langs->trans("Module").' '.ucfirst($module); } } @@ -357,7 +357,6 @@ public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $ } $this->liste_array = $TType; - return $this->liste_array; } else { $this->error = $this->db->lasterror(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 43342b72e42cb..315cb6fe63dac 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8581,7 +8581,7 @@ public function validateField($fields, $fieldKey, $fieldValue) $this->clearFieldError($fieldKey); - if (!isset($fields[$fieldKey]) || $fields[$fieldKey] === null) { + if (!isset($fields[$fieldKey])) { $this->setFieldError($fieldKey, $langs->trans('FieldNotFoundInObject')); return false; } From 9ffa8641ef8f7e1a0d787fdc0e9dc9310d703f5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 11:41:08 +0200 Subject: [PATCH 79/98] Fix phan --- htdocs/core/class/conf.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 08ce16ce1cddb..91883ed2ef3c8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -724,12 +724,12 @@ public function setValues($db) $this->global->MAIN_UMASK = '0660'; // Default mask } else { // We remove the execute bits on the file umask - $tmpumask = (octdec($this->global->MAIN_UMASK) & 0666); + $tmpumask = (octdec(getDolGlobalString('MAIN_UMASK')) & 0666); $tmpumask = decoct($tmpumask); - if (!preg_match('/^0/', $tmpumask)) { + if (!preg_match('/^0/', $tmpumask)) { // Convert string '123' into octal representation '0123' $tmpumask = '0'.$tmpumask; } - if (empty($tmpumask) || $tmpumask === '0') { + if (empty($tmpumask)) { // when $tmpmask is null, '', or '0' $tmpumask = '0664'; } $this->global->MAIN_UMASK = $tmpumask; From e0094bc8d42aa7531380cab1443eabf9aba21682 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 12:20:12 +0200 Subject: [PATCH 80/98] FIX #yogosha23096 --- htdocs/holiday/define_holiday.php | 41 +++++++++++++++++-------------- htdocs/holiday/view_log.php | 2 +- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 94b8c2a3164ed..c3f5ca6444b15 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -72,8 +72,23 @@ $holiday = new Holiday($db); +$arrayfields = array( + 'cp.rowid' => array('label' => $langs->trans("Employee"), 'checked' => 1, 'position' => 20), + 'cp.fk_user' => array('label' => $langs->trans("Supervisor"), 'checked' => 1, 'position' => 30), + 'cp.nbHoliday' => array('label' => $langs->trans("MenuConfCP"), 'checked' => 1, 'position' => 40), + 'cp.note_public' => array('label' => $langs->trans("Note"), 'checked' => 1, 'position' => 50), +); + +$permissiontoread = $user->hasRight('holiday', 'read'); +$permissiontoreadall = $user->hasRight('holiday', 'readall'); +$permissiontowrite = $user->hasRight('holiday', 'write'); +$permissiontowriteall = $user->hasRight('holiday', 'writeall'); +$permissiontodelete = $user->hasRight('holiday', 'delete'); + +$permissiontoapprove = $user->hasRight('holiday', 'approve'); +$permissiontosetup = $user->hasRight('holiday', 'define_holiday'); -if (empty($conf->holiday->enabled)) { +if (!isModEnabled('holiday')) { accessforbidden('Module not enabled'); } @@ -87,13 +102,6 @@ accessforbidden(); } -$arrayfields = array( - 'cp.rowid' => array('label' => $langs->trans("Employee"), 'checked' => 1, 'position' => 20), - 'cp.fk_user' => array('label' => $langs->trans("Supervisor"), 'checked' => 1, 'position' => 30), - 'cp.nbHoliday' => array('label' => $langs->trans("MenuConfCP"), 'checked' => 1, 'position' => 40), - 'cp.note_public' => array('label' => $langs->trans("Note"), 'checked' => 1, 'position' => 50), -); - /* * Actions @@ -128,14 +136,11 @@ // Mass actions $objectclass = 'Holiday'; $objectlabel = 'Holiday'; - $permissiontoread = $user->hasRight('holiday', 'read'); - $permissiontodelete = $user->hasRight('holiday', 'delete'); - $permissiontoapprove = $user->hasRight('holiday', 'approve'); $uploaddir = $conf->holiday->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; // If there is an update action - if ($action == 'update' && GETPOSTISSET('update_cp')) { + if ($action == 'update' && GETPOSTISSET('update_cp') && $permissiontosetup) { $error = 0; $nbok = 0; @@ -233,7 +238,7 @@ //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -if ($user->hasRight("holiday", "approve")) { +if ($permissiontosetup) { $arrayofmassactions['preincreaseholiday'] = img_picto('', 'add', 'class="pictofixedwidth"').$langs->trans("IncreaseHolidays"); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); @@ -294,7 +299,7 @@ // Filter on array of ids of all children $userchilds = array(); -if (!$user->hasRight('holiday', 'readall')) { +if (!$permissiontoreadall) { $userchilds = $user->getAllChildIds(1); $filters .= ' AND u.rowid IN ('.$db->sanitize(implode(', ', $userchilds)).')'; } @@ -322,7 +327,7 @@ //print ''; } else { $canedit = 0; - if ($user->hasRight('holiday', 'define_holiday')) { + if ($permissiontosetup) { $canedit = 1; } @@ -407,7 +412,7 @@ } } if (!empty($arrayfields['cp.note_public']['checked'])) { - print_liste_field_titre((!$user->hasRight('holiday', 'define_holiday') ? '' : 'Note'), $_SERVER["PHP_SELF"]); + print_liste_field_titre($permissiontosetup ? 'Note' : '', $_SERVER["PHP_SELF"]); } print_liste_field_titre(''); // Action column @@ -421,7 +426,7 @@ $arrayofselected = is_array($toselect) ? $toselect : array(); // If user has not permission to edit/read all, we must see only subordinates - if (!$user->hasRight('holiday', 'readall')) { + if (!$permissiontoreadall) { if (($users['rowid'] != $user->id) && (!in_array($users['rowid'], $userchilds))) { continue; // This user is not into hierarchy of current user, we hide it. } @@ -506,7 +511,7 @@ // Button modify print ''."\n"; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 2187692b95a09..a06d3236688cf 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -89,7 +89,7 @@ $arrayfields = array(); $arrayofmassactions = array(); -if (empty($conf->holiday->enabled)) { +if (!isModEnabled('holiday')) { accessforbidden('Module not enabled'); } From e72dd7d4658496213efb3b38132c532969f858c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 12:46:41 +0200 Subject: [PATCH 81/98] Fix error message when record not found --- .../class/bonprelevement.class.php | 8 +- htdocs/compta/prelevement/factures.php | 168 +++++++++--------- 2 files changed, 90 insertions(+), 86 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 677c71d31dee7..3b6fe148f5e85 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -395,7 +395,7 @@ public function getErrorString($error) * * @param int $rowid Id of object to load * @param string $ref Ref of direct debit - * @return int >0 if OK, <0 if KO + * @return int >0 if OK, 0=Not found, <0 if KO */ public function fetch($rowid, $ref = '') { @@ -448,11 +448,11 @@ public function fetch($rowid, $ref = '') return 1; } else { - dol_syslog(get_class($this) . "::Fetch Erreur aucune ligne retournee"); - return -1; + dol_syslog(get_class($this) . "::Fetch no record found"); + return 0; } } else { - return -2; + return -1; } } diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 827e2e9fc0780..534051f96f3b5 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -94,112 +94,116 @@ llxHeader('', $langs->trans("WithdrawalsReceipts")); if ($id > 0 || $ref) { - if ($object->fetch($id, $ref) >= 0) { - $head = prelevement_prepare_head($object); + $object->fetch($id, $ref); + if (empty($object->id)) { + $langs->load('errors'); + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; + llxFooter(); + exit; + } - print dol_get_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); + $head = prelevement_prepare_head($object); - $linkback = ''.$langs->trans("BackToList").''; + print dol_get_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); + $linkback = ''.$langs->trans("BackToList").''; - print '
'; - print '
'; - print '
'; $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 1d8d0d04ce18b..369b6a37bea24 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1,8 +1,8 @@ - * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2018-2024 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -19,9 +19,9 @@ */ /** - * \file asset/class/asset.class.php - * \ingroup asset - * \brief This file is a CRUD class file for Asset (Create/Read/Update/Delete) + * \file asset/class/asset.class.php + * \ingroup asset + * \brief This file is a CRUD class file for Asset (Create/Read/Update/Delete) */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -37,12 +37,12 @@ class Asset extends CommonObject public $module = 'asset'; /** - * @var string ID to identify managed object. + * @var string ID to identify a managed object. */ public $element = 'asset'; /** - * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + * @var string Name of table without prefix where an object is stored. This is also the key used for extrafields management. */ public $table_element = 'asset'; @@ -64,20 +64,20 @@ class Asset extends CommonObject * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'noteditable' says if field is not editable (1 or 0) - * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'default' is a default value for creation (can still be overwritten by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and the field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. - * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) - * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into a list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example, 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. - * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'showoncombobox' if the value of the field must be visible into the label of the combobox that list record * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. - * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' - * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'arrayofkeyval' to set a list of values if a type is a list of predefined values. For example, array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a creation form. Only 1 field should have this property set to 1. * 'comment' is not used. You can store here any text of your choice. It is not used by application. - * 'validate' is 1 if need to validate with $this->validateField() - * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * 'validate' is 1 if you need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow adding a picto to copy value into clipboard (1=picto after label, 2=picto after value) * * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ @@ -992,7 +992,7 @@ public function calculationDepreciation() // futures depreciation lines //----------------------------------------------------- - $nb_days_in_year = getDolGlobalInt('ASSET_DEPRECIATION_DURATION_PER_YEAR', 365); + $nb_days_in_year = getDolGlobalInt('ASSET_DEPRECIATION_DURATION_PER_YEAR', 360); $nb_days_in_month = getDolGlobalInt('ASSET_DEPRECIATION_DURATION_PER_MONTH', 30); $period_amount = (float) price2num($depreciation_period_amount / $fields['duration'], 'MT'); $first_period_found = false; diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 299b2564ec51f..262ea329abd2c 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2018-2024 Alexandre Spangaro * * 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 @@ -106,8 +106,8 @@ public function __construct($db) $this->const[1] = array( "ASSET_DEPRECIATION_DURATION_PER_YEAR", "chaine", - "365", - "Duration per year to calculate depreciation. In some case, can be 360 days", + "360", + "Duration per year to calculate depreciation. In some case, can be 365 days", 0, 'current', 1 @@ -232,7 +232,7 @@ public function __construct($db) /** * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * The init function adds constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * * @param string $options Options when enabling module ('', 'noboxes') diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d41619b4f2e61..7f7c7092f141e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1966,6 +1966,8 @@ CloseFiscalYear=Close accounting period DeleteFiscalYear=Delete accounting period ConfirmDeleteFiscalYear=Are you sure to delete this accounting period? ShowFiscalYear=Show accounting period +##### Assets ##### +AssetNumberingModules=Assets numbering module AlwaysEditable=Can always be edited MAIN_APPLICATION_TITLE=Force visible name of application (warning: setting your own name here may break autofill login feature when using DoliDroid mobile application) NbMajMin=Minimum number of uppercase characters @@ -1978,6 +1980,7 @@ SortOrder=Sort order Format=Format TypePaymentDesc=0:Customer payment type, 1:Vendor payment type, 2:Both customers and suppliers payment type IncludePath=Include path (defined into variable %s) +##### Expense reports ##### ExpenseReportsSetup=Setup of module Expense Reports TemplatePDFExpenseReports=Document templates to generate expense report document ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules diff --git a/htdocs/langs/en_US/assets.lang b/htdocs/langs/en_US/assets.lang index 1d9bcdab0d0e6..7cd68618ec692 100644 --- a/htdocs/langs/en_US/assets.lang +++ b/htdocs/langs/en_US/assets.lang @@ -34,6 +34,7 @@ AssetsTypeId=Asset model id AssetsTypeLabel=Asset model label AssetsTypes=Assets models ASSET_ACCOUNTANCY_CATEGORY=Fixed asset accounting group +ASSET_DEPRECIATION_DURATION_PER_YEAR=Proportional period in days for calculating amortization over one year # Menu MenuAssets=Assets MenuNewAsset=New asset From 37f4c89760e766d0a1a3bbbf9503dba93f83c75c Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Mon, 1 Jul 2024 14:16:23 +0200 Subject: [PATCH 62/98] New function to get public files of object (#30226) * function commit * Update website.lib.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/website.lib.php | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 4e3acd765bb43..d050cf0841d4e 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -1098,6 +1098,56 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '') return $image_path; } +/** + * Return list of public files of a given object. + * + * @param Object $object Object + * @return array List of public files of object + */ +function getPublicFilesOfObject($object) +{ + global $db; + + $files = array(); + + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + $regexforimg = getListOfPossibleImageExt(0); + $regexforimg = '/('.$regexforimg.')$/i'; + + $sql = "SELECT rowid, ref, share, filename, cover, position"; + $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; + $sql .= " WHERE entity IN (".getEntity($object->element).")"; + $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); + $sql .= $db->order("cover,position,rowid", "ASC,ASC,ASC"); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $obj = $db->fetch_object($resql); + if ($obj) { + if (!empty($obj->share)) { + $files[$obj->rowid]['filename'] = $obj->filename; + $files[$obj->rowid]['position'] = $obj->position; + if (defined('USEDOLIBARRSERVER') || defined('USEDOLIBARREDITOR')) { + if (preg_match($regexforimg, $obj->filename)) { + $files[$obj->rowid]['url'] = DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($obj->share); + } else { + $files[$obj->rowid]['url'] = DOL_URL_ROOT.'/document.php?hashp='.urlencode($obj->share); + } + } else { + $files[$obj->rowid]['url'] = '/wrapper.php?hashp='.urlencode($obj->share); + } + } + } + $i++; + } + } + + return $files; +} + /** * Return list of containers object that match a criteria. From 4170bd410c63c2e4d04ac8f1332d1eef9c9d32dd Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:17:44 +0200 Subject: [PATCH 63/98] NEW Opacity for finished lines (#30219) * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/projet/list.php | 2 +- htdocs/supplier_proposal/list.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 15ef7de9d7a19..ef52235ec004c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1792,7 +1792,7 @@ print '
'; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 457e7cae3914e..1ede2ad14bd3a 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1636,7 +1636,7 @@ } else { // Show line of result $j = 0; - print '
'; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 5d39c3f3840ba..725de0edfa90e 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -1037,7 +1037,7 @@ print '
'; From f7c0253035f901dace4c8323a38fa233562ee3ad Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:18:56 +0200 Subject: [PATCH 64/98] NEW checkbox to choose thirdparty nature (#30192) * New checkbox to choose thirdparty nature * fix some values * fix display for fields --------- Co-authored-by: Hystepik --- htdocs/societe/card.php | 212 +++++++++++++++++++++------------------- 1 file changed, 109 insertions(+), 103 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 075670f105b21..31d8b9f79f69d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -283,11 +283,15 @@ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors'); $error++; } - if (GETPOSTINT('client') && GETPOSTINT('client') < 0) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors'); + if (GETPOSTINT('customer') && GETPOSTINT('customer') < 0) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $error++; } - if (GETPOSTISSET('fournisseur') && GETPOSTINT('fournisseur') < 0) { + if (GETPOSTINT('prospect') && GETPOSTINT('prospect') < 0) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Prospect")), null, 'errors'); + $error++; + } + if (GETPOSTISSET('supplier') && GETPOSTINT('supplier') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); $error++; } @@ -375,8 +379,13 @@ $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type - $object->client = GETPOSTINT('client'); - $object->fournisseur = GETPOSTINT('fournisseur'); + // Calculate the type of the thirdparty + $customer = (GETPOSTINT('customer') > 0 ? 1 : 0); + $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); + $prospectcustomer = $customer + $prospect; + + $object->client = $prospectcustomer; + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); $object->commercial_id = GETPOSTINT('commercial_id'); $object->default_lang = GETPOST('default_lang'); @@ -1350,18 +1359,44 @@ function formatCustomerSelection (selection) { print '
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''; - $selected = (GETPOSTISSET('client') ? GETPOSTINT('client') : $object->client); - print $formcompany->selectProspectCustomerType($selected); - print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; + $selectedprospect = (GETPOSTISSET('prospect') ? GETPOSTINT('prospect') : $selectedprospect); + $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); + print '
'.$form->editfieldkey('NatureOfThirdParty', 'customerprospect', '', $object, 0, 'string', '', 0).''; + print ''.$langs->trans("Prospect").''; + print '      '; + + print ''.$langs->trans("Customer").''; + print '      '; + + if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) + || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { + // Supplier + $selected = (GETPOSTISSET('supplier') ? GETPOSTINT('supplier') : $object->fournisseur); + print ''.$langs->trans("Vendor").''; + } + print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print '
'; $tmpcode = $object->code_client; if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { @@ -1372,44 +1407,22 @@ function formatCustomerSelection (selection) { $s = $modCodeClient->getToolTip($langs, $object, 0); print $form->textwithpicto('', $s, 1); print '
'; - print '
'.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).''; - $default = -1; - if (getDolGlobalString('THIRDPARTY_SUPPLIER_BY_DEFAULT')) { - $default = 1; - } - print $form->selectyesno("fournisseur", (GETPOSTINT('fournisseur') != '' ? GETPOSTINT('fournisseur') : (GETPOSTINT("type") == '' ? $default : $object->fournisseur)), 1, 0, (GETPOSTINT("type") == '' ? 1 : 0), 1); - print '
'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).''; - print ''; - if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { - print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); + if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { + print ''; + $s = $modCodeFournisseur->getToolTip($langs, $object, 1); + print $form->textwithpicto('', $s, 1); + print '
'; + $tmpcode = $object->code_fournisseur; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($object, 1); } + print ''; print ''; - if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { - print '
'; - $tmpcode = $object->code_fournisseur; - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { - $tmpcode = $modCodeFournisseur->getNextValue($object, 1); - } - print ''; - print ''; - $s = $modCodeFournisseur->getToolTip($langs, $object, 1); - print $form->textwithpicto('', $s, 1); - print '
'; - } - print '
'; } + print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; @@ -2090,78 +2103,71 @@ function init_supplier_categ() { print '
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''; - print $formcompany->selectProspectCustomerType($object->client); - print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; + $selectedprospect = (GETPOSTISSET('prospect') ? GETPOSTINT('prospect') : $selectedprospect); + $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); + print '
'.$form->editfieldkey('NatureOfThirdParty', 'customerprospect', '', $object, 0, 'string', '', 0).''; + print ''.$langs->trans("Prospect").''; + print '      '; + + print ''.$langs->trans("Customer").''; + print '      '; + + if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) + || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { + // Supplier + $selected = (GETPOSTISSET('supplier') ? GETPOSTINT('supplier') : $object->fournisseur); + print ''.$langs->trans("Vendor").''; + } + print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print '
'; - if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto) { - $tmpcode = $object->code_client; - if (empty($tmpcode) && !empty($object->oldcopy->code_client)) { - $tmpcode = $object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. - } - if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { - $tmpcode = $modCodeClient->getNextValue($object, 0); - } - print ''; - } elseif ($object->codeclient_modifiable()) { - print ''; - } else { - print $object->code_client; - print ''; + $tmpcode = $object->code_client; + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($object, 0); } + print ''; print ''; $s = $modCodeClient->getToolTip($langs, $object, 0); print $form->textwithpicto('', $s, 1); print '
'; - print '
'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).''; - // Supplier - if (((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) - || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { - print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; - print $form->selectyesno("fournisseur", $object->fournisseur, 1, false, 0, 1); - print '
'; - if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { - print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); - } - print ''; + if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { print '
'; - if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { - $tmpcode = $object->code_fournisseur; - if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) { - $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. - } - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { - $tmpcode = $modCodeFournisseur->getNextValue($object, 1); - } - print ''; - } elseif ($object->codefournisseur_modifiable()) { - print ''; - } else { - print $object->code_fournisseur; - print ''; + $tmpcode = $object->code_fournisseur; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($object, 1); } + print ''; print ''; $s = $modCodeFournisseur->getToolTip($langs, $object, 1); print $form->textwithpicto('', $s, 1); print '
'; - print '
'.$form->editfieldkey('NatureOfThirdParty', 'customerprospect', '', $object, 0, 'string', '', 0).''; - print ''.$langs->trans("Prospect").''; + print ''; print '      '; - print ''.$langs->trans("Customer").''; + print ''; print '      '; if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { // Supplier $selected = (GETPOSTISSET('supplier') ? GETPOSTINT('supplier') : $object->fournisseur); - print ''.$langs->trans("Vendor").''; + print ''; } print '
'.$form->editfieldkey('NatureOfThirdParty', 'customerprospect', '', $object, 0, 'string', '', 0).''; - print ''.$langs->trans("Prospect").''; + print ''; print '      '; - print ''.$langs->trans("Customer").''; + print ''; print '      '; if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { // Supplier $selected = (GETPOSTISSET('supplier') ? GETPOSTINT('supplier') : $object->fournisseur); - print ''.$langs->trans("Vendor").''; + print ''; } print '
'.$form->editfieldkey('NatureOfThirdParty', 'customerprospect', '', $object, 0, 'string', '', 0).''; - print ''; - print '      '; + print ''; - print ''; - print '      '; + print ''; if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { // Supplier $selected = (GETPOSTISSET('supplier') ? GETPOSTINT('supplier') : $object->fournisseur); - print ''; + print ''; + } + // Add js to manage the background of nature + if ($conf->use_javascript_ajax) { + print ''; } print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; print ''; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 65f27101089e0..b0348224fc904 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1034,6 +1034,9 @@ .marginright2 { margin-: 2px; } +.paddinglarge { + padding: 6px !important; +} .nowidthimp { width: unset !important; } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index ab371e73d8c34..8808b323403e5 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -340,6 +340,19 @@ } +.nonature-back { + background-color: #EEE; + padding: 2px; + margin: 2px; + border-radius: 3px; +} +.prospect-back { + background-color: #b7d5c0 !important; + color: #FFF !important; + padding: 2px; + margin: 2px; + border-radius: 3px; +} .customer-back { background-color: #55955d !important; color: #FFF !important; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 879c78cec92b2..4acc981adbdec 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -27,6 +27,12 @@ ?> +.nonature-back { + background-color: #EEE; + padding: 2px; + margin: 2px; + border-radius: 3px; +} .customer-back { background-color: #65953d !important; color: #FFF !important; From 454664c011ea33f5f7148bc783766a6469da75f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 01:37:42 +0200 Subject: [PATCH 69/98] Fix protection against dynamic code too large --- htdocs/core/lib/website2.lib.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 69f278b479297..1ac81b4a5bf4b 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -715,7 +715,10 @@ function checkPHPCode(&$phpfullcodestringold, &$phpfullcodestring) break; } } - // This char can be used to execute RCE for example using with echo `ls` + } + + // This char can be used to execute RCE for example using with echo `ls` + if (!$error) { $forbiddenphpchars = array(); if (!getDolGlobalString('WEBSITE_PHP_ALLOW_DANGEROUS_CHARS')) { // If option is not on, we disallow functions to execute commands $forbiddenphpchars = array("`"); @@ -727,18 +730,27 @@ function checkPHPCode(&$phpfullcodestringold, &$phpfullcodestring) break; } } - // Deny dynamic functions '${a}(' or '$a[b](' or '$a->b(' => So we refuse '}(' and '](' + } + + // Deny dynamic functions '${a}(' or '$a[b](' => So we refuse '}(' and '](' + if (!$error) { if (preg_match('/[}\]]\(/ims', $phpfullcodestring)) { $error++; setEventMessages($langs->trans("DynamicPHPCodeContainsAForbiddenInstruction", ']('), null, 'errors'); } - // Deny dynamic functions '$xxx(' or '$a->b(' - if (preg_match('/\$[a-z0-9_\-\>\/\*]+\(/ims', $phpfullcodestring)) { + } + + // Deny dynamic functions '$xxx(' + if (!$error) { + if (preg_match('/\$[a-z0-9_\-\/\*]+\(/ims', $phpfullcodestring)) { $error++; setEventMessages($langs->trans("DynamicPHPCodeContainsAForbiddenInstruction", '$...('), null, 'errors'); } } + // No need to block $conf->global->aaa() because PHP try to run method aaa an not function into $conf->global->aaa. + + // Then check if installmodules does not block dynamic PHP code change. if ($phpfullcodestringold != $phpfullcodestring) { if (!$error) { $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); From 3da9e53b039d79c74f35069484506318090ef063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 2 Jul 2024 01:46:40 +0200 Subject: [PATCH 70/98] Project phpdoc (#30233) * add phpdoc * add phpdoc * add phpdoc * add phpdoc --- htdocs/projet/card.php | 38 ++++++------ htdocs/projet/class/project.class.php | 87 ++++++++++++++++++++------- htdocs/projet/class/task.class.php | 63 ++++++++++++++++++- htdocs/projet/tasks.php | 15 ++--- htdocs/public/project/new.php | 11 ++-- 5 files changed, 157 insertions(+), 57 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 42ce3bd1748ba..dbf7ee74c8770 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1,11 +1,11 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2023 Charlene Benke - * Copyright (C) 2023 Christian Foellmann - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2023 Christian Foellmann + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -223,7 +223,7 @@ $object->date_start_event = $date_start_event; $object->date_end_event = $date_end_event; $object->location = $location; - $object->statut = $status; + $object->status = $status; $object->opp_status = $opp_status; $object->opp_percent = $opp_percent; $object->usage_opportunity = (GETPOST('usage_opportunity', 'alpha') == 'on' ? 1 : 0); @@ -312,7 +312,7 @@ $object->ref = GETPOST('ref', 'alpha'); $object->fk_project = GETPOSTINT('fk_project'); $object->title = GETPOST('title', 'alphanohtml'); // Do not use 'alpha' here, we want field as it is - $object->statut = GETPOSTINT('status'); + $object->status = GETPOSTINT('status'); $object->socid = GETPOSTINT('socid'); $object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is $object->public = GETPOST('public', 'alpha'); @@ -1024,7 +1024,7 @@ function change_percent() unset($statuses[$object::STATUS_DRAFT]); } foreach ($statuses as $key => $val) { - print ''; + print ''; } print ''; print ajax_combobox('status'); @@ -1578,7 +1578,7 @@ function change_percent() // Send if (empty($user->socid)) { - if ($object->statut != Project::STATUS_CLOSED) { + if ($object->status != Project::STATUS_CLOSED) { print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); } } @@ -1586,7 +1586,7 @@ function change_percent() // Accounting Report /* $accouting_module_activated = isModEnabled('comptabilite') || isModEnabled('accounting'); - if ($accouting_module_activated && $object->statut != Project::STATUS_DRAFT) { + if ($accouting_module_activated && $object->status != Project::STATUS_DRAFT) { $start = dol_getdate((int) $object->date_start); $end = dol_getdate((int) $object->date_end); $url = DOL_URL_ROOT.'/compta/accounting-files.php?projectid='.$object->id; @@ -1598,7 +1598,7 @@ function change_percent() // Back to draft if (!getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') && !getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_PROJECT')) { - if ($object->statut != Project::STATUS_DRAFT && $user->hasRight('projet', 'creer')) { + if ($object->status != Project::STATUS_DRAFT && $user->hasRight('projet', 'creer')) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&confirm=yes&token='.newToken().'&id='.$object->id, ''); } else { @@ -1608,7 +1608,7 @@ function change_percent() } // Modify - if ($object->statut != Project::STATUS_CLOSED && $user->hasRight('projet', 'creer')) { + if ($object->status != Project::STATUS_CLOSED && $user->hasRight('projet', 'creer')) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, ''); } else { @@ -1617,7 +1617,7 @@ function change_percent() } // Validate - if ($object->statut == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer')) { + if ($object->status == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer')) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&token='.newToken().'&id='.$object->id, ''); } else { @@ -1626,7 +1626,7 @@ function change_percent() } // Close - if ($object->statut == Project::STATUS_VALIDATED && $user->hasRight('projet', 'creer')) { + if ($object->status == Project::STATUS_VALIDATED && $user->hasRight('projet', 'creer')) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.$object->id, ''); } else { @@ -1635,7 +1635,7 @@ function change_percent() } // Reopen - if ($object->statut == Project::STATUS_CLOSED && $user->hasRight('projet', 'creer')) { + if ($object->status == Project::STATUS_CLOSED && $user->hasRight('projet', 'creer')) { if ($userWrite > 0) { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); } else { @@ -1673,8 +1673,8 @@ function change_percent() } // Delete - if ($user->hasRight('projet', 'supprimer') || ($object->statut == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) { - if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) { + if ($user->hasRight('projet', 'supprimer') || ($object->status == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) { + if ($userDelete > 0 || ($object->status == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) { print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 26641c1cf86da..e153bbf56ff26 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1,15 +1,15 @@ - * Copyright (C) 2005-2020 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014-2017 Marcos García - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2019 Juanjo Menent - * Copyright (C) 2022 Charlene Benke - * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2002-2005 Rodolphe Quiedeville + * Copyright (C) 2005-2020 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014-2017 Marcos García + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2022 Charlene Benke + * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -132,6 +132,10 @@ class Project extends CommonObject public $date_close; public $socid; // To store id of thirdparty + + /** + * @var string thirdparty name + */ public $thirdparty_name; // To store name of thirdparty (defined only in some cases) public $user_author_id; //!< Id of project creator. Not defined if shared project. @@ -189,19 +193,50 @@ class Project extends CommonObject public $price_booth; /** - * @var int|string Max attendees (may be empty/need cast to iint) + * @var int|'' Max attendees (may be empty/need cast to int) */ public $max_attendees; + /** + * @var int status + * @deprecated + * @see $status + */ public $statut; // 0=draft, 1=opened, 2=closed + /** + * @var int opportunity status + */ public $opp_status; // opportunity status, into table llx_c_lead_status + + /** + * @var string opportunity code + */ public $opp_status_code; + + /** + * @var int opportunity status + */ public $fk_opp_status; // opportunity status, into table llx_c_lead_status + + /** + * @var float|'' opportunity amount + */ public $opp_amount; // opportunity amount + + /** + * @var float|'' opportunity percent + */ public $opp_percent; // opportunity probability + + /** + * @var float|'' opportunity weighted amount + */ public $opp_weighted_amount; // opportunity weighted amount + /** + * @var string email msgid + */ public $email_msgid; public $oldcopy; @@ -475,7 +510,7 @@ public function create($user, $notrigger = 0) $sql .= ", '".$this->db->escape($this->description)."'"; $sql .= ", ".($this->socid > 0 ? $this->socid : "null"); $sql .= ", ".((int) $user->id); - $sql .= ", ".(is_numeric($this->statut) ? ((int) $this->statut) : '0'); + $sql .= ", ".(is_numeric($this->status) ? ((int) $this->status) : '0'); $sql .= ", ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? ((int) $this->opp_status) : 'NULL'); $sql .= ", ".(is_numeric($this->opp_percent) ? ((int) $this->opp_percent) : 'NULL'); $sql .= ", ".($this->public ? 1 : 0); @@ -587,7 +622,7 @@ public function update($user, $notrigger = 0) $sql .= ", title = '".$this->db->escape($this->title)."'"; $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : "null"); - $sql .= ", fk_statut = ".((int) $this->statut); + $sql .= ", fk_statut = ".((int) $this->status); $sql .= ", fk_opp_status = ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? $this->opp_status : 'null'); $sql .= ", opp_percent = ".((is_numeric($this->opp_percent) && $this->opp_percent != '') ? $this->opp_percent : 'null'); $sql .= ", public = ".($this->public ? 1 : 0); @@ -954,14 +989,19 @@ public function delete($user, $notrigger = 0) // Set fk_projet into elements to null $listoftables = array( - 'propal' => 'fk_projet', 'commande' => 'fk_projet', 'facture' => 'fk_projet', - 'supplier_proposal' => 'fk_projet', 'commande_fournisseur' => 'fk_projet', 'facture_fourn' => 'fk_projet', - 'expensereport_det' => 'fk_projet', 'contrat' => 'fk_projet', + 'propal' => 'fk_projet', + 'commande' => 'fk_projet', + 'facture' => 'fk_projet', + 'supplier_proposal' => 'fk_projet', + 'commande_fournisseur' => 'fk_projet', + 'facture_fourn' => 'fk_projet', + 'expensereport_det' => 'fk_projet', + 'contrat' => 'fk_projet', 'fichinter' => 'fk_projet', 'don' => array('field' => 'fk_projet', 'module' => 'don'), 'actioncomm' => 'fk_project', 'mrp_mo' => 'fk_project', - 'entrepot' => 'fk_project' + 'entrepot' => 'fk_project', ); foreach ($listoftables as $key => $value) { if (is_array($value)) { @@ -1205,7 +1245,7 @@ public function setValid($user, $notrigger = 0) } if (!$error) { - $this->statut = 1; + $this->status = 1; $this->db->commit(); return 1; } else { @@ -1233,7 +1273,7 @@ public function setClose($user) $error = 0; - if ($this->statut != self::STATUS_CLOSED) { + if ($this->status != self::STATUS_CLOSED) { $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."projet"; @@ -1256,7 +1296,7 @@ public function setClose($user) // End call triggers if (!$error) { - $this->statut = 2; + $this->status = 2; $this->db->commit(); return 1; } else { @@ -1283,7 +1323,7 @@ public function setClose($user) */ public function getLibStatut($mode = 0) { - return $this->LibStatut(isset($this->statut) ? $this->statut : $this->status, $mode); + return $this->LibStatut(isset($this->status) ? $this->status : $this->statut, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -2266,6 +2306,7 @@ public function load_board($user) $response->nbtodo++; $project_static->statut = $obj->status; + $project_static->status = $obj->status; $project_static->opp_status = $obj->fk_opp_status; $project_static->date_end = $this->db->jdate($obj->datee); @@ -2343,7 +2384,7 @@ public function hasDelay() { global $conf; - if (!($this->statut == self::STATUS_VALIDATED)) { + if (!($this->status == self::STATUS_VALIDATED)) { return false; } if (!$this->date_end) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index d4e1a27ee0518..df77bf2268e2b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -131,6 +131,7 @@ class Task extends CommonObjectLine /** * @var int ID * @deprecated use status instead + * @see $status */ public $fk_statut; @@ -154,6 +155,9 @@ class Task extends CommonObjectLine */ public $fk_user_valid; + /** + * @var int rank + */ public $rang; public $timespent_min_date; @@ -181,6 +185,9 @@ class Task extends CommonObjectLine public $comments = array(); // Properties calculated from sum of llx_element_time linked to task + /** + * @var int is task to be billed + */ public $tobill; /** @@ -189,27 +196,79 @@ class Task extends CommonObjectLine public $billed; // Properties to store project information + /** + * @var string project ref + */ public $projectref; + + /** + * @var int project status + */ public $projectstatus; + + /** + * @var string project label + */ public $projectlabel; + + /** + * @var float|'' opportunity amount + */ public $opp_amount; + + /** + * @var float|'' opportunity percent + */ public $opp_percent; + + /** + * @var int opportunity status + */ public $fk_opp_status; + public $usage_bill_time; + + /** + * @var int is project public + */ public $public; + public $array_options_project; // Properties to store thirdparty of project information + + /** + * @var int ID of thirdparty + * @deprecated + * @see $thirdparty_id + */ public $socid; + + /** + * @var int ID of thirdparty + */ public $thirdparty_id; + + /** + * @var string name of thirdparty + */ public $thirdparty_name; + + /** + * @var string email of thirdparty + */ public $thirdparty_email; // store parent ref and position + /** + * @var string task parent ref + */ public $task_parent_ref; - public $task_parent_position; - + /** + * @var int task parent rank + */ + public $task_parent_position; /** * @var float budget_amount diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index cd51707d7ba17..ef97960d1262b 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2024 MDW +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -713,7 +714,7 @@ print load_fiche_titre($langs->trans("NewTask"), '', 'projecttask'); $projectoktoentertime = 1; - if ($object->id > 0 && $object->statut == Project::STATUS_CLOSED) { + if ($object->id > 0 && $object->status == Project::STATUS_CLOSED) { $projectoktoentertime = 0; print '
'; $langs->load("errors"); @@ -721,7 +722,7 @@ print '
'; } - if ($object->id > 0 && $object->statut == Project::STATUS_DRAFT) { + if ($object->id > 0 && $object->status == Project::STATUS_DRAFT) { $projectoktoentertime = 0; print '
'; $langs->load("errors"); @@ -743,7 +744,7 @@ print '
'; $tmpcode = $object->code_client; @@ -2122,21 +2149,49 @@ function init_supplier_categ() { break; } + // Nature of thirdparty $selectedprospect = (GETPOSTISSET('prospect') ? GETPOSTINT('prospect') : $selectedprospect); $selectedcustomer = (GETPOSTISSET('customer') ? GETPOSTINT('customer') : $selectedcustomer); print '
'.$form->editfieldkey('NatureOfThirdParty', 'customerprospect', '', $object, 0, 'string', '', 0).''; - print ''; - print '      '; + print ''; - print ''; - print '      '; + print ''; if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { // Supplier $selected = (GETPOSTISSET('supplier') ? GETPOSTINT('supplier') : $object->fournisseur); - print ''; + print ''; + } + + // Add js to manage the background of nature + if ($conf->use_javascript_ajax) { + print ''; } print '
'; $defaultref = ''; - $obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; + $obj = getDolGlobalString('PROJECT_TASK_ADDON', 'mod_task_simple'); if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) { require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php'; $modTask = new $obj(); diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 3fea349ceaeed..11615f00d3e0b 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -4,9 +4,9 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -201,7 +201,7 @@ function llxFooterVierge() $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } // Set default opportunity status - $defaultoppstatus = getDolGlobalString('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD'); + $defaultoppstatus = getDolGlobalInt('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD'); if (empty($defaultoppstatus)) { $error++; $langs->load("errors"); @@ -239,7 +239,6 @@ function llxFooterVierge() // Fill array 'array_options' with data from the form $extrafields->fetch_name_optionals_label($thirdparty->table_element); $ret = $extrafields->setOptionalsFromPost(null, $thirdparty, '', 1); - //var_dump($thirdparty->array_options);exit; if ($ret < 0) { $error++; $errmsg = ($extrafields->error ? $extrafields->error.'
' : '').implode('
', $extrafields->errors); @@ -305,8 +304,8 @@ function llxFooterVierge() $proj->usage_opportunity = 1; $proj->title = $langs->trans("LeadFromPublicForm"); $proj->description = GETPOST("description", "alphanohtml"); - $proj->opp_status = $defaultoppstatus; - $proj->fk_opp_status = $defaultoppstatus; + $proj->opp_status = $defaultoppstatus; + $proj->fk_opp_status = $defaultoppstatus; $proj->ip = getUserRemoteIP(); $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200); From b91858863b20db36b98f4ee9be93f20942e371fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 2 Jul 2024 01:51:31 +0200 Subject: [PATCH 71/98] add missing token (#30232) * add missing token * Update card.php --- htdocs/fichinter/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 42c4cc1867275..59fd5121ba68d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1654,7 +1654,7 @@ // Modify if ($object->statut == Fichinter::STATUS_VALIDATED && ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('ficheinter', 'creer')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('ficheinter', 'ficheinter_advance', 'unvalidate')))) { - print '
'; + print '
'; if (!getDolGlobalString('FICHINTER_DISABLE_DETAILS')) { print $langs->trans("Modify"); } else { From 96a5479e9eb78070e61e4b99a07693d0f1409bb4 Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Tue, 2 Jul 2024 01:56:45 +0200 Subject: [PATCH 72/98] FIX: Error mesg show untranslated extrafield name (#30227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2d3b4a604cd62..8faa999dc6f5c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6228,7 +6228,7 @@ public function insertExtraFields($trigger = '', $userused = null) foreach ($new_array_options as $key => $value) { $attributeKey = substr($key, 8); // Remove 'options_' prefix $attributeType = $extrafields->attributes[$this->table_element]['type'][$attributeKey]; - $attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey]; + $attributeLabel = $langs->transnoentities($extrafields->attributes[$this->table_element]['label'][$attributeKey]); $attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey]; $attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey]; $attributeUnique = $extrafields->attributes[$this->table_element]['unique'][$attributeKey]; From 46435ceb441349fcb67cbddee6f31bf34b4a52b4 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Tue, 2 Jul 2024 01:59:20 +0200 Subject: [PATCH 73/98] QUAL Update inc.php (#29822) Adaptation of detect_dolibarr_main_data_root to handle more cases, especially when servers don't have htdocs Co-authored-by: Laurent Destailleur --- htdocs/install/inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 27a08a6f4ce7c..e4e93da430d58 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -726,8 +726,7 @@ function detect_dolibarr_main_document_root() */ function detect_dolibarr_main_data_root($dolibarr_main_document_root) { - $dolibarr_main_data_root = preg_replace("/\/htdocs$/", "", $dolibarr_main_document_root); - $dolibarr_main_data_root .= "/documents"; + $dolibarr_main_data_root = preg_replace("/\/[^\/]+$/", "/documents", $dolibarr_main_document_root); return $dolibarr_main_data_root; } From dd08c07a6585dedb88136e25079d192c18620be7 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Tue, 2 Jul 2024 02:00:31 +0200 Subject: [PATCH 74/98] NEW : Constant to hide user login times (#29815) * Update card.php * Update list.php * Update list.php --- htdocs/user/card.php | 22 +++++++++++----------- htdocs/user/list.php | 26 ++++++++++++++++---------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 631681d9a46a6..532258aaca691 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1959,18 +1959,18 @@ } print ''; } - - print '
'; - print ''; + print ''; + print "\n"; } - print ''; - print "\n"; - print '
'.$langs->trans("LastConnexion").''; - if ($object->datepreviouslogin) { - print dol_print_date($object->datepreviouslogin, "dayhour", "tzuserrel").' ('.$langs->trans("Previous").'), '; - } - if ($object->datelastlogin) { - print dol_print_date($object->datelastlogin, "dayhour", "tzuserrel").' ('.$langs->trans("Currently").')'; + if ((getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) || (getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 1 && $object->id == $user->id)) { + print '
'.$langs->trans("LastConnexion").''; + if ($object->datepreviouslogin) { + print dol_print_date($object->datepreviouslogin, "dayhour", "tzuserrel").' ('.$langs->trans("Previous").'), '; + } + if ($object->datelastlogin) { + print dol_print_date($object->datelastlogin, "dayhour", "tzuserrel").' ('.$langs->trans("Currently").')'; + } + print '
'; print ''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 355265e10cc67..649a02d032895 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -141,12 +141,16 @@ 'u.national_registration_number' => array('label' => "NationalRegistrationNumber", 'checked' => -1, 'position' => 51, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)), 'u.job' => array('label' => "PostOrFunction", 'checked' => -1, 'position' => 60), 'u.salary' => array('label' => "Salary", 'checked' => -1, 'position' => 80, 'enabled' => (isModEnabled('salaries') && $user->hasRight("salaries", "readall")), 'isameasure' => 1), - 'u.datelastlogin' => array('label' => "LastConnexion", 'checked' => 1, 'position' => 100), - 'u.datepreviouslogin' => array('label' => "PreviousConnexion", 'checked' => 0, 'position' => 110), 'u.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), 'u.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500), 'u.statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000), ); + +if (getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { + $arrayfields['u.datelastlogin'] = array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100); + $arrayfields['u.datepreviouslogin'] = array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110); +} + // Extra fields include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -267,13 +271,15 @@ $search_warehouse = ""; $search_supervisor = ""; $search_api_key = ""; - $search_datelastlogin = ""; - $search_datepreviouslogin = ""; $search_date_creation = ""; $search_date_modification = ""; $search_categ = 0; $toselect = array(); $search_array_options = array(); + if (getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) { + $search_datelastlogin = ""; + $search_datepreviouslogin = ""; + } } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { @@ -812,10 +818,10 @@ if (!empty($arrayfields['u.salary']['checked'])) { print '
'.dol_print_date($db->jdate($obj->datelastlogin), "dayhour").''.dol_print_date($db->jdate($obj->datepreviouslogin), "dayhour").''; - print dol_escape_htmltag($invoicetmp->ref_supplier); + if ($object->type == 'bank-transfer' && !$salaryBonPl) { + $labeltoshow = ''; + if ($invoicetmp instanceof Facture) { + $labeltoshow = $invoicetmp->ref_supplier; + } + print ''; + if ($invoicetmp instanceof Facture) { + print dol_escape_htmltag($invoicetmp->ref_supplier); + } print "'; - print dol_escape_htmltag($invoicetmp->ref_supplier); + if ($object->type == 'bank-transfer' && !$salaryBonPl) { + $labeltoshow = ''; + if ($invoicetmp instanceof Facture) { + $labeltoshow = $invoicetmp->ref_supplier; + } + print ''; + if ($invoicetmp instanceof Facture) { + print dol_escape_htmltag($invoicetmp->ref_supplier); + } print "'; - if ($user->hasRight('holiday', 'define_holiday')) { // Allowed to set the balance of any user + if ($permissiontosetup) { // Allowed to set the balance of any user print ''; } print '
'."\n"; + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); - //print ''; - print ''; - print ''; + print '
'; + print '
'; + print '
'.$langs->trans("Ref").''.$object->getNomUrl(1).'
'.$langs->trans("Date").''.dol_print_date($object->datec, 'day').'
'.$langs->trans("Amount").''.price($object->amount).'
'."\n"; - if (!empty($object->date_trans)) { - $muser = new User($db); - $muser->fetch($object->user_trans); + //print ''; + print ''; + print ''; - print ''; - print ''; - } - if (!empty($object->date_credit)) { - print ''; - } + if (!empty($object->date_trans)) { + $muser = new User($db); + $muser->fetch($object->user_trans); - print '
'.$langs->trans("Ref").''.$object->getNomUrl(1).'
'.$langs->trans("Date").''.dol_print_date($object->datec, 'day').'
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans("TransData").''; - print dol_print_date($object->date_trans, 'day'); - print '   '.$langs->trans("By").' '.$muser->getNomUrl(-1).'
'.$langs->trans("TransMetod").''; - print $object->methodes_trans[$object->method_trans]; - print '
'.$langs->trans('CreditDate').''; - print dol_print_date($object->date_credit, 'day'); - print '
'; + print '
'.$langs->trans("TransData").''; + print dol_print_date($object->date_trans, 'day'); + print '   '.$langs->trans("By").' '.$muser->getNomUrl(-1).'
'.$langs->trans("TransMetod").''; + print $object->methodes_trans[$object->method_trans]; + print '
'.$langs->trans('CreditDate').''; + print dol_print_date($object->date_credit, 'day'); + print '
'; - print '
'; - print ''; + print '
'; - // Get bank account for the payment - $acc = new Account($db); - $fk_bank_account = $object->fk_bank_account; - if (empty($fk_bank_account)) { - $fk_bank_account = ($object->type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT')); - } - if ($fk_bank_account > 0) { - $result = $acc->fetch($fk_bank_account); - } + print '
'; + print '
'; - $labelofbankfield = "BankToReceiveWithdraw"; - if ($object->type == 'bank-transfer') { - $labelofbankfield = 'BankToPayCreditTransfer'; - } + // Get bank account for the payment + $acc = new Account($db); + $fk_bank_account = $object->fk_bank_account; + if (empty($fk_bank_account)) { + $fk_bank_account = ($object->type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT')); + } + if ($fk_bank_account > 0) { + $result = $acc->fetch($fk_bank_account); + } - print ''; + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') { + $labelofbankfield = 'BankToPayCreditTransfer'; + } - print ''; - print ''; + print ''; - $modulepart = 'prelevement'; - if ($object->type == 'bank-transfer') { - $modulepart = 'paymentbybanktransfer'; - } + print ''; + print ''; - print '
'; - print $form->textwithpicto($langs->trans("BankAccount"), $langs->trans($labelofbankfield)); - print ''; - if ($acc->id > 0) { - print $acc->getNomUrl(1); - } - print '
'; + print $form->textwithpicto($langs->trans("BankAccount"), $langs->trans($labelofbankfield)); + print ''; + if ($acc->id > 0) { + print $acc->getNomUrl(1); + } + print '
'; - $labelfororderfield = 'WithdrawalFile'; - if ($object->type == 'bank-transfer') { - $labelfororderfield = 'CreditTransferFile'; - } - print $langs->trans($labelfororderfield).''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') { + $modulepart = 'paymentbybanktransfer'; + } - if (isModEnabled('multicompany')) { - $labelentity = $conf->entity; - $relativepath = 'receipts/'.$object->ref.'-'.$labelentity.'.xml'; + print '
'; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') { + $labelfororderfield = 'CreditTransferFile'; + } + print $langs->trans($labelfororderfield).''; - if ($type != 'bank-transfer') { - $dir = $conf->prelevement->dir_output; - } else { - $dir = $conf->paymentbybanktransfer->dir_output; - } - if (!dol_is_file($dir.'/'.$relativepath)) { // For backward compatibility - $relativepath = 'receipts/'.$object->ref.'.xml'; - } + if (isModEnabled('multicompany')) { + $labelentity = $conf->entity; + $relativepath = 'receipts/'.$object->ref.'-'.$labelentity.'.xml'; + + if ($type != 'bank-transfer') { + $dir = $conf->prelevement->dir_output; } else { + $dir = $conf->paymentbybanktransfer->dir_output; + } + if (!dol_is_file($dir.'/'.$relativepath)) { // For backward compatibility $relativepath = 'receipts/'.$object->ref.'.xml'; } + } else { + $relativepath = 'receipts/'.$object->ref.'.xml'; + } - print ''.$relativepath; - print img_picto('', 'download', 'class="paddingleft"'); - print ''; - print '
'; + print ''.$relativepath; + print img_picto('', 'download', 'class="paddingleft"'); + print ''; + print ''; - print '
'; + print ''; - print dol_get_fiche_end(); - } else { - dol_print_error($db); - } + print dol_get_fiche_end(); } From a75d6e6ffedada8f7932f5f45de1f1b5a9eec9a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 18:46:20 +0200 Subject: [PATCH 82/98] Finished the groupby experimental into project list --- .../modulebuilder/template/myobject_list.php | 6 ++- htdocs/projet/card.php | 3 ++ htdocs/projet/class/project.class.php | 3 +- htdocs/projet/list.php | 51 +++++++++++++++---- htdocs/theme/eldy/global.inc.php | 8 +++ htdocs/theme/eldy/info-box.inc.php | 18 ++++++- htdocs/theme/md/info-box.inc.php | 21 +++++++- htdocs/theme/md/style.css.php | 10 +++- 8 files changed, 104 insertions(+), 16 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 31bd7f40717a2..0e817b7e80ef3 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -98,7 +98,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) +$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...) +$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); @@ -480,6 +481,9 @@ if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } +if ($groupby != '') { + $param .= '&groupby='.urlencode($groupby); +} foreach ($search as $key => $val) { if (is_array($search[$key])) { foreach ($search[$key] as $skey) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6b1edad2c2382..604002627a5b4 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -174,6 +174,9 @@ setEventMessages($object->error, $object->errors, 'errors'); } $action = ''; + + // For backward compatibility + $object->statut = $object::STATUS_DRAFT; // this already set for $object->status by $object->setStatut() } // Action add diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index fef5cafc92bf7..6d59e4fcc5e3b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1169,7 +1169,7 @@ public function deleteTasks($user) */ public function setValid($user, $notrigger = 0) { - global $langs, $conf; + global $langs; $error = 0; @@ -1206,6 +1206,7 @@ public function setValid($user, $notrigger = 0) if (!$error) { $this->statut = 1; + $this->status = 1; $this->db->commit(); return 1; } else { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4a51e6f1316e2..a924af9154443 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -59,6 +59,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'projectlist'; $mode = GETPOST('mode', 'alpha'); +$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' $title = $langs->trans("Projects"); @@ -267,9 +268,9 @@ // Add a groupby field. Set $groupby and $groupbyvalues. // TODO Move this into a inc file $groupbyvalues = array(); -if ($mode == 'kanban') { +$groupofcollpasedvalues = array(); +if ($mode == 'kanban' && $groupby) { $groupbyold = null; - $groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' $groupbyfield = preg_replace('/[a-z]\./', '', $groupby); if (!empty($object->fields[$groupbyfield]['alias'])) { $groupbyfield = $object->fields[$groupbyfield]['alias']; @@ -282,7 +283,8 @@ } elseif (!empty($object->fields[preg_replace('/[a-z]\./', '', $groupby)]['arrayofkeyval'])) { $groupbyvalues = $object->fields[preg_replace('/[a-z]\./', '', $groupby)]['arrayofkeyval']; } else { - // If type is 'integer:Object:classpath' + // var_dump($object->fields[$groupby]['type']); + // If type is 'integer:Object:classpath', for example "integer:CLeadStatus:core/class/cleadstatus.class.php" // TODO // $groupbyvalues = ... @@ -291,7 +293,7 @@ $sql .= " WHERE active = 1"; //$sql .= " AND cls.code <> 'LOST'"; //$sql .= " AND cls.code <> 'WON'"; - $sql .= $db->order('cls.rowid', 'ASC'); + $sql .= $db->order('cls.rowid', 'ASC'); // Must use the same order key than the key in $groupby $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -303,10 +305,13 @@ $i++; } } + + $groupofcollpasedvalues = array(6,7); // LOST and WON } //var_dump($groupbyvalues); } - if ($groupby) { + // Add a filter on the group by if not yet included first + if ($groupby && !preg_match('/^'.preg_quote($db->sanitize($groupby), '/').'/', $sortfield)) { //var_dump($arrayfields); $sortfield = $db->sanitize($groupby).($sortfield ? ",".$sortfield : ""); $sortorder = "ASC".($sortfield ? ",".$sortorder : ""); @@ -851,6 +856,10 @@ if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } +if ($groupby != '') { + $param .= '&groupby='.urlencode($groupby); +} + if ($socid) { $param .= '&socid='.urlencode((string) $socid); } @@ -1646,7 +1655,7 @@ if ($mode == 'kanban') { if ($i == 0) { - print ''; + print ''; } if (!empty($groupby)) { @@ -1663,11 +1672,21 @@ if (!is_null($groupbyold)) { print ''; // We need a new kanban column - end box-flex-container } - // TODO Create kanban column for all values into $groupbyvalues, until we reach the new $obj->$groupbyfield - // - //var_dump($groupbyvalues); - //var_dump($obj->$groupbyfield); + foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) { + //var_dump("tmpcursor=".$tmpcursor." groupbyold=".$groupbyold." groupbyvalue=".$groupbyvalue); + if (!is_null($groupbyold) && ($tmpcursor <= $groupbyold)) { continue; } + if ($tmpcursor >= $groupbyvalue) { continue; } + // We found a possible column with no value, we output the empty column + print '
'; + print '
'.$langs->trans($tmpgroupbyvalue).'
'; + print '
'; // Start and end the new column + } print '
'; // Start new column + print '
'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ? 'Undefined' : $groupbyvalues[$groupbyvalue]).'
'; } $groupbyold = $groupbyvalue; } elseif ($i == 0) { @@ -1691,6 +1710,18 @@ // Close kanban column if (!empty($groupby)) { print '
'; // end box-flex-container + foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) { + //var_dump("tmpcursor=".$tmpcursor." groupbyold=".$groupbyold." groupbyvalue=".$groupbyvalue); + if ($tmpcursor <= $groupbyvalue) { continue; } + // We found a possible column with no value, we output the empty column + print '
'; + print '
'.$langs->trans(empty($tmpgroupbyvalue) ? 'Undefined' : $tmpgroupbyvalue).'
'; + print '
'; // Start and end the new column + } print ''; // end box-flex-container-columns } else { print ''; // end box-flex-container diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 68d2ffea88202..608d4f680b668 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4800,6 +4800,14 @@ max-width: calc(50%); } + div.pagination ul li { + margin-top: 3px; + margin-bottom: 3px; + } + div.pagination .button-title-separator { + display: none; + } + .clearbothonsmartphone { clear: both; display: block !important; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index ab371e73d8c34..2b194da61c6be 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -533,6 +533,16 @@ .box-flex-container-column:not(:last-of-type) { border-right: 1px solid #AAA; } +.box-flex-container-column.kanban { + flex: 1; +} +.kanban.kanbancollapsed { + flex: unset; + width: 80px; +} +.kanban.kanbancollapsed .kanbanlabel, .text-vertical { + writing-mode: vertical-rl; +} .box-flex-grow-zero { flex-grow: 0 !important; @@ -547,12 +557,18 @@ .box-flex-item.filler { height: 0; } -.box-flex-item { +.box-flex-item, .kanbanlabel { margin-top: 5px; margin-: 20px; margin-bottom: 0px; margin-: 10px; } +.kanbanlabel { + background: var(--colorbacktitle1); + padding: 5px; + margin-bottom: 10px; + border-radius: 5px; +} .kanban .box-flex-item { line-height: 1.4em; } diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 879c78cec92b2..0317a6198acb9 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -580,11 +580,22 @@ } .box-flex-container-column { flex-grow: 1; - } +} .box-flex-container-column:not(:last-of-type) { border-right: 1px solid #AAA; } +.box-flex-container-column.kanban { + flex: 1; +} +.kanban.kanbancollapsed { + flex: unset; + width: 80px; +} +.kanban.kanbancollapsed .kanbanlabel, .text-vertical { + writing-mode: vertical-rl; +} + .box-flex-grow-zero{ flex-grow: 0 !important; } @@ -599,12 +610,18 @@ .box-flex-item.filler{ height: 0; } -.box-flex-item { +.box-flex-item, .kanbanlabel { margin-top: 5px; margin-: 10px; margin-bottom: 0px; margin-: 10px; } +.kanbanlabel { + background: var(--colorbacktitle1); + padding: 5px; + margin-bottom: 10px; + border-radius: 5px; +} .kanban .box-flex-item { line-height: 1.4em; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fb9b1da46551f..0dfb6d17f4e52 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4874,12 +4874,20 @@ height: 54px; padding: 3px; } -@media only screen and (max-width: 767px) +@media only screen and (max-width: 768px) { .tabBar .arearef .pagination.paginationref { max-width: calc(50%); } + div.pagination ul li { + margin-top: 3px; + margin-bottom: 3px; + } + div.pagination .button-title-separator { + display: none; + } + .clearbothonsmartphone { clear: both; display: block !important; From 331fb36f47ebb4ab484e4ddf4f51452f4325d6f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 18:52:26 +0200 Subject: [PATCH 83/98] Debug v20 --- htdocs/projet/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a924af9154443..05edffb1ddb96 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1681,11 +1681,11 @@ if (in_array($tmpcursor, $groupofcollpasedvalues)) { print ' kanbancollapsed'; } - print '" data-html="column_'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">'; + print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">'; print '
'.$langs->trans($tmpgroupbyvalue).'
'; print ''; // Start and end the new column } - print '
'; // Start new column + print '
'; // Start new column print '
'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ? 'Undefined' : $groupbyvalues[$groupbyvalue]).'
'; } $groupbyold = $groupbyvalue; @@ -1718,7 +1718,7 @@ if (in_array($tmpcursor, $groupofcollpasedvalues)) { print ' kanbancollapsed'; } - print '" data-html="column_'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">'; + print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">'; print '
'.$langs->trans(empty($tmpgroupbyvalue) ? 'Undefined' : $tmpgroupbyvalue).'
'; print '
'; // Start and end the new column } From 55425a51fcd7811f1bebabf7a315c51614abce5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 23:08:46 +0200 Subject: [PATCH 84/98] Debug v20 --- htdocs/user/param_ihm.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 2b422ddd1fdc5..d94cacfac02f4 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -182,6 +182,7 @@ $result = dol_set_user_param($db, $conf, $object, $tabparam); // Clear cache of widgets (because we may have modified the length of cached widget lists) + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $cachedir = DOL_DATA_ROOT.'/users/temp/widgets'; dol_delete_dir_recursive($cachedir); From 844f995c605a9d6527da11d2102acb3e9dd19330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 3 Jul 2024 01:33:55 +0200 Subject: [PATCH 85/98] fix phpstan (#30246) --- htdocs/projet/class/project.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1de720670b4a7..8621d3ebbe412 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1169,10 +1169,10 @@ public function getElementCount($type, $tablename, $projectkey = 'fk_projet') } /** - * Delete tasks with no children first, then task with children recursively + * Delete tasks with no children first, then task with children recursively * - * @param User $user User - * @return int Return integer <0 if KO, 1 if OK + * @param User $user User + * @return int Return integer <0 if KO, 1 if OK */ public function deleteTasks($user) { @@ -1193,7 +1193,7 @@ public function deleteTasks($user) $this->getLinesArray($user); if ($deleted && count($this->lines) < $countTasks) { if (count($this->lines)) { - $this->deleteTasks($this->lines); + $this->deleteTasks($user); } } From a878934f23b6c940503dc78045b39a0efaca719e Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Wed, 3 Jul 2024 01:53:37 +0200 Subject: [PATCH 86/98] fix originalcontentonly (#30245) --- htdocs/core/lib/website.lib.php | 5 ++++- htdocs/core/lib/website2.lib.php | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index d050cf0841d4e..ef3ae0a2f98e5 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -631,7 +631,10 @@ function includeContainer($containerref) $tmpoutput = ob_get_contents(); ob_end_clean(); - print "\n".''."\n"; + // We don't print info messages for pages of type library or service + if (!empty($websitepage->type_container) && !in_array($websitepage->type_container, array('library', 'service'))) { + print "\n".''."\n"; + } print preg_replace(array('/^.*]*>/ims', '/<\/body>.*$/ims'), array('', ''), $tmpoutput); if (!$res) { diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 1ac81b4a5bf4b..7046fa435a034 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -278,7 +278,16 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= '$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp, "html", '.$objectpage->id.'); dolWebsiteIncrementCounter('.$object->id.', "'.$objectpage->type_container.'", '.$objectpage->id.');'."\n"; $tplcontent .= "// END PHP ?>\n"; } else { - $tplcontent .= "\n"; + $tplcontent .= "\n"; + $tplcontent .= $objectpage->content; } From 7e5b11789b703107a3ce0c1acaeac175f4e3a20f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 3 Jul 2024 01:54:00 +0200 Subject: [PATCH 87/98] FIX look and feel : center zip field in contract list (#30247) --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 10d5c288a3b05..b43e84cdd3090 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1203,7 +1203,7 @@ } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; + print ''; print $obj->zip; print ''; if (!$i) { From 3faf45e6e5e99abf756c64e0fbc00c8b64d277cb Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 3 Jul 2024 01:56:19 +0200 Subject: [PATCH 88/98] FIX missing include (#30242) Co-authored-by: Christophe Battarel --- htdocs/user/param_ihm.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index b546bba719168..a933a7dffaaef 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -26,6 +26,7 @@ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; From 6dd25996c554862b1eb3bd7032c593650ed6a253 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 3 Jul 2024 02:03:37 +0200 Subject: [PATCH 89/98] fix missmatch of variables (#30241) --- htdocs/compta/stats/index.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 9442d0e927525..ff93f20f336b1 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -487,22 +487,22 @@ //var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end); if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) { if ($annee_decalage > $minyear && $case <= $casenow) { - if (!empty($cumulative_ht[$caseprev]) && !empty($cumulative_ht[$case])) { - $percent = (round(($cumulative_ht[$case] - $cumulative_ht[$caseprev]) / $cumulative_ht[$caseprev], 4) * 100); - //print "X $cumulative_ht[$case] - $cumulative_ht[$caseprev] - $cumulative_ht[$caseprev] - $percent X"; + if (!empty($cumulative[$caseprev]) && !empty($cumulative[$case])) { + $percent = (round(($cumulative[$case] - $cumulative[$caseprev]) / $cumulative[$caseprev], 4) * 100); + //print "X $cumulative[$case] - $cumulative[$caseprev] - $cumulative[$caseprev] - $percent X"; print($percent >= 0 ? "+$percent" : "$percent").'%'; } - if (!empty($cumulative_ht[$caseprev]) && empty($cumulative_ht[$case])) { + if (!empty($cumulative[$caseprev]) && empty($cumulative[$case])) { print '-100%'; } - if (empty($cumulative_ht[$caseprev]) && !empty($cumulative_ht[$case])) { + if (empty($cumulative[$caseprev]) && !empty($cumulative[$case])) { //print '+Inf%'; print '-'; } - if (isset($cumulative_ht[$caseprev]) && empty($cumulative_ht[$caseprev]) && empty($cumulative_ht[$case])) { + if (isset($cumulative[$caseprev]) && empty($cumulative[$caseprev]) && empty($cumulative[$case])) { print '+0%'; } - if (!isset($cumulative_ht[$caseprev]) && empty($cumulative_ht[$case])) { + if (!isset($cumulative[$caseprev]) && empty($cumulative[$case])) { print '-'; } } else { @@ -627,24 +627,24 @@ // Pourcentage total if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) { - if (!empty($total_ht[$annee - 1]) && !empty($total_ht[$annee])) { - $percent = (round(($total_ht[$annee] - $total_ht[$annee - 1]) / $total_ht[$annee - 1], 4) * 100); + if (!empty($total[$annee - 1]) && !empty($total[$annee])) { + $percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100); print ''; print($percent >= 0 ? "+$percent" : "$percent").'%'; print ''; } - if (!empty($total_ht[$annee - 1]) && empty($total_ht[$annee])) { + if (!empty($total[$annee - 1]) && empty($total[$annee])) { print '-100%'; } - if (empty($total_ht[$annee - 1]) && !empty($total_ht[$annee])) { + if (empty($total[$annee - 1]) && !empty($total[$annee])) { print '+'.$langs->trans('Inf').'%'; } - if (empty($total_ht[$annee - 1]) && empty($total_ht[$annee])) { + if (empty($total[$annee - 1]) && empty($total[$annee])) { print '+0%'; } } else { print ''; - if (!empty($total_ht[$annee]) || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { + if (!empty($total[$annee]) || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; From 2f5647e4e35b2bd67baacb08f481333205bfcfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 3 Jul 2024 02:30:53 +0200 Subject: [PATCH 90/98] fix checkFunctionArgumentTypes (#30234) * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * add ignore * add ignore add ignore add ignore add ignore add ignore * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes --- htdocs/admin/company.php | 3 +- htdocs/ai/ajax/generate_content.php | 3 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/bank/releve.php | 5 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 4 +- .../core/class/commondocgenerator.class.php | 6 +- htdocs/core/class/html.formprojet.class.php | 4 +- htdocs/core/class/rssparser.class.php | 5 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 17 +++--- htdocs/core/lib/phpsessionindb.lib.php | 3 +- .../modules/commande/mod_commande_saphir.php | 19 +++--- .../modules/delivery/mod_delivery_saphir.php | 16 +++-- .../doc/doc_generic_shipment_odt.modules.php | 1 + .../expedition/mod_expedition_ribera.php | 19 +++--- .../expensereport/mod_expensereport_jade.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 12 ++-- .../facture/doc/pdf_octopus.modules.php | 4 +- .../facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/modAgenda.class.php | 3 +- htdocs/core/modules/mrp/mod_mo_advanced.php | 48 ++++++++------- .../modules/project/mod_project_universal.php | 22 ++++--- .../modules/propale/mod_propale_saphir.php | 21 ++++--- .../supplier_order/doc/pdf_cornas.modules.php | 10 ++-- .../mod_commande_fournisseur_orchidee.php | 19 +++--- .../doc/pdf_zenith.modules.php | 10 ++-- .../modules/ticket/mod_ticket_universal.php | 49 ++++++++------- .../class/expensereport.class.php | 7 +-- htdocs/product/card.php | 4 +- htdocs/product/list.php | 3 +- htdocs/product/stats/supplier_proposal.php | 5 +- htdocs/public/members/new.php | 4 +- htdocs/societe/class/societe.class.php | 7 ++- htdocs/societe/contact.php | 2 +- htdocs/stripe/admin/stripe.php | 12 ++-- htdocs/ticket/index.php | 4 +- htdocs/user/class/user.class.php | 2 +- htdocs/variants/lib/variants.lib.php | 7 ++- htdocs/webportal/class/context.class.php | 2 +- phpstan.neon.dist | 60 ++++++++++++++++++- ...ail_expire_services_to_representatives.php | 16 ++--- scripts/emailings/mailing-send.php | 3 +- .../email_unpaid_invoices_to_customers.php | 17 +++--- 44 files changed, 290 insertions(+), 178 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b337a0922f8bb..51d9aac95ebb3 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -7,6 +7,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht * Copyright (C) 2023 Nick Fragoulis + * Copyright (C) 2024 Frédéric France * * 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 @@ -92,7 +93,7 @@ activateModulesRequiredByCountry($mysoc->country_code); } - $tmparray = getState(GETPOSTINT('state_id'), 'all', $db, $langs, 0); + $tmparray = getState(GETPOSTINT('state_id'), 'all', $db, 0, $langs, 0); if (!empty($tmparray['id'])) { $mysoc->state_id = $tmparray['id']; $mysoc->state_code = $tmparray['code']; diff --git a/htdocs/ai/ajax/generate_content.php b/htdocs/ai/ajax/generate_content.php index 6a9b14a4e1d9b..4ee6a4c170cff 100644 --- a/htdocs/ai/ajax/generate_content.php +++ b/htdocs/ai/ajax/generate_content.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2023 Eric Seigne + * Copyright (C) 2024 Frédéric France * * 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 @@ -57,7 +58,7 @@ $jsonData = json_decode($rawData, true); if (is_null($jsonData)) { - dol_print_error('data with format JSON valide.'); + dol_print_error($db, 'data with format JSON valide.'); } $ai = new Ai($db); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4952b0dfd50a9..00e1c2a033622 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1136,7 +1136,7 @@ public function create($user, $notrigger = 0) $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } } else { - dol_print_error($resqlcontact); + dol_print_error($this->db, $resqlcontact); } } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 4dab4a912a048..8267e6db7021f 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -6,6 +6,7 @@ * Copyright (C) 2017 Patrick Delcroix * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2022 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * 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 @@ -312,7 +313,7 @@ // If not cash account and can be reconciliate if ($user->hasRight('banque', 'consolidate')) { - $buttonreconcile = ''.$titletoconciliatemanual.''; + $buttonreconcile = ''.$titletoconciliatemanual.''; } else { $buttonreconcile = ''.$titletoconciliatemanual.''; } @@ -323,7 +324,7 @@ if ($user->hasRight('banque', 'consolidate')) { $newparam = $param; $newparam = preg_replace('/search_conciliated=\d+/i', '', $newparam); - $buttonreconcile .= ' '.$titletoconciliateauto.''; + $buttonreconcile .= ' '.$titletoconciliateauto.''; } else { $buttonreconcile .= ' '.$titletoconciliateauto.''; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2dfdd3b376522..79dc23859830d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -776,7 +776,7 @@ public function create(User $user, $notrigger = 0, $forceduedate = 0) $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } } else { - dol_print_error($resqlcontact); + dol_print_error($this->db, $resqlcontact); } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ffa89264f8725..985587f09dfd3 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1135,7 +1135,7 @@ public function create($user) $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } } else { - dol_print_error($resqlcontact); + dol_print_error($this->db, $resqlcontact); } } } @@ -1731,7 +1731,7 @@ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_star $localtaxes_type = getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc); $tvatx = preg_replace('/\s*\(.*\)/', '', $tvatx); // Remove code into vatrate. - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type); + $tabprice = calcul_price_total($qty, $pu, $remise_percent, (float) price2num($tvatx), $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 3db1703c03429..6186e1552ff7b 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -309,7 +309,7 @@ public function get_substitutionarray_mysoc($mysoc, $outputlangs) $mysoc->country = $outputlangs->transnoentitiesnoconv("Country".$mysoc->country_code); } if (empty($mysoc->state) && !empty($mysoc->state_code)) { - $mysoc->state = getState($mysoc->state_code, 0); + $mysoc->state = getState($mysoc->state_code, '0'); } $logotouse = $conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; @@ -365,7 +365,7 @@ public function get_substitutionarray_thirdparty($object, $outputlangs, $array_k $object->country = $outputlangs->transnoentitiesnoconv("Country".$object->country_code); } if (empty($object->state) && !empty($object->state_code)) { - $object->state = getState($object->state_code, 0); + $object->state = getState($object->state_code, '0'); } $array_thirdparty = array( @@ -431,7 +431,7 @@ public function get_substitutionarray_contact($object, $outputlangs, $array_key $object->country = $outputlangs->transnoentitiesnoconv("Country".$object->country_code); } if (empty($object->state) && !empty($object->state_code)) { - $object->state = getState($object->state_code, 0); + $object->state = getState($object->state_code, '0'); } $array_contact = array( diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index b6d0f99afb562..05909cfa6102b 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -877,7 +877,7 @@ public function selectInvoiceAndLine($selectedInvoiceId = 0, $selectedLineId = 0 } $out .= ''; } else { - dol_print_error($this->db->lasterror); + dol_print_error($this->db, $this->db->lasterror); return ''; } } @@ -929,7 +929,7 @@ public function selectInvoiceAndLine($selectedInvoiceId = 0, $selectedLineId = 0 $out .= ''; } } else { - dol_print_error($this->db->lasterror); + dol_print_error($this->db, $this->db->lasterror); return ''; } diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index c4f78b7f91fc2..5a31f520a1779 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -290,9 +291,9 @@ public function parser($urlRSS, $maxNb = 0, $cachedelay = 60, $cachedir = '') xml_set_object($xmlparser, $this); // @phan-suppress-next-line PhanUndeclaredFunctionInCallable - xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); + xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); // @phpstan-ignore-line // @phan-suppress-next-line PhanUndeclaredFunctionInCallable - xml_set_character_data_handler($xmlparser, 'feed_cdata'); + xml_set_character_data_handler($xmlparser, 'feed_cdata'); // @phpstan-ignore-line $status = xml_parse($xmlparser, $str, false); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 39fa548bce689..55c25b17f5c4f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2659,7 +2659,7 @@ function dol_get_fiche_end($notab = 0) * @param CommonObject $object Object to show * @param string $paramid Name of parameter to use to name the id into the URL next/previous link * @param string $morehtml More html content to output just before the nav bar - * @param int $shownav Show Condition (navigation is shown if value is 1) + * @param int|bool $shownav Show Condition (navigation is shown if value is 1 or true) * @param string $fieldid Name of the field in DB to use to select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search. * @param string $fieldref Name of the field (object->ref) to use to select next et previous * @param string $morehtmlref More html to show after the ref (see $morehtmlleft for before) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index d6e86ee59854c..141961e0da7a7 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -1,11 +1,12 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2017 Charlie Benke - * Copyright (C) 2017 ATM-CONSULTING - * Copyright (C) 2024 MDW +/* Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2017 Charlie Benke + * Copyright (C) 2017 ATM-CONSULTING + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -246,7 +247,7 @@ function invoice_admin_prepare_head() /** * Return array head with list of tabs to view object information. * - * @param Facture $object Invoice object + * @param FactureRec $object Invoice model object * @return array head array with tabs */ function invoice_rec_prepare_head($object) diff --git a/htdocs/core/lib/phpsessionindb.lib.php b/htdocs/core/lib/phpsessionindb.lib.php index f856ac71c90b7..65db9c661e27a 100644 --- a/htdocs/core/lib/phpsessionindb.lib.php +++ b/htdocs/core/lib/phpsessionindb.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -244,4 +245,4 @@ function dolSessionGC($max_lifetime) } // Call to register user call back functions. -session_set_save_handler("dolSessionOpen", "dolSessionClose", "dolSessionRead", "dolSessionWrite", "dolSessionDestroy", "dolSessionGC"); +session_set_save_handler("dolSessionOpen", "dolSessionClose", "dolSessionRead", "dolSessionWrite", "dolSessionDestroy", "dolSessionGC"); // @phpstan-ignore-line diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index aefd2718508eb..0c9bf197866b9 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -99,19 +99,22 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, null); - $mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type; + require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $order = new Commande($db); + $order->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $order); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index b6669961cd051..c1b46e768fa66 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -104,16 +104,22 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; + require_once DOL_DOCUMENT_ROOT . '/delivery/class/delivery.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $delivery = new Delivery($db); + $delivery->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $delivery); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index c8781cdd2cca7..50d33d378d306 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -404,6 +404,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails } // Make substitutions into odt of thirdparty if ($socobject->element == 'contact') { + /** @var Contact $socobject */ $tmparray = $this->get_substitutionarray_contact($socobject, $outputlangs); } else { $tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs); diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 4d85f30316973..44111872971c8 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -97,19 +97,22 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type; + require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $shipment = new Expedition($db); + $shipment->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $shipment); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index 63938b77da209..daecb8cf37fd7 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -170,7 +170,7 @@ public function getNextValue($object) $sqlbis = 'UPDATE '.MAIN_DB_PREFIX.'expensereport SET ref_number_int = '.((int) $ref_number_int).' WHERE rowid = '.((int) $object->id); $resqlbis = $db->query($sqlbis); if (!$resqlbis) { - dol_print_error($resqlbis); + dol_print_error($db, $resqlbis); exit; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a9a1cdf9ac808..38c26923098d8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -11,7 +11,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Anthony Berton * Copyright (C) 2022 Charlene Benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -211,7 +211,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && (getDolGlobalString('FACTURE_DRAFT_WATERMARK'))) { + if ($object->status == $object::STATUS_DRAFT && (getDolGlobalString('FACTURE_DRAFT_WATERMARK'))) { $this->watermark = getDolGlobalString('FACTURE_DRAFT_WATERMARK'); } @@ -1254,13 +1254,13 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlan $useonlinepayment = count($validpaymentmethod); } - if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { + if ($object->status != Facture::STATUS_DRAFT && $useonlinepayment) { require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; global $langs; $langs->loadLangs(array('payment', 'paybox', 'stripe')); $servicename = $langs->transnoentities('Online'); - $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', ''); + $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, 0, '', ''); $linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' '.$outputlangs->transnoentities("ClickHere").''; $pdf->SetXY($this->marge_gauche, $posy); @@ -1902,7 +1902,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output } } $title .= ' '.$outputlangs->convToOutputCharset($object->ref); - if ($object->statut == $object::STATUS_DRAFT) { + if ($object->status == $object::STATUS_DRAFT) { $pdf->SetTextColor(128, 0, 0); $title .= ' - '.$outputlangs->transnoentities("NotValidated"); } @@ -1916,7 +1916,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $textref = $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref); - if ($object->statut == $object::STATUS_DRAFT) { + if ($object->status == $object::STATUS_DRAFT) { $pdf->SetTextColor(128, 0, 0); $textref .= ' - '.$outputlangs->transnoentities("NotValidated"); } diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 4b4ce44606055..3f20ead4a8270 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1455,13 +1455,13 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan } - if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) { + if ($object->status != Facture::STATUS_DRAFT && $useonlinepayment) { require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; global $langs; $langs->loadLangs(array('payment', 'paybox', 'stripe')); $servicename = $langs->transnoentities('Online'); - $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', ''); + $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, 0, '', ''); $linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' '.$outputlangs->transnoentities("ClickHere").''; $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0cfa725a1ef69..45ac0a25dc3cf 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1362,7 +1362,7 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan $langs->loadLangs(array('payment', 'paybox', 'stripe')); $servicename = $langs->transnoentities('Online'); - $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', ''); + $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, 0, '', ''); $linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' '.$outputlangs->transnoentities("ClickHere").''; $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 3fe523af54811..9ea2ff996331f 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2015 Bahfir Abbes * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -99,7 +100,7 @@ public function __construct($db) $this->const[] = array('MAIN_AGENDA_ACTIONAUTO_'.$obj->code, "chaine", "1", '', 0, 'current'); } } else { - dol_print_error($this->db->lasterror()); + dol_print_error($this->db, $this->db->lasterror()); } // New pages on tabs diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index fe2948e1ea5ee..f9df0cf2ae7d0 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -66,12 +66,12 @@ public function info($langs) $form = new Form($db); - $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; - $texte .= ''; - $texte .= ''; - $texte .= ''; - $texte .= ''; - $texte .= ''; + $text = $langs->trans('GenericNumRefModelDesc')."
\n"; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Mo"), $langs->transnoentities("Mo")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -80,17 +80,17 @@ public function info($langs) $tooltip .= $langs->trans("GenericMaskCodes5"); // Parametrage du prefix - $texte .= ''; - $texte .= ''; + $text .= ''; + $text .= ''; - $texte .= ''; + $text .= ''; - $texte .= ''; + $text .= ''; - $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
'; - $texte .= ''; + $text .= ''; + $text .= ''; - return $texte; + return $text; } /** @@ -100,19 +100,23 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type; + require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; + require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + + $mo = new Mo($db); + $mo->initAsSpecimen(); + $product = new Product($db); + $product->initAsSpecimen(); + + + $numExample = $this->getNextValue($product, $mo); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } @@ -125,7 +129,7 @@ public function getExample() */ public function getNextValue($objprod, $object) { - global $db, $conf; + global $db; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 6ed05b3e72899..84c2b39658ae6 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -109,16 +109,22 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $project = new Project($db); + $project->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $project); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } @@ -131,7 +137,7 @@ public function getExample() */ public function getNextValue($objsoc, $project) { - global $db, $conf; + global $db, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -139,7 +145,7 @@ public function getNextValue($objsoc, $project) $mask = getDolGlobalString('PROJECT_UNIVERSAL_MASK'); if (!$mask) { - $this->error = 'NotConfigured'; + $this->error = $langs->trans('NotConfigured'); return 0; } diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 91772195411ab..9f7f83883a0c6 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2024 Frédéric France * * 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 @@ -106,19 +107,21 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type; + require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $propal = new Propal($db); + $propal->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + $numExample = $this->getNextValue($thirdparty, $propal); if (!$numExample) { - $numExample = 'NotConfigured'; + $numExample = $langs->trans('NotConfigured'); } + return $numExample; } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 3addf2c8c22d1..d6247a50d4362 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -5,9 +5,9 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2023 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2023 William Mead + * Copyright (C) 2024 MDW * * 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 @@ -911,7 +911,7 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) * Show total to pay * * @param TCPDF $pdf Object PDF - * @param Facture $object Object invoice + * @param CommandeFournisseur $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart * @param Translate $outputlangs Object langs @@ -1465,7 +1465,7 @@ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) /** * Define Array Column Field * - * @param object $object common object + * @param CommandeFournisseur $object common object * @param Translate $outputlangs langs * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index a53040525481b..6679263afb70d 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -107,12 +107,17 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; + + require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; + $supplierorder = new CommandeFournisseur($db); + $supplierorder->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); + + $numExample = $this->getNextValue($thirdparty, $supplierorder); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); @@ -129,7 +134,7 @@ public function getExample() */ public function getNextValue($objsoc, $object) { - global $db, $conf; + global $db, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -137,7 +142,7 @@ public function getNextValue($objsoc, $object) $mask = getDolGlobalString("COMMANDE_FOURNISSEUR_ORCHIDEE_MASK"); if (!$mask) { - $this->error = 'NotConfigured'; + $this->error = $langs->trans('NotConfigured'); return 0; } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index f78640fb41ffc..13a6948fb1a6b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -907,8 +907,8 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) /** * Show total to pay * - * @param TCPDF $pdf Object PDF - * @param Facture $object Object invoice + * @param TCPDF $pdf Object PDF + * @param SupplierProposal $object Object supplier proposal * @param int $deja_regle Montant deja regle * @param int $posy Position depart * @param Translate $outputlangs Object langs @@ -1167,7 +1167,7 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object to show + * @param SupplierProposal $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return float|int Return topshift value @@ -1435,7 +1435,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param CommandeFournisseur $object Object to show + * @param SupplierProposal $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text @@ -1451,7 +1451,7 @@ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) /** * Define Array Column Field * - * @param Object $object common object + * @param SupplierProposal $object common object * @param Translate $outputlangs langs * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 59f3753785197..3b79a6d0f193e 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -67,12 +68,12 @@ public function info($langs) $form = new Form($db); - $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; - $texte .= '
'; - $texte .= ''; - $texte .= ''; - $texte .= ''; - $texte .= ''; + $text = $langs->trans('GenericNumRefModelDesc')."
\n"; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Ticket"), $langs->transnoentities("Ticket")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -81,17 +82,17 @@ public function info($langs) $tooltip .= $langs->trans("GenericMaskCodes5"); // Prefix settings - $texte .= ''; - $texte .= ''; + $text .= ''; + $text .= ''; - $texte .= ''; + $text .= ''; - $texte .= ''; + $text .= ''; - $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
'; - $texte .= '
'; + $text .= ''; + $text .= ''; - return $texte; + return $text; } /** @@ -101,16 +102,22 @@ public function info($langs) */ public function getExample() { - global $conf, $langs, $mysoc; + global $db, $langs; + + require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; + + $ticket = new Ticket($db); + $ticket->initAsSpecimen(); + $thirdparty = new Societe($db); + $thirdparty->initAsSpecimen(); - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client = $old_code_client; + $numExample = $this->getNextValue($thirdparty, $ticket); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } + return $numExample; } @@ -123,7 +130,7 @@ public function getExample() */ public function getNextValue($objsoc, $ticket) { - global $db, $conf; + global $db, $langs; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -131,7 +138,7 @@ public function getNextValue($objsoc, $ticket) $mask = getDolGlobalString("TICKET_UNIVERSAL_MASK"); if (!$mask) { - $this->error = 'NotConfigured'; + $this->error = $langs->trans('NotConfigured'); return 0; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index f6a327d5a035d..57b80393617f4 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1972,7 +1972,7 @@ public function addline($qty = 0, $up = 0, $fk_c_type_fees = 0, $vatrate = 0, $d } $vatrate = preg_replace('/\*/', '', $vatrate); - $tmp = calcul_price_total($qty, $up, 0, $vatrate, -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type); + $tmp = calcul_price_total($qty, $up, 0, (float) price2num($vatrate), -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type); $this->line->value_unit = $up; @@ -2238,10 +2238,9 @@ public function updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comment } $vatrate = preg_replace('/\*/', '', $vatrate); - $tmp = calcul_price_total($qty, $value_unit, 0, $vatrate, -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type); - //var_dump($vatrate);var_dump($localtaxes_type);var_dump($tmp);exit; + $tmp = calcul_price_total($qty, $value_unit, 0, (float) price2num($vatrate), -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type); // calcul total of line - //$total_ttc = price2num($qty*$value_unit, 'MT'); + // $total_ttc = price2num($qty*$value_unit, 'MT'); $tx_tva = 1 + (float) $vatrate / 100; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 267fdc49bfcb1..c734af74e7cd8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -16,7 +16,7 @@ * Copyright (C) 2016-2022 Charlene Benke * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2019-2022 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * Copyright (C) 2022 Vincent de Grandpré @@ -2844,7 +2844,7 @@ // Origin country code print ''.$langs->trans("Origin").''.getCountry($object->country_id, 0, $db); if (!empty($object->state_id)) { - print ' - '.getState($object->state_id, 0, $db); + print ' - '.getState($object->state_id, '0', $db); } print ''; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6132e5460d7e9..af2c3dbc047b1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -16,6 +16,7 @@ * Copyright (C) 2020-2023 Alexandre Spangaro * Copyright (C) 2024 MDW * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Frédéric France * * 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 @@ -2155,7 +2156,7 @@ if (!empty($arrayfields['p.fk_state']['checked'])) { print ''; if (!empty($obj->fk_state)) { - print getState($obj->fk_state, 0, $db); + print getState($obj->fk_state, '0', $db); } print ''; if (!$i) { diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 3a1106b0e9ca0..9432db225f9fc 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Florian Henry + * Copyright (C) 2024 Frédéric France * * 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 @@ -219,8 +220,8 @@ print $langs->trans('Month').': '; print $langs->trans('Year').':'.$formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); print '
'; - print ''; - print ''; + print ''; + print ''; print '
'; print '
'; print ''; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index a94c09cf1192c..99a9927990afc 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -4,7 +4,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021 Waël Almoman * Copyright (C) 2022 Udo Tamm @@ -453,7 +453,7 @@ function llxFooterVierge() // It is not so important because a test is done on return of payment validation. } - $urlback = getOnlinePaymentUrl(0, 'member', $adh->ref, price2num(GETPOST('amount', 'alpha'), 'MT'), '', 0); + $urlback = getOnlinePaymentUrl(0, 'member', $adh->ref, (float) price2num(GETPOST('amount', 'alpha'), 'MT'), '', 0); if (GETPOST('email')) { $urlback .= '&email='.urlencode(GETPOST('email')); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 14893c241351e..5896b5be52746 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -20,7 +20,7 @@ * Copyright (C) 2022 ButterflyOfFire * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -4390,8 +4390,8 @@ public function setMysoc(Conf $conf) } else { // For backward compatibility dol_syslog("Your setup of State has an old syntax (entity=".$conf->entity."). Go in Home - Setup - Organization then Save should remove this error.", LOG_ERR); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - $state_code = getState($state_id, 2, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore - $state_label = getState($state_id, 0, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore + $state_code = getState($state_id, '2', $this->db); // This need a SQL request, but it's the old feature that should not be used anymore + $state_label = getState($state_id, '0', $this->db); // This need a SQL request, but it's the old feature that should not be used anymore } } $this->state_id = $state_id; @@ -4502,6 +4502,7 @@ public function initAsSpecimen() $this->code_client = 'CC-'.dol_print_date($now, 'dayhourlog'); $this->code_fournisseur = 'SC-'.dol_print_date($now, 'dayhourlog'); + $this->typent_code = 'TE_OTHER'; $this->capital = 10000; $this->client = 1; $this->prospect = 1; diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 82bb50d851919..434248a4277e2 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -198,7 +198,7 @@ $linkback = ''.$langs->trans("BackToList").''; -dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); +dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1); print dol_get_fiche_end(); diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index ce79aa23b7a5e..138f1ceb63383 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -3,7 +3,7 @@ * Copyright (C) 2017 Olivier Geffroy * Copyright (C) 2017 Saasprov * Copyright (C) 2018-2022 Thibault FOUCART - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -94,15 +94,15 @@ if (!($result > 0)) { $error++; } - $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS", GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS", (string) GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'chaine', 0, '', $conf->entity); if (!($result > 0)) { $error++; } - $result = dolibarr_set_const($db, "STRIPE_USER_ACCOUNT_FOR_ACTIONS", GETPOSTINT('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "STRIPE_USER_ACCOUNT_FOR_ACTIONS", (string) GETPOSTINT('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'chaine', 0, '', $conf->entity); if (!($result > 0)) { $error++; } - $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", (string) GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'), 'chaine', 0, '', $conf->entity); if (!($result > 0)) { $error++; } @@ -160,7 +160,7 @@ if ($action == "setlive") { $liveenable = GETPOSTINT('value'); - $res = dolibarr_set_const($db, "STRIPE_LIVE", $liveenable, 'yesno', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "STRIPE_LIVE", (string) $liveenable, 'yesno', 0, '', $conf->entity); if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -239,7 +239,7 @@ //global $dolibarr_main_instance_unique_id; //$url .= '&securitykey='.dol_hash('stripeipn-'.$dolibarr_main_instance_unique_id.'-'.$conf->global->STRIPE_TEST_PUBLISHABLE_KEY, 'md5'); $out .= ''; - $out .= ajax_autoselect("onlinetestwebhookurl", 0); + $out .= ajax_autoselect("onlinetestwebhookurl"); print '
'.$out; print ''; if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index f9410e9a237ad..4ab28ee409b64 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -249,7 +249,7 @@ $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= $langs->trans("Year").' '; -$stringtoshow .= ''; +$stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 98b3a24b2faba..311a49fd35259 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3830,7 +3830,7 @@ public function get_full_tree($deleteafterid = 0, $filter = '') } dol_syslog(get_class($this)."::get_full_tree dol_sort_array", LOG_DEBUG); - $this->users = dol_sort_array($this->users, 'fullname', 'asc', true, false, 1); + $this->users = dol_sort_array($this->users, 'fullname', 'asc', 1, 0, 1); //var_dump($this->users); diff --git a/htdocs/variants/lib/variants.lib.php b/htdocs/variants/lib/variants.lib.php index 609ea6cb1a1be..03356c6cbc4df 100644 --- a/htdocs/variants/lib/variants.lib.php +++ b/htdocs/variants/lib/variants.lib.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2022 Open-Dsi + * Copyright (C) 2024 Frédéric France * * 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 @@ -25,8 +26,8 @@ /** * Prepare array with list of tabs * - * @param Product $object Object related to tabs - * @return array Array of tabs to show + * @param ProductAttribute $object Object related to tabs + * @return array Array of tabs to show */ function productAttributePrepareHead($object) { diff --git a/htdocs/webportal/class/context.class.php b/htdocs/webportal/class/context.class.php index 9272071f22882..b76ff6017ca3f 100644 --- a/htdocs/webportal/class/context.class.php +++ b/htdocs/webportal/class/context.class.php @@ -546,7 +546,7 @@ public function setEventMessages($mesg, $mesgs, $style = 'mesgs') dol_syslog(__METHOD__ . ' Try to add a message in stack, but value to add is empty message', LOG_WARNING); } else { if (!in_array((string) $style, array('mesgs', 'warnings', 'errors'))) { - dol_print_error('', 'Bad parameter style=' . $style . ' for setEventMessages'); + dol_print_error(null, 'Bad parameter style=' . $style . ' for setEventMessages'); } if (empty($mesgs)) { $this->setEventMessage($mesg, $style); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4c660fa7741ec..3e2c708b9783e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -29,7 +29,7 @@ parameters: checkAlwaysTrueInstanceof: false checkAlwaysTrueStrictComparison: false checkClassCaseSensitivity: true - checkFunctionArgumentTypes: false + checkFunctionArgumentTypes: true checkFunctionNameCase: true checkArgumentsPassedByReference: false checkMaybeUndefinedVariables: false @@ -60,6 +60,64 @@ parameters: - '#Constructor of class .* has an unused parameter #' - '#Dead catch - Exception is never thrown in the try block#' - '#.*phan-var#' + - '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#' + - '#expects \(callable#' + - '#expects bool#' + - '#expects bool, int given.#' + - '#expects bool, string given.#' + - '#expects int#' + - '#expects int<-2, 2>, bool given.#' + - '#expects int<0, 1>, false given.#' + - '#expects int, string given.#' + - '#expects int, float given.#' + - '#expects int, bool given.#' + - '#expects int, false given.#' + - '#expects int, true given.#' + - '#expects int, array\|string given.#' + - '#expects int<0, 1>, '''' given.#' + - '#expects float\|string#' + - '#expects float\|null#' + - '#expects float, string given.#' + - '#expects string#' + - '#expects string, int given.#' + - '#expects string, \(float\|int\) given.#' + - '#expects string, array given.#' + - '#expects string, float given.#' + - '#expects string, true given.#' + - '#expects string, null given.#' + - '#expects string, int<0, 10> given.#' + - '#expects string, DateTime given.#' + - '#expects array#' + - '#expects array, string given.#' + - '#expects array, null given.#' + - '#expects array, null given.#' + - '#expects array, string given.#' + - '#expects resource#' + - '#expects resource, object given.#' + - '#expects object#' + - '#expects Adherent#' + - '#expects BOM#' + - '#expects Contrat#' + - '#expects FTP\\Connection#' + - '#expects Holiday#' + - '#expects LDAP\\Connection#' + - '#expects MultiCurrency#' + - '#expects Productlot#' + - '#expects Facture#' + - '#expects FactureFournisseur#' + - '#expects Paiement#' + - '#expects PgSql\\Result#' + - '#expects RecruitmentJobPosition#' + - '#expects RemiseCheque#' + - '#expects Societe#' + - '#expects SupplierProposal#' + - '#expects Translate#' + - '#expects User#' + - '#expects CommonObjectLine#' + - '#dol_eval expects#' + - '#check_authentication expects#' + - '#colorHexToHsl expects#' + - '#dolGetButtonTitle expects#' internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512 diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index a1b859d644f52..f1f5ae6793a50 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -1,9 +1,10 @@ #!/usr/bin/env php - * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * 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 @@ -79,18 +80,19 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; } +/** @var DoliDB $db */ + $sql = "SELECT DISTINCT c.ref, c.fk_soc, cd.date_fin_validite, cd.total_ttc, cd.description as description, p.label as plabel, s.rowid, s.nom as name, s.email, s.default_lang,"; $sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.lang"; $sql .= " FROM ".MAIN_DB_PREFIX."societe AS s, ".MAIN_DB_PREFIX."contrat AS c, ".MAIN_DB_PREFIX."contratdet AS cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product AS p ON p.rowid = cd.fk_product, ".MAIN_DB_PREFIX."societe_commerciaux AS sc, ".MAIN_DB_PREFIX."user AS u"; $sql .= " WHERE s.rowid = c.fk_soc AND c.rowid = cd.fk_contrat AND c.statut > 0 AND cd.statut<5"; if (is_numeric($duration_value)) { - $sql .= " AND cd.date_fin_validite < '".$db->idate(dol_time_plus_duree($now, $duration_value, "d"))."'"; + $sql .= " AND cd.date_fin_validite < '".$db->idate(dol_time_plus_duree($now, (int) $duration_value, "d"))."'"; } $sql .= " AND sc.fk_soc = s.rowid AND sc.fk_user = u.rowid"; $sql .= " ORDER BY u.email ASC, s.rowid ASC, c.ref ASC"; // Order by email to allow one message per email -// print $sql; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -112,7 +114,7 @@ if (($obj->email != $oldemail || $obj->uid != $olduid) || $oldemail == 'none') { // Break onto sales representative (new email or uid) if (dol_strlen($oldemail) && $oldemail != 'none') { - sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative, $duration_value); + sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative, (int) $duration_value); } else { if ($oldemail != 'none') { print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n"; @@ -160,7 +162,7 @@ // Si il reste des envois en buffer if ($foundtoprocess) { if (dol_strlen($oldemail) && $oldemail != 'none') { // Break onto email (new email) - sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative, $duration_value); + sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative, (int) $duration_value); } else { if ($oldemail != 'none') { print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n"; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 187db69db7cec..dccc05e33c401 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2024 Frédéric France * * 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 @@ -106,7 +107,7 @@ if (!empty($login)) { $user->fetch('', $login); } - +/** @var DoliDB $db */ // We get list of emailing id to process $sql = "SELECT m.rowid, m.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index ea892b8d804e4..c45f686116bf6 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -1,9 +1,10 @@ #!/usr/bin/env php - * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * 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 @@ -88,6 +89,8 @@ exit(1); } +/** @var DoliDB $db */ + $sql = "SELECT f.ref, f.total_ttc, f.date_lim_reglement as due_date,"; $sql .= " s.rowid as sid, s.nom as name, s.email, s.default_lang"; if ($targettype == 'contacts') { @@ -100,10 +103,10 @@ $sql .= " WHERE f.fk_statut = 1 AND f.paye = 0"; $sql .= " AND f.fk_soc = s.rowid"; if (is_numeric($duration_value2)) { - $sql .= " AND f.date_lim_reglement >= '".$db->idate(dol_time_plus_duree($now, $duration_value2, "d"))."'"; + $sql .= " AND f.date_lim_reglement >= '".$db->idate(dol_time_plus_duree($now, (int) $duration_value2, "d"))."'"; } if (is_numeric($duration_value)) { - $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_time_plus_duree($now, $duration_value, "d"))."'"; + $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_time_plus_duree($now, (int) $duration_value, "d"))."'"; } if ($targettype == 'contacts') { $sql .= " AND s.rowid = sp.fk_soc"; @@ -155,7 +158,7 @@ if ($startbreak) { // Break onto sales representative (new email or cid) if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { - envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget); + envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget); $trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid; } else { if ($oldemail != 'none') { @@ -209,7 +212,7 @@ // Si il reste des envois en buffer if ($foundtoprocess) { if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { // Break onto email (new email) - envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget); + envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget); $trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid; } else { if ($oldemail != 'none') { From 768050455addcc65202f3e63b25918fa93025ab1 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Wed, 3 Jul 2024 02:50:04 +0200 Subject: [PATCH 91/98] NEW / FIX Display invoice widgets by amount instead of number (#30215) * Update invoice.lib.php * Update invoice.lib.php --- htdocs/core/lib/invoice.lib.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 141961e0da7a7..8c0ccde4b6a6a 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -364,13 +364,15 @@ function getNumberInvoicesPieChart($mode) date_add($datenowadd30, $interval30days); date_add($datenowadd15, $interval15days); - $sql = "SELECT"; - $sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", 1, 0).") as nblate30"; - $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."'", 1, 0).") as nblate15"; - $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."'", 1, 0).") as nblatenow"; - $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."' OR f.date_lim_reglement IS NULL", 1, 0).") as nbnotlatenow"; - $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd15, 'Y-m-d')."'", 1, 0).") as nbnotlate15"; - $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30"; + $amount_mode = (getDolGlobalInt('FACTURE_VALIDATED_IN_AMOUNT') == 1); + + $sql = "SELECT"; + $sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late30"; + $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as late15"; + $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."' AND f.date_lim_reglement >= '".date_format($datenowsub15, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as latenow"; + $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."' AND f.date_lim_reglement < '".date_format($datenowadd15, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as notlatenow"; + $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($datenowadd15, 'Y-m-d')."' AND f.date_lim_reglement < '".date_format($datenowadd30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as notlate15"; + $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($datenowadd30, 'Y-m-d')."'", $amount_mode ? "f.total_ht" : 1, 0).") as notlate30"; if ($mode == 'customers') { $element = 'invoice'; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; @@ -404,7 +406,7 @@ function getNumberInvoicesPieChart($mode) ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30)); */ - $dataseries[$i] = array($langs->transnoentitiesnoconv('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); + $dataseries[$i] = array($langs->transnoentitiesnoconv('NbOfOpenInvoices'), $obj->late30, $obj->late15, $obj->latenow, $obj->notlatenow, $obj->notlate15, $obj->notlate30); $i++; } if (!empty($dataseries[0])) { From be87065259a5207e1eef5a974ba74d03e34abac1 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Wed, 3 Jul 2024 02:59:41 +0200 Subject: [PATCH 92/98] Fix filter bug, overdue invoices from home page (#30214) Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 87826db56ccd8..22ccb88cdfd57 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -147,8 +147,8 @@ $search_product_category = GETPOST('search_product_category', 'intcomma'); $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha'); -$search_late = GETPOST('search_late'); -if ($search_late == 'late') { +$search_option = GETPOST('search_option'); +if ($search_option == 'late') { $search_status = '1'; } @@ -398,7 +398,7 @@ $toselect = array(); $search_array_options = array(); $search_categ_cus = 0; - $search_late = ''; + $search_option = ''; $socid = 0; } @@ -859,7 +859,7 @@ if ($search_datelimit_end) { $sql .= " AND f.date_lim_reglement <= '".$db->idate($search_datelimit_end)."'"; } -if ($search_late == 'late') { +if ($search_option == 'late') { $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; } /*if ($search_sale > 0) { @@ -1181,8 +1181,8 @@ if ($show_files) { $param .= '&show_files='.urlencode((string) ($show_files)); } -if ($search_late) { - $param .= "&search_late=".urlencode($search_late); +if ($search_option) { + $param .= "&search_option=".urlencode($search_option); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -1322,7 +1322,7 @@ } // alert on due date $moreforfilter .= '
'; -$moreforfilter .= ''; +$moreforfilter .= ''; $moreforfilter .= '
'; $parameters = array(); From 3ddd6cceba09907aa69ed6b44a538c6ca7dde397 Mon Sep 17 00:00:00 2001 From: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Date: Wed, 3 Jul 2024 03:22:42 +0200 Subject: [PATCH 93/98] New box comm card (#30220) * hook retour completeListOfReferent * box comm card.php * commit --- htdocs/comm/card.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 162425c8037bf..fc5a015e8201a 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1210,7 +1210,9 @@ // print $formfile->getDocumentsLink($contrat->element, $filename, $filedir); print $late; print "\n"; - print ''.dol_trunc($objp->refsup, 12)."\n"; + print ''; + print dol_trunc(strtolower(get_class($object)) == strtolower(Client::class) ? $objp->refcus : $objp->refsup, 12); + print "\n"; //print ''.dol_print_date($db->jdate($objp->dc), 'day')."\n"; print ''.dol_print_date($db->jdate($objp->dcon), 'day')."\n"; print ' '; @@ -1422,7 +1424,7 @@ * Latest invoices */ if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { - $sql = 'SELECT f.rowid as facid, f.ref, f.type'; + $sql = 'SELECT f.rowid as facid, f.ref, f.type, f.ref_client'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; $sql .= ', f.total_ttc'; @@ -1452,6 +1454,9 @@ if (getDolGlobalString('MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES')) { $colspan++; } + if (getDolGlobalString('MAIN_SHOW_REF_CUSTOMER_INVOICES')) { + $colspan++; + } print ''; print ''; print ''; @@ -1466,6 +1471,7 @@ $facturestatic->id = $objp->facid; $facturestatic->ref = $objp->ref; + $facturestatic->ref_client = $objp->ref_client; $facturestatic->type = $objp->type; $facturestatic->total_ht = $objp->total_ht; $facturestatic->total_tva = $objp->total_tva; @@ -1511,6 +1517,11 @@ // $urlsource = '/compta/facture/card.php?id='.$objp->cid; //print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; + if (getDolGlobalString('MAIN_SHOW_REF_CUSTOMER_INVOICES')) { + print ''; + } if ($objp->df > 0) { print ''; } else { @@ -1521,6 +1532,7 @@ } else { print ''; } + print ''; From b0cd32bf68451064c3d17cec05e7fd49aa2c5517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Tue, 2 Jul 2024 21:29:05 -0400 Subject: [PATCH 94/98] NEW Implementing Billable tasks on projects using new attribute "billable" (#30092) * Implementing Billable task function on projects using new attribute in #30014 * added billable to Task->initAsSpecimen() * default billable to 1 in initAsSpecimen * set billable to 1 in ProjectTest::testTaskCreate * Moving attribut usage in usage_bill_time condition of project * PPDoc * fusion * pre-commit + typo --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/project.lib.php | 15 +++++++++++++- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/langs/de_DE/projects.lang | 1 + htdocs/langs/en_US/projects.lang | 1 + htdocs/langs/es_ES/projects.lang | 1 + htdocs/langs/fr_FR/projects.lang | 1 + htdocs/langs/it_IT/projects.lang | 1 + htdocs/projet/class/task.class.php | 25 +++++++++++++++++++----- htdocs/projet/tasks.php | 26 +++++++++++++++++++++++++ htdocs/projet/tasks/task.php | 14 ++++++++++++- htdocs/projet/tasks/time.php | 26 +++++++++++++++++++++---- test/phpunit/ProjectTest.php | 1 + 12 files changed, 102 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 4776907192f0c..2999eb74ac2e3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -5,7 +5,8 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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 @@ -691,6 +692,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $taskstatic->planned_workload = $lines[$i]->planned_workload; $taskstatic->duration_effective = $lines[$i]->duration_effective; $taskstatic->budget_amount = $lines[$i]->budget_amount; + $taskstatic->billable = $lines[$i]->billable; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { @@ -932,6 +934,17 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; } + // Billable + if (count($arrayfields) > 0 && !empty($arrayfields['t.billable']['checked'])) { + print ''; + } + // Extra fields $extrafieldsobjectkey = $taskstatic->table_element; $extrafieldsobjectprefix = 'efpt.'; diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index d58edcf7de269..a34ea519d2ab0 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -266,7 +266,7 @@ public function __construct($db) $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // Add fields for tasks - $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('pt.rowid'=>'TaskId', 'pt.ref'=>'RefTask', 'pt.label'=>'LabelTask', 'pt.dateo'=>"TaskDateStart", 'pt.datee'=>"TaskDateEnd", 'pt.duration_effective'=>"DurationEffective", 'pt.planned_workload'=>"PlannedWorkload", 'pt.progress'=>"Progress", 'pt.description'=>"TaskDescription")); + $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('pt.rowid'=>'TaskId', 'pt.ref'=>'RefTask', 'pt.label'=>'LabelTask', 'pt.dateo'=>"TaskDateStart", 'pt.datee'=>"TaskDateEnd", 'pt.duration_effective'=>"DurationEffective", 'pt.planned_workload'=>"PlannedWorkload", 'pt.progress'=>"Progress", 'pt.description'=>"TaskDescription", 'pt.billable'=>"Billable")); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('pt.rowid'=>'projecttask', 'pt.ref'=>'projecttask', 'pt.label'=>'projecttask', 'pt.dateo'=>"projecttask", 'pt.datee'=>"projecttask", 'pt.duration_effective'=>"projecttask", 'pt.planned_workload'=>"projecttask", 'pt.progress'=>"projecttask", 'pt.description'=>"projecttask")); // Add extra fields for task $keyforselect = 'projet_task'; diff --git a/htdocs/langs/de_DE/projects.lang b/htdocs/langs/de_DE/projects.lang index a1cf6c11a82f1..a2fe1e07f22c1 100644 --- a/htdocs/langs/de_DE/projects.lang +++ b/htdocs/langs/de_DE/projects.lang @@ -302,3 +302,4 @@ NewLeadbyWeb=Ihre Nachricht bzw. Anfrage wurde erfasst. Wir werden uns so bald w NewLeadForm=Neues Kontaktformular LeadFromPublicForm=Online-Interessent per öffentlichem Formular ExportAccountingReportButtonLabel=Bericht erhalten +Billable = Verrechenbar diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 5c0c2bde5fa01..c93a3744b4cf0 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -310,3 +310,4 @@ MergeTasks=Merge tasks TaskMergeSuccess=Tasks have been merged ErrorTaskIdIsMandatory=Error: Task id is mandatory ErrorsTaskMerge=An error occurred while merging tasks +Billable = Billable diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index 6a3714c1d9df4..89012d12a75c9 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -302,3 +302,4 @@ NewLeadbyWeb=Su mensaje o solicitud ha sido grabada. Le responderemos o contacta NewLeadForm=Nuevo formulario de contacto LeadFromPublicForm=Cliente potencial en línea desde un formulario público ExportAccountingReportButtonLabel=Obtener informe +Billable = Billable diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 40df6cbc7b91e..295af5d64b743 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -310,3 +310,4 @@ MergeTasks=Fusionner tâches TaskMergeSuccess=Les tâches ont été fusionnées ErrorTaskIdIsMandatory=Erreur : l'ID de tâche est obligatoire ErrorsTaskMerge=Une erreur s'est produite lors de la fusion des tâches +Billable = Facturable diff --git a/htdocs/langs/it_IT/projects.lang b/htdocs/langs/it_IT/projects.lang index 7458811858d9a..80cb0a69404f9 100644 --- a/htdocs/langs/it_IT/projects.lang +++ b/htdocs/langs/it_IT/projects.lang @@ -302,3 +302,4 @@ NewLeadbyWeb=Il tuo messaggio o richiesta è stato registrato. Ti risponderemo o NewLeadForm=Nuovo modulo di contatto LeadFromPublicForm=Lead online da modulo pubblico ExportAccountingReportButtonLabel=Get report +Billable = Fatturabile diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index df77bf2268e2b..40bb5c1bee614 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -6,7 +6,8 @@ * Copyright (C) 2020 Juanjo Menent * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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 @@ -270,6 +271,12 @@ class Task extends CommonObjectLine */ public $task_parent_position; + /** + * Status indicate whether the task is billable (time is meant to be added to invoice) '1' or not '0' + * @var int billable + */ + public $billable = 1; + /** * @var float budget_amount */ @@ -362,6 +369,7 @@ public function create($user, $notrigger = 0) $sql .= ", progress"; $sql .= ", budget_amount"; $sql .= ", priority"; + $sql .= ", billable"; $sql .= ") VALUES ("; $sql .= (!empty($this->entity) ? (int) $this->entity : (int) $conf->entity); $sql .= ", ".((int) $this->fk_project); @@ -379,6 +387,7 @@ public function create($user, $notrigger = 0) $sql .= ", ".(($this->progress != '' && $this->progress >= 0) ? ((int) $this->progress) : 'null'); $sql .= ", ".(($this->budget_amount != '' && $this->budget_amount >= 0) ? ((int) $this->budget_amount) : 'null'); $sql .= ", ".(($this->priority != '' && $this->priority >= 0) ? (int) $this->priority : 'null'); + $sql .= ", ".((int) $this->billable); $sql .= ")"; $this->db->begin(); @@ -456,7 +465,8 @@ public function fetch($id, $ref = '', $loadparentdata = 0) $sql .= " t.priority,"; $sql .= " t.note_private,"; $sql .= " t.note_public,"; - $sql .= " t.rang"; + $sql .= " t.rang,"; + $sql .= " t.billable"; if (!empty($loadparentdata)) { $sql .= ", t2.ref as task_parent_ref"; $sql .= ", t2.rang as task_parent_position"; @@ -508,6 +518,7 @@ public function fetch($id, $ref = '', $loadparentdata = 0) $this->task_parent_ref = $obj->task_parent_ref; $this->task_parent_position = $obj->task_parent_position; } + $this->billable = $obj->billable; // Retrieve all extrafield $this->fetch_optionals(); @@ -595,7 +606,8 @@ public function update($user = null, $notrigger = 0) $sql .= " progress=".(($this->progress != '' && $this->progress >= 0) ? $this->progress : 'null').","; $sql .= " budget_amount=".(($this->budget_amount != '' && $this->budget_amount >= 0) ? $this->budget_amount : 'null').","; $sql .= " rang=".((!empty($this->rang)) ? ((int) $this->rang) : "0").","; - $sql .= " priority=".((!empty($this->priority)) ? ((int) $this->priority) : "0"); + $sql .= " priority=".((!empty($this->priority)) ? ((int) $this->priority) : "0").","; + $sql .= " billable=".((int) $this->billable); $sql .= " WHERE rowid=".((int) $this->id); $this->db->begin(); @@ -1020,6 +1032,7 @@ public function initAsSpecimen() $this->priority = 0; $this->note_private = 'This is a specimen private note'; $this->note_public = 'This is a specimen public note'; + $this->billable = 1; return 1; } @@ -1063,7 +1076,7 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc $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, t.priority,"; - $sql .= " t.budget_amount,"; + $sql .= " t.budget_amount, t.billable,"; $sql .= " t.note_public, t.note_private,"; $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 as project_budget_amount"; @@ -1178,7 +1191,7 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc $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, t.priority,"; - $sql .= " t.budget_amount,"; + $sql .= " t.budget_amount, t.billable,"; $sql .= " t.note_public, t.note_private,"; $sql .= " s.rowid, s.nom, s.email,"; $sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount"; @@ -1273,6 +1286,8 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc $tasks[$i]->thirdparty_name = $obj->thirdparty_name; $tasks[$i]->thirdparty_email = $obj->thirdparty_email; + $tasks[$i]->billable = $obj->billable; + if ($loadextras) { if (!empty($extrafields->attributes['projet']['label'])) { foreach ($extrafields->attributes['projet']['label'] as $key => $val) { diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index ef97960d1262b..f1502d8ee9be0 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -89,6 +89,7 @@ $search_progresscalc = GETPOST('search_progresscalc'); $search_progressdeclare = GETPOST('search_progressdeclare'); $search_task_budget_amount = GETPOST('search_task_budget_amount'); +$search_task_billable = GETPOST('search_task_billable'); $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth'); $search_date_start_startyear = GETPOSTINT('search_date_start_startyear'); @@ -148,6 +149,7 @@ $progress = GETPOSTINT('progress'); $budget_amount = GETPOSTFLOAT('budget_amount'); +$billable = (GETPOST('billable', 'aZ') == 'yes'? 1 : 0); $label = GETPOST('label', 'alpha'); $description = GETPOST('description', 'restricthtml'); $planned_workloadhour = (GETPOSTISSET('planned_workloadhour') ? GETPOSTINT('planned_workloadhour') : ''); @@ -176,6 +178,7 @@ 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); + $arrayfields['t.billable'] = array('label' => $langs->trans("Billable"), 'checked' => 1, 'position' => 13); } // Extra fields @@ -234,6 +237,7 @@ $search_progresscalc = ''; $search_progressdeclare = ''; $search_task_budget_amount = ''; + $search_task_billable = ''; $toselect = array(); $search_array_options = array(); $search_date_start_startmonth = ""; @@ -315,6 +319,9 @@ if ($search_task_budget_amount) { $morewherefilterarray[] = natural_search('t.budget_amount', $search_task_budget_amount, 1, 1); } +if ($search_task_billable) { + $morewherefilterarray[] = " t.billable = ".($search_task_billable == "yes" ? 1 : 0); +} //var_dump($morewherefilterarray); $morewherefilter = ''; @@ -364,6 +371,7 @@ $task->date_end = $date_end; $task->progress = $progress; $task->budget_amount = $budget_amount; + $task->billable = $billable; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $task); @@ -557,6 +565,9 @@ if ($search_task_budget_amount) { $param .= '&search_task_budget_amount='.urlencode($search_task_budget_amount); } + if ($search_task_billable) { + $param .= '&search_task_billable='.urlencode($search_task_billable); + } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } @@ -796,6 +807,11 @@ } print ''; + // Billable + print ''; + // Date start task print ''; } + if (!empty($arrayfields['t.billable']['checked'])) { + print ''; + } + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; print ''; @@ -1126,6 +1148,10 @@ if (!empty($arrayfields['c.assigned']['checked'])) { print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ', ''); } + + if (!empty($arrayfields['t.billable']['checked'])) { + print_liste_field_titre($arrayfields['t.billable']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ', ''); + } // Extra fields $disablesortlink = 1; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index fd8585c588dd2..42baa45edc03f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -3,7 +3,8 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2018 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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 @@ -119,6 +120,7 @@ $object->date_end = dol_mktime(GETPOSTINT('date_endhour'), GETPOSTINT('date_endmin'), 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $object->progress = price2num(GETPOST('progress', 'alphanohtml')); $object->budget_amount = GETPOSTFLOAT('budget_amount'); + $object->billable = (GETPOST('billable', 'aZ') == 'yes' ? 1 : 0); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); @@ -509,6 +511,11 @@ print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1); print ''; + // Billable + print ''; + // Description print ''; @@ -682,6 +689,11 @@ } print ''; + // Billable + print ''; + // Other attributes $cols = 3; $parameters = array('socid' => $socid); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4d020e03ac08d..b65dce3385e5c 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -7,7 +7,8 @@ * Copyright (C) 2018 Frédéric France * Copyright (C) 2019-2021 Christophe Battarel * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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 @@ -1573,7 +1574,8 @@ function setDetailVisibility() { $sql .= " u.lastname, u.firstname, u.login, u.photo, u.gender, u.statut as user_status,"; $sql .= " il.fk_facture as invoice_id, inv.fk_statut,"; $sql .= " p.fk_soc,s.name_alias,"; - $sql .= " t.invoice_line_id"; + $sql .= " t.invoice_line_id,"; + $sql .= " pt.billable"; // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -2411,6 +2413,7 @@ function setDetailVisibility() { } // Invoiced + $invoiced = false; if (!empty($arrayfields['valuebilled']['checked'])) { print ''; } elseif ($value == 'code' && isset($obj->{$value})) { - print ''; + print ''; } elseif ($value == 'unit') { print '
'.$langs->trans("LastCustomersBills", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllBills").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').''; + print $objp->ref_client; + print ''.dol_print_date($db->jdate($objp->df), 'day').'!!!'; print price($objp->total_ht); print ''; + if ($lines[$i]->billable) { + print ''.$langs->trans('Yes').''; + } else { + print ''.$langs->trans('No').''; + } + print '
'.$langs->trans("Billable").''; + print $form->selectyesno('billable'); + print '
'.$langs->trans("DateStart").''; print img_picto('', 'action', 'class="pictofixedwidth"'); @@ -1054,6 +1070,12 @@ print ''; + print $form->selectyesno('search_task_billable', $search_task_billable, 0, false, 1); + print ' 
'.$langs->trans("Billable").''; + print $form->selectyesno('billable', $object->billable); + print '
'.$langs->trans("Description").'
'.$langs->trans("Billable").''; + print ''.($object->billable ? $langs->trans('Yes') : $langs->trans('No')).''; + print '
'; // invoice_id and invoice_line_id if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { @@ -2432,8 +2435,13 @@ function setDetailVisibility() { } } } + $invoiced = true; } else { - print $langs->trans("No"); + if ( intval($task_time->billable) == 1) { + print $langs->trans("No"); + } else { + print $langs->trans("Disabled"); + } } } else { print '' . $langs->trans("NA") . ''; @@ -2485,7 +2493,17 @@ function setDetailVisibility() { $selected = 1; } print ' '; - print ''; + // Disable select if task not billable or already invoiced + $disabled = (intval($task_time->billable) !=1 || $invoiced); + $ctrl = ''; + if ($disabled) { + // If disabled, a dbl-click very close outside the control + // will re-enable it, so that user is not blocked if needed. + print ''.$ctrl.''; + print ''; + } else { + print $ctrl; + } } } } diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index 89ab46c146146..152bc0361db38 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -165,6 +165,7 @@ public function testTaskCreate($idproject) $localobject = new Task($db); $localobject->initAsSpecimen(); $localobject->fk_project = $idproject; + $localobject->billable = 1; $result = $localobject->create($user); $this->assertLessThan($result, 0); From 21e4c0e73cacb037b92000ce86f63fcd777d54d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Jul 2024 18:35:19 +0200 Subject: [PATCH 95/98] Clean code --- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/resource/class/html.formresource.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 3295f966b6b13..b6a506e4e8082 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -331,7 +331,7 @@ public function select_state($selected = 0, $country_codeid = 0, $htmlname = 'st // Si traduction existe, on l'utilise, sinon on prend le libelle par default if ( getDolGlobalString('MAIN_SHOW_STATE_CODE') && - (getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || $conf->global->MAIN_SHOW_STATE_CODE === 'all') + (getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || getDolGlobalString('MAIN_SHOW_STATE_CODE') === 'all') ) { if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) { $out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 5471287c9f79f..4251565256433 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -348,7 +348,7 @@ public function select_state($selected = 0, $country_codeid = 0, $htmlname = 'st // If translation exists use it, otherwise use default name if ( getDolGlobalString('MAIN_SHOW_STATE_CODE') && - (getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || $conf->global->MAIN_SHOW_STATE_CODE === 'all') + (getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || getDolGlobalString('MAIN_SHOW_STATE_CODE') === 'all') ) { if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) { $out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); From fa4247a8125d3cd528dfdcbed767619e553632c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Jul 2024 19:35:06 +0200 Subject: [PATCH 96/98] More valid rector rules to change conf->global->xxx --- dev/tools/rector/rector.php | 13 ++++-- .../rector/src/Renaming/GlobalToFunction.php | 41 +++++++++++-------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/dev/tools/rector/rector.php b/dev/tools/rector/rector.php index 0d527997b8334..154a01f3cec27 100644 --- a/dev/tools/rector/rector.php +++ b/dev/tools/rector/rector.php @@ -48,6 +48,7 @@ __DIR__ . '/../../../scripts/', __DIR__ . '/../../../test/phpunit/', ]); + $rectorConfig->skip([ '**/includes/**', '**/custom/**', @@ -55,6 +56,7 @@ '**/rector/**', // Disable this line to test the "test.php" file. __DIR__ . '/../../../htdocs/custom/', __DIR__ . '/../../../htdocs/install/doctemplates/*' + //'test.php', ]); $rectorConfig->parallel(240); @@ -70,9 +72,9 @@ //$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class); + $rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class); $rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector::class); - $rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class); //Not yet ready: $rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class); $rectorConfig->rule(Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class); @@ -82,11 +84,16 @@ $rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class); //$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class); + + // This fix <> into != but it breaks other rules, so added at end. + $rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class); + + // Add all predefined rules to migrate to up to php 71. // Warning this break tab spacing of arrays on several lines /*$rectorConfig->sets([ - LevelSetList::UP_TO_PHP_70 - ]);*/ + LevelSetList::UP_TO_PHP_70 + ]);*/ // Add predefined rules for a given version only //$rectorConfig->import(SetList::PHP_70); //$rectorConfig->import(SetList::PHP_71); diff --git a/dev/tools/rector/src/Renaming/GlobalToFunction.php b/dev/tools/rector/src/Renaming/GlobalToFunction.php index 302a2ff4a2a4a..1c98c9671f654 100644 --- a/dev/tools/rector/src/Renaming/GlobalToFunction.php +++ b/dev/tools/rector/src/Renaming/GlobalToFunction.php @@ -64,8 +64,8 @@ public function getRuleDefinition(): RuleDefinition [new CodeSample( '$conf->global->CONSTANT', 'getDolGlobalInt(\'CONSTANT\')' - )] - ); + )] + ); } /** @@ -133,7 +133,7 @@ public function refactor(Node $node) $node->dim = new FuncCall( new Name('getDolGlobalString'), [new Arg($constName)] - ); + ); } return $node; } @@ -208,7 +208,7 @@ public function refactor(Node $node) $leftConcat = new FuncCall( new Name('getDolGlobalString'), [new Arg($constName)] - ); + ); $rightConcat = $node->right; } if ($this->isGlobalVar($node->right)) { @@ -219,7 +219,7 @@ public function refactor(Node $node) $rightConcat = new FuncCall( new Name('getDolGlobalString'), [new Arg($constName)] - ); + ); $leftConcat = $node->left; } if (!isset($leftConcat, $rightConcat)) { @@ -238,6 +238,7 @@ public function refactor(Node $node) $node = $nodes->getFirstExpr(); } + // Now process all comparison like: // $conf->global->... Operator Value @@ -264,11 +265,14 @@ public function refactor(Node $node) $typeofcomparison = 'NotIdentical'; //var_dump($node->left); } + if (empty($typeofcomparison)) { return; } - if (!$this->isGlobalVar($node->left)) { + $isconfglobal = $this->isGlobalVar($node->left); + if (!$isconfglobal) { + // The left side is not conf->global->xxx, so we leave return; } @@ -282,7 +286,8 @@ public function refactor(Node $node) $funcName = 'getDolGlobalString'; break; default: - return; + $funcName = 'getDolGlobalString'; + break; } $constName = $this->getConstName($node->left); @@ -295,9 +300,9 @@ public function refactor(Node $node) new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'NotEqual') { return new NotEqual( @@ -313,36 +318,36 @@ public function refactor(Node $node) new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'GreaterOrEqual') { return new GreaterOrEqual( new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'Smaller') { return new Smaller( new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'SmallerOrEqual') { return new SmallerOrEqual( new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'NotIdentical') { return new NotIdentical( @@ -382,7 +387,7 @@ function (Node $node): bool { } return \true; } - ); + ); } /** From 9af159cdd815f89571a52320201cfdbaa881e60a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Jul 2024 20:05:29 +0200 Subject: [PATCH 97/98] Replace "! empty($conf->global->$" with "getDolGlobalString($" --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/class/CMailFile.class.php | 18 +++++++++--------- htdocs/core/class/translate.class.php | 6 +++--- htdocs/core/lib/ajax.lib.php | 4 ++-- htdocs/core/lib/pdf.lib.php | 4 ++-- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- .../doc/doc_generic_asset_odt.modules.php | 2 +- .../bom/doc/doc_generic_bom_odt.modules.php | 2 +- .../modules/cheque/doc/pdf_blochet.class.php | 2 +- .../doc/doc_generic_order_odt.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 2 +- .../doc/doc_generic_shipment_odt.modules.php | 2 +- .../doc/doc_generic_invoice_odt.modules.php | 2 +- .../mrp/doc/doc_generic_mo_odt.modules.php | 2 +- .../doc/doc_generic_product_odt.modules.php | 2 +- .../doc/doc_generic_proposal_odt.modules.php | 2 +- .../doc/doc_generic_reception_odt.modules.php | 2 +- .../doc/doc_generic_stock_odt.modules.php | 2 +- ...oc_generic_supplier_invoice_odt.modules.php | 2 +- .../doc_generic_supplier_order_odt.modules.php | 2 +- ...c_generic_supplier_proposal_odt.modules.php | 2 +- .../doc/doc_generic_usergroup_odt.modules.php | 2 +- htdocs/product/admin/product.php | 4 ++-- .../eventorganization/subscriptionok.php | 2 +- htdocs/public/onlinesign/newonlinesign.php | 2 +- htdocs/public/opensurvey/index.php | 2 +- htdocs/public/payment/newpayment.php | 6 +++--- htdocs/public/payment/paymentko.php | 4 ++-- htdocs/public/payment/paymentok.php | 2 +- htdocs/public/project/viewandvote.php | 2 +- htdocs/public/recruitment/index.php | 2 +- htdocs/public/recruitment/view.php | 2 +- .../class/html.formwebportal.class.php | 2 +- 34 files changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 79dc23859830d..88c88da59010c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3224,7 +3224,7 @@ public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger // Check for mandatory prof id (but only if country is other than ours) if ($mysoc->country_id > 0 && $this->thirdparty->country_id == $mysoc->country_id) { $idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY'; - if (!$vallabel && !empty($conf->global->$idprof_mandatory)) { + if (!$vallabel && getDolGlobalString($idprof_mandatory)) { $langs->load("errors"); $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $this->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index a4bd1e2426cdb..28ebd8c0dfcb9 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1035,10 +1035,10 @@ public function sendfile() // If we use SSL/TLS $server = getDolGlobalString($keyforsmtpserver); $secure = ''; - if (!empty($conf->global->$keyfortls) && function_exists('openssl_open')) { + if (getDolGlobalString($keyfortls) && function_exists('openssl_open')) { $secure = 'ssl'; } - if (!empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) { + if (getDolGlobalString($keyforstarttls) && function_exists('openssl_open')) { $secure = 'tls'; } $server = ($secure ? $secure.'://' : '').$server; @@ -1050,11 +1050,11 @@ public function sendfile() $loginid = ''; $loginpass = ''; - if (!empty($conf->global->$keyforsmtpid)) { + if (getDolGlobalString($keyforsmtpid)) { $loginid = getDolGlobalString($keyforsmtpid); $this->smtps->setID($loginid); } - if (!empty($conf->global->$keyforsmtppw)) { + if (getDolGlobalString($keyforsmtppw)) { $loginpass = getDolGlobalString($keyforsmtppw); $this->smtps->setPW($loginpass); } @@ -1199,19 +1199,19 @@ public function sendfile() // If we use SSL/TLS $server = getDolGlobalString($keyforsmtpserver); $secure = ''; - if (!empty($conf->global->$keyfortls) && function_exists('openssl_open')) { + if (getDolGlobalString($keyfortls) && function_exists('openssl_open')) { $secure = 'ssl'; } - if (!empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) { + if (getDolGlobalString($keyforstarttls) && function_exists('openssl_open')) { $secure = 'tls'; } $this->transport = new Swift_SmtpTransport($server, getDolGlobalString($keyforsmtpport), $secure); - if (!empty($conf->global->$keyforsmtpid)) { + if (getDolGlobalString($keyforsmtpid)) { $this->transport->setUsername($conf->global->$keyforsmtpid); } - if (!empty($conf->global->$keyforsmtppw) && getDolGlobalString($keyforsmtpauthtype) != "XOAUTH2") { + if (getDolGlobalString($keyforsmtppw) && getDolGlobalString($keyforsmtpauthtype) != "XOAUTH2") { $this->transport->setPassword($conf->global->$keyforsmtppw); } if (getDolGlobalString($keyforsmtpauthtype) === "XOAUTH2") { @@ -1864,7 +1864,7 @@ public function check_server_port($host, $port) } // If we use SSL/TLS - if (!empty($conf->global->$keyfortls) && function_exists('openssl_open')) { + if (getDolGlobalString($keyfortls) && function_exists('openssl_open')) { $host = 'ssl://'.$host; } // tls smtp start with no encryption diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 92b32d2f25720..f0b5ded8db641 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -437,7 +437,7 @@ public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = // Kept for backward compatibility. if (empty($loadfromfileonly)) { $overwritekey = 'MAIN_OVERWRITE_TRANS_' . $this->defaultlang; - if (!empty($conf->global->$overwritekey)) { // Overwrite translation with key1:newstring1,key2:newstring2 + if (getDolGlobalString($overwritekey)) { // Overwrite translation with key1:newstring1,key2:newstring2 // Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX $tmparray = explode(',', getDolGlobalString($overwritekey)); foreach ($tmparray as $tmp) { @@ -683,7 +683,7 @@ public function trans($key, $param1 = '', $param2 = '', $param3 = '', $param4 = // Make some string replacement after translation $replacekey = 'MAIN_REPLACE_TRANS_' . $this->defaultlang; - if (!empty($conf->global->$replacekey)) { // Replacement translation variable with string1:newstring1;string2:newstring2 + if (getDolGlobalString($replacekey)) { // Replacement translation variable with string1:newstring1;string2:newstring2 $tmparray = explode(';', getDolGlobalString($replacekey)); foreach ($tmparray as $tmp) { $tmparray2 = explode(':', $tmp); @@ -777,7 +777,7 @@ public function transnoentitiesnoconv($key, $param1 = '', $param2 = '', $param3 // Make some string replacement after translation $replacekey = 'MAIN_REPLACE_TRANS_' . $this->defaultlang; - if (!empty($conf->global->$replacekey)) { // Replacement translation variable with string1:newstring1;string2:newstring2 + if (getDolGlobalString($replacekey)) { // Replacement translation variable with string1:newstring1;string2:newstring2 $tmparray = explode(';', getDolGlobalString($replacekey)); foreach ($tmparray as $tmp) { $tmparray2 = explode(':', $tmp); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f21101cd1aef2..06c89bef1bbe9 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -697,8 +697,8 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof '."\n"; $out .= ''; - $out .= ''.($revertonoff ? img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort)).''; - $out .= ''.($revertonoff ? img_picto($langs->trans("Disabled"), 'switch_off'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort)).''; + $out .= ''.($revertonoff ? img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort)).''; + $out .= ''.($revertonoff ? img_picto($langs->trans("Disabled"), 'switch_off'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on'.$suffix, '', false, 0, 0, '', '', $marginleftonlyshort)).''; $out .= "\n"; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ca1d72e1cd36e..8bab1e1bd0e71 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1029,7 +1029,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $dims = $pdf->getPageDimensions(); // Line of free text - if (empty($hidefreetext) && !empty($conf->global->$paramfreetext)) { + if (empty($hidefreetext) && getDolGlobalString($paramfreetext)) { $substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object); // More substitution keys $substitutionarray['__FROM_NAME__'] = $fromcompany->name; @@ -1633,7 +1633,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Check if description must be output if (!empty($object->element)) { $tmpkey = 'MAIN_DOCUMENTS_HIDE_DESCRIPTION_FOR_'.strtoupper($object->element); - if (!empty($conf->global->$tmpkey)) { + if (getDolGlobalString($tmpkey)) { $hidedesc = 1; } } diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 0d91d521370a4..a3fda66b87ab3 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -467,7 +467,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t while ($i <= $MAXFTP) { $paramkey = 'FTP_NAME_'.$i; //print $paramkey; - if (!empty($conf->global->$paramkey)) { + if (getDolGlobalString($paramkey)) { $link = "/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; $newmenu->add($link, dol_trunc($conf->global->$paramkey, 24)); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 65ad8a26263d7..b2f3e48a76e5b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -873,7 +873,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM while ($i <= $MAXFTP) { $paramkey = 'FTP_NAME_'.$i; //print $paramkey; - if (!empty($conf->global->$paramkey)) { + if (getDolGlobalString($paramkey)) { $link = "/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; $newmenu->add($link, dol_trunc($conf->global->$paramkey, 24)); } diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index 3d767b59571a4..a04f323bcb306 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -322,7 +322,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'ORDER_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 9233a93f151b1..89347b5b0c1b5 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -323,7 +323,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'BOM_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 5cecdaa413dcc..babd72f3d68fd 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -445,7 +445,7 @@ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) complete_substitutions_array($substitutionarray, $outputlangs, $object); $newfreetext = ''; $paramfreetext = 'BANK_CHEQUERECEIPT_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 529ca3a85398a..0dd24592bb414 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -333,7 +333,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'ORDER_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index c5b938fe8f16a..0112484d973b9 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -344,7 +344,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'CONTRACT_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $tmparray); } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 50d33d378d306..f2a1d1ee530a6 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -331,7 +331,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'EXPEDITION_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d279edc8b01fe..e03194f9f415d 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -373,7 +373,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'INVOICE_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 1a784af2dcbf0..f19deec6f4c67 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -316,7 +316,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'MRP_MO_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 85450edf7f07d..13d913dc4605e 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -328,7 +328,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'PRODUCT_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index e5fddcddd5fda..9f60a58023493 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -365,7 +365,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'PROPOSAL_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index c51179964e279..6d8c91419f932 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -326,7 +326,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'RECEPTION_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 4db3e9f93d291..d4d838f3475ab 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -327,7 +327,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'stock_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php index 8246efc372d6f..c84c52cb7291f 100644 --- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -329,7 +329,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'INVOICE_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index a6750022925f9..a7d4da8c27864 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -324,7 +324,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'ORDER_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 17e7fb8ae2c9a..db87bed9cce49 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -353,7 +353,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'SUPPLIER_PROPOSAL_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index cabdf9611aa44..475a1f555fe12 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -352,7 +352,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Line of free text $newfreetext = ''; $paramfreetext = 'user_FREE_TEXT'; - if (!empty($conf->global->$paramfreetext)) { + if (getDolGlobalString($paramfreetext)) { $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray); } diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 82759e7a8d55f..67380570aad8f 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -61,11 +61,11 @@ 'PRODUIT_CUSTOMER_PRICES' => $langs->trans('PriceByCustomer'), // Different price for each customer ); $keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY'; -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 || !empty($conf->global->$keyforparam)) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 || getDolGlobalString($keyforparam)) { $select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans('PriceByQuantity').' ('.$langs->trans("VersionExperimental").')'; // TODO If this is enabled, price must be hidden when price by qty is enabled, also price for quantity must be used when adding product into order/propal/invoice } $keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'; -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->$keyforparam)) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || getDolGlobalString($keyforparam)) { $select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'] = $langs->trans('MultiPricesAbility').'+'.$langs->trans('PriceByQuantity').' ('.$langs->trans("VersionExperimental").')'; } diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index fab5a6e70bfc4..a4416a3e849db 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -178,7 +178,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_PAYMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_PAYMENT_LOGO'); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index b38b114089626..fb3890a478bf4 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -268,7 +268,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_SIGN_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_SIGN_LOGO')) { $logosmall = getDolGlobalString('ONLINE_SIGN_LOGO'); diff --git a/htdocs/public/opensurvey/index.php b/htdocs/public/opensurvey/index.php index b07b047d58640..54d98ebccf5e6 100644 --- a/htdocs/public/opensurvey/index.php +++ b/htdocs/public/opensurvey/index.php @@ -135,7 +135,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_OPENSURVEY_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_OPENSURVEY_LOGO')) { $logosmall = getDolGlobalString('ONLINE_OPENSURVEY_LOGO_'); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d6d7edd6e967e..177c4ae64c0bf 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -345,9 +345,9 @@ $creditor = $mysoc->name; $paramcreditor = 'ONLINE_PAYMENT_CREDITOR'; $paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix; -if (!empty($conf->global->$paramcreditorlong)) { +if (getDolGlobalString($paramcreditorlong)) { $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show -} elseif (!empty($conf->global->$paramcreditor)) { +} elseif (getDolGlobalString($paramcreditor)) { $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show } @@ -897,7 +897,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_PAYMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_PAYMENT_LOGO'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 4cd8a67fdf6b7..fc550a763b725 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -233,7 +233,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; - if (!empty($conf->global->$paramlogo)) { + if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_PAYMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_PAYMENT_LOGO'); @@ -275,7 +275,7 @@ print $langs->trans("YourPaymentHasNotBeenRecorded")."

"; $key = 'ONLINE_PAYMENT_MESSAGE_KO'; - if (!empty($conf->global->$key)) { + if (getDolGlobalString($key)) { print $conf->global->$key; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 082ac3c4d1d7a..2fac1e73f716a 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -220,7 +220,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; - if (!empty($conf->global->$paramlogo)) { + if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_PAYMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_PAYMENT_LOGO'); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 7c088fa724933..3b30add23087c 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -236,7 +236,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_PAYMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_PAYMENT_LOGO'); diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 5615e8133e20f..586d3d8f87254 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -136,7 +136,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_RECRUITMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_RECRUITMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_RECRUITMENT_LOGO_'); diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 60b5191d468fd..228f29633f684 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -198,7 +198,7 @@ $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_RECRUITMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { +if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_RECRUITMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_RECRUITMENT_LOGO'); diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index 662f8f9835a22..232dc10e8ffaa 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -556,7 +556,7 @@ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $sh $textifempty = ' '; //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; - if (!empty($conf->global->$confkeyforautocompletemode)) { + if (getDolGlobalString($confkeyforautocompletemode)) { if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); } else { From 1d35417963673df95de575e5fb06ae626f0e0291 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Jul 2024 22:00:16 +0200 Subject: [PATCH 98/98] FIX Can't modifiy the payment code that is reserved --- htdocs/admin/dict.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 00bdb4e644662..b9625cd952142 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2756,7 +2756,15 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '') } elseif ($value == 'price' || preg_match('/^amount/i', $value)) { print '
'; + if ($tabname == 'c_paiement' && in_array($obj->{$value}, array('LIQ', 'CB', 'VIR'))) { + // Case of code that should not be modified + print ''; + print $obj->{$value}; + } else { + print ''; + } + print ''; $units = array(