From 0afd5cc7e3f0777aef99a86a6601a87e585a337d Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:22:37 +0200 Subject: [PATCH 01/37] FIX: social contribution payment: correct error reporting (#34002) * FIX: social contribution payment: correct error reporting * FIX: social contribution payment: correclty handle return of adding payment to bank --- htdocs/compta/paiement_charge.php | 8 ++++---- .../sociales/class/paymentsocialcontribution.class.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 4ae310fe421..178755fada1 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -51,7 +51,7 @@ $charge = new ChargeSociales($db); * Actions */ -if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'yes')) { +if ($action == 'add_payment') { $error = 0; if ($cancel) { @@ -89,7 +89,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y } } - if (count($amounts) <= 0) { + if (empty($amounts)) { $error++; setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors'); $action = 'create'; @@ -119,9 +119,9 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y if (!$error) { $result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOST('accountid', 'int'), '', ''); - if (!($result > 0)) { + if ($result <= 0) { $error++; - setEventMessages($paiement->error, null, 'errors'); + setEventMessages($paiement->error, $paiement->errors, 'errors'); $action = 'create'; } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index a798eee92bb..b6c865f84de 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -579,7 +579,6 @@ class PaymentSocialContribution extends CommonObject $result = $this->update_fk_bank($bank_line_id); if ($result <= 0) { $error++; - dol_print_error($this->db); } // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction @@ -591,7 +590,7 @@ class PaymentSocialContribution extends CommonObject $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); if ($result <= 0) { $error++; - dol_print_error($this->db); + $this->setErrorsFromObject($acc); } } @@ -603,7 +602,8 @@ class PaymentSocialContribution extends CommonObject $socialcontrib->fetch($key); $result = $acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib != $socialcontrib->type_label) ? ' ('.$socialcontrib->lib.')' : ''), 'sc'); if ($result <= 0) { - dol_print_error($this->db); + $this->setErrorsFromObject($acc); + $error++; } if ($socialcontrib->fk_user) { @@ -620,14 +620,14 @@ class PaymentSocialContribution extends CommonObject ); if ($result <= 0) { - $this->error = $acc->error; + $this->setErrorsFromObject($acc); $error++; } } } } } else { - $this->error = $acc->error; + $this->setErrorsFromObject($acc); $error++; } } From 956d545b41b59efc88ca04eb2c39ecf9aeaae788 Mon Sep 17 00:00:00 2001 From: VIAL-GOUTEYRON Quentin Date: Thu, 12 Jun 2025 12:17:29 +0200 Subject: [PATCH 02/37] fix missing last_main_doc (#34405) --- htdocs/fourn/class/fournisseur.commande.class.php | 2 ++ htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b5937495443..0d9239aac8e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -391,6 +391,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_label, cr.libelle_facture as cond_reglement_doc,"; $sql .= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle"; $sql .= ', c.fk_incoterms, c.location_incoterms'; + $sql .= ', c.last_main_doc'; $sql .= ', i.libelle as label_incoterms'; $sql .= " FROM ".$this->db->prefix()."commande_fournisseur as c"; $sql .= " LEFT JOIN ".$this->db->prefix()."c_payment_term as cr ON c.fk_cond_reglement = cr.rowid"; @@ -428,6 +429,7 @@ class CommandeFournisseur extends CommonOrder $this->statut = $obj->status; // deprecated $this->status = $obj->status; $this->billed = $obj->billed; + $this->last_main_doc = $obj->last_main_doc; $this->user_author_id = $obj->user_author_id; $this->user_validation_id = $obj->user_validation_id; $this->user_approve_id = $obj->user_approve_id; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index ae3818239c4..cf0dd614080 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1209,6 +1209,7 @@ class SupplierProposal extends CommonObject $sql .= ", p.fk_mode_reglement"; $sql .= ', p.fk_account'; $sql .= ", p.fk_shipping_method"; + $sql .= ", p.last_main_doc"; $sql .= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc"; $sql .= ", c.label as statut_label"; $sql .= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc"; @@ -1255,6 +1256,7 @@ class SupplierProposal extends CommonObject $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; + $this->last_main_doc = $obj->last_main_doc; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; $this->mode_reglement = $obj->mode_reglement; From 878474f1d138b238d252f2d04c833032c4b4ad89 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 12 Jun 2025 12:23:55 +0200 Subject: [PATCH 03/37] FIX element must be visible to set focus on select input when using default values (#34406) --- htdocs/core/lib/functions.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1ea0b5744b5..4be573045c8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9935,7 +9935,9 @@ function printCommonFooter($zone = 'private') print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; print '// required on a select works only if key is "", so we add the required attributes but also we reset the key -1 or 0 to an empty string'."\n"; - print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; + print 'if (jQuery("select[name=\''.$paramkey.'\']").is(\':visible\')===true) {'."\n"; + print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // can set focus only if this element is visible + print '}'."\n"; print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'-1\']").prop(\'value\', \'\');'."\n"; print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'0\']").prop(\'value\', \'\');'."\n"; From b47fbccfe31adcad8b68e908c3e85b07993166ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Jun 2025 15:26:48 +0200 Subject: [PATCH 04/37] Fix travis --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c42cd5371e..b03fb3458c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ # from Dolibarr GitHub repository. # For syntax, see https://docs.travis-ci.com/user/languages/php/ -# We use dist: bionic = 18.04, focal = 20.04 +# We use dist: focal = 20.04, jammy = 22.04 os: linux -dist: focal +dist: jammy language: generic @@ -21,7 +21,7 @@ services: addons: - mariadb: '10.5' + mariadb: '10.6' env: @@ -136,7 +136,8 @@ install: #sudo apt install composer composer -V - composer -n config -g vendor-dir htdocs/includes + sudo composer -n config -g vendor-dir htdocs/includes + sudo chmod -R a+rwx /home/travis/.config/composer echo - | @@ -206,8 +207,8 @@ before_script: phpcs -i | head - # Check PHP Vardump check version echo "PHP Vardump check version" - which var_dump_check - var_dump_check --version + which var-dump-check + var-dump-check --version # Check PHPUnit version echo "PHPUnit version" which phpunit From 1497541129a5ba94d553ced13fc4a92aae405a04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Jun 2025 15:30:30 +0200 Subject: [PATCH 05/37] Fix travis --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5e26790005..7bf1a512757 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ # from Dolibarr GitHub repository. # For syntax, see https://docs.travis-ci.com/user/languages/php/ -# We use dist: bionic = 18.04, focal = 20.04 +# We use dist: focal = 20.04, jammy = 22.04 os: linux -dist: focal +dist: jammy language: generic @@ -21,7 +21,7 @@ services: addons: - mariadb: '10.5' + mariadb: '10.6' env: @@ -123,7 +123,8 @@ install: sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer sudo chmod -R a+rwx /usr/local/bin/composer composer -V - composer -n config -g vendor-dir htdocs/includes + sudo composer -n config -g vendor-dir htdocs/includes + sudo chmod -R a+rwx /home/travis/.config/composer echo - | @@ -193,8 +194,8 @@ before_script: phpcs -i | head - # Check PHP Vardump check version echo "PHP Vardump check version" - which var_dump_check - var_dump_check --version + which var-dump-check + var-dump-check --version # Check PHPUnit version echo "PHPUnit version" which phpunit From 2091b65547f20d35ef63941b31b0bcc22e1ca4e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Jun 2025 16:30:42 +0200 Subject: [PATCH 06/37] Fix CI --- htdocs/accountancy/journal/purchasesjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 246ca9f18a0..91ac6b97ad8 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -374,7 +374,7 @@ if (!empty($tabfac)) { fd.product_type <= 2 AND fd.fk_code_ventilation <= 0 AND fd.total_ttc <> 0 - AND fk_facture_fourn IN (".$db->sanitize(join(",", array_keys($tabfac))).") + AND fk_facture_fourn IN (".$db->sanitize(implode(",", array_keys($tabfac))).") GROUP BY fk_facture_fourn "; $resql = $db->query($sql); From ed3612b942f1f3d75c845efa3c6fb8e3952e9a64 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:30:58 +0200 Subject: [PATCH 07/37] FIX: expensereport payment list: php warning (#34453) Co-authored-by: Laurent Destailleur --- htdocs/expensereport/payment/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 4354ae5da66..cb7a221c7dc 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -50,6 +50,7 @@ $massaction = GETPOST('massaction', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist'; $mode = GETPOST('mode', 'alpha'); +$toselect = GETPOSTISSET('toselect') ? GETPOST('toselect', 'array:int') : array(); $socid = GETPOSTINT('socid'); From c9f743983aa7e3d7e7708600d0f9da8d0d735362 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 13 Jun 2025 17:11:40 +0200 Subject: [PATCH 08/37] FIX: accountancy expensereport journal: php 8.1 warning (#34457) --- htdocs/accountancy/journal/expensereportsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 9b69c837113..09e1182bad5 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -238,7 +238,7 @@ if ($action == 'writebookkeeping' && !$error) { $db->begin(); // Error if some lines are not binded/ready to be journalized - if ($errorforinvoice[$key] == 'somelinesarenotbound') { + if (!empty($errorforinvoice[$key]) && $errorforinvoice[$key] == 'somelinesarenotbound') { $error++; $errorforline++; setEventMessages($langs->trans('ErrorInvoiceContainsLinesNotYetBounded', $val['ref']), null, 'errors'); From 9c45f42e4f2b6455409ae72e275363a7586418a9 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 13 Jun 2025 17:25:33 +0200 Subject: [PATCH 09/37] FIX: product translation: redirect after successful action (#34403) Co-authored-by: Laurent Destailleur --- htdocs/product/traduction.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 8fc7c415692..b8a4e597b64 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -88,7 +88,8 @@ if (empty($reshook)) { $object->fetch($id); $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - $action = ''; + header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id); + exit; } // Add translation @@ -119,7 +120,8 @@ if (empty($reshook)) { } if ($result > 0) { - $action = ''; + header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id); + exit; } else { $action = 'add'; setEventMessages($object->error, $object->errors, 'errors'); @@ -148,7 +150,8 @@ if (empty($reshook)) { $result = $object->setMultiLangs($user); if ($result > 0) { - $action = ''; + header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id); + exit; } else { $action = 'edit'; setEventMessages($object->error, $object->errors, 'errors'); @@ -163,7 +166,8 @@ if (empty($reshook)) { $result = $object->delMultiLangs($langtodelete, $user); if ($result > 0) { - $action = ''; + header('Location:'.$_SERVER['PHP_SELF'].'?id='.$id); + exit; } else { $action = 'edit'; setEventMessages($object->error, $object->errors, 'errors'); From 4bd11f64d72043c765543486b930420764b5ecde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= <121813548+BenjaminFlr@users.noreply.github.com> Date: Fri, 13 Jun 2025 23:45:18 +0200 Subject: [PATCH 10/37] FIX (#34448) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benjamin Falière Co-authored-by: Laurent Destailleur --- htdocs/projet/card.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 70760678b9e..e9766217995 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2025 Benjamin Falière * * 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 @@ -1570,13 +1571,17 @@ if ($action == 'create' && $user->rights->projet->creer) { // Buttons Create if (empty($conf->global->PROJECT_HIDE_CREATE_OBJECT_BUTTON)) { + // We check the type of thirdparty + $is_customer_or_prospect = (!empty($object->thirdparty->prospect) || !empty($object->thirdparty->client)); + $is_supplier_only= (!empty($object->thirdparty->fournisseur) && $is_customer_or_prospect == false); + $arrayforbutaction = array( - 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 10 => array('lang'=>'propal', 'enabled'=>(isModEnabled("propal") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 20 => array('lang'=>'orders', 'enabled'=>(isModEnabled("commande") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 30 => array('lang'=>'bills', 'enabled'=>(isModEnabled("facture") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&projectid='.$object->id.($is_supplier_only == true ? '&socid='.$object->socid : '')), + 50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&projectid='.$object->id.($is_supplier_only == true ? '&socid='.$object->socid : '')), + 60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&projectid='.$object->id.($is_supplier_only == true ? '&socid='.$object->socid : '')), 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("ficheinter"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contrat"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 90 => array('lang'=>'trips', 'enabled'=>isModEnabled("expensereport"), 'perm'=>$user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), From cada04442ba5a2cc3a7c6c9f6e964dd08818a8ab Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 13 Jun 2025 23:49:11 +0200 Subject: [PATCH 11/37] FIX: manufacturing orders: php 8.1 warnings on agenda tab (#34475) --- htdocs/mrp/mo_agenda.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 3e31bf3f6fa..8ee4c7fce08 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -44,6 +44,12 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +// Protection +$socid = 0; +if ($user->socid > 0) { + $socid = $user->socid; +} + if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) { @@ -84,7 +90,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 if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->mrp->multidir_output[$object->entity]."/".$object->id; + $upload_dir = (empty($conf->mrp->multidir_output[$object->entity]) ? $conf->mrp->dir_output : $conf->mrp->multidir_output[$object->entity])."/".$object->id; } // Security check - Protection if external user @@ -229,7 +235,10 @@ if ($object->id > 0) { print ''; if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { - $param = '&id='.$object->id.'&socid='.$socid; + $param = '&id='.$object->id; + if (!empty($socid)) { + $param .= '&socid='.$socid; + } if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } From 7152705e709366336d4a39f5cec92f7ed2d917ec Mon Sep 17 00:00:00 2001 From: atm-lena <52402938+atm-lena@users.noreply.github.com> Date: Fri, 13 Jun 2025 23:53:55 +0200 Subject: [PATCH 12/37] Task Clone : no translation (#34470) Co-authored-by: atm-lena --- htdocs/langs/en_US/projects.lang | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 82884c25b4e..748ca5d448a 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -302,3 +302,9 @@ NewLeadbyWeb=Your message or request has been recorded. We will answer or contac NewLeadForm=New contact form LeadFromPublicForm=Online lead from public form ExportAccountingReportButtonLabel=Get report +CloneChanges=Recalculate date of task +CloneAffectation=Clone affectations +CloneProgression=Clone progression +CloneTimes=Clone times +CloneFile=Clone files +ConfirmCloneTask=Do you want to clone this task? From c77c4efcb8415e11a95a27a8344a06bff1eb9da8 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 13 Jun 2025 23:57:37 +0200 Subject: [PATCH 13/37] FIX: accountancy lettering: php8.1 warning (#34469) --- htdocs/accountancy/class/lettering.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 0c22e2041a0..f6cc9613f84 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -574,7 +574,7 @@ class Lettering extends BookKeeping $grouped_lines = array(); foreach (self::$doc_type_infos as $doc_type => $doc_type_info) { - if (!is_array($bookkeeping_lines_by_type[$doc_type])) { + if (empty($bookkeeping_lines_by_type[$doc_type]) || !is_array($bookkeeping_lines_by_type[$doc_type])) { continue; } From bc18656fd5ddd132e4d3ecf58b8f2ee10b0f0e86 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 14 Jun 2025 00:27:36 +0200 Subject: [PATCH 14/37] FIX: files lib: multiple php 8.1 warnings (#34462) --- htdocs/core/lib/files.lib.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ba7a1e82968..ec42b934925 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2639,7 +2639,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $dolibarr_main_data_root.'/doctemplates/'.$original_file; } elseif ($modulepart == 'doctemplateswebsite' && !empty($dolibarr_main_data_root)) { // Wrapping for doctemplates of websites - $accessallowed = ($fuser->rights->website->write && preg_match('/\.jpg$/i', basename($original_file))); + $accessallowed = ($fuser->hasRight('website', 'write') && preg_match('/\.jpg$/i', basename($original_file))); $original_file = $dolibarr_main_data_root.'/doctemplates/websites/'.$original_file; } elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root)) { // Wrapping for *.zip package files, like when used with url http://.../document.php?modulepart=packages&file=module_myfile.zip @@ -2744,10 +2744,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->fournisseur->facture->dir_output.'/'.$original_file; } elseif (($modulepart == 'holiday') && !empty($conf->holiday->dir_output)) { - if ($fuser->hasRight('holiday', $read) || !empty($fuser->rights->holiday->readall) || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('holiday', $read) || $fuser->hasRight('holiday', 'readall') || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of holiday, call checkUserAccessToObject to check permission on properties and hierarchy of leave request - if ($refname && empty($fuser->rights->holiday->readall) && !preg_match('/^specimen/i', $original_file)) { + if ($refname && !$fuser->hasRight('holiday', 'readall') && !preg_match('/^specimen/i', $original_file)) { include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $tmpholiday = new Holiday($db); $tmpholiday->fetch('', $refname); @@ -2756,10 +2756,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->holiday->dir_output.'/'.$original_file; } elseif (($modulepart == 'expensereport') && !empty($conf->expensereport->dir_output)) { - if ($fuser->hasRight('expensereport', $lire) || !empty($fuser->rights->expensereport->readall) || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('expensereport', $lire) || $fuser->hasRight('expensereport', 'readall') || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of expensereport, call checkUserAccessToObject to check permission on properties and hierarchy of expense report - if ($refname && empty($fuser->rights->expensereport->readall) && !preg_match('/^specimen/i', $original_file)) { + if ($refname && !$fuser->hasRights('expensereport', 'readall') && !preg_match('/^specimen/i', $original_file)) { include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $tmpexpensereport = new ExpenseReport($db); $tmpexpensereport->fetch('', $refname); @@ -2859,7 +2859,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->categorie->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'prelevement' && !empty($conf->prelevement->dir_output)) { // Wrapping pour les prelevements - if ($fuser->rights->prelevement->bons->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('prelevement', 'bons', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->prelevement->dir_output.'/'.$original_file; @@ -2895,7 +2895,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->fckeditor->dir_output.'/'.$original_file; } elseif ($modulepart == 'user' && !empty($conf->user->dir_output)) { // Wrapping for users - $canreaduser = (!empty($fuser->admin) || $fuser->rights->user->user->{$lire}); + $canreaduser = (!empty($fuser->admin) || $fuser->hasRight('user', 'user', $lire)); if ($fuser->id == (int) $refname) { $canreaduser = 1; } // A user can always read its own card @@ -2908,7 +2908,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (empty($entity) || empty($conf->societe->multidir_output[$entity])) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } - if ($fuser->rights->societe->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('societe', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->societe->multidir_output[$entity].'/'.$original_file; @@ -3003,7 +3003,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('propal').")"; } elseif (($modulepart == 'commande' || $modulepart == 'order') && !empty($conf->commande->multidir_output[$entity])) { // Wrapping pour les commandes - if ($fuser->rights->commande->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRights('commande', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->commande->multidir_output[$entity].'/'.$original_file; @@ -3037,21 +3037,21 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) { // Wrapping pour les commandes fournisseurs - if ($fuser->rights->fournisseur->commande->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('fournisseur', 'commande', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->fournisseur->commande->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif (($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') && !empty($conf->fournisseur->facture->dir_output)) { // Wrapping pour les factures fournisseurs - if ($fuser->rights->fournisseur->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('fournisseur', 'facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->fournisseur->facture->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif ($modulepart == 'supplier_payment') { // Wrapping pour les rapport de paiements - if ($fuser->rights->fournisseur->facture->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('fournisseur', 'facture', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->fournisseur->payment->dir_output.'/'.$original_file; @@ -3068,7 +3068,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } } elseif ($modulepart == 'export_compta' && !empty($conf->accounting->dir_output)) { // Wrapping for accounting exports - if ($fuser->rights->accounting->bind->write || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('accounting', 'bind', 'write') || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->accounting->dir_output.'/'.$original_file; @@ -3134,7 +3134,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } } elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity])) { // Wrapping pour les contrats - if ($fuser->rights->contrat->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->hasRight('contrat', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->contrat->multidir_output[$entity].'/'.$original_file; @@ -3167,11 +3167,11 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } elseif ($modulepart == 'export' && !empty($conf->export->dir_temp)) { // Wrapping for export module // Note that a test may not be required because we force the dir of download on the directory of the user that export - $accessallowed = $user->rights->export->lire; + $accessallowed = $user->hasRight('export', 'lire'); $original_file = $conf->export->dir_temp.'/'.$fuser->id.'/'.$original_file; } elseif ($modulepart == 'import' && !empty($conf->import->dir_temp)) { // Wrapping for import module - $accessallowed = $user->rights->import->run; + $accessallowed = $user->hasRight('import', 'run'); $original_file = $conf->import->dir_temp.'/'.$original_file; } elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_output)) { // Wrapping for recruitment module @@ -3281,7 +3281,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, exit; } - // Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read + // Check fuser->hasRight('modulepart', 'myobject', 'read') and fuser->hasRight('modulepart', 'read') $partsofdirinoriginalfile = explode('/', $original_file); if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use) $partofdirinoriginalfile = $partsofdirinoriginalfile[0]; From bc8cb5a1e18a0c0a794829542539e2206d37f3be Mon Sep 17 00:00:00 2001 From: William Mead Date: Sat, 14 Jun 2025 01:36:00 +0200 Subject: [PATCH 15/37] FIX #33030 (#34460) * FIX #33030 * Update propal.php --------- Co-authored-by: Laurent Destailleur --- htdocs/admin/propal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 4cb0e063380..ea3afb1b724 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -9,6 +9,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 William Mead * * 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 @@ -579,7 +580,7 @@ print ""; if (!isModEnabled('invoice')) { print ''; - if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1)) { + if ((!isset($this->fields[$key]['default'])) || empty($this->fields[$key]['notnull']) || ($this->fields[$key]['notnull'] != 1)) { $out .= ''; } foreach ($param['options'] as $keyb => $valb) { From 06dc4f5426f9efba51de1e03ee3c0544dff3ff8c Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 14 Jun 2025 11:59:03 +0200 Subject: [PATCH 19/37] FIX: event info tab: php 8.1 warning (#34458) * FIX: event info tab: php 8.1 warning * Update info.php --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/action/info.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 9d9baff3c3e..27fdd324016 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -53,6 +53,9 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$object = new ActionComm($db); +$object->fetch($id); + $usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create')); @@ -65,8 +68,6 @@ $form = new Form($db); $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung'; llxHeader('', $langs->trans("Agenda"), $help_url); -$object = new ActionComm($db); -$object->fetch($id); $object->info($object->id); $head = actions_prepare_head($object); From d1d56fc12bdf4009a943771707d7de041548d5d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Jun 2025 15:03:13 +0200 Subject: [PATCH 20/37] Fix CI --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index db21f28fd8a..ed32b693aff 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -3000,7 +3000,7 @@ if ($action == 'create' && $usercancreate) { // Create intervention $arrayforbutaction[] = array('lang' => 'interventions', 'enabled' => (isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm' => $user->hasRight('ficheinter', 'creer'), 'label' => 'AddIntervention', 'url' => '/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); - /*if (isModEnabled('ficheinter')) { + /* if (isModEnabled('intervention')) { $langs->load("interventions"); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { From 17edce59722fe06c40030b87ce056a789f4adf38 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 14 Jun 2025 15:05:05 +0200 Subject: [PATCH 21/37] FIX: online propal sign: double header with logo when custom logo set (#34504) * FIX: online propal sign: double header with logo when custom logo get * Update company.lib.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/company.lib.php | 13 ++++++-- htdocs/public/onlinesign/newonlinesign.php | 35 +--------------------- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c91193ac55e..0877d18bdaf 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2664,16 +2664,25 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) * * @param Societe $mysoc Third party * @param Translate $langs Output language + * @param string $suffix Suffix * @return void */ -function htmlPrintOnlineHeader($mysoc, $langs) +function htmlPrintOnlineHeader($mysoc, $langs, $suffix = '') { global $conf; // Define urllogo $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + $suffix = GETPOST("suffix", 'aZ09'); - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $customLogoWithSuffix = getDolGlobalString('ONLINE_SIGN_LOGO_'.$suffix); + $customLogo = getDolGlobalString('ONLINE_SIGN_LOGO'); + + if (!empty($customLogoWithSuffix) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$customLogoWithSuffix)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$customLogoWithSuffix); + } elseif (!empty($customLogo) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$customLogo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$customLogo); + } elseif (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 566b45618cc..d3aa4043e0e 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -247,7 +247,7 @@ $title = $langs->trans("OnlineSignature"); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $title, '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); -htmlPrintOnlineHeader($mysoc, $langs); +htmlPrintOnlineHeader($mysoc, $langs, $suffix); if ($action == 'refusepropal') { print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); @@ -280,39 +280,6 @@ print ''."\n"; print ''."\n"; -// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) -// Define logo and logosmall -$logosmall = $mysoc->logo_small; -$logo = $mysoc->logo; -$paramlogo = 'ONLINE_SIGN_LOGO_'.$suffix; -if (getDolGlobalString($paramlogo)) { - $logosmall = getDolGlobalString($paramlogo); -} elseif (getDolGlobalString('ONLINE_SIGN_LOGO')) { - $logosmall = getDolGlobalString('ONLINE_SIGN_LOGO'); -} -//print ''."\n"; -// Define urllogo -$urllogo = ''; -$urllogofull = ''; -if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); -} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); -} -// Output html code for logo -if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; -} if ($source == 'proposal' && getDolGlobalString('PROPOSAL_IMAGE_PUBLIC_SIGN')) { print '
'; print ''; From 0a4013bfc4dd67a58899e285a51345caa42815ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Jun 2025 15:11:19 +0200 Subject: [PATCH 22/37] Fix CI --- htdocs/projet/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 0d092a4824a..44d36457859 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1679,13 +1679,13 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { $arrayforbutaction = array( 10 => array('lang'=>'propal', 'enabled'=>(isModEnabled("propal") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 20 => array('lang'=>'orders', 'enabled'=>(isModEnabled("commande") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 30 => array('lang'=>'bills', 'enabled'=>(isModEnabled("facture") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 20 => array('lang'=>'orders', 'enabled'=>(isModEnabled("order") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 30 => array('lang'=>'bills', 'enabled'=>(isModEnabled("invoice") && $is_customer_or_prospect == true), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&projectid='.$object->id.($is_supplier_only == true ? '&socid='.$object->socid : '')), 50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&projectid='.$object->id.($is_supplier_only == true ? '&socid='.$object->socid : '')), 60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&projectid='.$object->id.($is_supplier_only == true ? '&socid='.$object->socid : '')), - 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("ficheinter"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contrat"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("intervention"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contract"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 90 => array('lang'=>'trips', 'enabled'=>isModEnabled("expensereport"), 'perm'=>$user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 100 => array('lang'=>'donations', 'enabled'=>isModEnabled("don"), 'perm'=>$user->hasRight('don', 'creer'), 'label' => 'AddDonation', 'url'=>'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), ); From 456adc1e952d288a2f3830ac7eec15a73343add4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 14 Jun 2025 23:59:21 +0200 Subject: [PATCH 23/37] FIX: receptions: crash from api because of classes not found (#34523) --- htdocs/reception/class/reception.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 42c578c29f8..8e98cfe639e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1558,6 +1558,8 @@ class Reception extends CommonObject if ($resql) { // Set order billed if 100% of order is received (qty in reception lines match qty in order lines) if ($this->origin == 'order_supplier' && $this->origin_id > 0) { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $order = new CommandeFournisseur($this->db); $order->fetch($this->origin_id); @@ -1813,6 +1815,8 @@ class Reception extends CommonObject } if (!$error && $this->origin == 'order_supplier') { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $commande = new CommandeFournisseur($this->db); $commande->fetch($this->origin_id); $result = $commande->setStatus($user, 4); From 79779b1d2f740807ad5796a67112743be9514596 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Jun 2025 00:23:13 +0200 Subject: [PATCH 24/37] Doc --- .github/workflows/pr-18.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 04b4b0ff35e..abf15ecc096 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,3 +1,11 @@ +# Action to prepare the github action +# Go on Dolibarr - Settings - Developper settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account +# Click on generate the private keys +# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Chooose the repository access to "Repository Dolibarr". +# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Chooose the repository access to "Repository Dolibarr". +# +# + name: Set reviewer for v18 on: pull_request: From 478a8a4d52cb02ea2e7b6c77a94744b1dc7476d6 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sun, 15 Jun 2025 00:30:44 +0200 Subject: [PATCH 25/37] FIX: try to fix v18 github action workflow (#34439) * FIX: try to fix v18 github action workflow * FIX: try to fix v18 github action workflow, part 2 --------- Co-authored-by: Laurent Destailleur --- .github/workflows/pr-18.yaml | 41 +++++++++++------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 04b4b0ff35e..6f68492ddc6 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -17,38 +17,21 @@ jobs: # GH_TOKENS: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.PR18_APP_ID }} + private-key: ${{ secrets.PR18_SECRET_KEY }} + - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - #- name: Install GitHub CLI - # run: | - # sudo apt update - # sudo apt install gh -y - - - name: Assign reviewer method 1 + - name: Assign reviewer env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} url: ${{ github.event.pull_request.html_url }} run: | - gh pr edit "$url" --add-assignee rycks --add-reviewer rycks - gh pr merge "$url" --merge --auto - continue-on-error: true + gh pr edit "$url" --add-reviewer rycks + gh pr edit "$url" --add-reviewer lvessiller-opendsi - - name: Assign reviewer method 2 - env: - #REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer - REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer - run: | - echo "Run action by ${{ github.actor }}" - echo "github.token=${{ github.token }}" - echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" - echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" - echo Get the pr_number - pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) - echo "pr_number=$pr_number" - echo Authenticate login gh - gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" - gh auth setup-git - echo Set the reviewer - gh pr edit $pr_number --add-reviewer "$REVIEWER" - continue-on-error: true From 7a8e9269354aa52d624b33b6762aa176bd9932de Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sun, 15 Jun 2025 00:32:23 +0200 Subject: [PATCH 26/37] FIX: interventions: sql error when signed_status not set (#34515) --- htdocs/fichinter/class/fichinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 37d0bb8ad95..b9acbfcd7c5 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -334,7 +334,7 @@ class Fichinter extends CommonObject $sql .= ", ".($this->fk_project ? ((int) $this->fk_project) : 0); $sql .= ", ".($this->fk_contrat ? ((int) $this->fk_contrat) : 0); $sql .= ", ".((int) $this->statut); - $sql .= ", ".($this->signed_status); + $sql .= ", ".((int) $this->signed_status); $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null"); $sql .= ")"; From d50a938d125b1addf312762c255ae6033fbcdfe4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Jun 2025 00:50:25 +0200 Subject: [PATCH 27/37] Doc --- .github/workflows/pr-18.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index abf15ecc096..ab33eb72ee4 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,6 +1,7 @@ # Action to prepare the github action # Go on Dolibarr - Settings - Developper settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account # Click on generate the private keys +# Click on Install application - choose user of the Organization # Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Chooose the repository access to "Repository Dolibarr". # Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Chooose the repository access to "Repository Dolibarr". # From 4bb42de5d66e6c727b7576c1be24a609ef2f7689 Mon Sep 17 00:00:00 2001 From: Pichi1966 <57623859+josett225@users.noreply.github.com> Date: Sun, 15 Jun 2025 03:03:42 +0200 Subject: [PATCH 28/37] FIX BankTransfer link in list.php (#34513) FIX BankTransfer link in list.php This is to fix a wrong action link in list.php. The link was sending to a WithDraw screen creating confusion. --- htdocs/compta/prelevement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 0e3daaf496b..f7e5c98e7eb 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -417,7 +417,7 @@ while ($i < $imaxinloop) { print '
'; From d1f3f9eddd6ae3dc89c9ccc2c895ebcc091548c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= <81741011+altairis-noe@users.noreply.github.com> Date: Mon, 16 Jun 2025 20:09:00 +0200 Subject: [PATCH 29/37] FIX: PHP 8 Error 500 (#34545) * FIX: PHP 8 Error 500 * Update product.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 6e20f5452cf..3037b4a2325 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2375,7 +2375,7 @@ class Product extends CommonObject } } else { $price = (float) price2num($newprice, 'MU'); - $price_ttc = ($newnpr != 1) ? price2num($newprice) * (1 + ($newvat / 100)) : $price; + $price_ttc = ($newnpr != 1) ? (float) price2num($newprice) * (1 + ($newvat / 100)) : $price; $price_ttc = (float) price2num($price_ttc, 'MU'); if ($newminprice !== '' || $newminprice === 0) { From 030df976abcad9fa805c8176c6f1569b66e43504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= <142790847+clementgde@users.noreply.github.com> Date: Mon, 16 Jun 2025 20:12:38 +0200 Subject: [PATCH 30/37] FIX Bug filters (#34546) --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 83162692a0b..a394c3cf4ff 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5094,7 +5094,7 @@ class Facture extends CommonInvoice if ($generic_facture->hasDelay()) { $response->nbtodolate++; - $response->url_late = DOL_URL_ROOT.'/compta/facture/list.php?search_late=late&mainmenu=billing&leftmenu=customers_bills'; + $response->url_late = DOL_URL_ROOT.'/compta/facture/list.php?search_option=late&mainmenu=billing&leftmenu=customers_bills'; } } From 96e1017d14d7ccc038c0c713aa264e97cfa2adc7 Mon Sep 17 00:00:00 2001 From: atm-irvine <165771178+atm-irvine@users.noreply.github.com> Date: Wed, 18 Jun 2025 14:18:24 +0200 Subject: [PATCH 31/37] fix: document.php set default entity value (#34557) --- htdocs/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/document.php b/htdocs/document.php index f0e60549d1c..48c437da27e 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -103,7 +103,7 @@ $original_file = GETPOST('file', 'alphanohtml'); $hashp = GETPOST('hashp', 'aZ09'); $modulepart = GETPOST('modulepart', 'alpha'); $urlsource = GETPOST('urlsource', 'alpha'); -$entity = GETPOSTINT('entity'); +$entity = GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity; // Security check if (empty($modulepart) && empty($hashp)) { From 57c751f31948c4196df3f8765185910f6fb0d354 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 18 Jun 2025 14:20:17 +0200 Subject: [PATCH 32/37] FIX: expense report card: mail notifications not sent (#34556) --- htdocs/expensereport/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index c05b44f7123..23cf536d4a5 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -470,7 +470,7 @@ if (empty($reshook)) { // PREPARE SEND $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1); - if (!empty($mailfile->error)) { + if (empty($mailfile->error)) { // SEND $result = $mailfile->sendfile(); if ($result) { @@ -594,7 +594,7 @@ if (empty($reshook)) { // PREPARE SEND $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1); - if (!empty($mailfile->error)) { + if (empty($mailfile->error)) { // SEND $result = $mailfile->sendfile(); if ($result) { @@ -714,7 +714,7 @@ if (empty($reshook)) { $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, $emailCC, '', 0, -1); - if (!empty($mailfile->error)) { + if (empty($mailfile->error)) { // SEND $result = $mailfile->sendfile(); if ($result) { @@ -830,7 +830,7 @@ if (empty($reshook)) { // PREPARE SEND $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1); - if (!empty($mailfile->error)) { + if (empty($mailfile->error)) { // SEND $result = $mailfile->sendfile(); if ($result) { @@ -951,7 +951,7 @@ if (empty($reshook)) { // PREPARE SEND $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1); - if (!empty($mailfile->error)) { + if (empty($mailfile->error)) { // SEND $result = $mailfile->sendfile(); if ($result) { @@ -1137,7 +1137,7 @@ if (empty($reshook)) { // PREPARE SEND $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1); - if (!empty($mailfile->error)) { + if (empty($mailfile->error)) { // SEND $result = $mailfile->sendfile(); if ($result) { From 4548a6fffb3d8e50e86c0d7d02fc90e52d9d2363 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 18 Jun 2025 14:22:03 +0200 Subject: [PATCH 33/37] FIX Product batch series - Title, help url et picto (#34560) * Fix title / help url * Fix help / title on note of product batch series * Fix help / title on document of product batch series * Fix wrong picto on document of product batch series * Missing language file * Fix linkback * Update productlot_note.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/stock/productlot_card.php | 16 +++++----- htdocs/product/stock/productlot_document.php | 31 ++++++++++++-------- htdocs/product/stock/productlot_note.php | 16 ++++++---- 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 53e07ae1c73..0225b5e8473 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -1,8 +1,9 @@ - * Copyright (C) 2018 All-3kcis - * Copyright (C) 2021 Noé Cendrier - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2007-2018 Laurent Destailleur + * Copyright (C) 2018 All-3kcis + * Copyright (C) 2021 Noé Cendrier + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 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 @@ -21,8 +22,7 @@ /** * \file product/stock/productlot_card.php * \ingroup stock - * \brief This file is an example of a php page - * Initially built by build_class_from_table on 2016-05-17 12:22 + * \brief Batch/series card on products */ // Load Dolibarr environment @@ -398,8 +398,10 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -$title = $langs->trans("ProductLot"); $help_url = ''; +$shortlabel = dol_trunc($object->batch, 16); +$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Card'); +$help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_card'); diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index a53aafa557f..4122ab756a6 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -1,14 +1,15 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 All-3kcis - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2003-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005 Simon TOSSER + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018 All-3kcis + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 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 @@ -48,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; */ // Load translation files required by the page -$langs->loadLangs(array('other', 'products')); +$langs->loadLangs(array('other', 'products', 'productbatch')); $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); @@ -153,12 +154,16 @@ if (empty($reshook)) { $form = new Form($db); -llxHeader('', $langs->trans('ProductLot'), '', '', 0, 0, '', '', '', 'mod-product page-stock_productlot_document'); +$help_url = ''; +$shortlabel = dol_trunc($object->batch, 16); +$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Documents'); +$help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_document'); if ($object->id) { $head = productlot_prepare_head($object); - print dol_get_fiche_head($head, 'documents', $langs->trans("Batch"), -1, 'barcode'); + print dol_get_fiche_head($head, 'documents', $langs->trans("Batch"), -1, $object->picto); $parameters = array(); diff --git a/htdocs/product/stock/productlot_note.php b/htdocs/product/stock/productlot_note.php index 58baeea4107..fbc16265387 100644 --- a/htdocs/product/stock/productlot_note.php +++ b/htdocs/product/stock/productlot_note.php @@ -1,7 +1,7 @@ - * Copyright (C) ---Put here your own copyright and developer email--- - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 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 @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; */ // Load translation files required by the page -$langs->loadLangs(array('other', 'products')); +$langs->loadLangs(array('other', 'products', 'productbatch')); // Get parameters $id = GETPOSTINT('id'); @@ -90,7 +90,11 @@ if (empty($reshook)) { $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans('productlot'), $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_note'); +$shortlabel = dol_trunc($object->batch, 16); +$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Notes'); +$help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock_productlot_note'); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); @@ -101,7 +105,7 @@ if ($id > 0 || !empty($ref)) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'batch'); From fda1499eeeea552e8f4c02b8f042d1a982d537af Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 18 Jun 2025 14:28:36 +0200 Subject: [PATCH 34/37] Fix CI --- .github/workflows/pr-18.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 2282299bc58..4f274e28c8f 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,11 +1,10 @@ # Action to prepare the github action -# Go on Dolibarr - Settings - Developper settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account +# Go on Dolibarr - Settings - Developer settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account # Click on generate the private keys # Click on Install application - choose user of the Organization -# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Chooose the repository access to "Repository Dolibarr". -# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Chooose the repository access to "Repository Dolibarr". -# -# +# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr". +# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr". +# name: Set reviewer for v18 on: From b1109f6803e74658bed962acf5f924cb877650b0 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Thu, 19 Jun 2025 10:44:18 +0200 Subject: [PATCH 35/37] add env var for non-origin repository (#34577) --- build/makepack-dolibarr.pl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 829d41341ff..a2ed32f43b4 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -21,6 +21,9 @@ $PROJECT="dolibarr"; $PUBLISHBETARC="$ENV{'DESTIASSOLOGIN'}\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files"; $PUBLISHSTABLE="$ENV{'DESTISFLOGIN'}\@frs.sourceforge.net:/home/frs/project/dolibarr"; +# due to implicit origin on git commands, example +# implicit origin, lionel upstream, eric dolibarr +$GITREMOTENAME="$ENV{'GITREMOTENAME'}"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages %REQUIREMENTPUBLISH=( @@ -97,6 +100,13 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"}) exit 1; } +if (! $ENV{"GITREMOTENAME"}) +{ + print "Error: environment variable GITREMOTENAME does not exist.\n"; + print "$PROG.$Extension aborted.\n"; + sleep 2; + exit 1; +} # Detect OS type # -------------- if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; } @@ -442,15 +452,15 @@ if ($nboftargetok) { { print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; $ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`; - print 'Run git push -f --tags'."\n"; - $ret=`git push -f --tags`; + print 'Run git push $GITREMOTENAME -f --tags'."\n"; + $ret=`git push $GITREMOTENAME -f --tags`; #$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`; } } else { - print 'Run git push --tags'."\n"; - $ret=`git push --tags`; + print 'Run git push $GITREMOTENAME --tags'."\n"; + $ret=`git push $GITREMOTENAME --tags`; #$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`; } chdir("$olddir"); From 4cc3be24d3b9590599de33c1dd7b8773dfedc3c4 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 19 Jun 2025 10:46:15 +0200 Subject: [PATCH 36/37] Doc --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index a2ed32f43b4..1e5ebe630b1 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -102,7 +102,7 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"}) if (! $ENV{"GITREMOTENAME"}) { - print "Error: environment variable GITREMOTENAME does not exist.\n"; + print "Error: environment variable GITREMOTENAME does not exist. You can set it to 'origin' or any other git remote name.\n"; print "$PROG.$Extension aborted.\n"; sleep 2; exit 1; From 719de0aef368401035dc913c8654046a52391a5a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 19 Jun 2025 10:51:51 +0200 Subject: [PATCH 37/37] Disable not working github actions --- .../{pr-18-autolabel.yaml => pr-18-autolabel.yaml.disabled} | 0 .github/workflows/{pr-18.yaml => pr-18.yaml.disabled} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{pr-18-autolabel.yaml => pr-18-autolabel.yaml.disabled} (100%) rename .github/workflows/{pr-18.yaml => pr-18.yaml.disabled} (100%) diff --git a/.github/workflows/pr-18-autolabel.yaml b/.github/workflows/pr-18-autolabel.yaml.disabled similarity index 100% rename from .github/workflows/pr-18-autolabel.yaml rename to .github/workflows/pr-18-autolabel.yaml.disabled diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml.disabled similarity index 100% rename from .github/workflows/pr-18.yaml rename to .github/workflows/pr-18.yaml.disabled
'; print $line->LibStatut($obj->statut_ligne, 2); print " "; - print ''; + print ''; print substr('000000'.$obj->rowid_ligne, -6); print '