From ee4776d64ed5184724f6dd661022662cc9caff66 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 9 Oct 2024 01:49:07 +0200 Subject: [PATCH 01/17] Fix: Grand total correction (#31303) --- htdocs/core/tpl/list_print_total.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 8900665eaeb..8990ce12984 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -64,7 +64,8 @@ if (isset($totalarray['pos'])) { while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - printTotalValCell($totalarray['type'][$i], $sumsarray[$totalarray['pos'][$i]]); + $fieldname = preg_replace('/[^a-z0-9]/', '', $totalarray['pos'][$i]); + printTotalValCell($totalarray['type'][$i], $sumsarray[$fieldname]); } else { if ($i == 1) { print ''; From 46671adf1c935c7e776857a27185323a57f5f2d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2024 18:15:02 +0200 Subject: [PATCH 02/17] Fix css --- htdocs/theme/eldy/global.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c8d2c2117fb..57ae6d202a1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6492,6 +6492,7 @@ div.ecmjqft { float: ; right:4px; clear: both; + height: 16px; } #ecm-layout-north { min-height: 40px; From 37e9d4b69e12e2be444ced3473220ff76f799113 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2024 23:53:05 +0200 Subject: [PATCH 03/17] FIX #31015 --- htdocs/compta/facture/class/api_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 07abf2c4c33..12ddc4a7a28 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1502,7 +1502,7 @@ class Invoices extends DolibarrApi // Creation of payment line $paymentobj = new Paiement($this->db); - $paymentobj->datepaye = dol_stringtotime($datepaye); + $paymentobj->datepaye = $datepaye; $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; From aa849f548fa5acca10297130dd2c0870b8def808 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2024 11:28:40 +0200 Subject: [PATCH 04/17] FIX default visiblity --- 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 92ff1bca038..86265c872b8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -600,7 +600,7 @@ class Product extends CommonObject 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), ); /** From add1b28a76b8bd9406adc827f78fd5d580bbd8fa Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 11 Oct 2024 16:02:48 +0200 Subject: [PATCH 05/17] fix: when tobill field is displayes SQL Error (#31358) --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index dddc2f9630a..f19cd312a27 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -539,7 +539,7 @@ if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed $sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_statut, p.datee, p.fk_opp_status, p.public, p.fk_user_creat,"; $sql .= " s.nom, s.rowid,"; $sql .= " t.datec, t.dateo, t.datee, t.tms,"; - $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut as status"; + $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { From 727003e709efc0789fd985ba6722df0cc687372e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2024 19:54:36 +0200 Subject: [PATCH 06/17] FIX Picto menu not visible --- htdocs/core/menus/standard/auguria.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 0d91d521370..6b821ead7a7 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -69,7 +69,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout $classname = 'class="tmenu menuhider nohover"'; $idsel = 'menu'; - $menu->add('#', (getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE') == 1 ? '' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); + $menu->add('#', (getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE') == 1 ? '' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname, ''); } $num = count($newTabMenu); @@ -232,7 +232,7 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode) */ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array()) { - global $langs, $conf; + global $langs; $classnameimg = str_replace('class="', 'class="tmenuimage ', $classname); $classnametxt = str_replace('class="', 'class="tmenulabel ', $classname); From 20e022abeb3daecee9189df56cb2922961e64eae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Oct 2024 00:54:58 +0200 Subject: [PATCH 07/17] Fix log --- htdocs/public/payment/newpayment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 427784d5120..885186e8371 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -358,10 +358,11 @@ $mesg = ''; * Actions */ +// First log into the dolibarr_payment.log file +dol_syslog("--- newpayment.php action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment'); + // Action dopayment is called after clicking/choosing the payment mode if ($action == 'dopayment') { - dol_syslog("--- newpayment.php Execute action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment'); - if ($paymentmethod == 'paypal') { $PAYPAL_API_PRICE = price2num(GETPOST("newamount", 'alpha'), 'MT'); $PAYPAL_PAYMENT_TYPE = 'Sale'; @@ -852,7 +853,6 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); -dol_syslog("--- newpayment.php action = ".$action, LOG_DEBUG, 0, '_payment'); dol_syslog("newpayment.php show page source=".$source." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha')." ref=".$ref, LOG_DEBUG, 0, '_payment'); dol_syslog("_SERVER[SERVER_NAME] = ".(empty($_SERVER["SERVER_NAME"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_NAME"])), LOG_DEBUG, 0, '_payment'); dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_ADDR"])), LOG_DEBUG, 0, '_payment'); From 185d7f435851cba30cdd503c9abec3c31869ea2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Oct 2024 13:18:16 +0200 Subject: [PATCH 08/17] Fix output --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2650e495ab8..99e94aec306 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1360,7 +1360,7 @@ class Form $out .= ''; if (empty($hidelabel)) { - print $langs->trans("RefOrLabel") . ' : '; + $out .= $langs->trans("RefOrLabel") . ' : '; } elseif ($hidelabel > 1) { $placeholder = $langs->trans("RefOrLabel"); if ($hidelabel == 2) { From 21c1c02ef819712b793ac1a4394cc244733bf01d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Oct 2024 17:09:39 +0200 Subject: [PATCH 09/17] FIX #31360 delete contact when using pgsql. --- htdocs/core/lib/company.lib.php | 2 +- htdocs/societe/contact.php | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 411fe6d0663..6ec2b9bb051 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1566,7 +1566,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl // Delete if ($user->hasRight('societe', 'contact', 'delete')) { - print ''; + print ''; print img_delete(); print ''; } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 21f2105d94a..893f21db329 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -140,19 +140,26 @@ if ($action == 'confirm_delete' && $user->hasRight('societe', 'contact', 'delete if (!empty($id) && $socid > 0) { $db->begin(); - $sql = "DELETE t, et FROM ".MAIN_DB_PREFIX."socpeople AS t"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields AS et ON t.rowid = et.fk_object"; - $sql .= " WHERE t.fk_soc = ".((int) $socid); - $sql .= " AND t.rowid = ".((int) $id); - $sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople_extrafields"; + $sql .= " WHERE fk_object = ".((int) $socid); + $sql .= " AND fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople as sp WHERE sp.rowid = ".((int) $socid); + $sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0))"; - $result = $db->query($sql); - if (!$result) { + $result1 = $db->query($sql); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; + $sql .= " WHERE fk_soc = ".((int) $socid); + $sql .= " AND rowid = ".((int) $id); + $sql .= " AND ((fk_user_creat = ".((int) $user->id)." AND priv = 1) OR priv = 0)"; + + $result2 = $db->query($sql); + + if (!$result1 || !$result2) { setEventMessages($db->lasterror(), null, 'errors'); $db->rollback(); } else { $db->commit(); - setEventMessages('ContactDeleted', null, 'mesgs'); + setEventMessages('RecordDeleted', null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$socid); exit(); } From 523d472962fdb30404b537310dcb969ebc36e257 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 13 Oct 2024 17:29:56 +0200 Subject: [PATCH 10/17] ci: Automatically determine version for upgrade sequence (#31344) * ci: Automatically determine version for upgrade sequence This automatically determines the version for the upgrade process to help avoid editing the scripot on version upgrades. * Include filefunc.inc.php to md5sum, remove old som computation --- dev/setup/phpunit/setup_conf.sh | 35 ++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/dev/setup/phpunit/setup_conf.sh b/dev/setup/phpunit/setup_conf.sh index b525f4fa0d9..4fd88149572 100755 --- a/dev/setup/phpunit/setup_conf.sh +++ b/dev/setup/phpunit/setup_conf.sh @@ -128,12 +128,9 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the echo "MySQL flush" ${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES;' - sum=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | LC_ALL=C sort | md5sum) - cnt=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | wc) - echo "OLDSUM $sum COUNT:$cnt" - # shellcheck disable=2046 - sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | LC_ALL=C sort | md5sum) + # filefunc.inc.php holds the version, so include it" + sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum) # shellcheck disable=2046 cnt=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc) echo "NEWSUM $sum COUNT:$cnt" @@ -200,11 +197,39 @@ if [ "$load_cache" != "1" ] ; then ( cd "${TRAVIS_BUILD_DIR}/htdocs/install" || exit 1 + # Get the target version from the filefunc.inc.php file + target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9.]*\\).*/\\1/p" ../filefunc.inc.php) ; echo $target_version + # Default in case that failed + target_version=${target_version:=20.0.0} + + # Sequence of versions for upgrade process (to be completed) VERSIONS=("3.5.0" "3.6.0" "3.7.0" "3.8.0" "3.9.0") VERSIONS+=("4.0.0") VERSIONS+=("5.0.0" "6.0.0" "7.0.0" "8.0.0" "9.0.0") VERSIONS+=("10.0.0" "11.0.0" "12.0.0" "13.0.0" "14.0.0") VERSIONS+=("15.0.0" "16.0.0" "18.0.0" "19.0.0" "20.0.0") + + # Append versions up to the current dolibarr version + last_version=${VERSIONS[-1]} + + target_major=${target_version%%.*} + last_major=${last_version%%.*} + + # Add versions up to target_version + while (( last_major < target_major )); do + ((last_major++)) + VERSIONS+=("${last_major}.0.0") + done + + # Add target_version if it's not already in the list + last_version=${VERSIONS[-1]} + if [[ "${last_version}" != "${target_version}" ]]; then + VERSIONS+=("$target_version") + fi + + last_version=${VERSIONS[-1]} # Keep last_version up-to-date + + # Proceed with the upgrade process pVer=${VERSIONS[0]} for v in "${VERSIONS[@]:1}" ; do LOGNAME="${TRAVIS_BUILD_DIR}/upgrade${pVer//./}${v//./}" From 8aea1a88dd19586285d7bc53258924dab009ba67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 13 Oct 2024 17:30:24 +0200 Subject: [PATCH 11/17] fix translation (#31377) --- 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 c635c26b6f4..167b8026476 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -295,7 +295,7 @@ class Facture extends CommonInvoice 'datef' => array('type' => 'date', 'label' => 'DateInvoice', 'enabled' => 1, 'visible' => 1, 'position' => 20), 'date_valid' => array('type' => 'date', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 22), 'date_lim_reglement' => array('type' => 'date', 'label' => 'DateDue', 'enabled' => 1, 'visible' => 1, 'position' => 25), - 'date_closing' => array('type' => 'datetime', 'label' => 'Date closing', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'date_closing' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => -1, 'position' => 30), 'paye' => array('type' => 'smallint(6)', 'label' => 'InvoicePaidCompletely', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 80), //'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85), //'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>90), From 959392ff2667c5b9bc46acb034a3d0e4bcfe110c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Oct 2024 17:54:51 +0200 Subject: [PATCH 12/17] FIX Clear of option THEME_ELDY_USEBORDERONTABLE --- htdocs/core/lib/usergroups.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 7e205b0394a..f46b2181ba4 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -609,7 +609,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''.$langs->trans("UseBorderOnTable").''; print ''; if ($edit) { - print ajax_constantonoff('THEME_ELDY_USEBORDERONTABLE', array(), null, 0, 0, 1); + print ajax_constantonoff('THEME_ELDY_USEBORDERONTABLE', array(), null, 0, 0, 1, 2, 0, 1); //print $form->selectyesno('THEME_ELDY_USEBORDERONTABLE', $conf->global->THEME_ELDY_USEBORDERONTABLE, 1); } else { print yn(getDolGlobalString('THEME_ELDY_USEBORDERONTABLE')); From e46553079a2b81b69e021ffeeed62e1fba5ad6b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Oct 2024 18:36:32 +0200 Subject: [PATCH 13/17] FIX CSS --- htdocs/comm/index.php | 2 +- htdocs/core/lib/order.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index a4796f9cdda..01c96b952f2 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -1166,7 +1166,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) { print ''; print ''; print ''; - print ''; + print ''; print ''; print '
'.$propalstatic->getNomUrl(1).''.$warning.''.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).''.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'
'; print ''; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 2a8ccfef236..2f2d71a978b 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -316,7 +316,7 @@ function getCustomerOrderPieChart($socid = 0) } } if (!empty($conf->use_javascript_ajax)) { - $result .= ''; + $result .= ''; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); From 822e3cacd81ce5ba0269200431625f061daeb2b8 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:39:14 +0300 Subject: [PATCH 14/17] fix translation for non latin languages (#31343) --- htdocs/product/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 6c8db41eeb7..05843b55d90 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -20,7 +20,7 @@ * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * Copyright (C) 2022 Vincent de Grandpré - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1471,7 +1471,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // SellBy / EatBy mandatory list if (!empty($sellOrEatByMandatoryList)) { - print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->trans('SellByDate'), $langs->trans('EatByDate')).''; + print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).''; print $form->selectarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, GETPOSTINT('sell_or_eat_by_mandatory')); print ''; } @@ -2098,7 +2098,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } else { $sellOrEatByMandatorySelectedId = $object->sell_or_eat_by_mandatory; } - print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->trans('SellByDate'), $langs->trans('EatByDate')).''; + print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).''; print $form->selectarray('sell_or_eat_by_mandatory', $sellOrEatByMandatoryList, $sellOrEatByMandatorySelectedId); print ''; } @@ -2550,7 +2550,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } } - print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->trans('SellByDate'), $langs->trans('EatByDate')).''; + print ''.$langs->trans('BatchSellOrEatByMandatoryList', $langs->transnoentities('SellByDate'), $langs->transnoentities('EatByDate')).''; print $object->getSellOrEatByMandatoryLabel(); print ''; } From b2c59aa934549b0368be0b104ff3382ae3abdc72 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Sun, 13 Oct 2024 20:31:23 +0200 Subject: [PATCH 15/17] Fix: Does not filter correctly by project contacts (#31340) * Fix: Grand total correction * Fix: Does not filter correctly by project contacts --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6ec2b9bb051..acedf4e2fbd 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -10,7 +10,7 @@ * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2024 Ferran Marcet * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -1026,7 +1026,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid"; $sql .= " WHERE sc.fk_soc = ".((int) $object->id); $sql .= " AND p.entity IN (".getEntity('project').")"; - $sql .= " AND tc.element = 'project'"; + $sql .= " AND tc.element = 'project' AND tc.source = 'external'"; $sql .= " ORDER BY p.dateo DESC"; $result = $db->query($sql); From 52a60dc7601dad20a52f7b2aba67a60532634694 Mon Sep 17 00:00:00 2001 From: vladimirdulov Date: Sun, 13 Oct 2024 22:32:12 +0400 Subject: [PATCH 16/17] Undefined stdClass property warnings fixed (#31325) * Undefined stdClass property warnings fixed * execute permissions restored --------- Co-authored-by: Vladimir D --- scripts/user/sync_groups_ldap2dolibarr.php | 4 +-- scripts/user/sync_users_ldap2dolibarr.php | 34 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 9a91d90ede5..f70e3620879 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -142,9 +142,9 @@ if ($result >= 0) { foreach ($ldaprecords as $key => $ldapgroup) { $group = new UserGroup($db); $group->fetch('', $ldapgroup[getDolGlobalString('LDAP_KEY_GROUPS')]); - $group->name = $ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_FULLNAME')]; + $group->name = $ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_FULLNAME')] ?? null; $group->nom = $group->name; // For backward compatibility - $group->note = $ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION')]; + $group->note = $ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION')] ?? null; $group->entity = $conf->entity; // print_r($ldapgroup); diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 40a88d6bad0..46d836ae28f 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -201,30 +201,30 @@ if ($result >= 0) { } // Propriete membre - $fuser->firstname = $ldapuser[getDolGlobalString('LDAP_FIELD_FIRSTNAME')]; - $fuser->lastname = $ldapuser[getDolGlobalString('LDAP_FIELD_NAME')]; - $fuser->login = $ldapuser[getDolGlobalString('LDAP_FIELD_LOGIN')]; - $fuser->pass = $ldapuser[getDolGlobalString('LDAP_FIELD_PASSWORD')]; - $fuser->pass_indatabase_crypted = $ldapuser[getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED')]; + $fuser->firstname = $ldapuser[getDolGlobalString('LDAP_FIELD_FIRSTNAME')] ?? null; + $fuser->lastname = $ldapuser[getDolGlobalString('LDAP_FIELD_NAME')] ?? null; + $fuser->login = $ldapuser[getDolGlobalString('LDAP_FIELD_LOGIN')] ?? null; + $fuser->pass = $ldapuser[getDolGlobalString('LDAP_FIELD_PASSWORD')] ?? null; + $fuser->pass_indatabase_crypted = $ldapuser[getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED')] ?? null; // $user->societe; /* - * $fuser->address=$ldapuser[getDolGlobalString('LDAP_FIELD_ADDRESS')]; - * $fuser->zip=$ldapuser[getDolGlobalString('LDAP_FIELD_ZIP')]; - * $fuser->town=$ldapuser[getDolGlobalString('LDAP_FIELD_TOWN')]; - * $fuser->country=$ldapuser[getDolGlobalString('LDAP_FIELD_COUNTRY')]; + * $fuser->address=$ldapuser[getDolGlobalString('LDAP_FIELD_ADDRESS')] ?? null; + * $fuser->zip=$ldapuser[getDolGlobalString('LDAP_FIELD_ZIP')] ?? null; + * $fuser->town=$ldapuser[getDolGlobalString('LDAP_FIELD_TOWN')] ?? null; + * $fuser->country=$ldapuser[getDolGlobalString('LDAP_FIELD_COUNTRY')] ?? null; * $fuser->country_id=$countries[$hashlib2rowid[strtolower($fuser->country)]]['rowid']; * $fuser->country_code=$countries[$hashlib2rowid[strtolower($fuser->country)]]['code']; */ - $fuser->office_phone = $ldapuser[getDolGlobalString('LDAP_FIELD_PHONE')]; - $fuser->user_mobile = $ldapuser[getDolGlobalString('LDAP_FIELD_MOBILE')]; - $fuser->office_fax = $ldapuser[getDolGlobalString('LDAP_FIELD_FAX')]; - $fuser->email = $ldapuser[getDolGlobalString('LDAP_FIELD_MAIL')]; - $fuser->ldap_sid = $ldapuser[getDolGlobalString('LDAP_FIELD_SID')]; + $fuser->office_phone = $ldapuser[getDolGlobalString('LDAP_FIELD_PHONE')] ?? null; + $fuser->user_mobile = $ldapuser[getDolGlobalString('LDAP_FIELD_MOBILE')] ?? null; + $fuser->office_fax = $ldapuser[getDolGlobalString('LDAP_FIELD_FAX')] ?? null; + $fuser->email = $ldapuser[getDolGlobalString('LDAP_FIELD_MAIL')] ?? null; + $fuser->ldap_sid = $ldapuser[getDolGlobalString('LDAP_FIELD_SID')] ?? null; - $fuser->job = $ldapuser[getDolGlobalString('LDAP_FIELD_TITLE')]; - $fuser->note = $ldapuser[getDolGlobalString('LDAP_FIELD_DESCRIPTION')]; + $fuser->job = $ldapuser[getDolGlobalString('LDAP_FIELD_TITLE')] ?? null; + $fuser->note = $ldapuser[getDolGlobalString('LDAP_FIELD_DESCRIPTION')] ?? null; $fuser->admin = 0; $fuser->socid = 0; $fuser->contact_id = 0; @@ -236,7 +236,7 @@ if ($result >= 0) { * if (isset($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_STATUS')])) { * $fuser->datec=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]); * $fuser->datevalid=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]); - * $fuser->statut=$ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_STATUS')]; + * $fuser->statut=$ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_STATUS')] ?? null; * } */ // if ($fuser->statut > 1) $fuser->statut=1; From ffcc1ee11cca714ce946784d66116c63cca1ea05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 13 Oct 2024 20:52:55 +0200 Subject: [PATCH 17/17] CSS --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d1a278d8681..d25c4db05cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6337,7 +6337,7 @@ function print_barre_liste($title, $page, $file, $options = '', $sortfield = '', do { if ($pagenavastextinput) { if ($cpt == $page) { - $pagelist .= ''; + $pagelist .= ''; $pagelist .= '/'; } } else {