From 8c5ae9fa0ec87b3d05af107f8f507c3b1ea0f584 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Mar 2025 03:39:11 +0100 Subject: [PATCH 1/8] Fix duplicate calendar of bookcal module in aganda view --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e7dcc756305..85ccaf7b42d 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -605,7 +605,7 @@ if (isModEnabled("bookcal")) { while ($i < $num) { $objp = $db->fetch_object($resql); $label = !empty($objp->label) ? $objp->label : $objp->ref; - $bookcalcalendars["calendars"][] = array("id" => $objp->id_cal, "label" => $label); + $bookcalcalendars["calendars"][$objp->id_cal] = array("id" => $objp->id_cal, "label" => $label); $bookcalcalendars["availabilitieslink"][$objp->rowid] = $objp->id_cal; $i++; } From 2426a50cba3eb5d9248f91e8609765e166c96e85 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 20 Mar 2025 13:31:52 +0100 Subject: [PATCH 2/8] Fix CSS and td balance --- htdocs/expedition/card.php | 42 +++++++++---------- .../expedition/tpl/linkedobjectblock.tpl.php | 6 +-- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c7fc531c605..99c013612c5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1865,11 +1865,9 @@ if ($action == 'create') { } } elseif ($object->id > 0) { '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) - /* *************************************************************************** */ - /* */ - /* Edit and view mode */ - /* */ - /* *************************************************************************** */ + + // Edit and view mode + $lines = $object->lines; $num_prod = count($lines); @@ -2018,7 +2016,7 @@ if ($action == 'create') { if (!empty($typeobject) && $typeobject == 'commande' && $object->origin_object->id && isModEnabled('order')) { print ''; print $langs->trans("RefOrder").''; - print ''; + print ''; print $objectsrc->getNomUrl(1, 'commande'); print "\n"; print ''; @@ -2026,15 +2024,15 @@ if ($action == 'create') { if (!empty($typeobject) && $typeobject == 'propal' && $object->origin_object->id && isModEnabled("propal")) { print ''; print $langs->trans("RefProposal").''; - print ''; + print ''; print $objectsrc->getNomUrl(1, 'expedition'); print "\n"; print ''; } // Date creation - print ''.$langs->trans("DateCreation").''; - print ''.dol_print_date($object->date_creation, "dayhour")."\n"; + print ''.$langs->trans("DateCreation").''; + print ''.dol_print_date($object->date_creation, "dayhour")."\n"; print ''; // Delivery date planned @@ -2046,7 +2044,7 @@ if ($action == 'create') { print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; } print ''; - print ''; + print ''; if ($action == 'editdate_livraison') { print '
'; print ''; @@ -2069,7 +2067,7 @@ if ($action == 'create') { print 'id.'">'.img_edit($langs->trans('SetShippingDate'), 1).''; } print ''; - print ''; + print ''; if ($action == 'editdate_shipping') { print ''; print ''; @@ -2086,7 +2084,7 @@ if ($action == 'create') { // Weight print ''; print $form->editfieldkey("Weight", 'trueWeight', $object->trueWeight, $object, $user->hasRight('expedition', 'creer')); - print ''; + print ''; if ($action == 'edittrueWeight') { print ''; @@ -2116,13 +2114,13 @@ if ($action == 'create') { print ''; // Width - print ''.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')).''; + print ''.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')).''; print $form->editfieldval("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')); print ($object->trueWidth && $object->width_units != '') ? ' '.measuringUnitString(0, "size", $object->width_units) : ''; print ''; // Height - print ''.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')).''; + print ''.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')).''; if ($action == 'edittrueHeight') { print ''; print ''; @@ -2141,7 +2139,7 @@ if ($action == 'create') { print ''; // Depth - print ''.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')).''; + print ''.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')).''; print $form->editfieldval("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')); print ($object->trueDepth && $object->depth_units != '') ? ' '.measuringUnitString(0, "size", $object->depth_units) : ''; print ''; @@ -2150,7 +2148,7 @@ if ($action == 'create') { print ''; print $langs->trans("Volume"); print ''; - print ''; + print ''; $calculatedVolume = 0; $volumeUnit = 0; if ($object->trueWidth && $object->trueHeight && $object->trueDepth) { @@ -2179,7 +2177,7 @@ if ($action == 'create') { print ''; // Other attributes - $cols = 2; + //$cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; @@ -2191,7 +2189,7 @@ if ($action == 'create') { print ''; // Sending method - print ''; // Tracking Number - print ''; @@ -2240,7 +2238,7 @@ if ($action == 'create') { } print '
'; + print '
'; print ''; @@ -2200,7 +2198,7 @@ if ($action == 'create') { print ''; } print '
'; print $langs->trans('SendingMethod'); print 'id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).'
'; - print '
'; + print ''; if ($action == 'editshipping_method_id') { print ''; print ''; @@ -2223,7 +2221,7 @@ if ($action == 'create') { print '
'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')).''; + print '
'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')).''; print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->hasRight('expedition', 'creer'), 'safehtmlstring', $object->tracking_number); print '
'; print ''; - print ''; + print ''; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } else { @@ -2250,7 +2248,7 @@ if ($action == 'create') { } // Other attributes - $parameters = array('colspan' => ' colspan="3"', 'cols' => '3'); + $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index a5fdaf4982b..0114fbb6dd1 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -48,9 +48,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> trans("Shipment"); ?> - getNomUrl(1); ?> - ref_customer; ?> - date_delivery, 'day'); ?> + getNomUrl(1); ?> + ref_customer); ?> + date_delivery ? $objectlink->date_delivery : $objectlink->date_creation, 'day'); ?> hasRight('expedition', 'lire')) { $total += $objectlink->total_ht; From ae13ad70aebc4c260a7740b5cf4254a349414765 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 20 Mar 2025 13:39:25 +0100 Subject: [PATCH 3/8] FIX Responsive --- htdocs/core/lib/sendings.lib.php | 6 ++++-- htdocs/expedition/card.php | 10 +++++----- htdocs/expedition/shipment.php | 9 +++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 4a45fdf42af..4d54ecd0dab 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -273,6 +273,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print load_fiche_titre($langs->trans("SendingsAndReceivingForSameOrder")); } + print '
'; print ''; print ''; //print ''; @@ -310,7 +311,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; // Sending id - print ''; @@ -401,7 +402,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Warehouse if (isModEnabled('stock')) { - print '
'.$langs->trans("QtyOrdered").'
'; + print ''; print $expedition->getNomUrl(1); //print ''.img_object($langs->trans("ShowSending"), 'sending').' '.$objp->exp_ref.''; print ''; + print ''; if ($objp->warehouse_id > 0) { $warehousestatic->fetch($objp->warehouse_id); print $warehousestatic->getNomUrl(1); @@ -485,6 +486,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') } print '
'; + print '
'; } $db->free($resql); } else { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 99c013612c5..e86df3200ed 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1035,7 +1035,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0); + print $formproject->select_projects($soc->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'widthcentpercentminusxx'); print ' id).'">'; print ''; print ''; @@ -1104,7 +1104,7 @@ if ($action == 'create') { print ''; $expe->fetch_delivery_methods(); print img_picto('', 'dolly', 'class="pictofixedwidth"'); - print $form->selectarray("shipping_method_id", $expe->meths, GETPOSTINT('shipping_method_id'), 1, 0, 0, "", 1); + print $form->selectarray("shipping_method_id", $expe->meths, GETPOSTINT('shipping_method_id'), 1, 0, 0, "", 1, 0, 0, '', 'widthcentpercentminusxx'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -1148,7 +1148,7 @@ if ($action == 'create') { print "".$langs->trans("DefaultModel").""; print ''; print img_picto('', 'pdf', 'class="pictofixedwidth"'); - print $form->selectarray('model', $list, $conf->global->EXPEDITION_ADDON_PDF); + print $form->selectarray('model', $list, getDolGlobalString('EXPEDITION_ADDON_PDF'), 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx'); print "\n"; } @@ -2552,7 +2552,7 @@ if ($action == 'create') { // Qty to ship or shipped print ''.$unit_order.''; // Warehouse source - print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; + print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').''; // Batch number management print ''; if (isModEnabled('productbatch')) { @@ -2567,7 +2567,7 @@ if ($action == 'create') { // Qty to ship or shipped print ''.$unit_order.''; // Warehouse source - print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; + print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').''; // Batch number management print ''; if (isModEnabled('productbatch')) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 9cf50ba2a2a..f0671a933e5 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -226,6 +226,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; } + /* * View */ @@ -599,7 +600,8 @@ if ($id > 0 || !empty($ref)) { * Lines or orders with quantity shipped and remain to ship * Note: Qty shipped are already available into $object->expeditions[fk_product] */ - print ''; + print '
'; + print '
'; $sql = "SELECT cd.rowid, cd.fk_product, cd.product_type as type, cd.label, cd.description,"; $sql .= " cd.price, cd.tva_tx, cd.subprice,"; @@ -837,14 +839,13 @@ if ($id > 0 || !empty($ref)) { $db->free($resql); if (!$num) { - print ''; } - - print "
'.$langs->trans("NoArticleOfTypeProduct").'
'; + print '
'.$langs->trans("NoArticleOfTypeProduct").'
"; } else { dol_print_error($db); } + print ""; print ''; From aa783446155ebafcb27d8afc1277f947b37e0485 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 20 Mar 2025 18:39:54 +0100 Subject: [PATCH 4/8] Fix trans --- htdocs/langs/en_US/errors.lang | 1 + htdocs/product/stock/massstockmove.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index c66ece16b31..5470972e9f8 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -352,6 +352,7 @@ ErrorQtyOrderedLessQtyShipped = The quantity ordered cannot be less than the qua ErrorVariousPaymentOnBankAccountWithADifferentCurrencyNotYetSupported=Error, creating a various payment on a bank account with a currency different than the currency of the company is not yet supported. ErrorStreamMustBeEnabled=The PHP stream %s is not available. Check your PHP modules and Dolibarr parameter $dolibarr_main_stream_to_disable. ErrorYouTryToPayInvoicesWithDifferentCurrenciesInSamePayment=Error, you try to pay different invoices with different currencies in the same payment +ErrorBadNumberOfLinesMustHaveAtLeastOneLinePlusTitle=Bad number of lines. The files must have at least 2 lines (1 line for title and 1 line for data) # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 1eea94722db..d45156afd8b 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -356,7 +356,8 @@ if ($action == 'importCSV' && $user->hasRight('stock', 'mouvement', 'creer')) { $labelsrecord = $importcsv->import_read_record(); if ($nblinesrecord < 1) { - setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); } else { $i = 0; $data = array(); From 13d1cc06d783861b6092451d37dfce16aeb0c591 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 24 Mar 2025 01:24:40 +0100 Subject: [PATCH 5/8] Fix warning --- htdocs/core/class/conf.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index b85f1f7a295..1a771c3fd58 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1177,7 +1177,7 @@ class Conf extends stdClass $this->contrat->services->inactifs->warning_delay = getDolGlobalInt('MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400; $this->contrat->services->expires->warning_delay = getDolGlobalInt('MAIN_DELAY_RUNNING_SERVICES') * 86400; } - if (isset($this->commande)) { + if (isset($this->bank)) { $this->bank->rappro = new stdClass(); $this->bank->cheque = new stdClass(); $this->bank->rappro->warning_delay = getDolGlobalInt('MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400; From e1351bdd1886e6a9fc178740fe48c2b57bcbadd8 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 24 Mar 2025 12:49:46 +0100 Subject: [PATCH 6/8] FIX Translation of column in list of invoice --- htdocs/compta/facture/list.php | 5 ++--- htdocs/core/class/commonobject.class.php | 2 +- htdocs/modulebuilder/template/class/myobject.class.php | 1 + htdocs/theme/eldy/global.inc.php | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index e41b95def98..68e674e1632 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -226,8 +226,8 @@ $arrayfields = array( 'f.date_valid' => array('label' => "DateValidation", 'checked' => 0, 'position' => 22), 'f.date_lim_reglement' => array('label' => "DateDue", 'checked' => 1, 'position' => 25), 'f.date_closing' => array('label' => "DateClosing", 'checked' => 0, 'position' => 30), - 'p.ref' => array('label' => "ProjectRef", 'langs' => 'projects', 'checked' => 1, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 40), - 'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 41), + 'p.ref' => array('label' => "ProjectRef", 'langfile' => 'projects', 'checked' => 1, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 40), + 'p.title' => array('label' => "ProjectLabel", 'langfile' => 'projects', 'checked' => 0, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 41), 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 50), 's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1, 'position' => 51), 's.code_client' => array('label' => "CustomerCodeShort", 'checked' => -1, 'position' => 52), @@ -631,7 +631,6 @@ $formmargin = null; if (isModEnabled('margin')) { $formmargin = new FormMargin($db); } -$bankaccountstatic = new Account($db); $facturestatic = new Facture($db); $formcompany = new FormCompany($db); $companystatic = new Societe($db); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8c83db4b8a2..d4693486140 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -140,7 +140,7 @@ abstract class CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-6,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index fc064086174..6aa8cfdbf4c 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -78,6 +78,7 @@ class MyObject extends CommonObject * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" * 'length' the length of field. Example: 255, '24,8' * 'label' the translation key. + * 'langfile' the key of the language file for translation. * 'alias' the alias used into some old hard coded SQL requests * 'picto' is code of a picto to show before value in forms * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4a3210435f7..90bf24a1537 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -7651,7 +7651,8 @@ dl.dropdown { /* color: var(--colortext); */ color: var(--colortext); } -.dropdown dd ul li:hover { + +dropdown dd ul li:hover:not(.linputsearch) { background: #eee; } .dropdown dd ul li input[type="checkbox"] { From 7ce20a5ff3570661806428d49a2652cf74e70978 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 24 Mar 2025 13:00:35 +0100 Subject: [PATCH 7/8] FIX blank page on smartphone for bank SEPA direct transfer page --- htdocs/compta/prelevement/orders_list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 8e2d0ab15ef..2b3d588c3f5 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -175,10 +175,12 @@ if ($type == 'bank-transfer') { } include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + /* * View */ +$form = new Form($db); $directdebitorder = new BonPrelevement($db); $titlekey = "WithdrawalsReceipts"; From 72012227533d7d2030490334d1052eb13a287c9a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 24 Mar 2025 13:58:17 +0100 Subject: [PATCH 8/8] Test of a security fix backport. --- htdocs/core/lib/website2.lib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index a465e140ac1..e73c35b740b 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -180,6 +180,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n"; $tplcontent .= ' $pathdepth = count(explode(\'/\', $_SERVER[\'SCRIPT_NAME\'])) - 2;'."\n"; $tplcontent .= ' require_once ($pathdepth ? str_repeat(\'../\', $pathdepth) : \'./\').\'master.inc.php\';'."\n"; + if (getDolGlobalString("MAIN_ADD_WAF_V22") && empty($objectpage->disable_waf)) { + $tplcontent .= ' require_once DOL_DOCUMENT_ROOT.\'/waf.inc.php\';'."\n"; + } $tplcontent .= "} // Not already loaded\n"; $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; @@ -370,6 +373,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n"; $tplcontent .= ' $pathdepth = count(explode(\'/\', $_SERVER[\'SCRIPT_NAME\'])) - 2;'."\n"; $tplcontent .= ' require_once ($pathdepth ? str_repeat(\'../\', $pathdepth) : \'./\').\'master.inc.php\';'."\n"; + if (getDolGlobalString("MAIN_ADD_WAF_V22") && empty($objectpage->disable_waf)) { + $tplcontent .= ' require_once DOL_DOCUMENT_ROOT.\'/waf.inc.php\';'."\n"; + } $tplcontent .= "} // Not already loaded\n"; $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";