From 115323dec8e079da7768549da0189ed1e9b5d24c Mon Sep 17 00:00:00 2001 From: alkaan Date: Wed, 20 Nov 2024 20:57:22 +0100 Subject: [PATCH 1/8] FIX : removes traces of << --- htdocs/core/class/commonobject.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5333a0b6f17..b81688307b9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2156,12 +2156,7 @@ abstract class CommonObject if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { -<<<<<<< HEAD - $sql .= " AND ug.fk_user = te.rowid"; - $sql .= " AND ug.entity IN (".getEntity('usergroup').")"; -======= $sql .= " AND ug.entity IN (".getEntity($this->element).")"; ->>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git } } else { $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; From 04b7fdd4c442cc99edef6d04153e66ab1a631f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 19 Dec 2024 18:32:16 +0100 Subject: [PATCH 2/8] fix CI --- htdocs/core/class/commonobject.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c340cbd5d20..39009d1301e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3834,7 +3834,7 @@ abstract class CommonObject $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); if ($justsource || $justtarget) { if ($justsource) { $this->linkedObjectsIds[$obj->targettype][$obj->rowid] = $obj->fk_target; @@ -3894,11 +3894,11 @@ abstract class CommonObject $classpath = 'adherents/class'; $module = 'adherent'; } elseif ($objecttype == 'contact') { - $module = 'societe'; - } elseif ($objecttype == 'action') { - $module = 'agenda'; - $subelement = 'actionComm'; - } + $module = 'societe'; + } elseif ($objecttype == 'action') { + $module = 'agenda'; + $subelement = 'actionComm'; + } // Set classfile $classfile = strtolower($subelement); From 74881ae25125a53396a5ce363e4aa19d67c6e6b9 Mon Sep 17 00:00:00 2001 From: uvaldenaire-opendsi Date: Tue, 7 Jan 2025 12:10:40 +0100 Subject: [PATCH 3/8] fix join societe_commerciaux in societe list --- htdocs/societe/list.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 7f978829b91..512b7878a10 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -507,7 +507,7 @@ if ($search_sale == -2) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; //elseif ($search_sale || (empty($user->rights->societe->client->voir) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->societe->client->readallthirdparties_advance)) && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } elseif (!empty($search_sale) && $search_sale != '-1' || (empty($user->rights->societe->client->voir) && !$socid)) { - $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux AS sc ON s.rowid = sc.fk_soc"; } // Add table from hooks $parameters = array(); @@ -518,9 +518,6 @@ $sql .= " WHERE s.entity IN (".getEntity('societe').")"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } -if ($search_sale && $search_sale != '-1' && $search_sale != '-2') { - $sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale -} if (!$user->rights->fournisseur->lire) { $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible } From 7b08a99cf61c634fb35f8582087b82f4f5ff43db Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jan 2025 17:23:10 +0100 Subject: [PATCH 4/8] fix: remove list mass action update price wihen price mode is not uniq price --- htdocs/product/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index f4dbed9b156..c485cdfd3b4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -829,7 +829,10 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight($rightskey, 'creer')) { - $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); + if (getDolGlobalString('PRODUCT_PRICE_UNIQ')) { + $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); + } + $arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus"); $arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus"); } From 9f25fc0c8a03ca3f0357552f51f30ec30b060095 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jan 2025 17:27:11 +0100 Subject: [PATCH 5/8] fix: remove list mass action update price wihen price mode is not uniq price --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index c485cdfd3b4..4d817250cbe 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -829,7 +829,7 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight($rightskey, 'creer')) { - if (getDolGlobalString('PRODUCT_PRICE_UNIQ')) { + if (getDolGlobalString('PRODUCT_PRICE_UNIQ') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); } From 273ec857a3b0dd60b8ff49dc50ada418ef69d0fd Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 7 Jan 2025 18:35:58 +0100 Subject: [PATCH 6/8] Fix : cron job user rights force reload --- scripts/cron/cron_run_jobs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index ec8abcdea80..3174b0eae7f 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -210,7 +210,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) { exit(-1); } } - $user->getrights(); + $user->getrights('', 1); // We force rights reload to have the correct permissions for user in the entity we just switched in } // Reload langs From ea94370486b052bf53e232023d3063174a276f93 Mon Sep 17 00:00:00 2001 From: Amael-PE Date: Wed, 8 Jan 2025 17:03:15 +0100 Subject: [PATCH 7/8] FIX Complete wath was started in #17243 for pdf_cannelle --- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 6 +++++- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index c28c033b1bb..ae5823861c4 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -286,7 +286,11 @@ class pdf_standard_asset extends ModelePDFAsset // Set path to the background PDF File if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index a6bdd688a07..388b81de18f 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -250,7 +250,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } From 21e997acd79b1d07a6dfb4cfb69a09c99e173e37 Mon Sep 17 00:00:00 2001 From: Amael-PE Date: Wed, 8 Jan 2025 17:06:19 +0100 Subject: [PATCH 8/8] FIX Continue for eagle_proforma --- .../stocktransfer/doc/pdf_eagle_proforma.modules.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 9c6ceccf901..c8982040b2c 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -275,7 +275,11 @@ class pdf_eagle_proforma extends ModelePDFCommandes $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); }