########## accountancy/admin/index.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/admin/index.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/admin/index.php 2025-06-27 11:43:38.979398000 +0000 @@ -433,7 +433,7 @@ // Case of the parameter ACCOUNTING_MODE -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { print '
'; print ''; print ''; @@ -446,7 +446,7 @@ print ' ('.$langs->trans('Default').')'; print ''.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).''; print "\n"; - print ''; + print ''; print ''.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc')).""; print "\n"; @@ -579,16 +579,18 @@ print '
'; -// Show numbering options -print '

'; +print '
'; // Accountancy Numbering model $dirmodels = array_merge(array('/'), $conf->modules_parts['models']); +print load_fiche_titre($langs->trans("BookkeepingNumberingModules"), '', ''); + print '
'; print ''; print ''; -print ''; +print ''; +print ''; print ''; print ''; print ''; ########## accountancy/bookkeeping/balance.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/bookkeeping/balance.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/bookkeeping/balance.php 2025-06-27 11:43:38.909903000 +0000 @@ -344,15 +344,7 @@ $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { - if ($type == 'sub') { - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); - } else { - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly')); - } - - $newcardbutton .= dolGetButtonTitle($langs->trans('ExportToCsv'), '', 'fa fa-file-csv paddingleft', $_SERVER['PHP_SELF'], 'exportcsvbutton', 1, array('morecss' => 'marginleftonly')); + $newcardbutton = ''; print ''; + if ($type == 'sub') { + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); + } else { + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly')); + } + $newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'], 'exportpdfbutton', 1, array('morecss' => 'marginleftonly')); $newcardbutton .= dolGetButtonTitleSeparator(); ########## accountancy/class/bookkeeping.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/class/bookkeeping.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/class/bookkeeping.class.php 2025-06-27 11:43:38.940175000 +0000 @@ -243,7 +243,6 @@ } if (isset($this->doc_ref)) { $this->doc_ref = trim($this->doc_ref); - $this->doc_ref = dol_trunc($this->doc_ref, 300); // We limit to 300 chars to avoid problems with too long ref in DB } if (isset($this->fk_doc)) { $this->fk_doc = (int) $this->fk_doc; @@ -1193,7 +1192,7 @@ // Manage filter if (is_array($filter)) { // deprecated, use $filter = USF syntax - dol_syslog("You are using a deprecated use of fetchAll. filter parameter must be an USF string now.", LOG_WARNING); + dol_syslog("You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING); $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { @@ -3178,7 +3177,7 @@ $error++; } $objtmp = $this->db->fetch_object($result); - $bookkeeping->subledger_label = $objtmp->subledger_label ?? null; // latest subledger label used + $bookkeeping->subledger_label = $objtmp->subledger_label; // latest subledger label used } else { $bookkeeping->subledger_account = null; $bookkeeping->subledger_label = null; @@ -3904,9 +3903,4 @@ * @var int|string */ public $date_lim_reglement; - - /** - * @var string - */ - public $code_tiers; } ########## accountancy/journal/bankjournal.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/journal/bankjournal.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/journal/bankjournal.php 2025-06-27 11:43:38.996125000 +0000 @@ -5,7 +5,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2022 Open-DSI - * Copyright (C) 2013-2025 Alexandre Spangaro + * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2017-2025 Frédéric France @@ -673,7 +673,7 @@ $accountingaccountpayment->fetch(0, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true); $accountingaccountexpensereport = new AccountingAccount($db); - $accountingaccountexpensereport->fetch(0, getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'), true); + $accountingaccountexpensereport->fetch(0, $conf->global->ACCOUNTING_ACCOUNT_EXPENSEREPORT, true); $accountingaccountsuspense = new AccountingAccount($db); $accountingaccountsuspense->fetch(0, getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'), true); ########## accountancy/journal/treasuryjournal.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/accountancy/journal/treasuryjournal.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/accountancy/journal/treasuryjournal.php 2025-06-27 11:43:38.993875000 +0000 @@ -1402,7 +1402,7 @@ print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); } - print '
'; + print '
'; if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL')) { print ''; @@ -1441,6 +1441,7 @@ print '
'; print '
'.$langs->trans("BookkeepingNumberingModules").''.$langs->trans("Name").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'; print ''; + print ""; print ""; print "'; print ""; ########## adherents/class/adherent.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/adherents/class/adherent.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/adherents/class/adherent.class.php 2025-06-27 11:43:39.120796000 +0000 @@ -70,12 +70,12 @@ public $mesgs; /** - * @var ?string login of member + * @var string login of member */ public $login; /** - * @var ?string Clear password in memory + * @var string Clear password in memory */ public $pass; @@ -186,7 +186,7 @@ public $default_lang; /** - * @var ?string photo of member + * @var string photo of member */ public $photo; @@ -225,7 +225,7 @@ public $typeid; /** - * @var ?string label type member + * @var string label type member */ public $type; @@ -536,10 +536,6 @@ global $langs; $birthday = dol_print_date($this->birth, 'day'); - $photo = isset($this->photo) ? $this->photo : ''; - $login = isset($this->login) ? $this->login : ''; - $type = isset($this->type) ? $this->type : ''; - $pass = isset($this->pass) ? $this->pass : ''; $msgishtml = 0; if (dol_textishtml($text, 1)) { @@ -564,11 +560,11 @@ $infos .= $langs->transnoentities("PhonePerso").": ".$this->phone_perso."\n"; $infos .= $langs->transnoentities("PhoneMobile").": ".$this->phone_mobile."\n"; if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED')) { - $infos .= $langs->transnoentities("Login").": ".$login."\n"; - $infos .= $langs->transnoentities("Password").": ".$pass."\n"; + $infos .= $langs->transnoentities("Login").": ".$this->login."\n"; + $infos .= $langs->transnoentities("Password").": ".$this->pass."\n"; } $infos .= $langs->transnoentities("Birthday").": ".$birthday."\n"; - $infos .= $langs->transnoentities("Photo").": ".$photo."\n"; + $infos .= $langs->transnoentities("Photo").": ".$this->photo."\n"; $infos .= $langs->transnoentities("Public").": ".yn($this->public); // Substitutions @@ -587,13 +583,13 @@ '__COUNTRY__' => $msgishtml ? dol_htmlentitiesbr($this->country) : ($this->country ? $this->country : ''), '__EMAIL__' => $msgishtml ? dol_htmlentitiesbr((string) $this->email) : ($this->email ? $this->email : ''), '__BIRTH__' => $msgishtml ? dol_htmlentitiesbr($birthday) : ($birthday ? $birthday : ''), - '__PHOTO__' => $msgishtml ? dol_htmlentitiesbr($photo) : $photo, - '__LOGIN__' => $msgishtml ? dol_htmlentitiesbr($login) : $login, - '__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($pass) : $pass, + '__PHOTO__' => $msgishtml ? dol_htmlentitiesbr($this->photo) : ($this->photo ? $this->photo : ''), + '__LOGIN__' => $msgishtml ? dol_htmlentitiesbr($this->login) : ($this->login ? $this->login : ''), + '__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($this->pass) : ($this->pass ? $this->pass : ''), '__PHONE__' => $msgishtml ? dol_htmlentitiesbr($this->phone) : ($this->phone ? $this->phone : ''), '__PHONEPRO__' => $msgishtml ? dol_htmlentitiesbr($this->phone_perso) : ($this->phone_perso ? $this->phone_perso : ''), '__PHONEMOBILE__' => $msgishtml ? dol_htmlentitiesbr($this->phone_mobile) : ($this->phone_mobile ? $this->phone_mobile : ''), - '__TYPE__' => $msgishtml ? dol_htmlentitiesbr($type) : $type, + '__TYPE__' => $msgishtml ? dol_htmlentitiesbr($this->type) : ($this->type ? $this->type : '') ); complete_substitutions_array($substitutionarray, $langs, $this); @@ -960,6 +956,9 @@ $result = $luser->fetch($this->user_id); if ($result >= 0) { + //var_dump($this->user_login);exit; + //var_dump($this->login);exit; + // If option ADHERENT_LOGIN_NOT_REQUIRED is on, there is no login of member, so we do not overwrite user login to keep existing one. if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED')) { $luser->login = $this->login; @@ -970,7 +969,7 @@ $luser->firstname = $this->firstname; $luser->lastname = $this->lastname; $luser->gender = $this->gender; - $luser->pass = isset($this->pass) ? $this->pass : ''; + $luser->pass = $this->pass; //$luser->socid=$this->fk_soc; // We do not enable this. This may transform a user into an external user. $luser->birth = $this->birth; @@ -1777,7 +1776,7 @@ * @param string $emetteur_banque Name of bank of cheque * @param int $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice. * @param string $ext_payment_id External id of payment (for example Stripe charge id) - * @param string $ext_payment_site Name of external paymentmode (for example 'StripeLive', 'StripeTest', 'paypal', ...) + * @param string $ext_payment_site Name of external paymentmode (for example 'stripe') * @return int Return integer <0 if KO, >0 if OK */ public function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0, $ext_payment_id = '', $ext_payment_site = '') @@ -2464,7 +2463,7 @@ ($morecss ? ' usertext'.$morecss : '').'">'; } if ($mode == 'login') { - $result .= dol_trunc(isset($this->login) ? $this->login : '', $maxlen); + $result .= dol_trunc($this->login, $maxlen); } elseif ($mode == 'ref') { $result .= $this->ref; } else { @@ -2507,7 +2506,7 @@ */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->status, $this->need_subscription, $this->datefin, $mode); + return $this->LibStatut($this->statut, $this->need_subscription, $this->datefin, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps ########## adherents/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/adherents/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/adherents/list.php 2025-06-27 11:43:39.129841000 +0000 @@ -1292,14 +1292,14 @@ } // Technical ID if (!empty($arrayfields['d.rowid']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Ref if (!empty($arrayfields['d.ref']['checked'])) { - print '\n"; if (!$i) { @@ -1309,7 +1309,7 @@ // Title/Civility if (!empty($arrayfields['d.civility']['checked'])) { print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -1348,13 +1348,13 @@ } // Company if (!empty($arrayfields['d.company']['checked'])) { - print '\n"; } // Login if (!empty($arrayfields['d.login']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1382,7 +1382,7 @@ // Address if (!empty($arrayfields['d.address']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1391,7 +1391,7 @@ // Zip if (!empty($arrayfields['d.zip']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1400,7 +1400,7 @@ // Town if (!empty($arrayfields['d.town']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1409,7 +1409,7 @@ // State / County / Departement if (!empty($arrayfields['state.nom']['checked'])) { print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -1418,8 +1418,8 @@ // Country if (!empty($arrayfields['country.code_iso']['checked'])) { $tmparray = getCountry($obj->country, 'all'); - print ''; if (!$i) { $totalarray['nbfield']++; @@ -1523,8 +1523,8 @@ } // Import key if (!empty($arrayfields['d.import_key']['checked'])) { - print '\n"; if (!$i) { $totalarray['nbfield']++; ########## admin/agenda_extsites.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/agenda_extsites.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/agenda_extsites.php 2025-06-27 11:43:39.332503000 +0000 @@ -292,7 +292,7 @@ print ''; // Color (Possible colors are limited by Google) print ''; // Calendar active by default print '"; // Color print ''; print ""; $i++; ########## admin/barcode.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/barcode.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/barcode.php 2025-06-27 11:43:39.184809000 +0000 @@ -206,7 +206,7 @@ // Select barcode numbering module if (isModEnabled('product')) { - print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', 'product'); + print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', ''); print '
'; print '
".$langs->trans("Date")."".$langs->trans("Piece").' ('.$langs->trans("ObjectsRef").')".$langs->trans("AccountAccounting")."'.dolPrintHTML($obj->rowid).''.$obj->rowid.''; + print ""; print $memberstatic->getNomUrl(-1, 0, 'card', 'ref', '', -1, 0, 1); print ""; - print dolPrintHTML($obj->civility); + print dol_escape_htmltag($obj->civility); print "'; + print ''; print $companynametoshow; print "'.dolPrintHTML($obj->login)."'.$obj->login."'; - print dolPrintHTML($obj->address); + print dol_escape_htmltag($obj->address); print ''; - print dolPrintHTML($obj->zip); + print dol_escape_htmltag($obj->zip); print ''; - print dolPrintHTML($obj->town); + print dol_escape_htmltag($obj->town); print '"; - print dolPrintHTML($obj->state_name); + print dol_escape_htmltag($obj->state_name); print "'; - print dolPrintHTML($tmparray['label']); + print ''; + print dol_escape_htmltag($tmparray['label']); print ''; - print dolPrintHTML($obj->import_key); + print ''; + print dol_escape_htmltag($obj->import_key); print "'; - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, '', 1, array(), 'hideifnotset'); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, array(), 'hideifnotset'); print ''; ########## admin/agenda_other.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/agenda_other.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/agenda_other.php 2025-06-27 11:43:39.333710000 +0000 @@ -101,7 +101,7 @@ dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); $defaultValues = new DefaultValues($db); - $result = $defaultValues->fetchAll('', '', 0, 0, "(t.page:=:'comm/action/card.php') AND (t.param:=:'complete') AND (t.user_id:=:0) AND (t.type:=:'createform') AND (t.entity:=:".((int) $conf->entity).")"); + $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity)); if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } elseif (count($result) > 0) { @@ -391,7 +391,7 @@ print ''."\n"; $defval = 'na'; $defaultValues = new DefaultValues($db); -$result = $defaultValues->fetchAll('', '', 0, 0, "(t.page:=:'comm/action/card.php') AND (t.param:=:'complete') AND (t.user_id:=:0) AND (t.type:=:'createform') AND (t.entity:=:".((int) $conf->entity).")"); +$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => (string) $conf->entity)); if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } elseif (count($result) > 0) { ########## admin/bank.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/bank.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/bank.php 2025-06-27 11:43:39.337367000 +0000 @@ -478,7 +478,7 @@ print ''.$langs->trans("BankColorizeMovementName".$key)."'; - print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ? GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : getDolGlobalString($color)), "BANK_COLORIZE_MOVEMENT_COLOR".$key, '', 1, array(), 'right hideifnotset'); + print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ? GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : getDolGlobalString($color)), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, array(), 'right hideifnotset'); print '
'; @@ -264,16 +264,12 @@ } } print "
\n"; - - print dolButtonToOpenUrlInDialogPopup('barcodeinitproduct', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small'); - print '


'; - print '
'; } // Select barcode numbering module if (isModEnabled('societe')) { - print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', 'company'); + print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("ThirdParty").")", '', ''); print '
'; print ''; @@ -312,7 +308,7 @@ print ''; print '\n"; - if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') == "$file") { + if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM') && $conf->global->BARCODE_THIRDPARTY_ADDON_NUM == "$file") { print ''; @@ -332,17 +328,14 @@ } } print "
'.$modBarCode->getExample($langs)."'; print img_picto($langs->trans("Activated"), 'switch_on'); print '
\n"; - - print dolButtonToOpenUrlInDialogPopup('barcodeinitthirdparty', $langs->trans("MassBarcodeInit"), $langs->trans("GoOnThisPageToInitBarCode").' '.img_picto('', 'url'), '/barcode/codeinit.php', '', 'small'); - print '


'; - print '
'; } /* - * CHOOSE ENCODING + * CHOIX ENCODAGE */ +print '
'; print load_fiche_titre($langs->trans("BarcodeEncodeModule"), '', ''); if (empty($conf->use_javascript_ajax)) { @@ -479,7 +472,7 @@ // Module products if (isModEnabled('product')) { print ''; - print ''.img_picto('', 'product', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeProducts").''; + print ''.$langs->trans("SetDefaultBarcodeTypeProducts").''; print ''; print $formbarcode->selectBarcodeType(getDolGlobalInt('PRODUIT_DEFAULT_BARCODE_TYPE'), "PRODUIT_DEFAULT_BARCODE_TYPE", 1); print ''; @@ -490,7 +483,7 @@ // Module thirdparty if (isModEnabled('societe')) { print ''; - print ''.img_picto('', 'company', 'class="pictofixedwidth"').$langs->trans("SetDefaultBarcodeTypeThirdParties").''; + print ''.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; print ''; print $formbarcode->selectBarcodeType(getDolGlobalInt('GENBARCODE_BARCODETYPE_THIRDPARTY'), "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print ''; ########## admin/company.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/company.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/company.php 2025-06-27 11:43:39.342361000 +0000 @@ -74,8 +74,6 @@ // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('admincompany', 'globaladmin')); -$object = new Societe($db); - /* * Actions @@ -453,11 +451,11 @@ print ''; print ''; -print ''."\n"; +print ''."\n"; // Company name print ''."\n"; +print ''."\n"; // Main currency print ''."\n"; +print ''."\n"; // Zip print ''."\n"; +print ''."\n"; print ''."\n"; +print ''."\n"; // State print ''; +print ''; print ''."\n"; // Phone mobile print ''; +print ''; print ''."\n"; // Fax print ''; +print ''; print ''."\n"; // Email print ''; +print ''; print ''."\n"; // Web print ''; +print ''; print ''."\n"; // Barcode @@ -529,7 +527,7 @@ print ''; + print ''; print ''; } @@ -565,7 +563,7 @@ // Note print ''; +print ''; print ''; print '
'.$langs->trans("CompanyInfo").'
'.$langs->trans("CompanyInfo").'
'; -print '
'; @@ -474,14 +472,14 @@ // Address print '
'; -print '
'; -print '
'; -print '
'; @@ -497,31 +495,31 @@ // Phone print '
'; print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'object_phoning_mobile', '', 0, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth'); -print '
'; print ''; print ''; - print '
'; -print '
'; @@ -578,23 +576,23 @@ // IDs of the company (country-specific) print '
'; print ''; -print ''; +print ''; $langs->load("companies"); // Managing Director(s) print ''; +print ''; // GDPR contact print ''; +print 'global->MAIN_INFO_GDPR : ''))).'">'; // Capital print ''; +print ''; // Juridical Status print ''; +print ''; print ''; // Tax ID Intra-community VAT number print ''; // ProfId1 if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { print '\n"; print ''; +print $formother->select_month(getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; print "
'.$langs->trans("CompanyIds").'
'.$langs->trans("CompanyIds").'
'; -print '
'; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; -print '
'; -print '
'; @@ -607,19 +605,19 @@ // Object of the company print '
'; -print '
'; -print ''; +print ''; print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -630,7 +628,7 @@ if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -641,7 +639,7 @@ if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -652,7 +650,7 @@ if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -663,7 +661,7 @@ if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -674,7 +672,7 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -685,7 +683,7 @@ if ($langs->transcountry("ProfId7", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -696,7 +694,7 @@ if ($langs->transcountry("ProfId8", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -707,7 +705,7 @@ if ($langs->transcountry("ProfId9", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -718,7 +716,7 @@ if ($langs->transcountry("ProfId10", $mysoc->country_code) != '-') { print '
'; if (!empty($mysoc->country_code)) { - print ''; + print ''; } else { print $countrynotdefined; } @@ -737,7 +735,7 @@ print "
'; -print $formother->select_month(getDolGlobalString('SOCIETE_FISCAL_MONTH_START'), 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'
"; ########## admin/compta.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/compta.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/compta.php 2025-06-27 11:43:39.240631000 +0000 @@ -134,7 +134,6 @@ } } - /* * View */ @@ -159,11 +158,11 @@ print ''; print ''.$langs->trans('OptionMode').''; print "\n"; -print ''; -print ''.nl2br($langs->trans('OptionModeVirtualDesc'))."\n"; -print ''; +print ''; print ''.nl2br($langs->trans('OptionModeTrueDesc')); print "\n"; +print ''; +print ''.nl2br($langs->trans('OptionModeVirtualDesc'))."\n"; print "\n"; ########## admin/defaultvalues.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/defaultvalues.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/defaultvalues.php 2025-06-27 11:43:39.420448000 +0000 @@ -368,8 +368,8 @@ print ''; print ''."\n"; print ''."\n"; -//"(t.type:=:".$mode.") AND (t.entity:in:("((int)$user->entity).", ".((int)$conf->entity)."))" -$result = $object->fetchAll($sortorder, $sortfield, 0, 0, "(t.type:=:'".$mode."') AND (t.entity:in:".((int) $user->entity).", ".((int) $conf->entity).")"); + +$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type' => $mode, 't.entity' => array($user->entity,$conf->entity))); if (!is_array($result) && $result < 0) { setEventMessages($object->error, $object->errors, 'errors'); ########## admin/dict.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/dict.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/dict.php 2025-06-27 11:43:39.246789000 +0000 @@ -273,7 +273,7 @@ $tabsql[DICT_CIVILITY] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c"; $tabsql[DICT_ACTIONCOMM] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; $tabsql[DICT_CHARGESOCIALES] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays = c.rowid and c.active = 1"; -$tabsql[DICT_TYPENT] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.module, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid"; +$tabsql[DICT_TYPENT] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid"; $tabsql[DICT_CURRENCIES] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c"; $tabsql[DICT_TVA] = "SELECT t.rowid, t.entity, t.code, t.type_vat, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.fk_department_buyer as department_buyer_id, db.nom as department_buyer, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy, t.use_default FROM ".MAIN_DB_PREFIX."c_tva as t INNER JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_pays = c.rowid LEFT JOIN ".MAIN_DB_PREFIX."c_departements as db ON t.fk_department_buyer = db.rowid WHERE t.entity IN (".getEntity($tabname[DICT_TVA]).")"; $tabsql[DICT_TYPE_CONTACT] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; @@ -367,7 +367,7 @@ $tabfield[DICT_CIVILITY] = "code,label"; $tabfield[DICT_ACTIONCOMM] = "code,libelle,type,color,position"; $tabfield[DICT_CHARGESOCIALES] = "code,libelle,country,accountancy_code"; -$tabfield[DICT_TYPENT] = "code,libelle,module,country_id,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : ''); +$tabfield[DICT_TYPENT] = "code,libelle,country_id,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : ''); $tabfield[DICT_CURRENCIES] = "code,label,unicode"; $tabfield[DICT_TVA] = "country_id,country,department_buyer_id,department_buyer,code,type_vat,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,use_default,note"; $tabfield[DICT_TYPE_CONTACT] = "element,source,code,libelle,position"; @@ -2317,7 +2317,7 @@ $canbedisabled = 0; } } - if ($id == DICT_TYPE_CONTAINER && $obj->module == 'system') { + if ($id == DICT_TYPE_CONTAINER && in_array($obj->code, array('banner', 'blogpost', 'menu', 'page', 'other', 'service', 'library'))) { $iserasable = 0; $canbedisabled = 0; if (in_array($obj->code, array('banner'))) { ########## admin/modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/modules.php 2025-06-27 11:43:39.290847000 +0000 @@ -72,10 +72,8 @@ } $action = GETPOST('action', 'aZ09'); -$page_y = GETPOSTINT('page_y'); -$optioncss = GETPOST('optioncss', 'aZ09'); - $value = GETPOST('value', 'alpha'); +$page_y = GETPOSTINT('page_y'); $search_keyword = GETPOST('search_keyword', 'alpha'); $search_status = GETPOST('search_status', 'alpha'); $search_nature = GETPOST('search_nature', 'alpha'); @@ -85,14 +83,10 @@ // For remotestore search $options = array(); $options['per_page'] = 11; -$options['no_page'] = (GETPOSTINT('no_page') ? GETPOSTINT('no_page') : 1); -$options['categorie'] = (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0); +$options['no_page'] = ((int) GETPOSTINT('no_page') ? GETPOSTINT('no_page') : 1); +$options['categorie'] = ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0)); $options['search'] = GETPOST('search_keyword', 'alpha'); -// If it is a new search, we reset page to 1 -if (GETPOST('buttonsubmit', 'alphanohtml', 2)) { - $options['no_page'] = 1; -} // MAIN_ENABLE_EXTERNALMODULES_DOLISTORE is 1 if we enabled the dolistore modules $options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE'); @@ -458,6 +452,7 @@ } + /* * View */ @@ -773,10 +768,10 @@ $moreforfilter .= '
'; $moreforfilter .= ' '; $moreforfilter .= '
'; - $moreforfilter .= ''; + $moreforfilter .= ''; if ($search_keyword || ($search_nature && $search_nature != '-1') || ($search_version && $search_version != '-1') || ($search_status && $search_status != '-1')) { $moreforfilter .= ' '; - $moreforfilter .= ''; + $moreforfilter .= ''; } $moreforfilter .= '
'; $moreforfilter .= ''; @@ -1336,15 +1331,12 @@
- +
- - '.$langs->trans('Reset').''; - } - ?> + + ">trans('Reset') ?> +  
'; print ''; print '1 '.$conf->currency.' = '; - print ' '.$currency->code.' '; + print ' '.$currency->code.' '; print ' '; print ''; print '
'; ########## admin/pdf_other.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/pdf_other.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/pdf_other.php 2025-06-27 11:43:39.172469000 +0000 @@ -483,6 +483,7 @@ } print ''; + /* too late to have it enabled by default in v21 print ''; print $form->textwithpicto($langs->trans("PDF_INVOICE_SHOW_VAT_ANALYSIS"), ''); print ''; @@ -493,7 +494,7 @@ print $form->selectarray("PDF_INVOICE_SHOW_VAT_ANALYSIS", $arrval, $conf->global->PDF_INVOICE_SHOW_VAT_ANALYSIS); } print ''; - + */ /* Keep this option hidden for the moment to avoid options inflation. We'll see later if it is used enough... print ''; ########## admin/propal_pdf.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/propal_pdf.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/propal_pdf.php 2025-06-27 11:43:39.176056000 +0000 @@ -143,7 +143,7 @@ print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL', array(), null, 0, 0, 1); + print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL); @@ -164,48 +164,40 @@ print ''; print ''; -if (empty($conf->use_javascript_ajax)) { - print '
'; -} - +print load_fiche_titre($langs->trans("FileToConcatToGeneratedPDF"), '', 'file'); -if (getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) { - print '
'; - print load_fiche_titre($langs->trans("FileToConcatToGeneratedPDF"), '', 'file'); - - print '
'; - print ''; - print ''; - - // Terms of sale - $tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf'; - $maxfilesizearray = getMaxFileSizeArray(); - $tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; - $documenturl = DOL_URL_ROOT.'/document.php'; - if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { - $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; - } - $modulepart = 'propal'; +print '
'; +print '
'.$langs->trans("Parameters").'
'; +print ''; + +// Terms of sale +$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf'; +$maxfilesizearray = getMaxFileSizeArray(); +$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; +$documenturl = DOL_URL_ROOT.'/document.php'; +if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { + $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; +} +$modulepart = 'propal'; - print ''; - print '
'.$langs->trans("Parameters").'
'; - print '
'; - print ''; - if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) { - $termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE"); - if (file_exists($conf->propal->dir_output.'/'.$termofsale)) { - $file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale); - print '
'.$termofsale.''.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, ''); - print ''; - } +print '
'; +print '
'; +print ''; +if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) { + $termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE"); + if (file_exists($conf->propal->dir_output.'/'.$termofsale)) { + $file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale); + print '
'.$termofsale.''.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, ''); + print ''; } - print '
'; - print '
'; - print '
'; - - print '
'; } +print ''; +print ''; +print ''; +print ''; + +print '
'; print ''; ########## admin/remotestore/class/externalModules.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/remotestore/class/externalModules.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/remotestore/class/externalModules.class.php 2025-06-27 11:43:39.303148000 +0000 @@ -460,8 +460,8 @@ // Set and check version $version = ''; - if ($this->versionCompare($product["dolibarr_min"], $dolibarrversiontouse) <= 0) { - if (!empty($product["dolibarr_max"]) && $product["dolibarr_max"] != 'auto' && $product["dolibarr_max"] != 'unknown' && $this->versionCompare($product["dolibarr_max"], $dolibarrversiontouse) >= 0) { + if ($this->version_compare($product["dolibarr_min"], $dolibarrversiontouse) <= 0) { + if (!empty($product["dolibarr_max"]) && $product["dolibarr_max"] != 'auto' && $product["dolibarr_max"] != 'unknown' && $this->version_compare($product["dolibarr_max"], $dolibarrversiontouse) >= 0) { //compatible $version = ''.$langs->trans( 'CompatibleUpTo', @@ -508,7 +508,7 @@ $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html $html .= ''; $html .= '

'; - $html .= dolPrintHTML(dol_string_nohtmltag($product["label"])); + $html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"])); $html .= '
'; $html .= $version; // No dol_escape_htmltag, it is already escape html $html .= '

'; @@ -518,11 +518,11 @@ } else { $html .= ''.dol_print_date(dol_stringtotime($product['tms']), 'day').''; } - $html .= ' - '.$langs->trans('Ref').' '.dolPrintHTML($product["ref"]); + $html .= ' - '.$langs->trans('Ref').' '.dol_escape_htmltag($product["ref"]); //$html .= ' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product["id"]); $html .= '
'; $html .= ''.$langs->trans('Source').': '.$product["source"].'
'; - $html .= '
'.dolPrintHTML(dol_string_nohtmltag($product["description"])); + $html .= '
'.dol_escape_htmltag(dol_string_nohtmltag($product["description"])); $html .= ''; // do not load if display none $html .= ''; @@ -568,6 +568,7 @@ }; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * version compare * @@ -575,12 +576,9 @@ * @param string $v2 version 2 * @return int result of compare */ - public function versionCompare($v1, $v2) + public function version_compare($v1, $v2) { - // Clean v1 and v2 - $v1 = str_replace(array('v', 'V'), '', $v1); - $v2 = str_replace(array('v', 'V'), '', $v2); - + // phpcs:enable $v1 = explode('.', $v1); $v2 = explode('.', $v2); $ret = 0; @@ -780,8 +778,8 @@ } } - if (!empty($request['curl_error_msg'])) { - $error_message .= ' - ' . $request['curl_error_msg']; + if (!empty($request['response']['curl_error_msg'])) { + $error_message .= ' - ' . $request['response']['curl_error_msg']; } // Return the formatted error message ########## admin/security.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/security.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/security.php 2025-06-27 11:43:39.309673000 +0000 @@ -444,7 +444,7 @@ print ''; print ''.$langs->trans("MainDbPasswordFileConfEncrypted").''; print ''; -if (preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { +if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { print img_picto($langs->trans("Active"), 'tick'); } @@ -483,7 +483,7 @@ print ""; } if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) { - print ''; + print ''; print ''.$langs->trans("Disable").''; print ""; } ########## admin/security_other.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/security_other.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/security_other.php 2025-06-27 11:43:39.349396000 +0000 @@ -214,6 +214,19 @@ print ''; print ''; +/* +if (empty($conf->global->MAIN_APPLICATION_TITLE)) { + $conf->global->MAIN_APPLICATION_TITLE = ""; +} +print ''; +print ''.$langs->trans("MAIN_APPLICATION_TITLE").''; +print ''; +print ''; +print ' '; +print ''; +print ''; +*/ + print ''; print $form->buttonsSaveCancel("Modify", ''); ########## admin/system/perf.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/system/perf.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/system/perf.php 2025-06-27 11:43:39.218262000 +0000 @@ -480,7 +480,7 @@ print img_picto('', 'folder', 'class="pictofixedwidth"'); print ''.$langs->trans("HTTPCacheStaticResources").' - '.$langs->trans("CacheByClient").'
'; print '
'; -print '
'.img_picto('', 'question.png', 'class="pictofixedwidth"').' '.$langs->trans("TestNotPossibleWithCurrentBrowsers").'
'; +print '
'.img_picto('', 'question.png', 'class="pictofixedwidth"').' '.$langs->trans("TestNotPossibleWithCurrentBrowsers").'
'; print '
'; @@ -704,8 +704,7 @@ print img_picto('', 'minus', 'class="pictofixedwidth"'); } print $form->textwithpicto($langs->trans("EnableFileCache").' ('.$langs->trans("Widgets").')', $langs->trans("Option").' MAIN_ACTIVATE_FILECACHE'); -print ': '; -print yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE')); +print ': '.yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE')); print '
'; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { @@ -713,8 +712,7 @@ } else { print img_picto('', 'minus', 'class="pictofixedwidth"'); } -print $form->textwithpicto($langs->trans('MAIN_ENABLE_AJAX_TOOLTIP'), $langs->trans("Option").' MAIN_ENABLE_AJAX_TOOLTIP'); -print ': '; +print 'MAIN_ENABLE_AJAX_TOOLTIP : '; print yn(getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')); print '
'; @@ -724,8 +722,7 @@ } else { print img_picto('', 'minus', 'class="pictofixedwidth"'); } -print $form->textwithpicto($langs->trans('MAIN_CACHE_COUNT'), $langs->trans("Option").' MAIN_CACHE_COUNT'); -print ': '; +print 'MAIN_CACHE_COUNT : '; print yn(getDolGlobalInt('MAIN_CACHE_COUNT')); //.' '.img_picto('', 'warning.png'); print '
'; @@ -744,8 +741,7 @@ } else { print img_picto('', 'minus', 'class="pictofixedwidth"'); } -print $form->textwithpicto($langs->trans('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST'), $langs->trans("Option").' MAIN_DO_FETCH_IN_ONE_SQL_REQUEST'); -print ' = '.getDolGlobalString('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST', ''.$langs->trans("Undefined").''); +print 'MAIN_DO_FETCH_IN_ONE_SQL_REQUEST = '.getDolGlobalString('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST', ''.$langs->trans("Undefined").''); //print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)
')."
"; print '
'; print ''; ########## admin/system/security.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/system/security.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/system/security.php 2025-06-27 11:43:39.219809000 +0000 @@ -527,7 +527,7 @@ /* $usepassinconfencrypted = 0; global $dolibarr_main_db_pass, $dolibarr_main_db_encrypted_pass; -if (preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { +if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { $usepassinconfencrypted = 1; } print ''.$langs->trans("MainDbPasswordFileConfEncrypted").': '; ########## admin/ticket.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/ticket.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/ticket.php 2025-06-27 11:43:39.192241000 +0000 @@ -198,7 +198,7 @@ include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; $notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha'); - $notification_email_description = "Email of user allowed to send ticket replies from Dolibarr"; + $notification_email_description = "Sender of ticket replies sent from Dolibarr"; if (!empty($notification_email)) { $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, $notification_email_description, $conf->entity); } else { // If an empty e-mail address is providen, use the global "FROM" since an empty field will cause other issues @@ -208,17 +208,6 @@ $error++; } - $notification_email_replyto = GETPOST('TICKET_NOTIFICATION_EMAIL_REPLYTO', 'alpha'); - $notification_email_replyto_description = "Email that must appears as the sender of ticket replies sent from Dolibarr"; - if (!empty($notification_email)) { - $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_REPLYTO', $notification_email_replyto, 'chaine', 0, $notification_email_replyto_description, $conf->entity); - } else { - $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_EMAIL_FROM'), 'chaine', 0, $notification_email_replyto_description, $conf->entity); - } - if (!($res > 0)) { - $error++; - } - // altairis : differentiate notification email FROM and TO $notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha'); $notification_email_to_description = "Notified e-mail for ticket replies sent from Dolibarr"; @@ -656,7 +645,7 @@ print "\n"; } -// Email of sender allowed to send technical notifications +// Email to send notifications print ''; print ''; print img_picto('', 'email', 'class="pictofixedwidth"'); @@ -666,16 +655,6 @@ print ''; print ''; -// Email that must appears as the sender of email notifications -print ''; -print ''; -print img_picto('', 'email', 'class="pictofixedwidth"'); -print ''; -print ''; -print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationReplyToHelp"), 1, 'help'); -print ''; -print ''; - print ''; print ''; ########## admin/tools/listevents.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/listevents.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/listevents.php 2025-06-27 11:43:39.368989000 +0000 @@ -72,7 +72,7 @@ $search_desc = GETPOST("search_desc", "alpha"); $search_ua = GETPOST("search_ua", "restricthtml"); $search_prefix_session = GETPOST("search_prefix_session", "restricthtml"); -$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity')); // TODO Replace with $search_entity = GETPOSTINT('search_entity') when the filter is available on screen for this page +$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity')); $now = dol_now(); $nowarray = dol_getdate($now); ########## admin/tools/ui/class/documentation.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/ui/class/documentation.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/ui/class/documentation.class.php 2025-06-27 11:43:39.409575000 +0000 @@ -259,15 +259,14 @@ } /** - * Output header + body + * Output header + body * * @param string $title Title of page - * @param string[] $arrayofjs Array of complementary js files - * @param string[] $arrayofcss Array of complementary css files - * @param string $hidenavmenu Hide nav menu + * @param string[] $arrayofjs Array of complementary js files + * @param string[] $arrayofcss Array of complementary css files * @return void */ - public function docHeader($title = '', $arrayofjs = [], $arrayofcss = [], $hidenavmenu = '') + public function docHeader($title = '', $arrayofjs = [], $arrayofcss = []) { global $langs; $title = (!empty($title)) ? dol_escape_htmltag($title) : $langs->trans('Documentation'); @@ -276,7 +275,7 @@ top_htmlhead('', $title, 0, 0, $arrayofjs, $arrayofcss); - print ''; + print ''; } /** ########## admin/tools/ui/components/icons.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/ui/components/icons.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/ui/components/icons.php 2025-06-27 11:43:39.381047000 +0000 @@ -42,7 +42,7 @@ $documentation = new Documentation($db); // Output html head + body - Param is Title -$documentation->docHeader('Icons', [], ['admin/tools/ui/css/doc-icons.css'], GETPOST('hidenavmenu')); +$documentation->docHeader('Icons', [], ['admin/tools/ui/css/doc-icons.css']); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class ########## admin/tools/ui/css/documentation.css --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/tools/ui/css/documentation.css 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/tools/ui/css/documentation.css 2025-06-27 11:43:39.391538000 +0000 @@ -109,7 +109,6 @@ /* Documentation summary */ .doc-wrapper .doc-content-wrapper .summary-wrapper {margin-bottom: 32px;} -.doc-wrapper-bis .doc-content-wrapper .summary-wrapper {margin-bottom: 32px;} .doc-wrapper .doc-content-wrapper ul.documentation-summary {margin: 0;padding: 0;color: rgba(0, 0, 0, .25);} .doc-wrapper .doc-content-wrapper ul.documentation-summary li {list-style: disc;margin-left: 16px;} .doc-wrapper .doc-content-wrapper ul.documentation-summary li ul {margin: 0;padding: 0 ;color: rgba(0, 0, 0, .25);} ########## admin/translation.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/admin/translation.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/admin/translation.php 2025-06-27 11:43:39.304818000 +0000 @@ -363,22 +363,15 @@ $disablededit = ' disabled'; } - $text = $langs->trans("SomeTranslationAreUncomplete"); + $infoOnTransProcess = '
'; + $infoOnTransProcess .= img_info().' '.$langs->trans("SomeTranslationAreUncomplete"); $urlwikitranslatordoc = 'https://wiki.dolibarr.org/index.php/Translator_documentation'; - $text .= ' - '.$langs->trans("SeeAlso", $langs->transnoentitiesnoconv("Here")).' '.img_picto('', 'url').'.
'; - $infoOnTransProcess = info_admin($text); - - $infoOnTransProcess .= '
'; - $infoOnTransProcess .= ''; + $infoOnTransProcess .= ' ('.str_replace('{s1}', ''.$langs->trans("Here").'', $langs->trans("SeeAlso", '{s1}')).')
'; + $infoOnTransProcess .= '
'; $infoOnTransProcess .= $langs->trans("TranslationOverwriteDesc", $langs->transnoentitiesnoconv("Language"), $langs->transnoentitiesnoconv("TranslationKey"), $langs->transnoentitiesnoconv("NewTranslationStringToShow"))."\n"; $infoOnTransProcess .= ' ('.$langs->trans("TranslationOverwriteDesc2").').'."
\n"; $infoOnTransProcess .= '
'; - // If a cache for translation is on, show a warning. - if (isModEnabled('memcached') || getDolGlobalInt('MAIN_USE_CACHE_FOR_TRANSLATION')) { - $infoOnTransProcess .= info_admin($langs->trans("CacheForTranslationIsUsed"), 0, 0, '1', 'warning'); - } - print $infoOnTransProcess; print '
'; @@ -650,8 +643,8 @@ } print ''; print dolPrintHTML($val); - if (substr_count($langsenfileonly->tab_translate[$key], '%s') > 5) { - print '
Error, more than 5 %s in the source
'; + if (substr_count($langsenfileonly->tab_translate[$key], '%s') > 4) { + print '
Error, more than 4 %s in the source
'; } print '
'; print ''; ########## ai/class/ai.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ai/class/ai.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ai/class/ai.class.php 2025-06-27 11:43:39.064354000 +0000 @@ -138,7 +138,7 @@ } } - dol_syslog("Call API for apiKey=".substr($this->apiKey, 0, 5).'***********, apiEndpoint='.$this->apiEndpoint.", model=".$model); + dol_syslog("Call API for apiKey=".substr($this->apiKey, 0, 3).'***********, apiEndpoint='.$this->apiEndpoint.", model=".$model); try { if (empty($this->apiEndpoint)) { @@ -256,7 +256,7 @@ throw new Exception('API request failed. No http received'); } if (!empty($response['http_code']) && $response['http_code'] != 200) { - if (in_array($response['http_code'], array(400, 401, 403, 429)) && !empty($response['content'])) { + if ($response['http_code'] == 400 && !empty($response['content'])) { $tmp = json_decode($response['content'], true); if (!empty($tmp['message'])) { return array( ########## api/class/api_access.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/api/class/api_access.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/api/class/api_access.class.php 2025-06-27 11:43:39.081657000 +0000 @@ -124,7 +124,7 @@ $api_key = preg_replace('/^Bearer\s+/i', '', empty($headers['Authorization']) ? '' : $headers['Authorization']); }; - $api_key = dol_string_nounprintableascii($api_key, 1); + $api_key = dol_string_nounprintableascii($api_key); if (preg_match('/^dolcrypt:/i', $api_key)) { throw new RestException(503, 'Bad value for the API key. An API key should not start with dolcrypt:'); @@ -182,7 +182,7 @@ } // Check if user status is enabled - if ($fuser->status != $fuser::STATUS_ENABLED) { + if ($fuser->statut != $fuser::STATUS_ENABLED) { // Status is disabled dol_syslog("functions_isallowed::check_user_api_key Authentication KO for '".$login."': The user has been disabled", LOG_NOTICE); sleep(1); // Anti brute force protection. Must be same delay when user and password are not valid. @@ -205,14 +205,6 @@ throw new RestException(401, $genericmessageerroruser); } - // TODO - // Increase counter of API access - if (getDolGlobalString('API_COUNTER_ENABLED')) { - include DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($this->db, 'API_COUNTER_COUNT', getDolGlobalInt('API_COUNTER_COUNT') + 1); - //var_dump('eeee');exit; - } - // User seems valid $fuser->loadRights(); ########## api/class/api_documents.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/api/class/api_documents.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/api/class/api_documents.class.php 2025-06-27 11:43:39.083669000 +0000 @@ -548,7 +548,7 @@ } elseif ($modulepart == 'knowledgemanagement') { require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; - if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { + if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read') && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { throw new RestException(403); } ########## barcode/codeinit.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/barcode/codeinit.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/barcode/codeinit.php 2025-06-27 11:43:39.454734000 +0000 @@ -294,16 +294,19 @@ llxHeader('', $langs->trans("MassBarcodeInit"), '', '', 0, 0, '', '', '', 'mod-barcode page-codeinit'); -if (!GETPOST('dol_openinpopup', 'aZ')) { - print load_fiche_titre($langs->trans("MassBarcodeInit"), '', 'title_setup.png'); - print '
'; -} +print load_fiche_titre($langs->trans("MassBarcodeInit"), '', 'title_setup.png'); +print '
'; print ''.$langs->trans("MassBarcodeInitDesc").'
'; print '
'; + +//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'
'; +//print '
'; + print '
'; + // Example 1 : Adding jquery code print ''; -// For products -if (isModEnabled('product') || isModEnabled('service')) { +// For thirdparty +if (isModEnabled('societe')) { print '
'; print ''; - print ''; + print ''; print ''; - print ''; - - $nbproductno = $nbproducttotal = 0; + $nbthirdpartyno = $nbthirdpartytotal = 0; print '
'; - print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product'); + print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company'); - $sql = "SELECT count(rowid) as nb, fk_product_type, datec"; - $sql .= " FROM ".MAIN_DB_PREFIX."product"; - $sql .= " WHERE barcode IS NULL OR barcode = ''"; - $sql .= " AND entity IN (".getEntity('product').")"; - $sql .= " GROUP BY fk_product_type, datec"; - $sql .= " ORDER BY datec"; + $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - - $i = 0; - while ($i < $num) { - $obj = $db->fetch_object($resql); - $nbproductno += $obj->nb; - - $i++; - } + $obj = $db->fetch_object($resql); + $nbthirdpartyno = $obj->nb; } else { dol_print_error($db); } - $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product"; - $sql .= " WHERE entity IN (".getEntity('product').")"; + $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe"; + $sql .= " WHERE entity IN (".getEntity('societe').")"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); - $nbproducttotal = $obj->nb; + $nbthirdpartytotal = $obj->nb; } else { dol_print_error($db); } - print $langs->trans("CurrentlyNWithoutBarCode", $nbproductno, $nbproducttotal, $langs->transnoentitiesnoconv("ProductsOrServices"))."\n"; - - $disabledproduct = $disabledproduct1 = 0; + print $langs->trans("CurrentlyNWithoutBarCode", $nbthirdpartyno, $nbthirdpartytotal, $langs->transnoentitiesnoconv("ThirdParties"))."\n"; + $disabledthirdparty = $disabledthirdparty1 = 0; $titleno = ''; - if (is_object($modBarCodeProduct)) { + + if (is_object($modBarCodeThirdparty)) { print '
'.$langs->trans("BarCodeNumberManager").": "; - $objproduct = new Product($db); - print ''.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).' - '.$langs->trans("NextValue").': '.$modBarCodeProduct->getNextValue($objproduct).'
'; - $disabledproduct = 0; + $objthirdparty = new Societe($db); + print ''.(isset($modBarCodeThirdparty->name) ? $modBarCodeThirdparty->name : $modBarCodeThirdparty->nom).' - '.$langs->trans("NextValue").': '.$modBarCodeThirdparty->getNextValue($objthirdparty).'
'; + $disabledthirdparty = 0; print '
'; } else { - $disabledproduct = 1; + $disabledthirdparty = 1; $titleno = $langs->trans("NoBarcodeNumberingTemplateDefined"); - print '
'.$langs->trans("NoBarcodeNumberingTemplateDefined"); + print '
'.$langs->trans("NoBarcodeNumberingTemplateDefined"); print '
'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").''; print '
'; } - if (empty($nbproductno)) { - $disabledproduct1 = 1; + if (empty($nbthirdpartyno)) { + $disabledthirdparty1 = 1; } - //print ' '.$langs->trans("ResetBarcodeForAllRecords").'
'; - $moretagsproduct1 = (($disabledproduct || $disabledproduct1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : ''); - print ''; - $moretagsproduct2 = (($nbproductno == $nbproducttotal) ? ' disabled' : ''); + $moretagsthirdparty1 = (($disabledthirdparty || $disabledthirdparty1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : ''); + print ''; + $moretagsthirdparty2 = (($nbthirdpartyno == $nbthirdpartytotal) ? ' disabled' : ''); print '   '; - print ''; + print ''; print '

'; print '
'; print '
'; @@ -392,67 +380,78 @@ } - -// For thirdparty -if (isModEnabled('societe')) { +// For products +if (isModEnabled('product') || isModEnabled('service')) { print ''; print ''; - print ''; + print ''; print ''; - print ''; - $nbthirdpartyno = $nbthirdpartytotal = 0; + $nbproductno = $nbproducttotal = 0; print '
'; - print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company'); + print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'product'); - $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''"; + $sql = "SELECT count(rowid) as nb, fk_product_type, datec"; + $sql .= " FROM ".MAIN_DB_PREFIX."product"; + $sql .= " WHERE barcode IS NULL OR barcode = ''"; + $sql .= " AND entity IN (".getEntity('product').")"; + $sql .= " GROUP BY fk_product_type, datec"; + $sql .= " ORDER BY datec"; $resql = $db->query($sql); if ($resql) { - $obj = $db->fetch_object($resql); - $nbthirdpartyno = $obj->nb; + $num = $db->num_rows($resql); + + $i = 0; + while ($i < $num) { + $obj = $db->fetch_object($resql); + $nbproductno += $obj->nb; + + $i++; + } } else { dol_print_error($db); } - $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe"; - $sql .= " WHERE entity IN (".getEntity('societe').")"; + $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product"; + $sql .= " WHERE entity IN (".getEntity('product').")"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); - $nbthirdpartytotal = $obj->nb; + $nbproducttotal = $obj->nb; } else { dol_print_error($db); } - print $langs->trans("CurrentlyNWithoutBarCode", $nbthirdpartyno, $nbthirdpartytotal, $langs->transnoentitiesnoconv("ThirdParties"))."\n"; + print $langs->trans("CurrentlyNWithoutBarCode", $nbproductno, $nbproducttotal, $langs->transnoentitiesnoconv("ProductsOrServices"))."\n"; - $disabledthirdparty = $disabledthirdparty1 = 0; - $titleno = ''; + $disabledproduct = $disabledproduct1 = 0; - if (is_object($modBarCodeThirdparty)) { + $titleno = ''; + if (is_object($modBarCodeProduct)) { print '
'.$langs->trans("BarCodeNumberManager").": "; - $objthirdparty = new Societe($db); - print ''.(isset($modBarCodeThirdparty->name) ? $modBarCodeThirdparty->name : $modBarCodeThirdparty->nom).' - '.$langs->trans("NextValue").': '.$modBarCodeThirdparty->getNextValue($objthirdparty).'
'; - $disabledthirdparty = 0; + $objproduct = new Product($db); + print ''.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).' - '.$langs->trans("NextValue").': '.$modBarCodeProduct->getNextValue($objproduct).'
'; + $disabledproduct = 0; print '
'; } else { - $disabledthirdparty = 1; + $disabledproduct = 1; $titleno = $langs->trans("NoBarcodeNumberingTemplateDefined"); - print '
'.$langs->trans("NoBarcodeNumberingTemplateDefined"); + print '
'.$langs->trans("NoBarcodeNumberingTemplateDefined"); print '
'.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").''; print '
'; } - if (empty($nbthirdpartyno)) { - $disabledthirdparty1 = 1; + if (empty($nbproductno)) { + $disabledproduct1 = 1; } - $moretagsthirdparty1 = (($disabledthirdparty || $disabledthirdparty1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : ''); - print ''; - $moretagsthirdparty2 = (($nbthirdpartyno == $nbthirdpartytotal) ? ' disabled' : ''); + //print ' '.$langs->trans("ResetBarcodeForAllRecords").'
'; + $moretagsproduct1 = (($disabledproduct || $disabledproduct1) ? ' disabled title="'.dol_escape_htmltag($titleno).'"' : ''); + print ''; + $moretagsproduct2 = (($nbproductno == $nbproducttotal) ? ' disabled' : ''); print '   '; - print ''; + print ''; print '

'; print '
'; print '
'; ########## blockedlog/class/blockedlog.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/blockedlog/class/blockedlog.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/blockedlog/class/blockedlog.class.php 2025-06-27 11:43:39.019647000 +0000 @@ -400,7 +400,7 @@ } /** - * Populate properties of an unalterable log entry from object data + * Populate properties of log from object data * * @param CommonObject|stdClass $object object to store * @param string $action action @@ -955,18 +955,18 @@ $previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done and transaction closed - $concatenatedata = $this->buildKeyForSignature(); // All the information for the hash (meta data + data saved) + $keyforsignature = $this->buildKeyForSignature(); // All the information for the hash (meta data + data saved) $this->debuginfo = $this->buildFirstPartOfKeyForSignature(); include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; - $this->signature_line = dol_hash($concatenatedata, '5'); // Not really useful - $this->signature = dol_hash($previoushash.$concatenatedata, '5'); + $this->signature_line = dol_hash($keyforsignature, '5'); // Not really useful + $this->signature = dol_hash($previoushash.$keyforsignature, '5'); if ($forcesignature) { $this->signature = $forcesignature; } - //var_dump($concatenatedata);var_dump($previoushash);var_dump($this->signature_line);var_dump($this->signature); + //var_dump($keyforsignature);var_dump($previoushash);var_dump($this->signature_line);var_dump($this->signature); $sql = "INSERT INTO ".MAIN_DB_PREFIX."blockedlog ("; $sql .= " date_creation,"; @@ -1049,11 +1049,11 @@ } // Build the string for the signature - $concatenatedata = $this->buildKeyForSignature(); + $keyforsignature = $this->buildKeyForSignature(); - //$signature_line = dol_hash($concatenatedata, '5'); // Not really useful - $signature = dol_hash($previoushash.$concatenatedata, 'sha256'); - //var_dump($previoushash); var_dump($concatenatedata); var_dump($signature_line); var_dump($signature); + //$signature_line = dol_hash($keyforsignature, '5'); // Not really useful + $signature = dol_hash($previoushash.$keyforsignature, 'sha256'); + //var_dump($previoushash); var_dump($keyforsignature); var_dump($signature_line); var_dump($signature); $res = ($signature === $this->signature); @@ -1063,13 +1063,13 @@ if ($returnarray) { if ($returnarray == 1) { - unset($concatenatedata); + unset($keyforsignature); return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash); - } else { // Consume much memory ($concatenatedata is a large var) - return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature' => $concatenatedata); + } else { // Consume much memory ($keyforsignature is a large var) + return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature' => $keyforsignature); } } else { - unset($concatenatedata); + unset($keyforsignature); return $res; } } @@ -1312,7 +1312,7 @@ $result = false; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog"; - $sql .= " WHERE entity = ".((int) $conf->entity); + $sql .= " WHERE entity = ".$conf->entity; if ($ignoresystem) { $sql .= " AND action not in ('MODULE_SET','MODULE_RESET')"; } ########## bom/bom_list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/bom/bom_list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/bom/bom_list.php 2025-06-27 11:43:39.528409000 +0000 @@ -42,7 +42,8 @@ // Load translation files required by the page $langs->loadLangs(array('mrp', 'other')); -// Get parameters +// Get Parameters +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? @@ -54,7 +55,6 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // mode view (kanban or common) -$id = GETPOSTINT('id'); // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -104,8 +104,8 @@ } } -// List of fields to search into when doing a "search in all" $fieldstosearchall = array(); +// List of fields to search into when doing a "search in all" foreach ($object->fields as $key => $val) { if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; @@ -139,6 +139,7 @@ // Security check if ($user->socid > 0) { + // Protection if external user accessforbidden(); } $result = restrictedArea($user, 'bom'); @@ -171,15 +172,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; - if ($key == 'status') { - $search[$key] = -1; - } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { $search[$key.'_dtstart'] = ''; $search[$key.'_dtend'] = ''; } } - $search_all = ''; $toselect = array(); $search_array_options = array(); } @@ -191,6 +188,8 @@ // Mass actions $objectclass = 'BOM'; $objectlabel = 'BillOfMaterials'; + $permissiontoread = $user->hasRight('bom', 'read'); + $permissiontodelete = $user->hasRight('bom', 'delete'); $uploaddir = $conf->bom->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -374,7 +373,7 @@ /* If a group by is required $sql.= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= "t.".$db->sanitize($key).", "; + $sql .= "t.".$db->escape($key).", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -552,7 +551,7 @@ $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table +print '
'; print ''."\n"; @@ -741,7 +740,6 @@ $totalarray['nbfield']++; } } - // Fields foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { @@ -763,7 +761,7 @@ if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { - print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"'; + print ' title="'.dol_escape_htmltag((string) $object->$key).'"'; } print '>'; if ($key == 'status') { @@ -771,13 +769,7 @@ } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, (string) $object->id, ''); } else { - if ($val['type'] == 'html') { - print '
'; - } - print $object->showOutputField($val, $key, (string) $object->$key, ''); - if ($val['type'] == 'html') { - print '
'; - } + print $object->showOutputField($val, $key, $object->$key, ''); } print ''; if (!$i) { ########## bom/class/api_boms.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/bom/class/api_boms.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/bom/class/api_boms.class.php 2025-06-27 11:43:39.504783000 +0000 @@ -116,7 +116,7 @@ $obj_ret = array(); $tmpobject = new BOM($this->db); - $socid = DolibarrApiAccess::$user->socid ?: ''; + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; $restrictonsocid = 0; // Set to 1 if there is a field socid in table of object ########## bom/class/bom.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/bom/class/bom.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/bom/class/bom.class.php 2025-06-27 11:43:39.506711000 +0000 @@ -1442,20 +1442,16 @@ $this->error = $tmpproduct->error; return -1; } - - $unit_cost = (float) (is_null($tmpproduct->cost_price) ? $tmpproduct->pmp : $tmpproduct->cost_price); - if (empty($unit_cost)) { // @phpstan-ignore-line phpstan thinks this is always false. No,if unit_cost is 0, it is not. + $unit_cost = (!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp; + $line->unit_cost = (float) price2num($unit_cost); + if (empty($line->unit_cost)) { if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { if ($productFournisseur->fourn_remise_percent != "0") { $line->unit_cost = $productFournisseur->fourn_unitprice_with_discount; } else { $line->unit_cost = $productFournisseur->fourn_unitprice; } - } else { - $line->unit_cost = 0; } - } else { - $line->unit_cost = (float) price2num($unit_cost); } $line->total_cost = (float) price2num($line->qty * $line->unit_cost, 'MT'); ########## categories/categorie_list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/categories/categorie_list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/categories/categorie_list.php 2025-06-27 11:43:39.551551000 +0000 @@ -483,10 +483,7 @@ $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$param).$param, '', $permissiontoadd); - $morehtmlrightbeforebutton = ''; - if (!GETPOST('dol_openinpopup', 'aZ')) { - $morehtmlrightbeforebutton = ''.$langs->trans("BackToCategoryTypes").'   '; - } + $morehtmlrightbeforebutton = ''.$langs->trans("BackToCategoryTypes").'   '; print_barre_liste($title, 0, $_SERVER["PHP_SELF"], $param, '', '', '', 0, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', 0, 0, 0, 1, $morehtmlrightbeforebutton); @@ -613,10 +610,7 @@ $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$param).$param, '', $permissiontoadd); - $morehtmlrightbeforebutton = ''; - if (!GETPOST('dol_openinpopup', 'aZ')) { - $morehtmlrightbeforebutton = ''.$langs->trans("BackToCategoryTypes").'   '; - } + $morehtmlrightbeforebutton = ''.$langs->trans("BackToCategoryTypes").'   '; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1, $morehtmlrightbeforebutton); ########## comm/action/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/card.php 2025-06-27 11:43:39.622159000 +0000 @@ -1744,7 +1744,7 @@ print '$(document).ready(function () { $("#projectid").change(function () { var url = "'.DOL_URL_ROOT.'/projet/ajax/projects.php?mode=gettasks&socid="+$("#search_socid").val()+"&projectid="+$("#projectid").val(); - console.log("Call url to get the new list of tasks: "+url); + console.log("Call url to get new list of tasks: "+url); $.get(url, function(data) { console.log(data); if (data) $("#taskid").html(data).select2(); @@ -1765,15 +1765,7 @@ $tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : ''); - if (empty($projectsListId)) { - print ''; - print ajax_combobox('taskid'); - } else { - print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 32, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); - } + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId); print ''; } @@ -2326,7 +2318,7 @@ })'; print ''."\n"; - print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project, 'all', null, 1); + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project); print ''; print ''; @@ -2357,7 +2349,7 @@ $tid = GETPOSTINT("taskid"); } - print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId); print ''; } else { ########## comm/action/class/actioncomm.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/class/actioncomm.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/class/actioncomm.class.php 2025-06-27 11:43:39.629146000 +0000 @@ -327,11 +327,6 @@ public $email_from; /** - * @var string Email reply to - */ - public $email_reply_to; - - /** * @var string Email sender */ public $email_sender; ########## comm/action/class/api_agendaevents.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/class/api_agendaevents.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/class/api_agendaevents.class.php 2025-06-27 11:43:39.625850000 +0000 @@ -130,7 +130,7 @@ } // case of external user - $socid = DolibarrApiAccess::$user->socid ?: 0; + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0; // If the internal user must only see his customers, force searching by him $search_sale = 0; ########## comm/action/index.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/index.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/index.php 2025-06-27 11:43:39.614643000 +0000 @@ -52,13 +52,6 @@ $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB', 5); $DELAYFORCACHE = 300; // 300 seconds -$action = GETPOST('action', 'aZ09'); -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'aZ09'); -if (empty($mode) && preg_match('/show_/', $action)) { - $mode = $action; // For backward compatibility -} - $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $check_holiday = GETPOSTINT('check_holiday'); @@ -75,15 +68,13 @@ $newparam = ''; -// Pagination parameters -$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); -if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { - // If $page is not defined, or '' or -1 or if we click on clear filters +if (empty($page) || $page == -1) { $page = 0; -} +} // If $page is not defined, or '' or -1 +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -112,6 +103,12 @@ $filtert = (string) $user->id; } +$action = GETPOST('action', 'aZ09'); + +$mode = GETPOST('mode', 'aZ09'); +if (empty($mode) && preg_match('/show_/', $action)) { + $mode = $action; // For backward compatibility +} $resourceid = GETPOSTINT("search_resourceid"); $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); $month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); @@ -121,6 +118,7 @@ $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); $maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : getDolGlobalInt('AGENDA_MAX_EVENTS_DAY_VIEW', 3); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { @@ -193,7 +191,7 @@ if ($key == 'token') { continue; } - $param .= '&'.urlencode($key).'='.urlencode($val); + $param .= '&'.$key.'='.urlencode($val); } } if (!preg_match('/action=/', $param)) { @@ -211,7 +209,7 @@ if ($key == 'token') { continue; } - $param .= '&'.urlencode($key).'='.urlencode($val); + $param .= '&'.$key.'='.urlencode($val); } } //print $param; @@ -757,41 +755,29 @@ $sql .= ' a.fk_element, a.elementtype,'; $sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto'; -// Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sqlfields = $sql; // $sql fields to remove for count total - -$sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm as ca, ".MAIN_DB_PREFIX."actioncomm as a"; +$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; // We must filter on assignment table -if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { - // TODO Replace with a AND EXISTS - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; - if ($filtert != '-1' && $filtert != '-2' && $filtert != '-3') { - $sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility - } elseif ($filtert == '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; +if ($filtert > 0 || $usergroup > 0) { + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar"; + $sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type='user'"; + if ($filtert > 0) { + $sql .= " AND ar.fk_element = ".((int) $filtert); } if ($usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); } } - // We must filter on resource table if ($resourceid > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_resources as r"; } - -// Add table from hooks -$parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook -$sql .= $hookmanager->resPrint; - -$sql .= " WHERE a.fk_action = ca.id"; -$sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda +$sql .= ' WHERE a.fk_action = ca.id'; +$sql .= ' AND a.entity IN ('.getEntity('agenda').')'; // bookcal is a "virtual view" of agenda // Condition on actioncode if (!empty($actioncode)) { if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { @@ -808,27 +794,14 @@ } } } else { - if ($actioncode === 'AC_NON_AUTO') { + if ($actioncode == 'AC_NON_AUTO') { $sql .= " AND ca.type != 'systemauto'"; - } elseif ($actioncode === 'AC_ALL_AUTO') { + } elseif ($actioncode == 'AC_ALL_AUTO') { $sql .= " AND ca.type = 'systemauto'"; - } else { + } elseif (/* !empty($actioncode) && */ $actioncode !== '-1') { if (is_array($actioncode)) { - // Remove all -1 values - $actioncode = array_filter( - $actioncode, - /** - * @param string $value - * @return bool - */ - function ($value) { - return ((string) $value !== '-1'); - } - ); - if (count($actioncode)) { - $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")"; - } - } elseif ($actioncode !== '-1') { + $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")"; + } else { $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")"; } } @@ -854,7 +827,7 @@ } } // Search on socid -if ($socid > 0) { +if ($socid) { $sql .= " AND a.fk_soc = ".((int) $socid); } //var_dump($day.' '.$month.' '.$year); @@ -903,6 +876,17 @@ if ($status == 'todo') { $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } +// We must filter on assignment table +if ($filtert > 0 || $usergroup > 0) { + $sql .= " AND ("; + if ($filtert > 0) { + $sql .= "ar.fk_element = ".((int) $filtert); + } + if ($usergroup > 0) { + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); + } + $sql .= ")"; +} // Search in categories, -1 is all and -2 is no categories if ($search_categ_cus != -1) { @@ -2253,7 +2237,7 @@ $listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valignmiddle inline-block'); } - if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'HOLIDAY') { + if ($event->type_code != 'BIRTHDAY') { print $titletoshow; print $listofusertoshow.'  '; } @@ -2313,7 +2297,7 @@ // It's holiday calendar $tmpholiday->fetch($event->id); - print $tmpholiday->getNomUrl(1, -1, 0, 'valignmiddle inline-block'); + //print $tmpholiday->getNomUrl(1, -1, 0, 'valignmiddle inline-block'); $tmpid = $tmpholiday->fk_user; if (empty($cacheusers[$tmpid])) { @@ -2359,7 +2343,7 @@ print ''.img_picto("all", "1downarrow_selected.png").' ...'; print ' +'.(count($eventarray[$daykey]) - $maxprint); ########## comm/action/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/list.php 2025-06-27 11:43:39.617813000 +0000 @@ -58,13 +58,14 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); + + +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); + $mode = GETPOST('mode', 'aZ09'); if (empty($mode) && preg_match('/show_/', $action)) { $mode = $action; // For backward compatibility } - -$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); - $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); $pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3); $search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); @@ -119,7 +120,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // If not choice done on calendar owner, we filter on user. if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { - $filtert = (string) $user->id; + $filtert = $user->id; } // Pagination parameters @@ -162,7 +163,7 @@ $canedit = 0; } if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // If no permission to see all, we show only affected to me - $filtert = (string) $user->id; + $filtert = $user->id; } $arrayfields = array( @@ -205,7 +206,7 @@ $param = ''; if (is_array($_POST)) { foreach ($_POST as $key => $val) { - $param .= '&'.urlencode($key).'='.urlencode($val); + $param .= '&'.$key.'='.urlencode($val); } } //print $param; @@ -331,10 +332,10 @@ $param .= "&search_status=".urlencode($search_status); } if ($filter) { - $param .= "&search_filter=".urlencode((string) $filter); + $param .= "&search_filter=".urlencode($filter); } if ($filtert) { - $param .= "&search_filtert=".urlencode((string) $filtert); + $param .= "&search_filtert=".urlencode($filtert); } if ($usergroup > 0) { $param .= "&search_usergroup=".urlencode((string) ($usergroup)); @@ -462,17 +463,11 @@ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as r ON r.element_type = 'action' AND r.element_id = a.id"; } // We must filter on assignment table -if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { - // TODO Replace with a AND EXISTS - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; - if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { - $sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility - } elseif ($filtert == '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; - } - if ($usergroup > 0) { - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); - } +if ($filtert > 0 || $usergroup > 0) { + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type='user'"; +} +if ($usergroup > 0) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; } // Add table from hooks @@ -480,7 +475,7 @@ $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= " WHERE a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda +$sql .= " WHERE a.entity IN (".getEntity('agenda').")"; // Condition on actioncode if (!empty($actioncode)) { if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { @@ -551,18 +546,18 @@ $sql .= " AND c.id = ".((int) $type); } if ($search_status == '0') { - // To do (not started) $sql .= " AND a.percent = 0"; } if ($search_status == 'na') { - // Not applicable $sql .= " AND a.percent = -1"; -} +} // Not applicable if ($search_status == '50') { - // Running already started $sql .= " AND (a.percent > 0 AND a.percent < 100)"; +} // Running already started +if ($search_status == '100') { + $sql .= " AND a.percent = 100"; } -if ($search_status == 'done' || $search_status == '100') { +if ($search_status == 'done') { $sql .= " AND (a.percent = 100)"; } if ($search_status == 'todo') { @@ -577,6 +572,17 @@ if ($search_note) { $sql .= natural_search('a.note', $search_note); } +// We must filter on assignment table +if ($filtert > 0 || $usergroup > 0) { + $sql .= " AND ("; + if ($filtert > 0) { + $sql .= "(ar.fk_element = ".((int) $filtert)." OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility + } + if ($usergroup > 0) { + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); + } + $sql .= ")"; +} // The second or of next test is to take event with no end date (we suppose duration is 1 hour in such case) if ($dateselect > 0) { ########## comm/action/pertype.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/pertype.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/pertype.php 2025-06-27 11:43:39.619739000 +0000 @@ -57,7 +57,7 @@ $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); -$filtert = GETPOST("search_filtert", "intcomma", 3) ? GETPOST("search_filtert", "intcomma", 3) : GETPOST("filtert", "intcomma", 3); +$filtert = GETPOSTINT("search_filtert", 3) ? GETPOSTINT("search_filtert", 3) : GETPOSTINT("filtert", 3); $usergroup = GETPOSTINT("search_usergroup", 3) ? GETPOSTINT("search_usergroup", 3) : GETPOSTINT("usergroup", 3); //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; @@ -95,7 +95,8 @@ $socid = ''; } -$canedit = 1; // can read events of others +// Permissions +$canedit = 1; if (!$user->hasRight('agenda', 'myactions', 'read')) { accessforbidden(); } @@ -103,7 +104,7 @@ $canedit = 0; } if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // If no permission to see all, we show only affected to me - $filtert = (string) $user->id; + $filtert = $user->id; } $mode = 'show_pertype'; @@ -136,11 +137,11 @@ } // working hours -$tmp = getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS', '9-18'); +$tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_h = GETPOSTISSET('begin_h') ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOSTISSET('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) { $begin_h = 9; } @@ -195,7 +196,7 @@ // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agenda')); -$result = restrictedArea($user, 'agenda', 0, 'actioncomm&societe', 'myactions'); +$result = restrictedArea($user, 'agenda', 0, '', 'myactions'); if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } @@ -282,12 +283,10 @@ } $param = ''; -if (($actioncode && $actioncode !== '-1') || GETPOSTISSET('search_actioncode')) { +if ($actioncode || GETPOSTISSET('search_actioncode')) { if (is_array($actioncode)) { foreach ($actioncode as $str_action) { - if ($str_action != '-1') { - $param .= "&search_actioncode[]=".urlencode($str_action); - } + $param .= "&search_actioncode[]=".urlencode($str_action); } } else { $param .= "&search_actioncode=".urlencode($actioncode); @@ -300,7 +299,7 @@ $param .= "&search_status=".urlencode($status); } if ($filter) { - $param .= "&search_filter=".urlencode((string) $filter); + $param .= "&search_filter=".urlencode($filter); } if ($filtert) { $param .= "&search_filtert=".urlencode((string) $filtert); @@ -311,7 +310,7 @@ if ($socid > 0) { $param .= "&search_socid=".urlencode((string) ($socid)); } -if ($showbirthday) { // Always false @phpstan-suppress-current-line +if ($showbirthday) { $param .= "&search_showbirthday=1"; } if ($pid) { @@ -324,16 +323,16 @@ $param .= '&mode='.urlencode((string) $mode); } if ($begin_h != '') { - $param .= '&begin_h='.((int) $begin_h); + $param .= '&begin_h='.urlencode($begin_h); } if ($end_h != '') { - $param .= '&end_h='.((int) $end_h); + $param .= '&end_h='.urlencode($end_h); } if ($begin_d != '') { - $param .= '&begin_d='.((int) $begin_d); + $param .= '&begin_d='.urlencode((string) ($begin_d)); } if ($end_d != '') { - $param .= '&end_d='.((int) $end_d); + $param .= '&end_d='.urlencode((string) ($end_d)); } $param .= "&maxprint=".urlencode((string) ($maxprint)); @@ -490,7 +489,7 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now('tzuserrel'), true); - $newparam .= '&month='.str_pad((string) $month, 2, "0", STR_PAD_LEFT).'&year='.((int) $tmpforcreatebutton['year']); + $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; $urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create'; $urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes']; @@ -525,7 +524,7 @@ // DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR -$sql = "SELECT"; +$sql = 'SELECT'; if ($usergroup > 0) { $sql .= " DISTINCT"; } @@ -537,34 +536,20 @@ $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; $sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto'; - -$parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook -$sql .= $hookmanager->resPrint; - $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; // We must filter on resource table if ($resourceid > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_resources as r"; } // We must filter on assignment table -if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { - // TODO Replace with a AND EXISTS - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar"; - $sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; - if ($filtert != '-1' && $filtert != '-2' && $filtert != '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")"; - } elseif ($filtert == -3) { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; - } - if ($usergroup > 0) { - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); - } +if ($filtert > 0 || $usergroup > 0) { + $sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; } - -$sql .= " WHERE a.fk_action = ca.id"; -$sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda - +if ($usergroup > 0) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; +} +$sql .= ' WHERE a.fk_action = ca.id'; +$sql .= ' AND a.entity IN ('.getEntity('agenda').')'; // Condition on actioncode if (!empty($actioncode)) { if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { @@ -585,16 +570,9 @@ $sql .= " AND ca.type != 'systemauto'"; } elseif ($actioncode == 'AC_ALL_AUTO') { $sql .= " AND ca.type = 'systemauto'"; - } elseif ($actioncode !== '-1' && $actioncode !== '-3') { + } else { if (is_array($actioncode)) { - foreach ($actioncode as $key => $val) { - if ($val == '-1' || $val == '-2') { - unset($actioncode[$key]); - } - } - if (!empty($actioncode)) { - $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")"; - } + $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")"; } else { $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")"; } @@ -609,7 +587,7 @@ } // If the internal user must only see his customers, force searching by him $search_sale = 0; -if (isModEnabled("societe") && !$user->hasRight('societe', 'client', 'voir')) { +if (!$user->hasRight('societe', 'client', 'voir')) { $search_sale = $user->id; } // Search on sale representative @@ -624,7 +602,10 @@ if ($socid) { $sql .= " AND a.fk_soc = ".((int) $socid); } - +// We must filter on assignment table +if ($filtert > 0 || $usergroup > 0) { + $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; +} if ($mode == 'show_day') { $sql .= " AND ("; $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; @@ -635,7 +616,7 @@ $sql .= " OR "; $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; - $sql .= ")"; + $sql .= ')'; } else { // To limit array $sql .= " AND ("; @@ -653,7 +634,6 @@ $sql .= " AND ca.id = ".((int) $type); } if ($status == '0') { - // To do (not started) $sql .= " AND a.percent = 0"; } if ($status === 'na') { @@ -671,33 +651,26 @@ $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } // We must filter on assignment table -if (($filtert > 0 || $filtert == -3) || $usergroup > 0) { - // TODO Replace with a AND EXISTS +if ($filtert > 0 || $usergroup > 0) { $sql .= " AND ("; if ($filtert > 0) { - $sql .= "ar.fk_element = ".((int) $filtert); - } elseif ($filtert == -3) { - $sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; + $sql .= "ar.fk_element = ".$filtert; } if ($usergroup > 0) { $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } - // Sort on date -$sql .= $db->order("fk_user_action, datep"); - +$sql .= ' ORDER BY fk_user_action, datep'; //fk_user_action //print $sql; dol_syslog("comm/action/pertype.php", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - - $MAXONSAMEPAGE = 10000; // Useless to have more. Protection to avoid memory overload when high number of event (for example after a mass import) $i = 0; - while ($i < $num && $i < $MAXONSAMEPAGE) { + while ($i < $num) { $obj = $db->fetch_object($resql); // Discard auto action if option is on ########## comm/action/peruser.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/action/peruser.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/action/peruser.php 2025-06-27 11:43:39.634996000 +0000 @@ -54,14 +54,19 @@ $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); -$action = GETPOST('action', 'aZ09'); - $check_holiday = GETPOSTINT('check_holiday'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); -$filtert = GETPOST("search_filtert", "intcomma", 3) ? GETPOST("search_filtert", "intcomma", 3) : GETPOST("filtert", "intcomma", 3); +$filtert = GETPOSTINT("search_filtert", 3) ? GETPOSTINT("search_filtert", 3) : GETPOSTINT("filtert", 3); $usergroup = GETPOSTINT("search_usergroup", 3) ? GETPOSTINT("search_usergroup", 3) : GETPOSTINT("usergroup", 3); +//if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; +//$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; $showbirthday = getDolGlobalInt('AGENDA_ENABLE_SHOW_BIRTHDAY_PER_USER'); // disabled by default +// If no choice done on calendar owner (like on left menu link "Agenda"), we filter on current user by default. +/*if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { + $filtert = (string) $user->id; +}*/ + $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); @@ -86,7 +91,7 @@ $socid = ''; } -$canedit = 1; // can read events of others +$canedit = 1; if (!$user->hasRight('agenda', 'myactions', 'read')) { accessforbidden(); } @@ -97,6 +102,8 @@ $filtert = (string) $user->id; } +$action = GETPOST('action', 'aZ09'); + $mode = 'show_peruser'; $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); @@ -126,7 +133,6 @@ $year = GETPOSTINT('dateselectyear'); } -// working hours $tmp = getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS', '9-18'); $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); @@ -142,7 +148,6 @@ $end_h = $begin_h + 1; } -// working days $tmp = getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS', '1-5'); $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); @@ -166,22 +171,19 @@ $mode = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_peruser'); } -// View by month if (GETPOST('viewcal', 'alpha') && $mode != 'show_day' && $mode != 'show_week' && $mode != 'show_peruser') { $mode = 'show_month'; $day = ''; -} -// View by week +} // View by month if (GETPOST('viewweek', 'alpha') || $mode == 'show_week') { $mode = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); -} -// View by day +} // View by week if (GETPOST('viewday', 'alpha') || $mode == 'show_day') { $mode = 'show_day'; $day = ($day ? $day : date("d")); -} +} // View by day $object = new ActionComm($db); @@ -333,12 +335,10 @@ } $param = ''; -if (($actioncode && $actioncode !== '-1') || GETPOSTISSET('search_actioncode')) { +if ($actioncode || GETPOSTISSET('search_actioncode')) { if (is_array($actioncode)) { foreach ($actioncode as $str_action) { - if ($str_action != '-1') { - $param .= "&search_actioncode[]=".urlencode($str_action); - } + $param .= "&search_actioncode[]=".urlencode($str_action); } } else { $param .= "&search_actioncode=".urlencode($actioncode); @@ -531,16 +531,16 @@ $urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create'; $urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes']; - $urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$newparam); + $urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"] . $newparam); $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction); } -$link = ''; - // Define the legend/list of calendard to show $s = ''; +$link = ''; + $showextcals = $listofextcals; $bookcalcalendars = array(); @@ -554,7 +554,7 @@ $sql .= " WHERE bc.status = 1"; $sql .= " AND ba.status = 1"; $sql .= " AND bc.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda - if (!empty($filtert) && $filtert != '-1' && $filtert != '-2') { + if (!empty($filtert) && $filtert != '-1') { $sql .= " AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).")"; } $resql = $db->query($sql); @@ -677,7 +677,7 @@ $sql .= " a.datep,"; $sql .= " a.datep2,"; $sql .= " a.percent,"; -$sql .= " a.fk_user_author, a.fk_user_action,"; +$sql .= " a.fk_user_author,a.fk_user_action,"; $sql .= " a.transparency, a.priority, a.fulldayevent, a.location,"; $sql .= " a.fk_soc, a.fk_contact, a.fk_project, a.fk_bookcal_calendar,"; $sql .= " a.fk_element, a.elementtype,"; @@ -692,16 +692,12 @@ if ($resourceid > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_resources as r"; } - // We must filter on assignment table -if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { - // TODO Replace with a AND EXISTS +if ($filtert > 0 || $usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar"; - $sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; - if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")"; - } elseif ($filtert == '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; + $sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type='user'"; + if ($filtert > 0) { + $sql .= " AND ar.fk_element = ".((int) $filtert); } if ($usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); @@ -710,7 +706,6 @@ $sql .= " WHERE a.fk_action = ca.id"; $sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda - // Condition on actioncode if (!empty($actioncode)) { if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { @@ -731,16 +726,9 @@ $sql .= " AND ca.type != 'systemauto'"; } elseif ($actioncode == 'AC_ALL_AUTO') { $sql .= " AND ca.type = 'systemauto'"; - } elseif ($actioncode !== '-1' && $actioncode !== '-3') { + } elseif (/* !empty($actioncode) && */ $actioncode !== '-1') { if (is_array($actioncode)) { - foreach ($actioncode as $key => $val) { - if ($val == '-1' || $val == '-2') { - unset($actioncode[$key]); - } - } - if (!empty($actioncode)) { - $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")"; - } + $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", $actioncode)."'", 1).")"; } else { $sql .= " AND ca.code IN (".$db->sanitize("'".implode("','", explode(',', $actioncode))."'", 1).")"; } @@ -817,13 +805,10 @@ $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } // We must filter on assignment table -if (($filtert > 0 || $filtert == -3) || $usergroup > 0) { - // TODO Replace with a AND EXISTS +if ($filtert > 0 || $usergroup > 0) { $sql .= " AND ("; if ($filtert > 0) { $sql .= "ar.fk_element = ".((int) $filtert); - } elseif ($filtert == -3) { - $sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); @@ -1071,8 +1056,8 @@ } } -// LEAVE-HOLIDAY CALENDAR if ($user->hasRight("holiday", "read")) { + // LEAVE-HOLIDAY CALENDAR $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = x.fk_user"; @@ -1514,7 +1499,6 @@ // Show div with list of calendars print $s; -// Top filters print '
'; print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', (string) $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); print '
'; @@ -1559,13 +1543,13 @@ print $langs->trans("DaysOfWeek").''; print "\n"; print '
'; - print ''; + print ''; if (empty($conf->dol_use_jmobile)) { print ' - '; } else { print '
'; } - print ''; + print ''; print '
'; } @@ -1598,13 +1582,13 @@ print $langs->trans("Hours").''; print "\n"; print '
'; - print ''; + print ''; if (empty($conf->dol_use_jmobile)) { print ' - '; } else { print '
'; } - print ''; + print ''; if (empty($conf->dol_use_jmobile)) { print ' '.$langs->trans("HourShort"); } @@ -1646,7 +1630,7 @@ } } } else { - /* Use this list to have lines of all users to show */ + /* Use this list to have lines for all users */ $sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; $sql .= " FROM ".$db->prefix()."user as u"; if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { @@ -1677,13 +1661,6 @@ // External users should see only contacts of their company $sql .= " AND u.fk_soc = ".((int) $user->socid); } - // Filter on users in hierarchy - if (!$canedit || $filtert == '-3') { // If we can't read event of others - if (!$user->hasRight('user', 'user', 'lire') || $filtert == '-3') { - $usersInHierarchy = $user->getAllChildIds(1); - $sql .= " AND u.rowid IN (".$db->sanitize(implode(',', $usersInHierarchy)).")"; - } - } //print $sql; $resql = $db->query($sql); @@ -2479,7 +2456,7 @@ print 'style="background: #'.$color1.'; "'; } print 'class="'; - print $style1.' '; + print ($style1 ? $style1.' ' : ''); print 'center'.($title1 ? ' classfortooltip' : '').($title1 ? ' cursorpointer' : '').'"'; print 'ref="'.$ref1.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_00_'.($ids1 ? $ids1 : 'none').'"'; print ($title1 ? ' title="'.$title1.'"' : '').'>'; @@ -2493,7 +2470,7 @@ print 'style="background: #'.$color2.'; "'; } print 'class="'; - print $style2.' '; + print ($style2 ? $style2.' ' : ''); print 'center'.($title2 ? ' classfortooltip' : '').($title2 ? ' cursorpointer' : '').'"'; print ' ref="'.$ref2.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_15_'.($ids2 ? $ids2 : 'none').'"'; print ($title2 ? ' title="'.$title2.'"' : '').'>'; @@ -2507,7 +2484,7 @@ print 'style="background: #'.$color3.'; "'; } print 'class="'; - print $style3.' '; + print ($style3 ? $style3.' ' : ''); print 'center'.($title3 ? ' classfortooltip' : '').($title3 ? ' cursorpointer' : '').'"'; print ' ref="'.$ref3.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_30_'.($ids3 ? $ids3 : 'none').'"'; print ($title3 ? ' title="'.$title3.'"' : '').'>'; @@ -2521,7 +2498,7 @@ print 'style="background: #'.$color4.'; "'; } print 'class="'; - print $style4.' '; + print ($style4 ? $style4.' ' : ''); print 'center'.($title4 ? ' classfortooltip' : '').($title4 ? ' cursorpointer' : '').'"'; print ' ref="'.$ref4.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_45_'.($ids4 ? $ids4 : 'none').'"'; print ($title4 ? ' title="'.$title4.'"' : '').'>'; ########## comm/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/card.php 2025-06-27 11:43:39.604427000 +0000 @@ -81,7 +81,7 @@ */ // Load translation files required by the page -$langs->loadLangs(array('companies', 'banks', 'commercial')); +$langs->loadLangs(array('companies', 'banks')); if (isModEnabled('contract')) { $langs->load("contracts"); ########## comm/mailing/class/advtargetemailing.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/mailing/class/advtargetemailing.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/mailing/class/advtargetemailing.class.php 2025-06-27 11:43:39.644728000 +0000 @@ -641,27 +641,6 @@ if ($arrayquery['options_'.$key] > 0) { $sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key]).")"; } - } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst' - && is_array($arrayquery['options_'.$key])) { - if (count($arrayquery['options_'.$key])) { - $i2 = 0; - $field = "te.".$key; - $sqlwhereselllist=""; - foreach ($arrayquery['options_'.$key] as $data) { - $data = trim($data); - if ($data) { - $sqlwhereselllist .= ($i2 > 0 ? " OR (" : "(").$field." LIKE '".$this->db->escape($data).",%'"; - $sqlwhereselllist .= " OR ".$field." = '".$this->db->escape($data)."'"; - $sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data)."'"; - $sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data).",%'"; - $sqlwhereselllist .= ")"; - $i2++; // a criteria for 1 more field was added to string (we can add several criteria for the same field as it is a multiselect search criteria) - } - } - if (!empty($sqlwhereselllist)) { - $sqlwhere[] = "( ".$sqlwhereselllist." )"; - } - } } else { if (is_array($arrayquery['options_'.$key])) { $sqlwhere[] = " (te.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery["options_".$key])."'", 1)."))"; @@ -805,31 +784,6 @@ $sqlwhere[] = " (te.".$key." = ".((int) $arrayquery["options_".$key."_cnct"]).")"; } } - } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') { - if ($arrayquery['options_'.$key."_cnct"] > 0) { - $sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key."_cnct"]).")"; - } - } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst' - && is_array($arrayquery['options_'.$key.'_cnct'])) { - if (count($arrayquery['options_'.$key.'_cnct'])) { - $i2 = 0; - $field = "te.".$key; - $sqlwhereselllist=""; - foreach ($arrayquery['options_'.$key.'_cnct'] as $data) { - $data = trim($data); - if ($data) { - $sqlwhereselllist .= ($i2 > 0 ? " OR (" : "(").$field." LIKE '".$this->db->escape($data).",%'"; - $sqlwhereselllist .= " OR ".$field." = '".$this->db->escape($data)."'"; - $sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data)."'"; - $sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data).",%'"; - $sqlwhereselllist .= ")"; - $i2++; // a criteria for 1 more field was added to string (we can add several criteria for the same field as it is a multiselect search criteria) - } - } - if (!empty($sqlwhereselllist)) { - $sqlwhere[] = "( ".$sqlwhereselllist." )"; - } - } } else { if (is_array($arrayquery['options_'.$key.'_cnct'])) { $sqlwhere[] = " (te.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery["options_".$key."_cnct"])."'", 1)."))"; @@ -934,31 +888,6 @@ if ($arrayquery['options_'.$key] != '') { $sqlwhere[] = " (tse.".$key." = ".((int) $arrayquery["options_".$key]).")"; } - } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') { - if ($arrayquery['options_'.$key] > 0) { - $sqlwhere[]= " (te.".$key." = ".((int) $arrayquery["options_".$key]).")"; - } - } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'chkbxlst' - && is_array($arrayquery['options_'.$key])) { - if (count($arrayquery['options_'.$key])) { - $i2 = 0; - $field = "tse.".$key; - $sqlwhereselllist=""; - foreach ($arrayquery['options_'.$key] as $data) { - $data = trim($data); - if ($data) { - $sqlwhereselllist .= ($i2 > 0 ? " OR (" : "(").$field." LIKE '".$this->db->escape($data).",%'"; - $sqlwhereselllist .= " OR ".$field." = '".$this->db->escape($data)."'"; - $sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data)."'"; - $sqlwhereselllist .= " OR ".$field." LIKE '%,".$this->db->escape($data).",%'"; - $sqlwhereselllist .= ")"; - $i2++; // a criteria for 1 more field was added to string (we can add several criteria for the same field as it is a multiselect search criteria) - } - } - if (!empty($sqlwhereselllist)) { - $sqlwhere[] = "( ".$sqlwhereselllist." )"; - } - } } else { if (is_array($arrayquery['options_'.$key])) { $sqlwhere[] = " (tse.".$key." IN (".$this->db->sanitize("'".implode("','", $arrayquery["options_".$key])."'", 1)."))"; ########## comm/propal/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/card.php 2025-06-27 11:43:39.583676000 +0000 @@ -525,7 +525,7 @@ $object->contact_id = GETPOSTINT('contactid'); $object->fk_project = GETPOSTINT('projectid'); $object->model_pdf = GETPOST('model', 'alphanohtml'); - $object->author = $user; // deprecated + $object->author = $user->id; // deprecated $object->user_author_id = $user->id; $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -555,8 +555,7 @@ $object->contact_id = GETPOSTINT('contactid'); $object->fk_project = GETPOSTINT('projectid'); $object->model_pdf = GETPOST('model'); - $object->author = $user; // deprecated - $object->user_author_id = $user->id; + $object->author = $user->id; // deprecated $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); $object->fk_incoterms = GETPOSTINT('incoterm_id'); ########## comm/propal/class/api_proposals.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/class/api_proposals.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/class/api_proposals.class.php 2025-06-27 11:43:39.590152000 +0000 @@ -193,7 +193,7 @@ $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; ########## comm/propal/class/propal.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/class/propal.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/class/propal.class.php 2025-06-27 11:43:39.593000000 +0000 @@ -197,7 +197,6 @@ /** * @var User user identified by user_author_id - * @deprecated Set only $user_author_id */ public $author; ########## comm/propal/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/comm/propal/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/comm/propal/list.php 2025-06-27 11:43:39.578813000 +0000 @@ -2382,7 +2382,7 @@ // Note public if (!empty($arrayfields['p.note_public']['checked'])) { print '
'; if (!$i) { $totalarray['nbfield']++; @@ -2391,7 +2391,7 @@ // Note private if (!empty($arrayfields['p.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; ########## commande/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/card.php 2025-06-27 11:43:39.991603000 +0000 @@ -2978,7 +2978,7 @@ print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; + print dolPrintHTML($obj->note_public); print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; + print dolPrintHTML($obj->note_private); print '
'; - if ($action != 'editposinfo' && $usercancreate) { + if ($action != 'editposinfo' && $object->status == $object::STATUS_DRAFT && $usercancreate) { print ''; } print '
'; print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo')); print 'id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'
'; ########## commande/class/api_orders.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/class/api_orders.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/class/api_orders.class.php 2025-06-27 11:43:39.998045000 +0000 @@ -186,7 +186,7 @@ $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; ########## commande/class/commande.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/class/commande.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/class/commande.class.php 2025-06-27 11:43:40.002622000 +0000 @@ -1068,15 +1068,10 @@ for ($i = 0; $i < $num; $i++) { $line = $this->lines[$i]; - // Test and convert into OrderLine object this->lines[$i]. When coming from REST API, we may still have an array + // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (!is_object($line)) { - $lineobj = new OrderLine($this->db); - foreach ($line as $key => $val) { - $lineobj->$key = $val; - } - $line = $lineobj; - $this->lines[$i] = $line; + $line = (object) $line; } // Reset fk_parent_line for no child products and special product @@ -1829,12 +1824,9 @@ $this->line_order(true, 'DESC'); } elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines starting from the same $ranktouse - foreach ($this->lines as $tmpline) { - if ($tmpline->rang >= $ranktouse) { - if (!empty($tmpline->id)) { - $this->updateRangOfLine($tmpline->id, $tmpline->rang + 1); - } - } + $linecount = count($this->lines); + for ($ii = $ranktouse; $ii <= $linecount; $ii++) { + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); } } ########## commande/class/orderline.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/class/orderline.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/class/orderline.class.php 2025-06-27 11:43:39.995667000 +0000 @@ -37,7 +37,6 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php'; // Because the CommonOrderLine is still in commonorder.class.php file require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; @@ -151,42 +150,6 @@ */ public $packaging; - - // BEGIN MODULEBUILDER PROPERTIES - /** - * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. - */ - public $fields = array( - 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), - 'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1), - 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20), - 'ref_customer' => array('type' => 'varchar(50)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 25, 'searchall' => 1), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1), - 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), - 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 40), - 'fk_commande' => array('type' => 'integer:Commande:commande/class/commande.class.php', 'label' => 'Order', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 70), - 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 75), - 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1', 'label' => 'ProductOrService', 'enabled' => "isModEnabled('product') || isModEnabled('service')", 'visible' => -1, 'position' => 76), - //'fk_commercial_signature' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative Signature', 'enabled' => 1, 'visible' => -1, 'position' => 80), - //'fk_commercial_suivi' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'SaleRepresentative follower', 'enabled' => 1, 'visible' => -1, 'position' => 85), - 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 90), - 'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 125, 'isameasure' => 1), - 'total_tva' => array('type' => 'double(24,8)', 'label' => 'VAT', 'enabled' => 1, 'visible' => -1, 'position' => 130, 'isameasure' => 1), - 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LocalTax1', 'enabled' => 1, 'visible' => -1, 'position' => 135, 'isameasure' => 1), - 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LocalTax2', 'enabled' => 1, 'visible' => -1, 'position' => 140, 'isameasure' => 1), - 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 145, 'isameasure' => 1), - 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105, 'searchall' => 1), - 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110, 'searchall' => 1), - 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 115), - 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 120), - 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 125), - 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 135), - 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'Last main doc', 'enabled' => 1, 'visible' => -1, 'position' => 140), - 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'position' => 500, 'notnull' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed')) - ); - // END MODULEBUILDER PROPERTIES - - /** * Constructor * ########## commande/customer.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/customer.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/customer.php 2025-06-27 11:43:40.004156000 +0000 @@ -80,9 +80,13 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-commande page-customer'); -// Mode List +$thirdpartystatic = new Societe($db); -$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec,"; +/* + * Mode List + */ + +$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea,"; $sql .= " st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta as code_compta_client"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE s.fk_stcomm = st.id AND c.fk_soc = s.rowid"; @@ -96,6 +100,9 @@ if (GETPOST("search_code_client")) { $sql .= natural_search("s.code_client", GETPOST("search_code_client")); } +if (dol_strlen($begin)) { + $sql .= " AND s.nom LIKE '".$db->escape($begin)."'"; +} // If the internal user must only see his customers, force searching by him $search_sale = 0; if (!$user->hasRight('societe', 'client', 'voir')) { @@ -114,7 +121,7 @@ $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= " AND c.fk_statut in (1, 2) AND c.facture = 0"; -$sql .= " GROUP BY s.nom, s.rowid"; +$sql .= " GROUP BY s.nom"; $sql .= $db->order($sortfield, $sortorder); // Count total nb of records @@ -148,7 +155,7 @@ print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder); print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", "", "", 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder); print "\n"; // Fields title search @@ -177,7 +184,7 @@ $obj = $db->fetch_object($resql); print ''; - print ''; + print ''; $result = ''; $link = $linkend = ''; @@ -185,7 +192,7 @@ $linkend = ''; $name = $obj->name; $result .= ($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend); - $result .= $link.$name.$linkend; + $result .= $link.(dol_trunc($name, $maxlen)).$linkend; print $result; print ''; ########## commande/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/list.php 2025-06-27 11:43:40.006328000 +0000 @@ -1026,12 +1026,7 @@ } } if ($search_option == 'late') { - // Use delivery date if set and not disabled, otherwise use order date. - if (!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE')) { - $sql .= " AND ((c.date_livraison IS NOT NULL AND c.date_livraison < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."') OR (c.date_livraison IS NULL AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'))"; - } else { - $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'"; - } + $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'"; } if ($search_datecloture_start) { $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; @@ -2913,8 +2908,8 @@ // Note public if (!empty($arrayfields['c.note_public']['checked'])) { - print ''; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; + print ''; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'
'; print ''; if (!$i) { $totalarray['nbfield']++; @@ -2923,8 +2918,8 @@ // Note private if (!empty($arrayfields['c.note_private']['checked'])) { - print ''; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; + print ''; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'
'; print ''; if (!$i) { $totalarray['nbfield']++; ########## commande/list_det.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/commande/list_det.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/commande/list_det.php 2025-06-27 11:43:39.984996000 +0000 @@ -191,11 +191,11 @@ $checkedtypetiers = 0; $arrayfields = array( // Détail commande - 'rowid' => array('label' => 'LineID', 'checked' => '-1', 'position' => 1, 'enabled' => '1'), + 'rowid' => array('label' => 'TechnicalID', 'checked' => '-1', 'position' => 1, 'enabled' => '1'), + 'pr.ref' => array('label' => 'ProductRef', 'checked' => '1', 'position' => 2), + 'pr.desc' => array('label' => 'ProductDescription', 'checked' => '-1', 'position' => 3), + 'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => '1', 'position' => 4), 'c.ref' => array('label' => "RefOrder", 'checked' => '1', 'position' => 5), - 'pr.ref' => array('label' => 'ProductRef', 'checked' => '1', 'position' => 6), - 'pr.desc' => array('label' => 'ProductDescription', 'checked' => '-1', 'position' => 7), - 'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => '1', 'position' => 8), 'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => '-1', 'position' => 10), 'p.ref' => array('label' => "ProjectRef", 'checked' => '-1', 'enabled' => (string) (int) isModEnabled('project'), 'position' => 20), 'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'enabled' => (string) (int) isModEnabled('project'), 'position' => 25), @@ -1032,13 +1032,7 @@ print ''; print ''; } - // Ref order - if (!empty($arrayfields['c.ref']['checked'])) { - print ''; - print ''; - print ''; - } - // Product ref + // Détail commande if (!empty($arrayfields['pr.ref']['checked'])) { print ''; print ''; @@ -1055,6 +1049,12 @@ print ''; } + // Ref + if (!empty($arrayfields['c.ref']['checked'])) { + print ''; + print ''; + print ''; + } // Ref customer if (!empty($arrayfields['c.ref_client']['checked'])) { print ''; @@ -1321,14 +1321,11 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center '); } - // Detail order + // Détail commande if (!empty($arrayfields['rowid']['checked'])) { // @phan-suppress-next-line PhanTypeInvalidDimOffset print_liste_field_titre($arrayfields['rowid']['label'], $_SERVER["PHP_SELF"], 'rowid', '', $param, '', $sortfield, $sortorder); } - if (!empty($arrayfields['c.ref']['checked'])) { - print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder); - } if (!empty($arrayfields['pr.ref']['checked'])) { print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder); } @@ -1339,6 +1336,9 @@ print_liste_field_titre($arrayfields['cdet.qty']['label'], $_SERVER["PHP_SELF"], 'cdet.qty', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['c.ref']['checked'])) { + print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['c.ref_client']['checked'])) { print_liste_field_titre($arrayfields['c.ref_client']['label'], $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder); } @@ -1611,22 +1611,6 @@ } } - // Ref order - if (!empty($arrayfields['c.ref']['checked'])) { - print ''; - print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1); - - $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; - print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); - - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Product Ref if (!empty($arrayfields['pr.ref']['checked'])) { if (!empty($obj->product_rowid)) { @@ -1676,6 +1660,22 @@ } } + // Ref + if (!empty($arrayfields['c.ref']['checked'])) { + print ''; + print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1); + + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); + + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Ref customer if (!empty($arrayfields['c.ref_client']['checked'])) { print ''.$obj->ref_client.''; ########## compta/bank/bankentries_list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/bank/bankentries_list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/bank/bankentries_list.php 2025-06-27 11:43:39.897355000 +0000 @@ -796,8 +796,8 @@ print ''; print ''; print ''; - if (!empty($mode)) { - print ''; + if (!empty($view)) { + print ''; } print ''; print ''; @@ -845,7 +845,7 @@ print ''; print ' '; print ''; - print $form->select_types_paiements((GETPOST('operation') ? GETPOST('operation') : ($object->type == Account::TYPE_CASH ? 'LIQ' : '')), 'operation', '1,2', 2, 1, 0, 0, 1, '', 1); + $form->select_types_paiements((GETPOST('operation') ? GETPOST('operation') : ($object->type == Account::TYPE_CASH ? 'LIQ' : '')), 'operation', '1,2', 2, 1); print ''; print ''; print ''; @@ -853,7 +853,7 @@ //if (! $search_account > 0) //{ print ''; - print $form->select_comptes(GETPOSTINT('add_account') ? GETPOSTINT('add_account') : $search_account, 'add_account', 0, '', 1, ($id > 0 || !empty($ref) ? ' disabled="disabled"' : ''), 0, '', 1); + $form->select_comptes(GETPOSTINT('add_account') ? GETPOSTINT('add_account') : $search_account, 'add_account', 0, '', 1, ($id > 0 || !empty($ref) ? ' disabled="disabled"' : '')); print ''; //} print ''; @@ -1138,7 +1138,7 @@ } // Type if (!empty($arrayfields['type']['checked'])) { - print ''; + print ''; print $form->select_types_paiements(empty($search_type) ? '' : $search_type, 'search_type', '', 2, 1, 1, 0, 1, 'maxwidth100', 1); print ''; } @@ -1240,7 +1240,7 @@ $totalarray['nbfield']++; } if (!empty($arrayfields['type']['checked'])) { - print_liste_field_titre($arrayfields['type']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['type']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['b.num_chq']['checked'])) { @@ -1670,13 +1670,13 @@ if (!empty($arrayfields['type']['checked'])) { $labeltype = ($langs->transnoentitiesnoconv("PaymentTypeShort".$objp->fk_type) != "PaymentTypeShort".$objp->fk_type) ? $langs->transnoentitiesnoconv("PaymentTypeShort".$objp->fk_type) : $langs->getLabelFromKey($db, $objp->fk_type, 'c_paiement', 'code', 'libelle', '', 1); if (empty($arrayfields['b.num_chq']['checked'])) { - $labeltype .= ($objp->num_chq ? ' - '.$objp->num_chq.'' : ''); + $labeltype .= ($objp->num_chq ? ' - '.$objp->num_chq : ''); } print ''; if ($labeltype == 'SOLD') { print ' '; //$langs->trans("InitialBankBalance"); } else { - print dolPrintHtml($labeltype); + print dolPrintLabel($labeltype); } print "\n"; if (!$i) { ########## compta/bank/various_payment/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/bank/various_payment/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/bank/various_payment/list.php 2025-06-27 11:43:39.882000000 +0000 @@ -234,7 +234,6 @@ } } - /* * View */ @@ -404,16 +403,16 @@ $param .= '&search_label='.urlencode($search_label); } if ($search_datep_start) { - $param .= '&search_datep_start='.urlencode((string) $search_datep_start); + $param .= '&search_datep_start='.urlencode($search_datep_start); } if ($search_datep_end) { - $param .= '&search_datep_end='.urlencode((string) $search_datep_end); + $param .= '&search_datep_end='.urlencode($search_datep_end); } if ($search_datev_start) { - $param .= '&search_datev_start='.urlencode((string) $search_datev_start); + $param .= '&search_datev_start='.urlencode($search_datev_start); } if ($search_datev_end) { - $param .= '&search_datev_end='.urlencode((string) $search_datev_end); + $param .= '&search_datev_end='.urlencode($search_datev_end); } if ($search_type_id > 0) { $param .= '&search_type_id='.urlencode((string) ($search_type_id)); ########## compta/facture/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/card.php 2025-06-27 11:43:39.831953000 +0000 @@ -5251,7 +5251,7 @@ print ''; - if ($action != 'editposinfo' && $usercancreate) { + if ($action != 'editposinfo' && $object->status == $object::STATUS_DRAFT && $usercancreate) { print ''; } print '
'; print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo')); print 'id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'
'; ########## compta/facture/class/api_invoices.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/class/api_invoices.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/class/api_invoices.class.php 2025-06-27 11:43:39.837599000 +0000 @@ -203,7 +203,7 @@ $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; @@ -1616,10 +1616,10 @@ * Warning: Take care that all invoices are owned by the same customer. * Example of value for parameter arrayofamounts: {"1": {"amount": "99.99", "multicurrency_amount": ""}, "2": {"amount": "", "multicurrency_amount": "10"}} * - * @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice + * @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice * @phan-param array $arrayofamounts * @phpstan-param array $arrayofamounts - * @param string $datepaye {@from body} Payment date + * @param string $datepaye {@from body} Payment date * @param int $paymentid {@from body} Payment mode Id {@min 1} * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} * @param int $accountid {@from body} Account Id {@min 1} @@ -1694,23 +1694,23 @@ $totalpaid = $this->invoice->getSommePaiement($is_multicurrency); $totalcreditnotes = $this->invoice->getSumCreditNotesUsed($is_multicurrency); $totaldeposits = $this->invoice->getSumDepositsUsed($is_multicurrency); - $remainstopay = $amount = (float) price2num($total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); + $remainstopay = $amount = price2num($total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); if (!$is_multicurrency && $amountarray["amount"] != 'remain') { - $amount = (float) price2num($amountarray["amount"], 'MT'); + $amount = price2num($amountarray["amount"], 'MT'); } if ($is_multicurrency && $amountarray["multicurrency_amount"] != 'remain') { - $amount = (float) price2num($amountarray["multicurrency_amount"], 'MT'); + $amount = price2num($amountarray["multicurrency_amount"], 'MT'); } - if (abs($amount) > abs($remainstopay) && !$accepthigherpayment) { + if ($amount > $remainstopay && !$accepthigherpayment) { $this->db->rollback(); throw new RestException(400, 'Payment amount on invoice ID '.$id.' ('.$amount.') is higher than remain to pay ('.$remainstopay.')'); } if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) { - $amount = (float) price2num(-1 * abs((float) $amount), 'MT'); + $amount = price2num(-1 * (float) $amount, 'MT'); } if ($is_multicurrency) { ########## compta/facture/class/facture.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/class/facture.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/class/facture.class.php 2025-06-27 11:43:39.844663000 +0000 @@ -175,7 +175,6 @@ * @var int id of source invoice if replacement invoice or credit note */ public $fk_facture_source; - public $linked_objects = array(); /** @@ -214,7 +213,7 @@ public $situation_cycle_ref; /** - * @var ?int Situation counter inside the cycle + * @var int Situation counter inside the cycle */ public $situation_counter; @@ -1081,7 +1080,7 @@ 0, $fk_parent_line, $fk_product_fournisseur_price, - is_null($buyprice) ? '' : $buyprice, // do not use (float) here, it may be '' + $buyprice, $_facrec->lines[$i]->label, empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, 100, // situation percent is undefined on recurring invoice lines @@ -1296,7 +1295,6 @@ $object->fk_user_author = $user->id; $object->fk_user_valid = null; $object->fk_facture_source = 0; - $object->fk_fac_rec_source = 0; $object->date_creation = ''; $object->date_modification = ''; $object->date_validation = ''; @@ -6191,7 +6189,7 @@ } else { $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; } - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch processes only one company (no sharing) + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) if (!empty($paymentmode) && $paymentmode != 'all') { $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; } @@ -6201,7 +6199,6 @@ } else { $sql .= $this->db->order("date_lim_reglement", "ASC"); } - // TODO Add a date date_last_remind_email in select. We can update date after the result of sendfile() later. To avoid to send it twiceif we rerun the batch. $resql = $this->db->query($sql); @@ -6218,217 +6215,210 @@ if ($resql) { while ($obj = $this->db->fetch_object($resql)) { - // Create a loopError that is reset at each loop, this counter is added to the global counter at the end of loop - $loopError = 0; - - // Load event - $res = $tmpinvoice->fetch($obj->id); - if ($res > 0) { - $tmpinvoice->fetch_thirdparty(); - - $outputlangs = new Translate('', $conf); - if ($tmpinvoice->thirdparty->default_lang) { - $outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang); - $outputlangs->loadLangs(array("main", "bills")); - } else { - $outputlangs = $langs; - } + if (!$error) { + // Load event + $res = $tmpinvoice->fetch($obj->id); + if ($res > 0) { + $tmpinvoice->fetch_thirdparty(); + + $outputlangs = new Translate('', $conf); + if ($tmpinvoice->thirdparty->default_lang) { + $outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "bills")); + } else { + $outputlangs = $langs; + } - // Select email template according to language of recipient - $arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template)); - if (is_numeric($arraymessage) && $arraymessage <= 0) { - $langs->load("errors"); - $this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template); - return 0; - } + // Select email template according to language of recipient + $arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template)); + if (is_numeric($arraymessage) && $arraymessage <= 0) { + $langs->load("errors"); + $this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template); + return 0; + } - // PREPARE EMAIL - $errormesg = ''; + // PREPARE EMAIL + $errormesg = ''; - // Make substitution in email content - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $tmpinvoice); + // Make substitution in email content + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $tmpinvoice); - complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice); + complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice); - // Topic - $sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1); + // Topic + $sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1); - // Content - $content = $outputlangs->transnoentitiesnoconv($arraymessage->content); + // Content + $content = $outputlangs->transnoentitiesnoconv($arraymessage->content); - $sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1); + $sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1); - // Recipient - $to = array(); - if ($forcerecipient) { // If a recipient was forced - $to = array($forcerecipient); - } else { - $res = $tmpinvoice->fetch_thirdparty(); - $recipient = $tmpinvoice->thirdparty; - if ($res > 0) { - $tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING'); - if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { - foreach ($tmparraycontact as $data_email) { - if (!empty($data_email['email'])) { - $to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email'); + // Recipient + $to = array(); + if ($forcerecipient) { // If a recipient was forced + $to = array($forcerecipient); + } else { + $res = $tmpinvoice->fetch_thirdparty(); + $recipient = $tmpinvoice->thirdparty; + if ($res > 0) { + $tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING'); + if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { + foreach ($tmparraycontact as $data_email) { + if (!empty($data_email['email'])) { + $to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email'); + } } } + if (empty($to) && !empty($recipient->email)) { + $to[] = $recipient->email; + } + if (empty($to)) { + $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer."; + $error++; + } + } else { + $errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid; + $error++; } - if (empty($to) && !empty($recipient->email)) { - $to[] = $recipient->email; - } - if (empty($to)) { - $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer."; - $loopError++; - } - } else { - $errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid; - $loopError++; } - } - - // Sender - $from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); - if (!empty($arraymessage->email_from)) { // If a sender is defined into template, we use it in priority - $from = (string) $arraymessage->email_from; - } - if (empty($from)) { - $errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM"; - $loopError++; - } - if (!$loopError && !empty($to)) { - $to = implode(',', $to); - if (!empty($arraymessage->email_to)) { // If a recipient is defined into template, we add it - $to = $to.','.$arraymessage->email_to; + // Sender + $from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); + if (!empty($arraymessage->email_from)) { // If a sender is defined into template, we use it in priority + $from = (string) $arraymessage->email_from; } - - // Errors Recipient - $errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO'); - - $trackid = 'inv'.$tmpinvoice->id; - $sendcontext = 'standard'; - - $email_tocc = ''; - if (!empty($arraymessage->email_tocc)) { // If a CC is defined into template, we use it - $email_tocc = (string) $arraymessage->email_tocc; + if (empty($from)) { + $errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM"; + $error++; } - $email_tobcc = ''; - if (!empty($arraymessage->email_tobcc)) { // If a BCC is defined into template, we use it - $email_tobcc = (string) $arraymessage->email_tobcc; - } + if (!$error && !empty($to)) { + $this->db->begin(); - //join file is asked - $joinFile = []; - $joinFileName = []; - $joinFileMime = []; - if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) { - $joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc; - $joinFileName[] = basename($tmpinvoice->last_main_doc); - $joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc); - } + $to = implode(',', $to); + if (!empty($arraymessage->email_to)) { // If a recipient is defined into template, we add it + $to = $to.','.$arraymessage->email_to; + } - // Mail Creation - $cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, $email_tocc, $email_tobcc, 0, 1, $errors_to, '', $trackid, '', $sendcontext, ''); + // Errors Recipient + $errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO'); - $resultsendmail = $cMailFile->sendfile(); + $trackid = 'inv'.$tmpinvoice->id; + $sendcontext = 'standard'; - $this->db->begin(); + $email_tocc = ''; + if (!empty($arraymessage->email_tocc)) { // If a CC is defined into template, we use it + $email_tocc = (string) $arraymessage->email_tocc; + } - // Sending Mail - if ($resultsendmail) { - $nbMailSend++; + $email_tobcc = ''; + if (!empty($arraymessage->email_tobcc)) { // If a BCC is defined into template, we use it + $email_tobcc = (string) $arraymessage->email_tobcc; + } - // Add a line into event table - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + //join file is asked + $joinFile = []; + $joinFileName = []; + $joinFileMime = []; + if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) { + $joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc; + $joinFileName[] = basename($tmpinvoice->last_main_doc); + $joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc); + } - // Insert record of emails sent - $actioncomm = new ActionComm($this->db); + // Mail Creation + $cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, $email_tocc, $email_tobcc, 0, 1, $errors_to, '', $trackid, '', $sendcontext, ''); - $actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically - $actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company - $actioncomm->contact_id = 0; + // Sending Mail + if ($cMailFile->sendfile()) { + $nbMailSend++; + + // Add a line into event table + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + + // Insert record of emails sent + $actioncomm = new ActionComm($this->db); + + $actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically + $actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company + $actioncomm->contact_id = 0; + + $actioncomm->code = 'AC_EMAIL'; + $actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateOK (nbdays='.$nbdays.' paymentmode='.$paymentmode.' template='.$template.' datetouse='.$datetouse.' forcerecipient='.$forcerecipient.')'; + $actioncomm->note_private = $sendContent; + $actioncomm->fk_project = $tmpinvoice->fk_project; + $actioncomm->datep = dol_now(); + $actioncomm->datef = $actioncomm->datep; + $actioncomm->percentage = -1; // Not applicable + $actioncomm->authorid = $user->id; // User saving action + $actioncomm->userownerid = $user->id; // Owner of action + // Fields when action is an email (content should be added into note) + $actioncomm->email_msgid = $cMailFile->msgid; + $actioncomm->email_subject = $sendTopic; + $actioncomm->email_from = $from; + $actioncomm->email_sender = ''; + $actioncomm->email_to = $to; + //$actioncomm->email_tocc = $sendtocc; + //$actioncomm->email_tobcc = $sendtobcc; + //$actioncomm->email_subject = $subject; + $actioncomm->errors_to = $errors_to; + + $actioncomm->elementtype = 'invoice'; + $actioncomm->elementid = $tmpinvoice->id; + $actioncomm->fk_element = $tmpinvoice->id; - $actioncomm->code = 'AC_EMAIL'; - $actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateOK (nbdays='.$nbdays.' paymentmode='.$paymentmode.' template='.$template.' datetouse='.$datetouse.' forcerecipient='.$forcerecipient.')'; - $actioncomm->note_private = $sendContent; - $actioncomm->fk_project = $tmpinvoice->fk_project; - $actioncomm->datep = dol_now(); - $actioncomm->datef = $actioncomm->datep; - $actioncomm->percentage = -1; // Not applicable - $actioncomm->authorid = $user->id; // User saving action - $actioncomm->userownerid = $user->id; // Owner of action - // Fields when action is an email (content should be added into note) - $actioncomm->email_msgid = $cMailFile->msgid; - $actioncomm->email_subject = $sendTopic; - $actioncomm->email_from = $from; - $actioncomm->email_sender = ''; - $actioncomm->email_to = $to; - //$actioncomm->email_tocc = $sendtocc; - //$actioncomm->email_tobcc = $sendtobcc; - //$actioncomm->email_subject = $subject; - $actioncomm->errors_to = $errors_to; + //$actioncomm->extraparams = $extraparams; - $actioncomm->elementtype = 'invoice'; - $actioncomm->elementid = $tmpinvoice->id; + $actioncomm->create($user); + } else { + $errormesg = $cMailFile->error.' : '.$to; + $error++; - //$actioncomm->extraparams = $extraparams; + // Add a line into event table + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - $actioncomm->create($user); - } else { - $errormesg = $cMailFile->error.' : '.$to; - $loopError++; + // Insert record of emails sent + $actioncomm = new ActionComm($this->db); - // Add a line into event table - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically + $actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company + $actioncomm->contact_id = 0; + + $actioncomm->code = 'AC_EMAIL'; + $actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateKO'; + $actioncomm->note_private = $errormesg; + $actioncomm->fk_project = $tmpinvoice->fk_project; + $actioncomm->datep = dol_now(); + $actioncomm->datef = $actioncomm->datep; + $actioncomm->percentage = -1; // Not applicable + $actioncomm->authorid = $user->id; // User saving action + $actioncomm->userownerid = $user->id; // Owner of action + // Fields when action is an email (content should be added into note) + $actioncomm->email_msgid = $cMailFile->msgid; + $actioncomm->email_from = $from; + $actioncomm->email_sender = ''; + $actioncomm->email_to = $to; + //$actioncomm->email_tocc = $sendtocc; + //$actioncomm->email_tobcc = $sendtobcc; + //$actioncomm->email_subject = $subject; + $actioncomm->errors_to = $errors_to; - // Insert record of emails sent - $actioncomm = new ActionComm($this->db); + //$actioncomm->extraparams = $extraparams; - $actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically - $actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company - $actioncomm->contact_id = 0; - - $actioncomm->code = 'AC_EMAIL'; - $actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateKO'; - $actioncomm->note_private = $errormesg; - $actioncomm->fk_project = $tmpinvoice->fk_project; - $actioncomm->datep = dol_now(); - $actioncomm->datef = $actioncomm->datep; - $actioncomm->percentage = -1; // Not applicable - $actioncomm->authorid = $user->id; // User saving action - $actioncomm->userownerid = $user->id; // Owner of action - // Fields when action is an email (content should be added into note) - $actioncomm->email_msgid = $cMailFile->msgid; - $actioncomm->email_from = $from; - $actioncomm->email_sender = ''; - $actioncomm->email_to = $to; - //$actioncomm->email_tocc = $sendtocc; - //$actioncomm->email_tobcc = $sendtobcc; - //$actioncomm->email_subject = $subject; - $actioncomm->errors_to = $errors_to; - - $actioncomm->elementtype = 'invoice'; - $actioncomm->elementid = $tmpinvoice->id; - - //$actioncomm->extraparams = $extraparams; + $actioncomm->create($user); + } - $actioncomm->create($user); + $this->db->commit(); // We always commit } - $this->db->commit(); // We always commit - } - - if ($errormesg) { - $errorsMsg[] = $errormesg; + if ($errormesg) { + $errorsMsg[] = $errormesg; + } + } else { + $errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id; + $error++; } - } else { - $errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id; - $loopError++; } - - $error += $loopError; } } else { $error++; ########## compta/facture/invoicetemplate_list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/invoicetemplate_list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/invoicetemplate_list.php 2025-06-27 11:43:39.809542000 +0000 @@ -64,7 +64,6 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$groupby = GETPOST('groupby', 'aZ09'); $socid = GETPOSTINT('socid'); @@ -183,13 +182,9 @@ $objecttype = 'facture_rec'; -$permissiontoread = $user->hasRight("facture", "read"); $permissionnote = $user->hasRight('facture', 'creer'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('facture', 'creer'); // Used by the include of actions_dellink.inc.php $permissiontoedit = $user->hasRight('facture', 'creer'); // Used by the include of actions_lineupdonw.inc.php -$permissiontodelete = $user->hasRight("facture", "delete"); - -$uploaddir = $conf->facture->dir_output; // Security check $result = restrictedArea($user, 'facture', $object->id, $objecttype); @@ -207,7 +202,7 @@ $massaction = ''; } -$parameters = array('arrayfields' => &$arrayfields, 'socid' => $socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -260,8 +255,11 @@ } // Mass actions - /*$objectclass = 'MyObject'; - $objectlabel = 'MyObject'; + /*$objectclass='MyObject'; + $objectlabel='MyObject'; + $permissiontoread = $user->hasRight("mymodule", "read"); + $permissiontodelete = $user->hasRight("mymodule", "delete"); + $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ } @@ -405,7 +403,7 @@ dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -449,12 +447,6 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } -if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); -} -if ($groupby != '') { - $param .= '&groupby='.urlencode($groupby); -} if ($socid > 0) { $param .= '&socid='.urlencode((string) ($socid)); } @@ -530,11 +522,14 @@ if ($search_status != '') { $param .= '&search_status='.urlencode($search_status); } +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array('param' => &$param); -$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -602,7 +597,7 @@ print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; + print ''; $searchpicto = $form->showFilterButtons('left'); print $searchpicto; print ''; @@ -734,7 +729,7 @@ } // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print ''; ########## compta/facture/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/facture/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/facture/list.php 2025-06-27 11:43:39.813554000 +0000 @@ -2920,7 +2920,7 @@ // Note public if (!empty($arrayfields['f.note_public']['checked'])) { print ''; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; + print dolPrintHTML($obj->note_public); print ''; if (!$i) { $totalarray['nbfield']++; @@ -2928,8 +2928,8 @@ } // Note private if (!empty($arrayfields['f.note_private']['checked'])) { - print ''; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; + print ''; + print dolPrintHTML($obj->note_private); print ''; if (!$i) { $totalarray['nbfield']++; ########## compta/paiement/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/paiement/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/paiement/card.php 2025-06-27 11:43:39.669352000 +0000 @@ -92,7 +92,7 @@ $service = 'StripeTest'; $servicestatus = 0; - if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) { + if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) { $service = 'StripeLive'; $servicestatus = 1; } ########## compta/paiement/class/paiement.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/paiement/class/paiement.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/paiement/class/paiement.class.php 2025-06-27 11:43:39.683439000 +0000 @@ -171,6 +171,11 @@ public $num_payment; /** + * @var string Id of external payment mode + */ + public $ext_payment_id; + + /** * @var int Id of prelevement */ public $id_prelevement; @@ -181,12 +186,7 @@ public $num_prelevement; /** - * @var string Id of external payment mode (With Stripe: 'pi_xxx:cus_ccc@pk_ppp', ...) - */ - public $ext_payment_id; - - /** - * @var string Name of external payment mode ('StripeLive', 'StripeTest', 'stripe' on old version, 'paypal', ...) + * @var string Name of external payment mode */ public $ext_payment_site; @@ -296,8 +296,7 @@ /** * Create payment of invoices into database. * It uses this->amounts and ->multicurrency_amounts to get the list of detail of payment for each invoices for the payment. - * For payment of a customer invoice, amounts are positive, for payment of credit note, amounts are negative. - * Can also close the invoice if remain to pay is 0. + * For payment of a customer invoice, amounts are positive, for payment of credit note, amounts are negative * This will set also ->amount and ->multicurrency_amount at end. * * @param User $user Object user ########## compta/paiement.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/paiement.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/paiement.php 2025-06-27 11:43:39.666854000 +0000 @@ -828,7 +828,7 @@ if (!empty($conf->use_javascript_ajax)) { print ''; } - print ''; // class is required to be used by javascript callForResult(); + print ''; // class is required to be used by javascript callForResult(); print ''; } else { print ''; ########## compta/prelevement/card.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/prelevement/card.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/prelevement/card.php 2025-06-27 11:43:39.705154000 +0000 @@ -80,11 +80,8 @@ $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); $type = $object->type; - -// Check if salary or invoice +// check if salary pl $salaryBonPl = $object->checkIfSalaryBonPrelevement(); - -// Security check if ($type == 'bank-transfer') { $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); @@ -102,6 +99,7 @@ } + /* * Actions */ @@ -199,6 +197,7 @@ } + /* * View */ ########## compta/prelevement/fiche-rejet.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/compta/prelevement/fiche-rejet.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/compta/prelevement/fiche-rejet.php 2025-06-27 11:43:39.702771000 +0000 @@ -1,9 +1,9 @@ - * Copyright (C) 2005-2025 Laurent Destailleur + * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ */ // Load translation files required by the page -$langs->loadLangs(array("banks", "categories", "companies", 'withdrawals', 'bills')); +$langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); // Security check if ($user->socid > 0) { @@ -76,9 +76,6 @@ // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals -// Check if salary or invoice -$salaryBonPl = $object->checkIfSalaryBonPrelevement(); - // Security check if ($user->socid > 0) { accessforbidden(); @@ -92,6 +89,7 @@ } + /* * View */ @@ -227,8 +225,11 @@ $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND p.entity IN (".getEntity('facture').")"; $sql .= " AND pl.fk_soc = s.rowid"; -$sql .= " AND pl.statut = 3"; +$sql .= " AND pl.statut = 3 "; $sql .= " AND pr.fk_prelevement_lignes = pl.rowid"; +/*if ($socid) { + $sql .= " AND s.rowid = ".((int) $socid); +}*/ $sql .= " ORDER BY pl.amount DESC"; // Count total nb of records @@ -251,20 +252,16 @@ // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Rejects"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); - $param = '&id='.((int) $object->id); - print"\n\n"; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; - print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "pl.rowid", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre((!$salaryBonPl ? "ThirdParty" : "Employee"), $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", '', $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("ToBill", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre(""); + print ''; + print ''; + print ''; print ''; $total = 0; ########## contact/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/contact/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/contact/list.php 2025-06-27 11:43:39.946308000 +0000 @@ -845,7 +845,7 @@ if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } -$param .= '&userid='.urlencode((string) $userid).'&contactname='.urlencode((string) $search_all); +$param .= '&begin='.urlencode((string) ($begin)).'&userid='.urlencode((string) ($userid)).'&contactname='.urlencode((string) ($search_all)); $param .= '&type='.urlencode($type).'&view='.urlencode($view); if (!empty($search_sale) && $search_sale != '-1') { $param .= '&search_sale='.urlencode($search_sale); ########## contrat/class/api_contracts.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/contrat/class/api_contracts.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/contrat/class/api_contracts.class.php 2025-06-27 11:43:38.871796000 +0000 @@ -114,7 +114,7 @@ $obj_ret = array(); // case of external user, $thirdparty_ids param is ignored and replaced by user's socid - $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids; + $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids; // If the internal user must only see his customers, force searching by him $search_sale = 0; ########## contrat/list.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/contrat/list.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/contrat/list.php 2025-06-27 11:43:38.891950000 +0000 @@ -149,7 +149,10 @@ $result = restrictedArea($user, 'contrat', $id); -$diroutputmassaction = $conf->contract->dir_output.'/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->contrat->dir_output.'/temp/massgeneration/'.$user->id; + +$staticcontrat = new Contrat($db); +$staticcontratligne = new ContratLigne($db); if ($search_status == '') { $search_status = 1; @@ -158,7 +161,6 @@ // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $object = new Contrat($db); $extrafields = new ExtraFields($db); -$staticcontratligne = new ContratLigne($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -250,7 +252,7 @@ $search_town = ''; $search_zip = ""; $search_state = ""; - $search_type_thirdparty = ''; + $search_type = ''; $search_country = ''; $search_contract = ""; $search_ref_customer = ""; @@ -286,6 +288,7 @@ $search_status = ""; $search_signed_status = ''; $toselect = array(); + $search_type_thirdparty = ''; $searchCategoryCustomerList = array(); $search_array_options = array(); } @@ -293,7 +296,7 @@ if (empty($reshook)) { $objectclass = 'Contrat'; $objectlabel = 'Contracts'; - $uploaddir = $conf->contract->dir_output; + $uploaddir = $conf->contrat->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -340,11 +343,11 @@ $sqlfields = $sql; // $sql fields to remove for count total -$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (c.fk_soc = s.rowid)"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; +$sql .= ", ".MAIN_DB_PREFIX."contrat as c"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)"; } @@ -353,11 +356,8 @@ $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } -// Add table from hooks -$parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook -$sql .= $hookmanager->resPrint; -$sql .= " WHERE c.entity IN (".getEntity('contract').")"; +$sql .= " WHERE c.fk_soc = s.rowid "; +$sql .= ' AND c.entity IN ('.getEntity('contract').')'; if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')'; } @@ -394,6 +394,9 @@ if ($search_country && $search_country != '-1') { $sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')'; } +/*if ($search_sale > 0) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); +}*/ if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } @@ -661,7 +664,7 @@ $param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday)); } if ($search_date_creation_start) { - $param .= '&search_date_creation_start='.urlencode((string) $search_date_creation_start); + $param .= '&search_date_creation_start='.urlencode($search_date_creation_start); } if ($search_date_creation_endmonth) { $param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth)); @@ -673,7 +676,7 @@ $param .= '&search_date_creation_endday='.urlencode((string) ($search_date_creation_endday)); } if ($search_date_creation_end) { - $param .= '&search_date_creation_end='.urlencode((string) $search_date_creation_end); + $param .= '&search_date_creation_end='.urlencode($search_date_creation_end); } if ($search_date_modif_startmonth) { $param .= '&search_date_modif_startmonth='.urlencode((string) ($search_date_modif_startmonth)); @@ -685,7 +688,7 @@ $param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday)); } if ($search_date_modif_start) { - $param .= '&search_date_modif_start='.urlencode((string) $search_date_modif_start); + $param .= '&search_date_modif_start='.urlencode($search_date_modif_start); } if ($search_date_modif_endmonth) { $param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth)); @@ -697,7 +700,7 @@ $param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday)); } if ($search_date_modif_end) { - $param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end); + $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); } if ($search_date_startday > 0) { $param .= '&search_date_startday='.urlencode((string) ($search_date_startday)); ########## core/actions_addupdatedelete.inc.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_addupdatedelete.inc.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_addupdatedelete.inc.php 2025-06-27 11:43:41.102435000 +0000 @@ -61,9 +61,6 @@ * @var string $hidedetails * @var string $hidedesc * @var string $hideref - * @var ?string $confirm - * @var ?int $lineid - * @var ?int $id */ // $action or $cancel must be defined // $object must be defined ########## core/actions_builddoc.inc.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_builddoc.inc.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_builddoc.inc.php 2025-06-27 11:43:41.008508000 +0000 @@ -29,29 +29,20 @@ // $permissiontoadd must be defined // $upload_dir must be defined (example $conf->project->dir_output . "/";) // $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. - /** * @var Conf $conf * @var Translate $langs * @var User $user - * @var CommonObject $object - * * @var string $action * @var int $id - * @var ?int $permissioncreate - * @var ?int $usercangeneratedoc + * @var CommonObject $object + * @var ?int $permissiontocreate * @var int $permissiontoadd * @var string $upload_dir - * * @var ?int $hidedetails * @var ?int $hidedesc * @var ?int $hideref - * @var ?array $moreparams */ -' -@phan-var-force ?array $moreparams -'; - if (!empty($permissioncreate) && empty($permissiontoadd)) { $permissiontoadd = $permissioncreate; // For backward compatibility } @@ -96,10 +87,18 @@ } // To be sure vars is defined - $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); - $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); - $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); - $moreparams = isset($moreparams) ? $moreparams : null; + if (empty($hidedetails)) { + $hidedetails = 0; + } + if (empty($hidedesc)) { + $hidedesc = 0; + } + if (empty($hideref)) { + $hideref = 0; + } + if (empty($moreparams)) { + $moreparams = null; + } $result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); if ($result <= 0) { ########## core/actions_massactions.inc.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_massactions.inc.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_massactions.inc.php 2025-06-27 11:43:40.953219000 +0000 @@ -1,5 +1,6 @@ + +/* Copyright (C) 2015-2017 Laurent Destailleur * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet @@ -33,7 +34,6 @@ // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined // $uploaddir may be defined (example to $conf->project->dir_output."/";) -// $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. // $toselect may be defined // $diroutputmassaction may be defined // $confirm @@ -47,31 +47,24 @@ * @var User $user * * @var string $dolibarr_main_url_root - * @var string $action - * @var string $massaction - * @var string $confirm - * @var ?int[] $toselect - * @var ?string $diroutputmassaction - * @var string $uploaddir - * @var string $objectclass - * @var ?string $objectlabel - * - * @var int $error - * * @var ?string $permissiontoadd * @var ?string $permissiontoread * @var ?string $permissiontodelete * @var ?string $permissiontoclose * @var ?string $permissiontoapprove + * @var ?int[] $toselect + * @var ?string $diroutputmassaction + * @var ?string $objectlabel * @var ?string $option * @var int $deliveryreceipt + * @var string $action + * @var string $massaction + * @var string $objectclass + * @var string $uploaddir + * @var string $confirm * @var string $month * @var string $year - * @var ?string $search_status - * @var ?int $hidedetails - * @var ?int $hidedesc - * @var ?int $hideref - * @var ?array $moreparams + * @var int $error */ ' @phan-var-force ?string $permissiontoread @@ -83,7 +76,6 @@ @phan-var-force ?string $objectlabel @phan-var-force ?string $option @phan-var-force int $deliveryreceipt -@phan-var-force ?array $moreparams '; @@ -95,6 +87,7 @@ if (empty($massaction)) { $massaction = ''; } +$error = 0; // Note: list of strings for objectclass could be extended to accepted/expected classes ' @@ -846,10 +839,7 @@ foreach ($listofobjectref as $tmppdf) { $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files } - - $listoffiles = dol_dir_list($uploaddir, 'all', 1, $arrayofinclusion, '\.meta$|\.png$', 'date', SORT_DESC, 0, 1); - - dol_syslog("Found ".count($listoffiles)." files"); + $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, 1); // build list of files with full path $files = array(); @@ -1092,14 +1082,13 @@ } $model = $objecttmp->model_pdf; $ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records - // To be sure vars is defined - $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); - $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); - $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); - $moreparams = isset($moreparams) ? $moreparams : null; + $hidedetails = !empty($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + $hidedesc = !empty($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + $hideref = !empty($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + $moreparams = !empty($moreparams) ? $moreparams : null; - $result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + $result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); } @@ -1257,10 +1246,18 @@ } // To be sure vars is defined - $hidedetails = isset($hidedetails) ? $hidedetails : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); - $hidedesc = isset($hidedesc) ? $hidedesc : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); - $hideref = isset($hideref) ? $hideref : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); - $moreparams = isset($moreparams) ? $moreparams : null; + if (empty($hidedetails)) { + $hidedetails = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0); + } + if (empty($hidedesc)) { + $hidedesc = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0); + } + if (empty($hideref)) { + $hideref = (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0); + } + if (empty($moreparams)) { + $moreparams = null; + } $result = $objecttmp->generateDocument($objecttmp->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); ########## core/actions_sendmails.inc.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/actions_sendmails.inc.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/actions_sendmails.inc.php 2025-06-27 11:43:40.955340000 +0000 @@ -145,7 +145,7 @@ $result = $object->fetch($id); if (method_exists($object, "fetch_thirdparty") && !in_array($object->element, array('member', 'user', 'expensereport', 'societe', 'contact'))) { - $object->fetch_thirdparty(); + $resultthirdparty = $object->fetch_thirdparty(); $thirdparty = $object->thirdparty; if (is_object($thirdparty)) { $sendtosocid = $thirdparty->id; ########## core/ajax/fetchCategories.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/ajax/fetchCategories.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/ajax/fetchCategories.php 2025-06-27 11:43:40.995821000 +0000 @@ -1,6 +1,5 @@ - * Copyright (C) 2025 Laurent Destailleur * * 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 @@ -103,7 +102,7 @@ } */ foreach ($cate_arbo as $categ) { - $response[] = array('id' => $categ['id'], 'label' => $categ['label'], 'fulllabel' => $categ['fulllabel'], 'htmlforoption' => dolPrintHTML((string) $categ['fulllabel']), 'htmlforattribute' => dolPrintHTMLForAttribute((string) $categ['data-html']), 'color' => $categ['color']); + $response[] = array('id' => $categ['id'], 'label' => $categ['label'], 'fulllabel' => $categ['fulllabel'], 'htmlforoption' => dolPrintHTML($categ['fulllabel']), 'htmlforattribute' => dolPrintHTMLForAttribute($categ['data-html']), 'color' => $categ['color']); } $response =json_encode($response); echo $response; ########## core/boxes/box_actions_future.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/boxes/box_actions_future.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/boxes/box_actions_future.php 2025-06-27 11:43:41.058402000 +0000 @@ -55,10 +55,6 @@ $this->enabled = isModEnabled('agenda'); $this->hidden = !($user->hasRight('agenda', 'myactions', 'read')); - - $this->urltoaddentry = DOL_URL_ROOT.'/comm/action/card.php?action=create'; - - $this->msgNoRecords = 'NoUpcomingEvent'; } /** @@ -69,7 +65,7 @@ */ public function loadBox($max = 5) { - global $user, $langs; + global $user, $langs, $conf; $this->max = $max; @@ -80,10 +76,7 @@ $societestatic = new Societe($this->db); $actionstatic = new ActionComm($this->db); - $text = $langs->trans("BoxTitleFutureActions", $max); - $this->info_box_head = array( - 'text' => $text.'...' - ); + $this->info_box_head = array('text' => $langs->trans("BoxTitleFutureActions", $max)); if ($user->hasRight('agenda', 'myactions', 'read')) { $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage"; @@ -184,6 +177,13 @@ $line++; } + if ($num == 0) { + $this->info_box_contents[$line][0] = array( + 'td' => 'class="center"', + 'text' => ''.$langs->trans("NoActionsToDo").'' + ); + } + $this->db->free($result); } else { $this->info_box_contents[0][0] = array( ########## core/boxes/box_commandes.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/boxes/box_commandes.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/boxes/box_commandes.php 2025-06-27 11:43:41.035609000 +0000 @@ -121,8 +121,9 @@ $result = $this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); - + $num=0; $line = 0; + while ($line < $num) { $objp = $this->db->fetch_object($result); $date = $this->db->jdate($objp->date_commande); ########## core/boxes/box_contacts.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/boxes/box_contacts.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/boxes/box_contacts.php 2025-06-27 11:43:41.036662000 +0000 @@ -56,7 +56,6 @@ $this->hidden = !($user->hasRight('societe', 'lire') && $user->hasRight('societe', 'contact', 'lire')); $this->urltoaddentry = DOL_URL_ROOT.'/contact/card.php?action=create'; - $this->msgNoRecords = 'NoRecordedContacts'; } ########## core/class/CMailFile.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/CMailFile.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/CMailFile.class.php 2025-06-27 11:43:40.181045000 +0000 @@ -205,26 +205,26 @@ /** * CMailFile * - * @param string $subject Topic/Subject of mail - * @param string $to Recipients emails (RFC 2822: "Name firstname [, ...]" or "email[, ...]" or "[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller. - * @param string $from Sender email (RFC 2822: "Name firstname [, ...]" or "email[, ...]" or "[, ...]") - * @param string $msg Message - * @param ?string[] $filename_list List of files to attach (full path of filename on file system) - * @param ?string[] $mimetype_list List of MIME type of attached files - * @param ?string[] $mimefilename_list List of attached file name in message - * @param string $addr_cc Email cc (Example: 'abc@def.com, ghk@lmn.com') - * @param string $addr_bcc Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined) - * @param int<0,1> $deliveryreceipt Ask a delivery receipt - * @param int<-1,1> $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable) - * @param string $errors_to Email for errors-to - * @param string|array $css Css option (should be array, legacy: empty string if none) - * @param string $trackid Tracking string (contains type and id of related element) - * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" at end of each line - * @param string $sendcontext 'standard', 'emailing', 'ticket', 'password', ... (used to define which sending mode and parameters to use) - * @param string $replyto Reply-to email (will be set to the same value than From by default if not provided) - * @param string $upload_dir_tmp Temporary directory (used to convert images embedded as img src=data:image) - * @param string $in_reply_to Message-ID of the message we reply to - * @param string $references String with list of Message-ID of the thread ('<123> <456> ...') + * @param string $subject Topic/Subject of mail + * @param string $to Recipients emails (RFC 2822: "Name firstname [, ...]" or "email[, ...]" or "[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller. + * @param string $from Sender email (RFC 2822: "Name firstname [, ...]" or "email[, ...]" or "[, ...]") + * @param string $msg Message + * @param ?string[] $filename_list List of files to attach (full path of filename on file system) + * @param ?string[] $mimetype_list List of MIME type of attached files + * @param ?string[] $mimefilename_list List of attached file name in message + * @param string $addr_cc Email cc (Example: 'abc@def.com, ghk@lmn.com') + * @param string $addr_bcc Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined) + * @param int<0,1> $deliveryreceipt Ask a delivery receipt + * @param int<-1,1> $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable) + * @param string $errors_to Email for errors-to + * @param string|array $css Css option (should be array, legacy: empty string if none) + * @param string $trackid Tracking string (contains type and id of related element) + * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" at end of each line + * @param string $sendcontext 'standard', 'emailing', 'ticket', 'password', ... (used to define which sending mode and parameters to use) + * @param string $replyto Reply-to email (will be set to the same value than From by default if not provided) + * @param string $upload_dir_tmp Temporary directory (used to convert images embedded as img src=data:image) + * @param string $in_reply_to Message-ID of the message we reply to + * @param string $references String with list of Message-ID of the thread ('<123> <456> ...') */ public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '', $in_reply_to = '', $references = '') { @@ -653,8 +653,6 @@ $this->msgid = time().'.'.mt_rand(100, 999).'.SMTPs-dolibarr-'.$this->trackid.'@'.$host; - $smtps->setMessageID($this->msgid); - $this->smtps = $smtps; } elseif ($this->sendmode == 'swiftmailer') { // Use Swift Mailer library ########## core/class/commonincoterm.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/commonincoterm.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/commonincoterm.class.php 2025-06-27 11:43:40.148331000 +0000 @@ -91,8 +91,6 @@ */ public function getIncotermsForPDF() { - global $langs; - $sql = "SELECT code FROM ".$this->db->prefix()."c_incoterms WHERE rowid = ".(int) $this->fk_incoterms; $resql = $this->db->query($sql); if ($resql) { @@ -100,7 +98,7 @@ if ($num > 0) { $res = $this->db->fetch_object($resql); if ($res) { - return $langs->trans("IncotermLabel").': '.$res->code.' - '.$this->location_incoterms; + return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; } else { return $res; } ########## core/class/commoninvoice.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/commoninvoice.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/commoninvoice.class.php 2025-06-27 11:43:40.309147000 +0000 @@ -1341,7 +1341,7 @@ // Set a default value for service if not provided if (empty($service)) { $service = 'StripeTest'; - if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) { + if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) { $service = 'StripeLive'; } } ########## core/class/commonobject.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/commonobject.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/commonobject.class.php 2025-06-27 11:43:40.320417000 +0000 @@ -125,7 +125,7 @@ /** * @var int<0,1>|string Does this object support multicompany module ? - * 0=No test on entity, 1=Test with field entity in local table, 'field@table'=Test entity into the field@table (example 'fk_soc@societe') + * 0=No test on entity, 1=Test with field entity for internal and external users, 'field@table'=Test with link by field@table (example 'fk_soc@societe') */ public $ismultientitymanaged; @@ -9773,7 +9773,7 @@ * @param float $unitPrice Product unit price * @param float $discountPercent Line discount percent * @param int $fk_product Product id - * @return float|int<-2,-1> Return buy price if OK, integer <0 if KO + * @return float|int<-1,-1> Return buy price if OK, integer <0 if KO */ public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0) { @@ -9826,8 +9826,7 @@ } } } - - return (float) $buyPrice; + return $buyPrice; } /** ########## core/class/conf.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/conf.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/conf.class.php 2025-06-27 11:43:40.193062000 +0000 @@ -1293,7 +1293,7 @@ $this->global->MAIN_MODULE_DOLISTORE_API_SRV = 'https://www.dolistore.com/api/'; } if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) { - $this->global->MAIN_MODULE_DOLISTORE_API_KEY = 'dolistorepublicapi'; + $this->global->MAIN_MODULE_DOLISTORE_API_KEY = 'dolistorecatalogpublickey1234567'; } // Enable by default the CSRF protection by token. ########## core/class/fiscalyear.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/fiscalyear.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/fiscalyear.class.php 2025-06-27 11:43:40.256927000 +0000 @@ -119,6 +119,8 @@ $this->db = $db; $this->ismultientitymanaged = 1; + $this->labelStatusShort = array(self::STATUS_OPEN => 'Opened', self::STATUS_CLOSED => 'Closed'); + $this->labelStatus = array(self::STATUS_OPEN => 'Opened', self::STATUS_CLOSED => 'Closed'); } /** ########## core/class/html.form.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.form.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.form.class.php 2025-06-27 11:43:40.274117000 +0000 @@ -1,4 +1,5 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier @@ -104,18 +105,18 @@ /** * Output key field for an editable field * - * @param string $text Text of label or key to translate - * @param string $htmlname Name of select field ('edit' prefix will be added) - * @param string $preselected Value to show/edit (not used in this function) - * @param object $object Object (on the page we show) - * @param int<0,1>|boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. - * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker' 'checkbox:ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) - * @param string $moreparam More param to add on a href URL. - * @param int<0,1> $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS. - * @param int<0,3> $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' ' - * @param string $paramid Key of parameter for id ('id', 'socid') - * @param string $help Tooltip help - * @return string HTML edit field + * @param string $text Text of label or key to translate + * @param string $htmlname Name of select field ('edit' prefix will be added) + * @param string $preselected Value to show/edit (not used in this function) + * @param object $object Object (on the page we show) + * @param int<0,1> $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker' 'checkbox:ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) + * @param string $moreparam More param to add on a href URL. + * @param int<0,1> $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS. + * @param int<0,3> $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' ' + * @param string $paramid Key of parameter for id ('id', 'socid') + * @param string $help Tooltip help + * @return string HTML edit field */ public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id', $help = '') { @@ -125,7 +126,7 @@ // TODO change for compatibility if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { - if ($perm) { + if (!empty($perm)) { $tmp = explode(':', $typeofdata); $ret .= '
'; if ($fieldrequired) { @@ -2140,13 +2141,13 @@ * @param int<0,1>|string $show_empty 0=list with no empty value, 1=add also an empty value into list * @param int[]|null $exclude Array list of users id to exclude * @param int $disabled If select list must be disabled - * @param int[]|''|'hierarchy'|'hierarchyme' $include Array list of users id to include. Use '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me + * @param int[]|''|'hierarchy'|'hierarchyme' $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me * @param int[]|'' $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled * @param string $force_entity '0' or list of Ids of environment to force, separated by a comma, or 'default' = do no extend to all entities allowed to superadmin. * @param int $maxlength Maximum length of string into list (0=no limit) * @param int<-1,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @param string $morefilter Add more filters into sql request (Example: '(employee:=:1)'). This value must not come from user input. - * @param int<0,3> $showalso 0=default list, 1=add also a value "Everybody" at beginning of list, 2=add also a value "My team" at beginning of list (if user has at least 1 people), 3=add also "Everybody" + "My Team" + * @param int<0,1> $show_every 0=default list, 1=add also a value "Everybody" at beginning of list * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css * @param int<0,1> $notdisabled Show only active users (note: this will also happen, whatever is this option, if USER_HIDE_INACTIVE_IN_COMBOBOX is on). @@ -2156,14 +2157,14 @@ * @return string|array HTML select string * @see select_dolgroups() */ - public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '', $maxlength = 0, $showstatus = 0, $morefilter = '', $showalso = 0, $enableonlytext = '', $morecss = '', $notdisabled = 0, $outputmode = 0, $multiple = false, $forcecombo = 0) + public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $notdisabled = 0, $outputmode = 0, $multiple = false, $forcecombo = 0) { // phpcs:enable global $conf, $user, $langs, $hookmanager; global $action; // If no preselected user defined, we take current user - if ((is_numeric($selected) && ($selected < -3 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) { + if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) { $selected = $user->id; } @@ -2173,38 +2174,23 @@ $selected = array($selected); } - // Exclude some users in $excludeUsers string $excludeUsers = null; + $includeUsers = null; + + // Exclude some users if (is_array($exclude)) { $excludeUsers = implode(",", $exclude); } - - // Include some users in $includeUsers string - $includeUsers = null; - $includeUsersArray = array(); + // Include some uses if (is_array($include)) { - $includeUsersArray = $include; + $includeUsers = implode(",", $include); } elseif ($include == 'hierarchy') { - // Build list includeUsersArray to have only hierarchy - $includeUsersArray = $user->getAllChildIds(0); + // Build list includeUsers to have only hierarchy + $includeUsers = implode(",", $user->getAllChildIds(0)); } elseif ($include == 'hierarchyme') { - // Build list includeUsersArray to have only hierarchy and current user - $includeUsersArray = $user->getAllChildIds(1); + // Build list includeUsers to have only hierarchy and current user + $includeUsers = implode(",", $user->getAllChildIds(1)); } - // Get list of allowed users - /* We do not limit list of users. Because we should limit this only for combo list into HR features where we may be allowed to - * see all other users and element in other. For example in agenda, we can have permission to read all event of otherusers. - * So we disable this. - if (!$user->hasRight('user', 'user', 'lire')) { - if (empty($includeUsersArray)) { - $includeUsers = implode(",", $user->getAllChildIds(1)); - } else { - $includeUsers = implode(",", array_intersect($includeUsersArray, $user->getAllChildIds(1))); - } - } else { - $includeUsers = implode(",", $includeUsersArray); - } */ - $includeUsers = implode(",", $includeUsersArray); $num = 0; @@ -2213,7 +2199,7 @@ $outarray2 = array(); // Do we want to show the label of entity into the combo list ? - $showlabelofentity = isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity) && !preg_match('/^search_/', $htmlname); + $showlabelofentity = isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity); $userissuperadminentityone = isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && empty($user->entity); // Forge request to select users @@ -2312,23 +2298,7 @@ 'picto' => '' ); } - if ($showalso == 2 || $showalso == 3) { - $out .= '' . "\n"; - - $hasAtLeastOneSubordinate = (count($user->getAllChildIds(1)) > 1); - if ($hasAtLeastOneSubordinate) { - //$sql = "SELECT rowid FROM".MAIN_DB_PREFIX."user " - $outarray[-3] = '-- ' . $langs->trans("MyTeam") . ' --'; - $outarray2[-3] = array( - 'id' => -3, - 'label' => '-- ' . $langs->trans("MyTeam") . ' --', - 'labelhtml' => '-- ' . $langs->trans("MyTeam") . ' --', - 'color' => '', - 'picto' => '' - ); - } - } - if ($showalso == 1 || $showalso == 3) { + if ($show_every) { $out .= '' . "\n"; $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; @@ -5853,7 +5823,7 @@ * @param int<0,1> $include [=0] Removed or 1=Keep only * @param string $morecss More CSS * @param int<0,2> $useempty 0=No empty value, 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. Default is 1. - * @return string|array|array|array String list or Array of categories + * @return string|array|array|array String list or Array of categories * @see select_categories() */ public function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $fromid = 0, $outputmode = 0, $include = 0, $morecss = '', $useempty = 1) @@ -6218,8 +6188,8 @@ $formconfirm .= ' resizable: false, - height: \'' . dol_escape_js($height) . '\', - width: \'' . dol_escape_js($width) . '\', + height: \'' . ((int) $height) . '\', + width: \'' . ((int) $width) . '\', modal: true, closeOnEscape: false, buttons: { @@ -9135,7 +9105,7 @@ $sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product"; } if (!empty($objecttmp->ismultientitymanaged)) { - if ($objecttmp->ismultientitymanaged == 1) { // @phan-suppress-current-line PhanPluginEmptyStatementIf + if ($objecttmp->ismultientitymanaged == 1) { // No need to join/link another table } if (!is_numeric($objecttmp->ismultientitymanaged)) { @@ -9157,8 +9127,6 @@ $sql .= $hookmanager->resPrint; } else { $sql .= " WHERE 1=1"; - - // If table need a multientity restriction if (!empty($objecttmp->ismultientitymanaged)) { if ($objecttmp->ismultientitymanaged == 1) { $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; @@ -9174,14 +9142,23 @@ $sql .= " WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = ".((int) $user->id).")"; } } - } - - // If user is external user, we must also make a test on llx_societe_commerciaux - if (!empty($user->socid)) { - if ($objecttmp->element == 'societe') { - $sql .= " AND t.rowid = " . ((int) $user->socid); - } elseif (!empty($objecttmp->fields['fk_soc']) || !empty($objecttmp->fields['t.fk_soc']) || property_exists($objecttmp, 'fk_soc') || property_exists($objecttmp, 'socid')) { - $sql .= " AND t.fk_soc = " . ((int) $user->socid); + // If user is external user, we also make a test on llx_societe_commerciaux + if (!empty($user->socid)) { + if ($objecttmp->ismultientitymanaged == 1) { + if ($objecttmp->element == 'societe') { + $sql .= " AND t.rowid = " . ((int) $user->socid); + } else { + $sql .= " AND t.fk_soc = " . ((int) $user->socid); + } + } + if (!is_numeric($objecttmp->ismultientitymanaged)) { + $sql .= " AND t." . $this->db->sanitize($tmparray[0])." = ".((int) $user->socid); + } + // If the parent table is llx_societe and user is an external user, + // then we must also check that user has permissions + if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { + $sql .= " AND t.fk_soc = ".((int) $user->socid); + } } } @@ -10851,18 +10828,18 @@ /** * Return HTML code to output a photo * - * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') + * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') * @param Societe|Adherent|Contact|User|CommonObject $object Object containing data to retrieve file name - * @param int $width Width of photo - * @param int $height Height of photo (auto if 0) - * @param int<0,1> $caneditfield Add edit fields - * @param string $cssclass CSS name to use on img for photo - * @param string $imagesize 'mini', 'small' or '' (original) - * @param int<0,1> $addlinktofullsize Add link to fullsize image - * @param int<0,1> $cache 1=Accept to use image in cache - * @param ''|'user'|'environment' $forcecapture '', 'user' (user-facing camera) or 'environment' ('outward-facing camera'). Force the parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. - * @param int<0,1> $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module) - * @return string HTML code to output photo + * @param int $width Width of photo + * @param int $height Height of photo (auto if 0) + * @param int<0,1> $caneditfield Add edit fields + * @param string $cssclass CSS name to use on img for photo + * @param string $imagesize 'mini', 'small' or '' (original) + * @param int<0,1> $addlinktofullsize Add link to fullsize image + * @param int<0,1> $cache 1=Accept to use image in cache + * @param ''|'user'|'environment' $forcecapture '', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. + * @param int<0,1> $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module) + * @return string HTML code to output photo * @see getImagePublicURLOfObject() */ public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '', $noexternsourceoverwrite = 0) @@ -11040,7 +11017,7 @@ if ($maxmin > 0) { $ret .= ''; // MAX_FILE_SIZE must precede the field type=file } - $ret .= ''; + $ret .= ''; $ret .= ''; $ret .= '
'.$langs->trans("Line").''.$langs->trans("ThirdParty").''.$langs->trans("Amount").''.$langs->trans("Reason").''.$langs->trans("ToBill").''; // Invoice to charge the error. No yet implemented. //print $langs->trans("Invoice"); + print '
'; } ########## core/class/html.formaccounting.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formaccounting.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formaccounting.class.php 2025-06-27 11:43:40.177925000 +0000 @@ -666,6 +666,7 @@ public static function printJournalLine($langs, $date, $ref, $accountAccounting, $labelOperation, $paymentMode, $amount) { $out = ''; + $out .= ''; $out .= ''.$date.''; $out .= ''.$ref.''; // Ledger account ########## core/class/html.formfile.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formfile.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formfile.class.php 2025-06-27 11:43:40.217546000 +0000 @@ -256,7 +256,7 @@ $out .= ''; $out .= ''; } - $out .= 'trans("Upload").'"'; $out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : ''); $out .= '>'; @@ -357,7 +357,7 @@ $out2 .= ''; $out2 .= '
'; $out2 .= '
'; - $out2 .= 'trans("ToLink").'"'; $out2 .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : ''); $out2 .= '>'; $out2 .= '
'; ########## core/class/html.formprojet.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formprojet.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formprojet.class.php 2025-06-27 11:43:40.156954000 +0000 @@ -400,7 +400,7 @@ } if (empty($option_only)) { - $out .= ''; } if (!empty($show_empty)) { $out .= ''."\n"; + $out .= ''; } $num = $this->db->num_rows($resql); @@ -486,7 +486,7 @@ $out .= ''; } else { if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { $resultat = ''; @@ -500,7 +500,7 @@ $resultat .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"'; $resultat .= '>'; $resultat .= $labeltoshow; - $resultat .= ''."\n"; + $resultat .= ''; } $out .= $resultat; } @@ -509,7 +509,7 @@ } } if (empty($option_only)) { - $out .= ''."\n"; + $out .= ''; } $this->nboftasks = $num; ########## core/class/html.formticket.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formticket.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formticket.class.php 2025-06-27 11:43:40.288904000 +0000 @@ -1685,19 +1685,10 @@ } */ - // From (and Reply-To if defined) + // From $from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM'); - $replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO'); - print ''.$langs->trans("MailFrom"); - if ($replyto) { - print ' ('.$langs->trans("MailReply").')'; - } - print ''; - print ''.img_picto('', 'email', 'class="pictofixedwidth"').$from; - if ($replyto) { - print ' ('.$replyto.')'; - } - print ''; + print ''.$langs->trans("MailFrom").''; + print ''.img_picto('', 'email', 'class="pictofixedwidth"').$from.''; // Recipients / adressed-to print ''.$langs->trans('MailRecipients'); ########## core/class/notify.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/notify.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/notify.class.php 2025-06-27 11:43:40.163934000 +0000 @@ -662,12 +662,10 @@ //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Define some vars - $application = constant('DOL_APPLICATION_TITLE'); - $applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE'); - if ($applicationcustom) { - $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom; + $application = 'Dolibarr'; + if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { + $application = getDolGlobalString('MAIN_APPLICATION_TITLE'); } - $from = getDolGlobalString('NOTIFICATION_EMAIL_FROM'); $object_type = ''; $link = ''; ########## core/class/smtps.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/smtps.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/smtps.class.php 2025-06-27 11:43:40.173577000 +0000 @@ -78,11 +78,6 @@ private $_smtpsToken = null; /** - * @var ?string Message-ID to use - */ - private $_msgId = null; - - /** * @var ?array{org:string,real?:string,addr:string,user:string,host:string} Who sends the Message * This can be defined via a INI file or via a setter method */ @@ -298,20 +293,8 @@ */ private $_options = array(); - - /** - * Set Message-ID - * - * @param string $_msgId Message-ID to use - * @return void - */ - public function setMessageID($_msgId = '') - { - $this->_msgId = $_msgId; - } - /** - * Set options + * Set delivery receipt * * @param array> $_options An array of options for stream_context_create() * @return void @@ -1563,15 +1546,16 @@ $host = dol_getprefix('email'); + //NOTE: Message-ID should probably contain the username of the user who sent the msg $_header .= 'Subject: '.$this->getSubject()."\r\n"; $_header .= 'Date: '.date("r")."\r\n"; $trackid = $this->getTrackId(); if ($trackid) { - $_header .= 'Message-ID: <'.(empty($this->_msgId) ? uniqid().'.SMTPs-dolibarr-'.$trackid.'@'.$host : $this->_msgId).">\r\n"; + $_header .= 'Message-ID: <'.time().'.SMTPs-dolibarr-'.$trackid.'@'.$host.">\r\n"; $_header .= 'X-Dolibarr-TRACKID: '.$trackid.'@'.$host."\r\n"; } else { - $_header .= 'Message-ID: <'.(empty($this->_msgId) ? uniqid().'.SMTPs@'.$host : $this->_msgId).">\r\n"; + $_header .= 'Message-ID: <'.time().'.SMTPs@'.$host.">\r\n"; } if (!empty($_SERVER['REMOTE_ADDR'])) { $_header .= "X-RemoteAddr: ".$_SERVER['REMOTE_ADDR']."\r\n"; ########## core/customreports.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/customreports.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/customreports.php 2025-06-27 11:43:40.346063000 +0000 @@ -1,6 +1,6 @@ - * Copyright (C) 2024-2025 MDW +/* Copyright (C) 2020-2024 Laurent Destailleur + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -39,10 +39,7 @@ * @var Translate $langs * @var User $user * - * @var ?int[] $toselect Items selected on page, only used to see if not empty here - * @var ?int $SHOWLEGEND Show legend or not - * @var string $customreportkey Custom report key - * @var string $customsql Custom SQL + * @var ?int[] $toselect Items selected on page, only used to see if not empty here */ ' @phan-var-force ?int[] $toselect @@ -92,6 +89,8 @@ $pageprev = $page - 1; $pagenext = $page + 1; + $diroutputmassaction = $conf->user->dir_temp.'/'.$user->id.'/customreport'; + $object = null; } else { // When included into a main page @@ -129,7 +128,7 @@ if (!empty($object)) { $objecttype = $object->element.($object->module ? '@'.$object->module : ''); } -if ((!is_string($objecttype) || empty($objecttype)) && isModEnabled('societe')) { +if (!is_string($objecttype) || empty($objecttype)) { $objecttype = 'thirdparty'; } '@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null @@ -159,13 +158,12 @@ $ObjectClassName = ''; // Objects available by default $arrayoftype = array( - 'thirdparty' => array('label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php", 'langs' => 'companies'), + 'thirdparty' => array('langs' => 'companies', 'label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), 'contact' => array('label' => 'Contacts', 'picto' => 'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), - 'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php", 'langs' => 'propal'), - 'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php", 'langs' => 'orders'), - 'orderdet' => array('label' => 'SaleOrderLines', 'picto' => 'order', 'ObjectClassName' => 'OrderLine', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/orderline.class.php", 'langs' => 'orders'), - 'invoice' => array('label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php", 'langs' => 'bills'), - 'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture-rec.class.php", 'langs' => 'bills'), + 'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), + 'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), + 'invoice' => array('langs' => 'facture', 'label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), + 'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs' => 'bills'), 'contract' => array('label' => 'Contracts', 'picto' => 'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'), 'contractdet' => array('label' => 'ContractLines', 'picto' => 'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'), 'bom' => array('label' => 'BOM', 'picto' => 'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), @@ -211,7 +209,6 @@ if ($fileforclass !== null) { dol_include_once($fileforclass); - $ObjectClassName = $arrayoftype[$objecttype]['ObjectClassName']; } if (!empty($ObjectClassName)) { @@ -357,9 +354,10 @@ $features .= (empty($object->module) ? '' : '@'.$object->module); } -// Security check restrictedArea($user, $features, 0, ''); +$error = 0; + /* * Actions @@ -386,7 +384,6 @@ } } -// Define $newarrayoftype that is array of object available for report $newarrayoftype = array(); foreach ($arrayoftype as $key => $val) { if (dol_eval((string) $val['enabled'], 1, 1, '1')) { @@ -638,8 +635,7 @@ // Select object print '
'; print '
'.$langs->trans("StatisticsOn").'
'; - - print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth250', 1, '', 0, 1); + print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1, '', 0, 1); if (empty($conf->use_javascript_ajax)) { print ''; } else { @@ -655,41 +651,40 @@ } print '
'; - if (!empty($newarrayoftype)) { - // Filter (you can use param &show_search_component_params_hidden=1 for debug) - if (!empty($object)) { - print '
'; - print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden, $arrayoffilterfields); - print '
'; - } - - // YAxis (add measures into array) - $count = 0; - //var_dump($arrayofmesures); - print '
'; - print '
'; - $simplearrayofmesures = array(); - foreach ($arrayofmesures as $key => $val) { - $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; - } - print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields - print '
'; - - // XAxis - $count = 0; + // Filter (you can use param &show_search_component_params_hidden=1 for debug) + if (!empty($object)) { print '
'; - print '
'; - //var_dump($arrayofxaxis); - print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields + print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden, $arrayoffilterfields); print '
'; + } - // Group by - $count = 0; - print '
'; - print '
'; - print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields - print '
'; + // YAxis (add measures into array) + $count = 0; + //var_dump($arrayofmesures); + print '
'; + print '
'; + $simplearrayofmesures = array(); + foreach ($arrayofmesures as $key => $val) { + $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; } + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields + print '
'; + + // XAxis + $count = 0; + print '
'; + print '
'; + //var_dump($arrayofxaxis); + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields + print '
'; + + // Group by + $count = 0; + print '
'; + print '
'; + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields + print '
'; + if ($mode == 'grid') { // YAxis @@ -752,12 +747,13 @@ print '
'; } - if (!empty($newarrayoftype)) { - print '
'; - print ''; - print '
'; - } + //if ($mode == 'graph') { + // + //} + print '
'; + print ''; + print '
'; print '
'; print ''; } @@ -1221,10 +1217,6 @@ print ''."\n"; print '
'; -if (empty($newarrayoftype)) { - $langs->load("admin"); - print info_admin($langs->trans("NoSupportedModulesHaveBeenActivated"), 0, 0, 'warning'); -} if ($mode == 'grid') { // TODO ########## core/js/lib_head.js.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/js/lib_head.js.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/js/lib_head.js.php 2025-06-27 11:43:40.363090000 +0000 @@ -677,11 +677,6 @@ }); if (forcereload) { var url = window.location.href; - - /* reset action param */ - url = url.replace(/action=\w+/g, ''); - - /* reset dol_resetcache param */ if (url.indexOf('dol_resetcache') < 0) { if (url.indexOf('?') > -1) { url = url + "&dol_resetcache=1"; @@ -689,8 +684,6 @@ url = url + "?dol_resetcache=1"; } } - - /* reset page_y param */ var page_y = $(document).scrollTop(); url = url.replace(/page_y=\d+/g, ''); if (page_y > 0) { ########## core/lib/admin.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/admin.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/admin.lib.php 2025-06-27 11:43:41.383895000 +0000 @@ -1575,7 +1575,7 @@ */ function activateModulesRequiredByCountry($country_code) { - global $db; + global $db, $conf, $langs; $modulesdir = dolGetModulesDirs(); @@ -1736,8 +1736,8 @@ /** * Show array with constants to edit * - * @param array|array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label, 'tooltip'=>tooltip) - * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... + * @param array|array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label) + * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... * @param int<2,3> $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) (typed as int<2,3> to highlight the deprecated values) * @param string $helptext Tooltip help to use for the column name of values * @param string $text Text to use for the column name of values ########## core/lib/agenda.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/agenda.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/agenda.lib.php 2025-06-27 11:43:41.385902000 +0000 @@ -104,7 +104,7 @@ // Assigned to user print '
'; print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="pictofixedwidth inline-block"'); - print $form->select_dolusers($filtert, 'search_filtert', 1, null, (int) !$canedit, '', '', '0', 0, 0, '', 2, '', 'minwidth100 maxwidth250 widthcentpercentminusx'); + print $form->select_dolusers($filtert, 'search_filtert', 1, null, (int) !$canedit, '', '', '0', 0, 0, '', 0, '', 'minwidth100 maxwidth250 widthcentpercentminusx'); print '
'; // Assigned to user group ########## core/lib/company.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/company.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/company.lib.php 2025-06-27 11:43:41.398161000 +0000 @@ -219,7 +219,7 @@ $servicestatus = 0; if (isModEnabled('stripe')) { - if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) { + if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) { $servicestatus = 1; } @@ -1399,10 +1399,10 @@ $param .= '&search_note_private='.urlencode($search_note_private); } if ($search_birthday_dtstart != '') { - $param .= '&search_birthday_dtstart='.urlencode((string) $search_birthday_dtstart); + $param .= '&search_birthday_dtstart='.urlencode($search_birthday_dtstart); } if ($search_birthday_dtend != '') { - $param .= '&search_birthday_dtend='.urlencode((string) $search_birthday_dtend); + $param .= '&search_birthday_dtend='.urlencode($search_birthday_dtend); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -1657,7 +1657,7 @@ // Photo - Name if (!empty($arrayfields['t.name']['checked'])) { print ''; - print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user'); + print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, '1'); print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage)); print ''; } ########## core/lib/date.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/date.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/date.lib.php 2025-06-27 11:43:41.295081000 +0000 @@ -1334,35 +1334,16 @@ return 'ErrorBadParameter_num_open_day'; } + //print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday; if ($timestampStart < $timestampEnd) { - // --- 1. Calculate Gross Working Days --- - // Gross working days = total days in range - non-working days (weekends & public holidays). - $nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday); + $numdays = num_between_day($timestampStart, $timestampEnd, $lastday); - // --- 2. Apply Contextual Half-Day Deductions --- - $halfday = (int) $halfday; // Ensure $halfday is an integer for reliable comparisons. - - // Check if start/end days are working days just ONCE to optimize performance - // by avoiding redundant calls to the potentially slow num_public_holiday() function. - $isStartDayWorking = (num_public_holiday($timestampStart, $timestampStart, $country_code, 1) == 0); - $isEndDayWorking = (num_public_holiday($timestampEnd, $timestampEnd, $country_code, 1) == 0); - - // Deduct 0.5 if the leave starts in the afternoon of a working day. - if (($halfday == -1 || $halfday == 2) && $isStartDayWorking) { - $nbOpenDay -= 0.5; - } - - // Deduct 0.5 if the leave ends in the morning of a different, working day. - if (($halfday == 1 || $halfday == 2) && date('Y-m-d', $timestampStart) != date('Y-m-d', $timestampEnd) && $isEndDayWorking) { - $nbOpenDay -= 0.5; + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday); + $nbOpenDay = ($numdays - $numholidays); + if ($inhour == 1 && $nbOpenDay <= 3) { + $nbOpenDay *= 24; } - - // --- 3. Return Final Value --- - if ($inhour == 1) { - return $nbOpenDay * 24; - } - - return $nbOpenDay; + return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); } elseif ($timestampStart == $timestampEnd) { $numholidays = 0; if ($lastday) { ########## core/lib/files.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/files.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/files.lib.php 2025-06-27 11:43:41.308113000 +0000 @@ -47,8 +47,8 @@ * @param string $utf8_path Starting path from which to search. This is a full path. * @param string $types Can be "directories", "files", or "all" * @param int $recursive Determines whether subdirectories are searched - * @param string|string[] $filter Regex or Array of Regex filter to restrict list. The regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, - * but must NOT contains the start and end '/'. Filter is checked into basename only. + * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, + * but must not contains the start and end '/'. Filter is checked into basename only. * @param string|string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx'). * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') * @param int $sortorder Sort order (SORT_ASC, SORT_DESC) @@ -66,39 +66,22 @@ global $object; if ($recursive <= 1) { // Avoid too verbose log + // Verify filters (only on first call to function) + $filters_ok = true; $error_info = ""; - - // Verify filters (only on the first call of the function) - $filter_ok = true; - if (!is_array($filter)) { - if (strlen($filter) > 25000) { // Note that limit depends on syntax of filter - dol_syslog("Value for filter is too large", LOG_ERR); - $filter_ok = false; - } else { - // Check that all '/' are escaped. - if ((int) preg_match('/(?:^|[^\\\\])\//', $filter) > 0) { - $excludefilter_ok = false; - $error_info .= " error='filter_has_unescaped_slash'"; - dol_syslog("'$filter' has unescaped '/'", LOG_ERR); - } - } - } - // Ensure we have an array for the exclusions - $excludefilter_ok = true; $exclude_array = ($excludefilter === null || $excludefilter === '') ? array() : (is_array($excludefilter) ? $excludefilter : array($excludefilter)); - foreach ($exclude_array as $f) { + foreach ((array($filter) + $exclude_array) as $f) { // Check that all '/' are escaped. if ((int) preg_match('/(?:^|[^\\\\])\//', $f) > 0) { - $excludefilter_ok = false; - $error_info .= " error='excludefilter_has_unescaped_slash'"; + $filters_ok = false; + $error_info .= " error='$f unescaped_slash'"; dol_syslog("'$f' has unescaped '/'", LOG_ERR); } } - - dol_syslog("files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".json_encode($filter)." excludefilter=".json_encode($excludefilter).$error_info); - // print 'xxx'."files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".json_encode($filter)." excludefilter=".json_encode($exclude_array); - if (!$filter_ok || !$excludefilter_ok) { + dol_syslog("files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter).$error_info); + // print 'xxx'."files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($exclude_array); + if (!$filters_ok) { // Return empty array when filters are invalid return array(); } @@ -173,10 +156,11 @@ $utf8_file = $os_file; } + $qualified = 1; + $utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file; // Temp variable for speed // Check if file is qualified - $qualified = 1; foreach ($excludefilterarray as $filt) { if (preg_match('/'.$filt.'/i', $utf8_file) || preg_match('/'.$filt.'/i', $utf8_fullpathfile)) { $qualified = 0; @@ -201,28 +185,7 @@ $fileperm = dol_fileperm($utf8_fullpathfile); } - $qualifiedforfilter = 0; - if (empty($filter)) { - $qualifiedforfilter = 1; - } else { - $testpregmatch = false; - if (is_array($filter)) { - $chunks = array_chunk($filter, 500); - foreach ($chunks as $chunk) { - $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large - if ($testpregmatch) { - break; - } - } - } else { - $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large - } - if ($testpregmatch) { - $qualifiedforfilter = 1; - } - } - - if ($qualifiedforfilter) { // We do not search key $filter into all $path, only into $file part + if (!$filter || preg_match('/'.$filter.'/i', $utf8_file)) { // We do not search key $filter into all $path, only into $file part $reg = array(); preg_match('/([^\/]+)\/[^\/]+$/', $utf8_fullpathfile, $reg); $level1name = (isset($reg[1]) ? $reg[1] : ''); @@ -256,28 +219,7 @@ $filesize = dol_filesize($utf8_fullpathfile); } - $qualifiedforfilter = 0; - if (empty($filter)) { - $qualifiedforfilter = 1; - } else { - $testpregmatch = false; - if (is_array($filter)) { - $chunks = array_chunk($filter, 500); - foreach ($chunks as $chunk) { - $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large - if ($testpregmatch) { - break; - } - } - } else { - $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large - } - if ($testpregmatch) { - $qualifiedforfilter = 1; - } - } - - if ($qualifiedforfilter) { // We do not search key $filter into all $path, only into $file part + if (!$filter || preg_match('/'.$filter.'/i', $utf8_file)) { // We do not search key $filter into $utf8_path, only into $utf8_file if (empty($nbsecondsold) || $filedate <= ($now - $nbsecondsold)) { preg_match('/([^\/]+)\/[^\/]+$/', $utf8_fullpathfile, $reg); $level1name = (isset($reg[1]) ? $reg[1] : ''); @@ -343,7 +285,7 @@ $sql .= ", description"; } $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; - if (!empty($object->entity)) { + if (!empty($object->entity) && $object->entity != $conf->entity) { $sql .= " WHERE entity = ".((int) $object->entity); } else { $sql .= " WHERE entity = ".((int) $conf->entity); @@ -390,7 +332,6 @@ "acl" => $obj->acl, "share" => $obj->share, "description" => ($mode ? $obj->description : '') - // TODO Add 'content' with $mode == 2 ? ); } $i++; @@ -464,7 +405,6 @@ //var_dump($relativedir); //var_dump($filearray); //var_dump($filearrayindatabase); - //var_dump($object->entity); // Complete filearray with properties found into $filearrayindatabase foreach ($filearray as $key => $val) { @@ -496,7 +436,6 @@ if (!preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filename)) { // If not a tmp file dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it"); - include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($db); @@ -513,10 +452,6 @@ $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content $ecmfile->keywords = ''; // keyword content - // When you scan file with dol_dir_list_in_database, you scan for files in entity of object (like with projects), even if you - // are connected into another entity. So we must also create record that was not found into the entity scan, so the one of the object). - $ecmfile->entity = empty($object->entity) ? $conf->entity : $object->entity; - $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); ########## core/lib/ftp.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/ftp.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/ftp.lib.php 2025-06-27 11:43:41.312317000 +0000 @@ -1,7 +1,7 @@ +/* Copyright (C) 2022-2023 Laurent Destailleur * Copyright (C) 2022 Anthony Berton - * 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 @@ -122,9 +122,9 @@ /** * Tell if an entry is a FTP directory * - * @param resource|FTP\Connection $connect_id Connection handler - * @param string $dir Directory - * @return int 1=directory, 0=not a directory + * @param resource $connect_id Connection handler + * @param string $dir Directory + * @return int 1=directory, 0=not a directory */ function ftp_isdir($connect_id, $dir) { @@ -139,11 +139,13 @@ /** * Tell if an entry is a FTP directory * - * @param resource|FTP\Connection $connect_id Connection handler - * @return boolean Result of closing + * @param resource $connect_id Connection handler + * @return boolean Result of closing */ function dol_ftp_close($connect_id) { + global $conf; + // Close FTP connection if ($connect_id) { if (!getDolGlobalString('FTP_CONNECT_WITH_SFTP')) { @@ -156,18 +158,21 @@ /** * Delete a FTP file * - * @param resource|FTP\Connection $connect_id Connection handler - * @param string $file File - * @param string $newsection Directory + * @param resource $connect_id Connection handler + * @param string $file File + * @param string $newsection $newsection * @return bool */ function dol_ftp_delete($connect_id, $file, $newsection) { + global $conf; + if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) { $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 } // Remote file + $filename = $file; $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; $newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1'); @@ -183,19 +188,22 @@ /** * Download a FTP file * - * @param resource|FTP\Connection $connect_id Connection handler - * @param string $localfile The local file path - * @param string $file The remote file path - * @param string $newsection Directory + * @param resource $connect_id Connection handler + * @param string $localfile The local file path + * @param string $file The remote file path + * @param string $newsection $newsection * @return bool|resource */ function dol_ftp_get($connect_id, $localfile, $file, $newsection) { + global $conf; + if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) { $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 } // Remote file + $filename = $file; $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; $newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1'); @@ -209,19 +217,22 @@ /** * Upload a FTP file * - * @param resource|FTP\Connection $connect_id Connection handler - * @param string $file File name - * @param string $localfile The path to the local file - * @param string $newsection Directory + * @param resource $connect_id Connection handler + * @param string $file File name + * @param string $localfile The path to the local file + * @param string $newsection $newsection * @return bool */ function dol_ftp_put($connect_id, $file, $localfile, $newsection) { + global $conf; + if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) { $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 } // Remote file + $filename = $file; $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; $newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1'); @@ -235,18 +246,21 @@ /** * Remove FTP directory * - * @param resource|FTP\Connection $connect_id Connection handler - * @param string $file File - * @param string $newsection Directory + * @param resource $connect_id Connection handler + * @param string $file File + * @param string $newsection $newsection * @return bool */ function dol_ftp_rmdir($connect_id, $file, $newsection) { + global $conf; + if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) { $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 } // Remote file + $filename = $file; $remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file; $newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1'); @@ -261,13 +275,15 @@ /** * Remove FTP directory * - * @param resource|FTP\Connection $connect_id Connection handler - * @param string $newdir Dir create - * @param string $newsection Directory + * @param resource $connect_id Connection handler + * @param string $newdir Dir create + * @param string $newsection $newsection * @return bool|string */ function dol_ftp_mkdir($connect_id, $newdir, $newsection) { + global $conf; + if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) { $newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 } ########## core/lib/functions.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/functions.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/functions.lib.php 2025-06-27 11:43:41.321005000 +0000 @@ -462,7 +462,7 @@ * @param string $type Type of database (mysql, pgsql...) * @param string $host Address of database server * @param string $user Authorized username - * @param string $pass Password (clear) + * @param string $pass Password * @param string $name Name of database * @param int $port Port of database server * @return DoliDB A DoliDB instance @@ -1530,6 +1530,7 @@ dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_WARNING); return false; } + if (!empty($classname) && !class_exists($classname)) { return include $fullpath; } else { @@ -1995,7 +1996,7 @@ } /** - * Returns text slugified (lowercase and no special char, separator is "-"). + * Returns text slugified (no special char, separator is "-". * * @param string $stringtoslugify String to slugify * @return string Slugified string @@ -4816,7 +4817,7 @@ if ($trusted) { // Return only IP we can rely on (not spoofable by the client) $ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']); // value may be the IP of a proxy // Note that if apache module remoteip has been enabled, REMOTE_ADDR can contain the real client (the value from cloudFlare HTTP_CF_CONNECTING_IP for example) - // This can happen if the proxy were added in the list of trusted proxy. + // if the proxy were added in the list of trusted proxy. return $ip; } @@ -6513,7 +6514,7 @@ * @param int<0,2> $thead 0=To use with standard table format, 1=To use inside , 2=To use with
* @param string $file Url used when we click on sort picto * @param string $field Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def" - * @param string $begin ("" by default) + * @param string $begin ("" by default) * @param string $moreparam Add more parameters on sort url links ("" by default) * @param string $moreattrib Add more attributes on th ("" by default). To add more css class, use param $prefix. * @param ?string $sortfield Current field used to sort (Ex: 'd.datep,d.id') @@ -6587,8 +6588,8 @@ } } $sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink); - $out .= 'global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : ''); $out .= '>'; } if ($tooltip) { @@ -6616,12 +6617,17 @@ } if (!$sortorder || ($field1 != $sortfield1)) { - // Nothing + //$out.= ''.img_down("A-Z",0).''; + //$out.= ''.img_up("Z-A",0).''; } else { if (preg_match('/^DESC/', $sortorder)) { + //$out.= ''.img_down("A-Z",0).''; + //$out.= ''.img_up("Z-A",1).''; $sortimg .= ''.img_up("Z-A", 0, 'paddingright').''; } if (preg_match('/^ASC/', $sortorder)) { + //$out.= ''.img_down("A-Z",1).''; + //$out.= ''.img_up("Z-A",0).''; $sortimg .= ''.img_down("A-Z", 0, 'paddingright').''; } } @@ -7052,7 +7058,7 @@ * Function to format a value into an amount for visual output * Function used into PDF and HTML pages * - * @param int|float|string|null $amount Amount value to format + * @param string|float $amount Amount value to format * @param int<0,1> $form Type of formatting: 1=HTML, 0=no formatting (no by default) * @param Translate|string|null $outlangs Object langs for output. '' use default lang. 'none' use international separators. * @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accuracy) before being inserted into database or after a computation, so this parameter should be useless. @@ -7172,7 +7178,7 @@ * Function to use on each input amount before any numeric test or database insert. A better name for this function * should be roundtext2num(). * - * @param int|float|string|null $amount Amount to convert/clean or round + * @param string|float $amount Amount to convert/clean or round * @param ''|'MU'|'MT'|'MS'|'CU'|'CT'|int<0,max> $rounding ''=No rounding * 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT) * 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT) @@ -7260,7 +7266,6 @@ // - `[^,]*,`: Any sequence of characters that is not ',' with ',' accepted as the decimal point (from start of string because of earlier `^`); // - `[^.]*\.`: Any sequence of characters that is not a '.' with '.' accepted as the decimal point (from start of string. // - `(?[^.,]*)`: The sequence after the character accepted as the decimal point, not including it. - $matches = array(); if (preg_match('/^(?[^,]*,|[^.]*\.)(?[^.,]*)$/u', $amount, $matches)) { $intPart = $matches['int']; $decPart = $matches['dec']; @@ -7285,15 +7290,15 @@ if ($rounding) { $nbofdectoround = ''; if ($rounding == 'MU') { - $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT'); // usually 5 + $nbofdectoround = getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'); } elseif ($rounding == 'MT') { - $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'); // usually 2 or 3 + $nbofdectoround = getDolGlobalString('MAIN_MAX_DECIMALS_TOT'); } elseif ($rounding == 'MS') { - $nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? getDolGlobalInt('MAIN_MAX_DECIMALS_STOCK') : 5; + $nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? $conf->global->MAIN_MAX_DECIMALS_STOCK : 5; } elseif ($rounding == 'CU') { - $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_CURRENCY_UNIT', getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT')); // TODO Use param of currency + $nbofdectoround = max(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), 8); // TODO Use param of currency } elseif ($rounding == 'CT') { - $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_CURRENCY_TOT', getDolGlobalInt('MAIN_MAX_DECIMALS_TOT')); // TODO Use param of currency + $nbofdectoround = max(getDolGlobalString('MAIN_MAX_DECIMALS_TOT'), 8); // TODO Use param of currency } elseif (is_numeric($rounding)) { $nbofdectoround = (int) $rounding; } @@ -8530,21 +8535,14 @@ { if (is_null($allowed_attributes)) { $allowed_attributes = array( - "allow", "allowfullscreen", "alt", "async", "class", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width", + "allow", "allowfullscreen", "alt", "async", "class", "content", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width", // HTML5 "header", "footer", "nav", "section", "menu", "menuitem" ); } - // Always add content and http-equiv for meta tags, required to force encoding and keep html content in utf8 by load/saveHTML functions. - if (!in_array("content", $allowed_attributes)) { - $allowed_attributes[] = "content"; - } - if (!in_array("http-equiv", $allowed_attributes)) { - $allowed_attributes[] = "http-equiv"; - } if (class_exists('DOMDocument') && !empty($stringtoclean)) { - $stringtoclean = ''.$stringtoclean.''; + $stringtoclean = ''.$stringtoclean.''; // Warning: loadHTML does not support HTML5 on old libxml versions. $dom = new DOMDocument('', 'UTF-8'); @@ -8595,15 +8593,12 @@ } } - $dom->encoding = 'UTF-8'; - $return = $dom->saveHTML(); // This may add a LF at end of lines, so we will trim later //$return = 'aaaa

bb

ssdd

'."\n

aaa

aa

bb

"; $return = preg_replace('/^'.preg_quote('', '/').'/', '', $return); - $return = preg_replace('/^'.preg_quote('<', '/').'[^<>]*'.preg_quote('>', '/').'/', '', $return); - $return = preg_replace('/'.preg_quote('', '/').'$/', '', trim($return)); - + $return = preg_replace('/^'.preg_quote('', '/').'/', '', $return); + $return = preg_replace('/'.preg_quote('', '/').'$/', '', $return); return trim($return); } else { return $stringtoclean; @@ -8775,24 +8770,17 @@ // like 'abc' that wrongly ends up, without the trick, with '

abc

' if (dol_textishtml($out)) { - $out = '
'.$out.'
'; + $out = '
'.$out.'
'; } else { - $out = '
'.dol_nl2br($out).'
'; + $out = '
'.dol_nl2br($out).'
'; } $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL); - - $dom->encoding = 'UTF-8'; - $out = trim($dom->saveHTML()); - // Remove the trick added to solve pb with text in utf8 and text without parent tag - $out = preg_replace('/^'.preg_quote('', '/').'/', '', $out); - $out = preg_replace('/^'.preg_quote('<', '/').'[^<>]+'.preg_quote('>
', '/').'/', '', $out); - $out = preg_replace('/'.preg_quote('
', '/').'$/', '', trim($out)); - // $out = preg_replace('/^<\?xml encoding="UTF-8">
/', '', $out); - // $out = preg_replace('/<\/div>$/', '', $out); - // var_dump('rrrrrrrrrrrrrrrrrrrrrrrrrrrrr'.$out); + // Remove the trick added to solve pb with text without parent tag + $out = preg_replace('/^<\?xml encoding="UTF-8">
/', '', $out); + $out = preg_replace('/<\/div>$/', '', $out); } catch (Exception $e) { // If error, invalid HTML string with no way to clean it //print $e->getMessage(); @@ -8906,7 +8894,7 @@ $out = preg_replace('/on(repeat|begin|finish|beforeinput)[a-z]*\s*=/i', '', $out); } while ($oldstringtoclean != $out); - // Check the limit of external links that are automatically executed in a Rich text content. We count: + // Check the limit of external links that are automatically executed in a Rich text content. We count: // ', we can only accept " @@ -9304,9 +9292,7 @@ $substitutionarray = array_merge($substitutionarray, array( '__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_EMAIL__' => $mysoc->email, - '__MYCOMPANY_URL__' => $mysoc->url, '__MYCOMPANY_PHONE__' => dol_print_phone($mysoc->phone, '', 0, 0, '', " ", '', '', -1), - '__MYCOMPANY_PHONEMOBILE__' => dol_print_phone($mysoc->phone_mobile, '', 0, 0, '', " ", '', '', -1), '__MYCOMPANY_FAX__' => dol_print_phone($mysoc->fax, '', 0, 0, '', " ", '', '', -1), '__MYCOMPANY_PROFID1__' => $mysoc->idprof1, '__MYCOMPANY_PROFID2__' => $mysoc->idprof2, @@ -9442,7 +9428,6 @@ } } else { '@phan-var-force Adherent|Delivery $object'; - /** @var Adherent|Delivery $object */ $substitutionarray['__ID__'] = $object->id; $substitutionarray['__REF__'] = $object->ref; $substitutionarray['__NEWREF__'] = $object->newref; @@ -9483,7 +9468,6 @@ if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0) { '@phan-var-force Adherent $object'; - /** @var Adherent $object */ $birthday = (empty($object->birth) ? '' : dol_print_date($object->birth, 'day')); $substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : ''); @@ -9582,14 +9566,12 @@ if (is_object($object) && $object->element == 'recruitmentcandidature') { '@phan-var-force RecruitmentCandidature $object'; - /** @var RecruitmentCandidature $object */ $substitutionarray['__CANDIDATE_FULLNAME__'] = $object->getFullName($outputlangs); $substitutionarray['__CANDIDATE_FIRSTNAME__'] = isset($object->firstname) ? $object->firstname : ''; $substitutionarray['__CANDIDATE_LASTNAME__'] = isset($object->lastname) ? $object->lastname : ''; } if (is_object($object) && $object->element == 'conferenceorboothattendee') { '@phan-var-force ConferenceOrBoothAttendee $object'; - /** ConferenceOrBoothAttendee $object */ $substitutionarray['__ATTENDEE_FULLNAME__'] = $object->getFullName($outputlangs); $substitutionarray['__ATTENDEE_FIRSTNAME__'] = isset($object->firstname) ? $object->firstname : ''; $substitutionarray['__ATTENDEE_LASTNAME__'] = isset($object->lastname) ? $object->lastname : ''; @@ -9597,7 +9579,6 @@ if (is_object($object) && $object->element == 'project') { '@phan-var-force Project $object'; - /** @var Project $object */ $substitutionarray['__PROJECT_ID__'] = $object->id; $substitutionarray['__PROJECT_REF__'] = $object->ref; $substitutionarray['__PROJECT_NAME__'] = $object->title; @@ -9631,26 +9612,22 @@ if (is_object($object) && $object->element == 'facture') { '@phan-var-force Facture $object'; - /** @var Facture $object */ $substitutionarray['__INVOICE_SITUATION_NUMBER__'] = isset($object->situation_counter) ? $object->situation_counter : ''; } if (is_object($object) && $object->element == 'shipping') { '@phan-var-force Expedition $object'; - /** @var Expedition $object */ $substitutionarray['__SHIPPINGTRACKNUM__'] = $object->tracking_number; $substitutionarray['__SHIPPINGTRACKNUMURL__'] = $object->tracking_url; $substitutionarray['__SHIPPINGMETHOD__'] = $object->shipping_method; } if (is_object($object) && $object->element == 'reception') { '@phan-var-force Reception $object'; - /** @var Reception $object */ $substitutionarray['__RECEPTIONTRACKNUM__'] = $object->tracking_number; $substitutionarray['__RECEPTIONTRACKNUMURL__'] = $object->tracking_url; } if (is_object($object) && $object->element == 'contrat' && $object->id > 0 && is_array($object->lines)) { '@phan-var-force Contrat $object'; - /** @var Contrat $object */ $dateplannedstart = ''; $datenextexpiration = ''; foreach ($object->lines as $line) { @@ -9672,7 +9649,6 @@ // add substitution variables for ticket if (is_object($object) && $object->element == 'ticket') { '@phan-var-force Ticket $object'; - /** @var Ticket $object */ $substitutionarray['__TICKET_TRACKID__'] = $object->track_id; $substitutionarray['__TICKET_SUBJECT__'] = $object->subject; $substitutionarray['__TICKET_TYPE__'] = $object->type_code; @@ -9803,55 +9779,46 @@ if (is_object($object) && $object->element == 'propal') { '@phan-var-force Propal $object'; - /** @var Propal $object */ $substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/comm/propal/card.php?id=".$object->id; require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref, 1, $object); } if (is_object($object) && $object->element == 'commande') { '@phan-var-force Commande $object'; - /** @var Commande $object */ $substitutionarray['__URL_ORDER__'] = DOL_MAIN_URL_ROOT."/commande/card.php?id=".$object->id; } if (is_object($object) && $object->element == 'facture') { '@phan-var-force Facture $object'; - /** @var Facture $object */ $substitutionarray['__URL_INVOICE__'] = DOL_MAIN_URL_ROOT."/compta/facture/card.php?id=".$object->id; } if (is_object($object) && $object->element == 'contrat') { '@phan-var-force Contrat $object'; - /** @var Contrat $object */ $substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id; require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', $object->ref, 1, $object); } if (is_object($object) && $object->element == 'fichinter') { '@phan-var-force Fichinter $object'; - /** @var Fichinter $object */ $substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id; require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; $substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', $object->ref, 1, $object); } if (is_object($object) && $object->element == 'supplier_proposal') { '@phan-var-force SupplierProposal $object'; - /** @var SupplierProposal $object */ $substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id; } if (is_object($object) && $object->element == 'invoice_supplier') { '@phan-var-force FactureFournisseur $object'; - /** @var FactureFournisseur $object */ $substitutionarray['__URL_SUPPLIER_INVOICE__'] = DOL_MAIN_URL_ROOT."/fourn/facture/card.php?id=".$object->id; } if (is_object($object) && $object->element == 'shipping') { '@phan-var-force Expedition $object'; - /** @var Expedition $object */ $substitutionarray['__URL_SHIPMENT__'] = DOL_MAIN_URL_ROOT."/expedition/card.php?id=".$object->id; } } if (is_object($object) && $object->element == 'action') { '@phan-var-force ActionComm $object'; - /** @var ActionComm $object */ $substitutionarray['__EVENT_LABEL__'] = $object->label; $substitutionarray['__EVENT_TYPE__'] = $outputlangs->trans("Action".$object->type_code); $substitutionarray['__EVENT_DATE__'] = dol_print_date($object->datep, 'day', 'auto', $outputlangs); @@ -9861,7 +9828,6 @@ } if ((empty($exclude) || !in_array('objectamount', $exclude)) && (empty($include) || in_array('objectamount', $include))) { '@phan-var-force Facture|FactureRec $object'; - /** @var Facture|FactureRec|null $object */ include_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; $substitutionarray['__DATE_YMD__'] = is_object($object) ? (isset($object->date) ? dol_print_date($object->date, 'day', false, $outputlangs) : null) : ''; @@ -9960,8 +9926,6 @@ '__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort'.sprintf("%02d", $tmp['mon'])), '__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort'.sprintf("%02d", $tmp['mon'])), '__YEAR__' => (string) $tmp['year'], - '__YEAR_PREVIOUS_MONTH__' => (string) $tmp3['year'], - '__YEAR_NEXT_MONTH__' => (string) $tmp5['year'], '__PREVIOUS_DAY__' => (string) $tmp2['day'], '__PREVIOUS_MONTH__' => (string) $tmp3['month'], '__PREVIOUS_MONTH_TEXT__' => $outputlangs->trans('Month'.sprintf("%02d", $tmp3['month'])), @@ -10908,14 +10872,14 @@ /** * Replace eval function to add more security. - * This function is called by verifCond() for example. + * This function is called by verifCond() or trans() and transnoentitiesnoconv(). * * @param string $s String to evaluate * @param int<0,1> $returnvalue 0=No return (deprecated, used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). * @param int<0,1> $hideerrors 1=Hide errors - * @param string $onlysimplestring '0' (deprecated, do not use it anymore) = Accept all chars, - * '1' (most common use) = Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', - * '2' (used for example for the compute property of extrafields) = Accept also '<[]' + * @param string $onlysimplestring '0' (deprecated, do not use it anymore)=Accept all chars, + * '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', + * '2' (used for example for the compute property of extrafields)=Accept also '<[]' * @return string Return result of eval (even if type can be int, it is safer to assume string and find all potential typing issues as abs(dol_eval(...)). * @see verifCond(), checkPHPCode() to see sanitizing rules that should be very close. * @phan-suppress PhanPluginUnsafeEval @@ -11282,26 +11246,14 @@ $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_GLOBAL', '_POST', '_REQUEST', 'ReflectionFunction')); // We list all forbidden function as keywords we don't want to see (we don't mind it if is "kewyord(" or just "keyword", we don't want "keyword" at all) - // We must exclude all functions that allow to execute another function. This includes all function that has a parameter with type "callable" to avoid things - // like we can do with array_map and its callable parameter: dol_eval('json_encode(array_map(implode("",["ex","ec"]), ["id"]))', 1, 1, '0') $forbiddenphpfunctions = array(); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("override_function", "session_id", "session_create_id", "session_regenerate_id")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func", "call_user_func_array")); - - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("array_all", "array_any", "array_diff_ukey", "array_filter", "array_find", "array_find_key", "array_map", "array_reduce", "array_intersect_uassoc", "array_intersect_ukey", "array_walk", "array_walk_recursive")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("usort", "uasort", "uksort", "preg_replace_callback", "preg_replace_callback_array", "header_register_callback")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("set_error_handler", "set_exception_handler", "libxml_set_external_entity_loader", "register_shutdown_function", "register_tick_function", "unregister_tick_function")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("spl_autoload_register", "spl_autoload_unregister", "iterator_apply", "session_set_save_handler")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("forward_static_call", "forward_static_call_array", "register_postsend_function")); - - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("ob_start")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("exec", "passthru", "shell_exec", "system", "proc_open", "popen")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "dol_eval_new", "dol_eval_standard", "dol_concatdesc", "executeCLI", "verifCond", "GETPOST")); // native dolibarr functions $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("readline_completion_function", "readline_callback_handler_install")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_decode", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include")); ########## core/lib/geturl.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/geturl.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/geturl.lib.php 2025-06-27 11:43:41.365699000 +0000 @@ -66,7 +66,7 @@ print $nvpStr; exit;*/ curl_setopt($ch, CURLOPT_VERBOSE, 1); - curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function'); // set the Dolibarr user agent name + curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function'); // We use @ here because this may return warning if safe mode is on or open_basedir is on (following location is forbidden when safe mode is on). // We force value to false so we will manage redirection ourself later. @@ -178,7 +178,7 @@ do { if ($maxRedirection < 1) { - return array('http_code' => 400, 'content' => 'Maximum number of redirections reached', 'curl_error_no' => 1, 'curl_error_msg' => 'Maximum number of redirections reached'); + break; } curl_setopt($ch, CURLOPT_URL, $newUrl); @@ -192,7 +192,7 @@ if (in_array($hosttocheck, array('metadata.google.internal'))) { $info['http_code'] = 400; $info['content'] = 'Error bad hostname '.$hosttocheck.' (Used by Google metadata). This value for hostname is not allowed.'; - return array('http_code' => 400, 'content' => $info['content'], 'curl_error_no' => 1, 'curl_error_msg' => $info['content']); + break; } // Clean host name $hosttocheck to convert it into an IP $iptocheck @@ -220,7 +220,7 @@ if ($tmpresult) { $info['http_code'] = 400; $info['content'] = $tmpresult; - return array('http_code' => 400, 'content' => $tmpresult, 'curl_error_no' => 1, 'curl_error_msg' => $tmpresult); + break; } } @@ -371,10 +371,9 @@ /** * Function get second level domain name. - * For example: https://www.abc.mydomain.com/dir/page.html returns 'mydomain' with mode 0, 'mydomain.om' with mode 1, 'abc.mydomain.com' with mode 2. - * For example: part1@mydomain.com returns 'mydomain.com' with mode 1 + * For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain' * - * @param string $url Full URL or Email. + * @param string $url Full URL. * @param int $mode 0=return 'mydomain', 1=return 'mydomain.com', 2=return 'abc.mydomain.com' * @return string Returns domaine name */ @@ -399,10 +398,8 @@ $mode++; } - $tmpdomain = preg_replace('/^https?:\/\/[^:]+:[^@]+@/i', '', $url); // Remove http(s)://login@pass in https://login@pass:mydomain.com/path, so we now got mydomain.com/path - $tmpdomain = preg_replace('/^https?:\/\//i', '', $tmpdomain); // Remove http(s):// - $tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after / - $tmpdomain = preg_replace('/^[^@]+@/i', '', $tmpdomain); // Remove part1@ in part1@part2 (for emails) + $tmpdomain = preg_replace('/^https?:\/\//i', '', $url); // Remove http(s):// + $tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after / if ($mode == 3) { $tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)\.([^\.]+)\.([^\.]+)$/', '\1.\2.\3.\4', $tmpdomain); } elseif ($mode == 2) { ########## core/lib/pdf.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/pdf.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/pdf.lib.php 2025-06-27 11:43:41.344170000 +0000 @@ -1873,9 +1873,7 @@ if ($detail->batch) { $dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch); } - if ($detail->qty) { - $dte[] = $outputlangs->transnoentitiesnoconv('printQty', (string) $detail->qty); - } + $dte[] = $outputlangs->transnoentitiesnoconv('printQty', (string) $detail->qty); // Add also info of planned warehouse for lot if ($object->element == 'shipping' && $detail->fk_origin_stock > 0 && getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) { @@ -2590,7 +2588,7 @@ $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal"); $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs); } - } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order' || $objecttype == 'order_supplier') { + } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') { '@phan-var-force array $objects'; $outputlangs->load('orders'); @@ -2749,17 +2747,15 @@ } /** - * Return line total amount discount. - * Calculated by taking the unit price (subprice) * quantity - (total without tax) + * Return line total amount discount * * @param Commande|Facture|Propal $object Object * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @param int<0,1> $multicurrency 1=Get value in the foreign currency * @return int|float|string Return total of line excl tax */ -function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0, $multicurrency = 0) +function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0) { global $hookmanager; @@ -2781,8 +2777,7 @@ 'i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, - 'special_code' => $special_code, - 'multicurrency' => $multicurrency + 'special_code' => $special_code ); $action = ''; @@ -2797,11 +2792,7 @@ } if (empty($hidedetails) || $hidedetails > 1) { - if (empty($multicurrency)) { - return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1); - } else { - return (float) price2num($sign * (($object->lines[$i]->multicurrency_subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->multicurrency_total_ht), 'MT', 1); - } + return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1); } } return 0; ########## core/lib/security.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/security.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/security.lib.php 2025-06-27 11:43:41.245124000 +0000 @@ -178,7 +178,7 @@ * Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ. * * @param string $chain string to decode - * @param string $key If '', we use $conf->file->dolcrypt_key else $conf->file->instance_unique_id + * @param string $key If '', we use $conf->file->instance_unique_id * @return string encoded string * @since v17 * @see dolEncrypt(), dol_hash() ########## core/lib/security2.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/security2.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/security2.lib.php 2025-06-27 11:43:41.247029000 +0000 @@ -152,14 +152,8 @@ // Title $appli = constant('DOL_APPLICATION_TITLE'); $title = $appli.(getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' : ' '.constant('DOL_VERSION')); - - $customapplication = getDolGlobalString('MAIN_APPLICATION_TITLE'); - if ($customapplication) { - if (preg_match('/^\+/', $customapplication)) { - $title .= $customapplication; - } else { - $title = $customapplication; - } + if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { + $title = getDolGlobalString('MAIN_APPLICATION_TITLE'); } $titletruedolibarrversion = constant('DOL_VERSION'); // $title used by login template after the @ to inform of true Dolibarr version ########## core/lib/website.lib.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/website.lib.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/website.lib.php 2025-06-27 11:43:41.353025000 +0000 @@ -1512,14 +1512,9 @@ dol_mkdir(dirname($filetosave)); $fp = fopen($filetosave, "w"); - if ($fp) { - fwrite($fp, $tmpgeturl['content']); - fclose($fp); - dolChmod($filetosave); - } else { - setEventMessages('Error failed to open file '.$filetosave.' for writing', null, 'errors'); - //print 'Failed to open file '.$filetosave.' for writing.'; - } + fwrite($fp, $tmpgeturl['content']); + fclose($fp); + dolChmod($filetosave); } } } ########## core/login/functions_openid_connect.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/login/functions_openid_connect.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/login/functions_openid_connect.php 2025-06-27 11:43:40.379661000 +0000 @@ -121,7 +121,7 @@ return false; } - // Step 3: retrieve user info (login, email, ...) from OIDC server using token + // Step 3: retrieve user info using token $userinfo_headers = array('Authorization: Bearer '.$token_content->access_token); $userinfo_response = getURLContent(getDolGlobalString('MAIN_AUTHENTICATION_OIDC_USERINFO_URL'), 'GET', '', 1, $userinfo_headers, array('https'), 2); $userinfo_content = json_decode($userinfo_response['content']); @@ -159,12 +159,7 @@ // Success: retrieve claim to return to Dolibarr as login $sql = 'SELECT login, entity, datestartvalidity, dateendvalidity'; $sql .= ' FROM '.MAIN_DB_PREFIX.'user'; - if ($login_claim === 'email') { - // If login claim is email, check both login and email fields - $sql .= " WHERE (login = '".$db->escape($userinfo_content->$login_claim)."' OR email = '".$db->escape($userinfo_content->$login_claim)."')"; - } else { - $sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'"; - } + $sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'"; $sql .= ' AND entity IN (0,'.(array_key_exists('dol_entity', $_SESSION) ? ((int) $_SESSION["dol_entity"]) : 1).')'; dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG); @@ -174,11 +169,6 @@ dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error with sql query (".$db->error().")"); return false; } - $numres = $db->num_rows($resql); - if ($numres > 1) { - dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error more than 1 result from the query"); - return false; - } $obj = $db->fetch_object($resql); if (!$obj) { dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error no result from the query"); ########## core/modules/accountancy/doc/pdf_balance.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php 2025-06-27 11:43:40.564998000 +0000 @@ -502,7 +502,7 @@ $curY, $nexY, $default_font_size, - $langs->transnoentities('GrandTotals'), + $langs->trans('GrandTotals'), $tab_top_newpage, $totalDebit, $totalCredit, ########## core/modules/accountancy/doc/pdf_bookkeeping.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php 2025-06-27 11:43:40.562967000 +0000 @@ -511,7 +511,7 @@ $curY, $nexY, $default_font_size, - $langs->transnoentities('GrandTotals'), + $langs->trans('GrandTotals'), $tab_top_newpage, $totalDebit, $totalCredit, ########## core/modules/accountancy/doc/pdf_ledger.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php 2025-06-27 11:43:40.567274000 +0000 @@ -512,7 +512,7 @@ $curY, $nexY, $default_font_size, - $langs->transnoentities('GrandTotals'), + $langs->trans('GrandTotals'), $tab_top_newpage, $totalDebit, $totalCredit, ########## core/modules/asset/mod_asset_standard.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/asset/mod_asset_standard.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/asset/mod_asset_standard.php 2025-06-27 11:43:40.698985000 +0000 @@ -98,7 +98,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } @@ -137,7 +137,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } ########## core/modules/commande/doc/pdf_einstein.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/commande/doc/pdf_einstein.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/commande/doc/pdf_einstein.modules.php 2025-06-27 11:43:40.648800000 +0000 @@ -937,41 +937,31 @@ // Get Total HT $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); - // Total discount - $total_discount_on_lines = 0; - $multicurrency_total_discount_on_lines = 0; + // Total remise + $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); - $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1); - - $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0); - $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0); - // If line was a negative line, we do not count the discount as a discount + $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); + // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { - $total_discount_on_lines += -$line->total_ht; - $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht; + $total_line_remise += -$line->total_ht; } } + if ($total_line_remise > 0) { + $pdf->SetFillColor(255, 255, 255); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); + + $index++; - if ($total_discount_on_lines > 0) { // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - - $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); - - $index++; - - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - - $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -981,7 +971,7 @@ $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); @@ -1170,7 +1160,7 @@ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); - $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); ########## core/modules/commande/doc/pdf_eratosthene.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php 2025-06-27 11:43:40.642905000 +0000 @@ -1214,41 +1214,33 @@ // Get Total HT $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); - // Total discount - $total_discount_on_lines = 0; - $multicurrency_total_discount_on_lines = 0; + // Total remise + $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); - $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1); - - $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0); - $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0); - // If line was a negative line, we do not count the discount as a discount + $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); + // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { - $total_discount_on_lines += -$line->total_ht; - $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht; + $total_line_remise += -$line->total_ht; } } + $total_line_remise = (float) price2num($total_line_remise, 'MT', 1); - if ($total_discount_on_lines > 0) { - // Show total NET before discount - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); - $pdf->SetXY($col2x, $tab2_top); - - $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); - - $index++; - + if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); - $total_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); + $index++; + + // Show total NET before discount + $pdf->SetFillColor(255, 255, 255); + $pdf->SetXY($col1x, $tab2_top); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); + $pdf->SetXY($col2x, $tab2_top); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1257,7 +1249,7 @@ $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); @@ -1265,7 +1257,6 @@ $pdf->SetFillColor(248, 248, 248); $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; - $total_ttc_origin = $object->total_ttc; $this->atleastoneratenotnull = 0; if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) { @@ -1300,7 +1291,7 @@ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); - $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); @@ -1459,21 +1450,7 @@ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); - } else { - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); - - //$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R'); - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); - } + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); } } ########## core/modules/expensereport/doc/pdf_standard_expensereport.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php 2025-06-27 11:43:40.779089000 +0000 @@ -713,7 +713,7 @@ $pdf->SetFont('', 'B', $default_font_size + 4); $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 6, $outputlangs->trans("ExpenseReport"), 0, 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 6, $langs->trans("ExpenseReport"), 0, 'R'); $pdf->SetFont('', '', $default_font_size - 1); ########## core/modules/facture/doc/pdf_crabe.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/facture/doc/pdf_crabe.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/facture/doc/pdf_crabe.modules.php 2025-06-27 11:43:40.518976000 +0000 @@ -1480,41 +1480,31 @@ // Get Total HT $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); - // Total discount - $total_discount_on_lines = 0; - $multicurrency_total_discount_on_lines = 0; + // Total remise + $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); - $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1); - - $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0); - $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0); - // If line was a negative line, we do not count the discount as a discount + $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); + // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { - $total_discount_on_lines += -$line->total_ht; - $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht; + $total_line_remise += -$line->total_ht; } } + if ($total_line_remise > 0) { + $pdf->SetFillColor(255, 255, 255); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); + + $index++; - if ($total_discount_on_lines > 0) { // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - - $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); - - $index++; - - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - - $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1524,7 +1514,7 @@ $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true); ########## core/modules/facture/doc/pdf_sponge.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/facture/doc/pdf_sponge.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/facture/doc/pdf_sponge.modules.php 2025-06-27 11:43:40.514927000 +0000 @@ -1755,7 +1755,7 @@ } if ($fac->type === Facture::TYPE_CREDIT_NOTE) { - $facSign = '-'; + $facSign = '-'; // les avoirs } @@ -1798,41 +1798,31 @@ // Get Total HT $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); - // Total discount - $total_discount_on_lines = 0; - $multicurrency_total_discount_on_lines = 0; + // Total remise + $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); - $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1); - - $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0); - $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0); - // If line was a negative line, we do not count the discount as a discount + $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); + // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { - $total_discount_on_lines += -$line->total_ht; - $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht; + $total_line_remise += -$line->total_ht; } } + if ($total_line_remise > 0) { + $pdf->SetFillColor(255, 255, 255); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); + + $index++; - if ($total_discount_on_lines > 0) { // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - - $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); - - $index++; - - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - - $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1842,7 +1832,7 @@ $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true); @@ -2068,7 +2058,7 @@ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); - $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); @@ -2097,17 +2087,8 @@ if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); } else { - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); - + $pdf->MultiCell($largcol2, $tab2_hl, '('.price($sign * $total_ttc_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); //$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R'); - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); } // Retained warranty @@ -2169,18 +2150,11 @@ $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - //if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); - //} else { - // $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); - // - // $index++; - // $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - // $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true); - - // $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - // $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); - //} + if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); + } else { + $pdf->MultiCell($largcol2, $tab2_hl, '('.price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); + } // Credit note if ($creditnoteamount) { @@ -2215,17 +2189,7 @@ if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); } else { - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); - - //$pdf->MultiCell($largcol2, $tab2_hl, '('.price($resteapayer_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($resteapayer, 0, $outputlangs), 0, 'R', true); - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); + $pdf->MultiCell($largcol2, $tab2_hl, '('.price($resteapayer_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($resteapayer, 0, $outputlangs), 0, 'R', true); } $pdf->SetFont('', '', $default_font_size - 1); ########## core/modules/hrm/doc/pdf_standard_evaluation.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php 2025-06-27 11:43:40.538886000 +0000 @@ -115,8 +115,7 @@ */ public function __construct($db) { - global $langs, $mysoc; - + global $conf, $langs, $mysoc, $user; // Translations $langs->loadLangs(array("main", "hrm")); @@ -306,8 +305,6 @@ $iniY = $tab_top + 7; $nexY = $tab_top + 7; - $showmorebeforepagebreak = 0; - $pdf->setTopMargin($tab_top_newpage); // Loop on each lines $i = 0; @@ -327,10 +324,10 @@ $curY = $nexY; $pdf->startTransaction(); - // Shod fields of line $this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails); + $pageposafter = $pdf->getPage(); if ($pageposafter > $pageposbefore) { // There is a pagebreak @@ -498,64 +495,39 @@ */ protected function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0) { + global $conf; $objectligne = $object->lines[$linenumber]; $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); - // Rank of employee - $rankemptoshow = "-"; - if ($objectligne->rankorder > 0) { - $rankemptoshow = (string) $objectligne->rankorder; - } elseif ($objectligne->rankorder < 0) { - $rankemptoshow = $outputlangs->transnoentitiesnoconv("NA"); - } - $pdf->SetXY($this->posxrankemp, $curY); - $pdf->MultiCell($this->posxrequiredrank - $this->posxrankemp - 0.8, 4, $rankemptoshow, 0, 'C'); - - // Expected required Rank - $rankexpectedtoshow = "-"; - if ($objectligne->required_rank > 0) { - if ($objectligne->rankorder != 0) { - $rankexpectedtoshow = $objectligne->required_rank; - } - } elseif ($objectligne->required_rank < 0) { - $rankexpectedtoshow = $outputlangs->transnoentitiesnoconv("NA"); - } - $pdf->SetXY($this->posxrequiredrank, $curY); - $pdf->MultiCell($this->posxresult - $this->posxrequiredrank - 0.8, 4, $rankexpectedtoshow, 0, 'C'); - // Result $pdf->SetXY($this->posxresult - 1, $curY); - if ($objectligne->required_rank < 0) { // NA - $pdf->SetFillColor(255, 255, 255); - } elseif ($objectligne->rankorder > $objectligne->required_rank) { // Higher than expected + if ($objectligne->rankorder > $objectligne->required_rank) { // Teal Green - $pdf->SetFillColor(20, 129, 111); - } elseif ($objectligne->rankorder == $objectligne->required_rank) { // Same than expected + $pdf->SetFillColor(0, 109, 91); + } elseif ($objectligne->rankorder == $objectligne->required_rank) { // Seafoam Green - $pdf->SetFillColor(169, 236, 201); - } elseif ($objectligne->rankorder < $objectligne->required_rank) { // Lower than expected - // Red + $pdf->SetFillColor(159, 226, 191); + } elseif ($objectligne->rankorder < $objectligne->required_rank) { + // red $pdf->SetFillColor(205, 92, 92); } - if ($objectligne->rankorder <= 0 || $objectligne->required_rank == 0) { + if ($objectligne->rankorder == 0 || $objectligne->required_rank == 0) { // No fill color - $pdf->SetFillColor(240, 240, 240); - } - $result = "-"; - if ($objectligne->required_rank < 0) { - if ($objectligne->rankorder > 0) { - $result = $objectligne->rankorder; - } - } elseif ($objectligne->rankorder < 0) { - $result = $outputlangs->transnoentitiesnoconv("NA"); - } elseif ($objectligne->required_rank != 0 && $objectligne->rankorder != 0) { - $result = $objectligne->rankorder . "/" . $objectligne->required_rank; + $pdf->SetFillColor(255, 255, 255); } + $result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder . "/" . $objectligne->required_rank : "-"); $pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', true); - // The next fields can be on several lines so we output them at end so the pos on next line will work correctly + + // required Rank + $pdf->SetXY($this->posxrequiredrank, $curY); + $pdf->MultiCell($this->posxresult - $this->posxrequiredrank - 0.8, 4, (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->required_rank : "-"), 0, 'C'); + + // Rank Employee + $pdf->SetXY($this->posxrankemp, $curY); + $pdf->MultiCell($this->posxrequiredrank - $this->posxrankemp - 0.8, 4, (($objectligne->rankorder != 0) ? $objectligne->rankorder : "-"), 0, 'C'); // Skill $skill = new Skill($this->db); @@ -568,6 +540,8 @@ } $pdf->writeHTMLCell($this->posxrankemp - $this->posxskill - 0.8, 4, $this->posxskill - 1, $curY, $comment, 0, 1); + + // Line num $pdf->SetXY($this->posxpiece, $curY); $pdf->writeHTMLCell($this->posxskill - $this->posxpiece - 0.8, 3, $this->posxpiece - 1, $curY, (string) ($linenumber + 1), 0, 1, false, false, 'C'); ########## core/modules/hrm/mod_evaluation_standard.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/hrm/mod_evaluation_standard.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/hrm/mod_evaluation_standard.php 2025-06-27 11:43:40.540971000 +0000 @@ -98,7 +98,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } @@ -136,7 +136,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } ########## core/modules/modCron.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/modCron.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/modCron.class.php 2025-06-27 11:43:40.811188000 +0000 @@ -39,6 +39,8 @@ */ public function __construct($db) { + global $langs, $conf; + $this->db = $db; $this->numero = 2300; @@ -139,8 +141,8 @@ 'url'=>'/cron/list.php?leftmenu=admintools', 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>500, - 'enabled'=>'isModEnabled("cron") && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->hasRight("cron", "read")', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules + 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; ########## core/modules/modMultiCurrency.class.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/modMultiCurrency.class.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/modMultiCurrency.class.php 2025-06-27 11:43:40.738613000 +0000 @@ -154,7 +154,7 @@ 'parameters' => '0,0,cron', 'comment' => 'Update all the currencies using the currencylayer API. An API key needs to be given in the multi-currency module config page to have this job working.
First param is not used, Second parameter is 0 to update only already existing currency defined into the Multicurrency module or 1 to add any currency. Third parameter must be "cron".', 'frequency' => 1, - 'unitfrequency' => 604800, + 'unitfrequency' => 2678400, 'status' => $statusatinstall, 'test' => 'isModEnabled("cron")', 'datestart' => $datestart ########## core/modules/propale/doc/pdf_azur.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/propale/doc/pdf_azur.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/propale/doc/pdf_azur.modules.php 2025-06-27 11:43:40.681909000 +0000 @@ -1111,8 +1111,7 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $outputlangsbis = null) { // phpcs:enable - global $mysoc; - + global $conf, $mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); $tab2_top = $posy; @@ -1133,41 +1132,31 @@ // Get Total HT $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); - // Total discount - $total_discount_on_lines = 0; - $multicurrency_total_discount_on_lines = 0; + // Total remise + $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); - $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1); - - $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0); - $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0); - // If line was a negative line, we do not count the discount as a discount + $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); + // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { - $total_discount_on_lines += -$line->total_ht; - $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht; + $total_line_remise += -$line->total_ht; } } + if ($total_line_remise > 0) { + $pdf->SetFillColor(255, 255, 255); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); + + $index++; - if ($total_discount_on_lines > 0) { // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - - $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); - - $index++; - - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - - $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1323,7 +1312,7 @@ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); - $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); ########## core/modules/propale/doc/pdf_cyan.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/propale/doc/pdf_cyan.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/propale/doc/pdf_cyan.modules.php 2025-06-27 11:43:40.684047000 +0000 @@ -1087,8 +1087,7 @@ */ public function drawInfoTable(&$pdf, $object, $posy, $outputlangs) { - global $mysoc; - + global $conf, $mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 1); @@ -1302,41 +1301,31 @@ // Get Total HT $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); - // Total discount - $total_discount_on_lines = 0; - $multicurrency_total_discount_on_lines = 0; + // Total remise + $total_line_remise = 0; foreach ($object->lines as $i => $line) { $resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2); - $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1); - - $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0); - $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0); - // If line was a negative line, we do not count the discount as a discount + $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0); + // Gestion remise sous forme de ligne négative if ($line->total_ht < 0) { - $total_discount_on_lines += -$line->total_ht; - $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht; + $total_line_remise += -$line->total_ht; } } + if ($total_line_remise > 0) { + $pdf->SetFillColor(255, 255, 255); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); + + $index++; - if ($total_discount_on_lines > 0) { // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - - $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); - - $index++; - - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - - $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1354,7 +1343,6 @@ $pdf->SetFillColor(248, 248, 248); $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; - $total_ttc_origin = $object->total_ttc; $this->atleastoneratenotnull = 0; if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) { @@ -1535,21 +1523,7 @@ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); - } else { - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); - - //$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).')   '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R'); - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); - } + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); } } ########## core/modules/societe/doc/doc_generic_odt.modules.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php 2025-06-27 11:43:40.441120000 +0000 @@ -95,7 +95,7 @@ */ public function info($langs) { - global $langs; + global $conf, $langs; // Load traductions files required by page $langs->loadLangs(array("companies", "errors")); ########## core/modules/stocktransfer/mod_stocktransfer_standard.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php 2025-06-27 11:43:40.463911000 +0000 @@ -99,7 +99,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } @@ -137,7 +137,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } ########## core/modules/workstation/mod_workstation_standard.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/workstation/mod_workstation_standard.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/workstation/mod_workstation_standard.php 2025-06-27 11:43:40.632264000 +0000 @@ -97,7 +97,7 @@ $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; - } elseif (!is_numeric($object->ismultientitymanaged)) { + } elseif ($object->ismultientitymanaged == 2) { // TODO } ########## core/tpl/login.tpl.php --- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/login.tpl.php 2025-08-04 13:08:35.000000000 +0000 +++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/login.tpl.php 2025-06-27 11:43:40.140838000 +0000 @@ -148,20 +148,12 @@ '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)) ); -// We display application title -$application = constant('DOL_APPLICATION_TITLE'); -$applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE'); -if ($applicationcustom) { - $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom; -} - -// We define login title -if ($applicationcustom) { - $titleofloginpage = $langs->trans('Login').' '.$application; +// We display application title instead Login term +if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { + $titleofloginpage = getDolGlobalString('MAIN_APPLICATION_TITLE'); } else { $titleofloginpage = $langs->trans('Login'); } -// Title of HTML page must have pattern ' @ (?:Doli[a-zA-Z]+ |)(\\d+)\\.(\\d+)\\.([^\\s]+)' to be detected as THE login page by webviews. $titleofloginpage .= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version. $disablenofollow = 1; @@ -264,12 +256,12 @@ -