diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a7f395116b0..630e9fab8d7 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -336,7 +336,7 @@ class Commande extends CommonOrder 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 185), 'date_livraison' => array('type' => 'date', 'label' => 'DateDeliveryPlanned', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'csslist' => 'nowraponall'), 'fk_shipping_method' => array('type' => 'integer', 'label' => 'ShippingMethod', 'enabled' => 1, 'visible' => -1, 'position' => 195), - 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Fk warehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 200), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'DefaultWarehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 200, 'nodepth' => 1), 'fk_availability' => array('type' => 'integer', 'label' => 'Availability', 'enabled' => 1, 'visible' => -1, 'position' => 205), 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 210), //'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>-1, 'position'=>215), @@ -856,7 +856,7 @@ class Commande extends CommonOrder */ public function cancel($idwarehouse = -1) { - global $conf, $user, $langs; + global $user, $langs; $error = 0; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a17d7309b15..238121bb533 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1415,7 +1415,7 @@ if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER_IN_LIST')) { } // Ref if (!empty($arrayfields['f.ref']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -1439,7 +1439,7 @@ if (!empty($arrayfields['f.type']['checked'])) { } //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. // @phan-suppress-next-line PhanPluginSuspiciousParamOrder - print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); + print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth75'); print ''; } // Invoice Subtype @@ -2505,7 +2505,7 @@ if ($num > 0) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); } else { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4e46f88bb23..f6719809fbb 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -664,7 +664,7 @@ class Contact extends CommonObject $sql .= ", phone = ".(isset($this->phone_pro) ? "'".$this->db->escape($this->phone_pro)."'" : "NULL"); $sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "NULL"); $sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "NULL"); - $sql .= ", priv = '".$this->db->escape($this->priv)."'"; + $sql .= ", priv = ".((int) $this->priv); $sql .= ", fk_prospectlevel = '".$this->db->escape($this->fk_prospectlevel)."'"; if (isset($this->stcomm_id)) { $sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0"); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 48d54d40f5f..9661927d240 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -12,7 +12,7 @@ * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify @@ -368,7 +368,7 @@ if (empty($reshook)) { 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 $search_all = ""; $search_id = ''; - $search_ref = ''; + $search_ref_ext = ''; $search_firstlast_only = ""; $search_lastname = ""; $search_firstname = ""; @@ -866,8 +866,8 @@ if ($search_all != '') { if ($search_id > 0) { $param .= "&search_id=".((int) $search_id); } -if ($search_ref) { - $param .= "&search_ref=".urlencode($search_ref); +if ($search_ref_ext) { + $param .= "&search_ref_ext=".urlencode($search_ref_ext); } if ($search_lastname != '') { $param .= '&search_lastname='.urlencode($search_lastname); diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 030713957a3..31297131479 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -103,7 +103,7 @@ class DolEditor * @param string $toolbarname Name of the toolbar set to use ('dolibarr_details[_encoded]'=the less featured, 'dolibarr_notes[_encoded]' for notes content, 'dolibarr_mailings[_encoded]' for emailing content, 'dolibarr_readonly'). * @param string $toolbarlocation Deprecated. Not used * @param bool $toolbarstartexpanded Bar is visible or not at start - * @param bool|int $uselocalbrowser Enabled to add links to local object with a local media filemanager. If false, only external images URL can be added into content, or images saved inline with src="data:..." with a cut/paste. + * @param bool|int $uselocalbrowser Enabled to add links to local object with a local media filemanager. -1=auto, false=only external images URL can be added into content, or images saved inline with src="data:..." with a cut/paste. * @param bool|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". * @param int $rows Size of rows for textarea tool diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 59a9f25598c..f0f1cd22712 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -32,7 +32,7 @@ * include DOL_DOCUMENT_ROOT.'/core/customreports.php'; */ - /** +/** * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager @@ -322,6 +322,7 @@ $HH = substr($langs->trans("Hour"), 0, 1).substr($langs->trans("Hour"), 0, 1); $MI = substr($langs->trans("Minute"), 0, 1).substr($langs->trans("Minute"), 0, 1); $SS = substr($langs->trans("Second"), 0, 1).substr($langs->trans("Second"), 0, 1); +$arrayoffilterfields = array(); $arrayofmesures = array(); $arrayofxaxis = array(); $arrayofgroupby = array(); @@ -375,6 +376,10 @@ foreach ($arrayoftype as $key => $val) { } } +$count = 0; +$arrayoffilterfields = fillArrayOfFilterFields($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayoffilterfields, 0, $count); +$arrayoffilterfields = dol_sort_array($arrayoffilterfields, 'position', 'asc', 0, 0, 1); + $count = 0; $arrayofmesures = fillArrayOfMeasures($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofmesures, 0, $count); $arrayofmesures = dol_sort_array($arrayofmesures, 'position', 'asc', 0, 0, 1); @@ -387,10 +392,6 @@ $count = 0; $arrayofgroupby = fillArrayOfGroupBy($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofgroupby, 0, $count); $arrayofgroupby = dol_sort_array($arrayofgroupby, 'position', 'asc', 0, 0, 1); -$count = 0; -$arrayoffilterfields = fillArrayOfFilterFields($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayoffilterfields, 0, $count); -$arrayoffilterfields = dol_sort_array($arrayoffilterfields, 'position', 'asc', 0, 0, 1); - // Check parameters if ($action == 'viewgraph') { diff --git a/htdocs/core/lib/customreports.lib.php b/htdocs/core/lib/customreports.lib.php index 553e3f3681b..574faafeabb 100644 --- a/htdocs/core/lib/customreports.lib.php +++ b/htdocs/core/lib/customreports.lib.php @@ -523,10 +523,12 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof { global $langs, $extrafields, $db; + $MAXLEVEL = 2; + if (empty($object)) { // Protection against bad use of method return array(); } - if ($level >= 3) { // Limit scan on 2 levels max + if ($level > $MAXLEVEL) { // Limit scan on 2 levels max return $arrayoffields; } @@ -612,7 +614,11 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof if (class_exists($newobject)) { $tmpobject = new $newobject($db); $count++; - $arrayoffields = fillArrayOfFilterFields($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayoffields, $level + 1, $count, $tablepath); + if (!empty($val['nodepth'])) { + $arrayoffields = fillArrayOfFilterFields($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayoffields, $MAXLEVEL, $count, $tablepath); + } else { + $arrayoffields = fillArrayOfFilterFields($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayoffields, $level + 1, $count, $tablepath); + } } else { print 'For property '.$object->element.'->'.$key.', type="'.$val['type'].'": Failed to find class '.$newobject." in file ".$tmptype[2]."
\n"; } diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 86737d3defc..8c6673a2bbc 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -33,7 +33,7 @@ */ function dolStripPhpCode($str, $replacewith = '') { - $str = str_replace('initAll(); // For the case this method is called alone + dol_syslog("modGeneratePassPerso::validatePassword"); + $password_a = preg_split('//u', $password, 0, PREG_SPLIT_NO_EMPTY); $maj = preg_split('//u', $this->Maj, 0, PREG_SPLIT_NO_EMPTY); $num = preg_split('//u', $this->Nb, 0, PREG_SPLIT_NO_EMPTY); diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 53f40260dbc..c363f1c050b 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -125,6 +125,8 @@ class modGeneratePassStandard extends ModeleGenPassword { global $langs; + dol_syslog("modGeneratePassStandard::validatePassword"); + if (dol_strlen($password) < $this->length2) { $langs->load("other"); $this->error = $langs->trans("YourPasswordMustHaveAtLeastXChars", $this->length2); diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 2defceeee72..12245ab9643 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -291,7 +291,7 @@ class ConferenceOrBooth extends ActionComm $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.urlencode((string) ($id)).'&type=conf'; - $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, '2'); + $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $id), 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); /*$this->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 8512701a0bb..8a7fd4a3b91 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -489,9 +489,9 @@ class ConferenceOrBoothAttendee extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.fk_soc' || $key == 't.fk_project' || $key == 't.fk_actioncomm') { - $sqlwhere[] = $key.'='.((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; + $sqlwhere[] = $this->db->sanitize($key).' = '.((int) $value); + } elseif (!empty($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; } elseif (strpos($value, '%') === false) { diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 63725bae5cc..b839978b0a9 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -307,7 +307,7 @@ yourCompanyInformation=Your company information emailAlreadyRegistered=This email is already registered. firstnameContainsLettersOnly=Firstname must contain letters and spaces only lastnameContainsLettersOnly=Lastname must contain letters and spaces only -passwordCriteria=Password must meet the following criteria:
- 12 characters
- 1 uppercase letter
- 1 digit
- No special characters
- Avoid repeating characters more than 3 times
+passwordCriteria=Password must meet the following criteria:
- At least 12 characters
- At lest 1 uppercase letter
- At least 1 digit
- At last 1 special characters
- Avoid repeating characters more than 3 times
errorOccurred=An error has occurred. accountCreation=Create an account errorsOccurred=There are %s error%s diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index c8aece70148..24e56e6ac0b 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -257,6 +257,7 @@ logOutFromYourCustomerAccount=Déconnectez-vous de votre compte client filteredByVersion=Filtré par version removeFilter=Supprimer filtre viewMyCart=Voir mon panier +Shipping=Expédition freeShipping=Expédition gratuite ! noProducts=Aucun produits nbrItemsInCart=Il y a 0 articles dans votre panier. diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index d3099bbc36b..70a22f644e4 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -362,7 +362,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If the registration has already been paid for this attendee if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) { - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'master'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorded", $email); @@ -698,7 +698,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); header("Location: ".$redirection); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index a1fe0017a3a..5b3be5058eb 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -81,7 +81,7 @@ $error = 0; // Security check $id = GETPOSTINT("id"); $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeyreceived != $securekeytocompare) { print $langs->trans('MissingOrBadSecureKey'); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 949bb286c48..9247e6d9159 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -94,7 +94,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST('securekey', 'alpha'); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'md5'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -550,7 +550,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; header("Location: ".$redirection); exit; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index fcc9dfc6025..e3ddf9c4260 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -94,7 +94,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST('securekey', 'alpha'); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'md5'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -486,7 +486,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he if (!$error) { $db->commit(); - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); header("Location: ".$redirection); exit; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 5b9404e2515..250a7b4c5df 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -81,7 +81,7 @@ $error = 0; $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'md5'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -173,10 +173,10 @@ while ($i < $db->num_rows($result)) { */ // Get vote result -$idvote = GETPOST("vote"); -$hashedvote = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'vote'.$idvote); +$idvote = GETPOSTINT("vote"); +$hashedvote = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'vote'.$idvote); -if (strlen($idvote)) { +if ($idvote > 0) { if (in_array($hashedvote, $listofvotes)) { // Has already voted $votestatus = 'ko'; diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index afd7e020886..01a3f1d4824 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -28,6 +28,9 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { @phan-var-force string $colorblind_deuteranopes_badgeWarning '; ?> + +/* IDE Hack