From af062aa5f609c513c039f62bd7e12e8ed94f2e25 Mon Sep 17 00:00:00 2001 From: Eric <1468823+rycks@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:34:39 +0100 Subject: [PATCH 001/117] datenextrun is mandatory as dolibarr 16.0 (#28344) --- htdocs/core/modules/DolibarrModules.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 627a13a7844a4..7978238333032 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004-2023 Eric Seigne * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud @@ -1445,6 +1445,7 @@ public function insert_cronjobs() $frequency = isset($this->cronjobs[$key]['frequency']) ? $this->cronjobs[$key]['frequency'] : ''; $unitfrequency = isset($this->cronjobs[$key]['unitfrequency']) ? $this->cronjobs[$key]['unitfrequency'] : ''; $priority = isset($this->cronjobs[$key]['priority']) ? $this->cronjobs[$key]['priority'] : ''; + $datenextrun = isset($this->cronjobs[$key]['datenextrun']) ? $this->cronjobs[$key]['datenextrun'] : ''; $datestart = isset($this->cronjobs[$key]['datestart']) ? $this->cronjobs[$key]['datestart'] : ''; $dateend = isset($this->cronjobs[$key]['dateend']) ? $this->cronjobs[$key]['dateend'] : ''; $status = isset($this->cronjobs[$key]['status']) ? $this->cronjobs[$key]['status'] : ''; @@ -1480,7 +1481,7 @@ public function insert_cronjobs() $this->db->begin(); if (!$err) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datenextrun, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,"; if (is_int($frequency)) { $sql .= ' frequency,'; } @@ -1497,6 +1498,7 @@ public function insert_cronjobs() $sql .= " VALUES ("; $sql .= "'".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."', "; $sql .= "'".$this->db->idate($now)."', "; + $sql .= ($datenextrun ? "'".$this->db->idate($datenextrun)."'" : "'".$this->db->idate($now)."'").", "; $sql .= ($datestart ? "'".$this->db->idate($datestart)."'" : "'".$this->db->idate($now)."'").", "; $sql .= ($dateend ? "'".$this->db->idate($dateend)."'" : "NULL").", "; $sql .= "'".$this->db->escape($label)."', "; From 692e10ec944b95064c4dd5927c82aae97127f400 Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Fri, 23 Feb 2024 17:14:10 +0100 Subject: [PATCH 002/117] FIX: Error When cloning fourn price no default value for tva_tx (#28368) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3ba34b9672847..e754148f6d5ed 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4723,8 +4723,8 @@ public function clone_fournisseurs($fromId, $toId) // les prix de fournisseurs. $sql = "INSERT ".$this->db->prefix()."product_fournisseur_price ("; - $sql .= " datec, fk_product, fk_soc, price, quantity, fk_user)"; - $sql .= " SELECT '".$this->db->idate($now)."', ".((int) $toId).", fk_soc, price, quantity, fk_user"; + $sql .= " datec, fk_product, fk_soc, price, quantity, fk_user, tva_tx)"; + $sql .= " SELECT '".$this->db->idate($now)."', ".((int) $toId).", fk_soc, price, quantity, fk_user, tva_tx"; $sql .= " FROM ".$this->db->prefix()."product_fournisseur_price"; $sql .= " WHERE fk_product = ".((int) $fromId); From 1a25a086cb6cb246b34f1fef544487a7ce211824 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Feb 2024 17:44:30 +0100 Subject: [PATCH 003/117] FIX quote in sql request --- htdocs/core/modules/modStockTransfer.class.php | 14 +++++++------- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index d2f4b0b5bb705..ecb103946cba7 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -435,26 +435,26 @@ public function init($options = '') $sql = array(); - // Rôles - $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "internal"'); + // Roles + $resql = $this->db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE code = 'STDEST' AND element = 'stocktransfer' AND source = 'internal'"); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsable du transfert de stocks", 1, NULL, 0)'); + $this->db->query("INSERT INTO ".MAIN_DB_PREFIX."c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(".((int) $nextid).", 'stocktransfer', 'internal', 'STRESP', 'Responsible for stock transfers', 1, NULL, 0)"); } - $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STFROM" AND element = "StockTransfer" AND source = "external"'); + $resql = $this->db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE code = 'STFROM' AND element = 'stocktransfer' AND source = 'external'"); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact expéditeur transfert de stocks", 1, NULL, 0)'); + $this->db->query("INSERT INTO ".MAIN_DB_PREFIX."c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(".((int) $nextid).", 'stocktransfer', 'external', 'STFROM', 'Contact sending the stock transfer', 1, NULL, 0)"); } - $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "external"'); + $resql = $this->db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE code = 'STDEST' AND element = 'stocktransfer' AND source = 'external'"); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact destinataire transfert de stocks", 1, NULL, 0)'); + $this->db->query("INSERT INTO ".MAIN_DB_PREFIX."c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(".((int) $nextid).", 'stocktransfer', 'external', 'STDEST', 'Contact receiving the stock transfer', 1, NULL, 0)"); } return $this->_init($sql, $options); diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index c355ca25b7937..f528d39bdc62f 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -211,3 +211,5 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Soci ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; ALTER TABLE llx_bom_bomline ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + +UPDATE llx_c_type_contact SET element = 'stocktransfer' WHERE element = 'StockTransfer'; From fca9ebe72f8d793e5cc1ef63d330ebb2d28960bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 12:58:20 +0100 Subject: [PATCH 004/117] Fix field position --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index df07651e7afa9..d68d6fbb99e5a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -136,7 +136,7 @@ class EmailCollector extends CommonObject 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'oauth_service' => array('type'=>'varchar(128)', 'label'=>'oauthService', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>104, 'notnull'=>0, 'index'=>1, 'comment'=>"IMAP login oauthService", 'arrayofkeyval'=>array(), 'help'=>'TokenMustHaveBeenCreated'), - 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>104, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), + 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>109, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), 'target_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxTargetDirectory', 'visible'=>1, 'enabled'=>1, 'position'=>110, 'notnull'=>0, 'help'=>"EmailCollectorTargetDir"), 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>50), 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), From 4c3830b90973640805be1a8d804e8cd3b59daaa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 13:06:31 +0100 Subject: [PATCH 005/117] Fix set the default value --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index d68d6fbb99e5a..8a74a5a434a26 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -152,7 +152,7 @@ class EmailCollector extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) ); From 05914b4c78162d3dfdaea7de746b1a90efedd370 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 16:57:45 +0100 Subject: [PATCH 006/117] Fix warning --- htdocs/core/lib/website.lib.php | 6 +++--- htdocs/core/website.inc.php | 2 +- htdocs/website/class/website.class.php | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 912247eb0ff7f..4583852526a0e 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -676,13 +676,13 @@ function getStructuredData($type, $data = array()) $ret .= '{ "@context": "https://schema.org", "@type": "Organization", - "name": "'.dol_escape_json($data['name'] ? $data['name'] : $companyname).'", - "url": "'.dol_escape_json($data['url'] ? $data['url'] : $url).'", + "name": "'.dol_escape_json(!empty($data['name']) ? $data['name'] : $companyname).'", + "url": "'.dol_escape_json(!empty($data['url']) ? $data['url'] : $url).'", "logo": "'.($data['logo'] ? dol_escape_json($data['logo']) : '/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo)).'", "contactPoint": { "@type": "ContactPoint", "contactType": "Contact", - "email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'" + "email": "'.dol_escape_json(!empty($data['email']) ? $data['email'] : $mysoc->email).'" }'."\n"; if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= ",\n"; diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 9be644e0c1648..9a340050d22e4 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -67,7 +67,7 @@ if (!is_object($pagelangs)) { $pagelangs = new Translate('', $conf); } -if ($pageid > 0) { +if (!empty($pageid) && $pageid > 0) { $websitepage->fetch($pageid); $weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['weblangs-shortcode']))); diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index f5a4ec292bd88..84a350748059e 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -77,10 +77,15 @@ class Website extends CommonObject public $description; /** - * @var string Main language of web site + * @var string Main language on 5 chars of web site */ public $lang; + /** + * @var string Main language on 2 chars of web site + */ + public $shortlang; + /** * @var string List of languages of web site ('fr', 'es_MX', ...) */ From 0a9d4540554627525539803c2e1104792a16219d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 17:01:37 +0100 Subject: [PATCH 007/117] Fix revert --- htdocs/website/class/website.class.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 84a350748059e..f5a4ec292bd88 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -77,15 +77,10 @@ class Website extends CommonObject public $description; /** - * @var string Main language on 5 chars of web site + * @var string Main language of web site */ public $lang; - /** - * @var string Main language on 2 chars of web site - */ - public $shortlang; - /** * @var string List of languages of web site ('fr', 'es_MX', ...) */ From 076cde3005e3246b7821cd5e0b4f3b18ae1230e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 17:20:28 +0100 Subject: [PATCH 008/117] Fix warning --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 058c12b377f30..f8835a4d44ced 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index b8eead4838413..531937c699d4d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3e8a0c4dab240..21f32a19efc4d 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 4490852b2a8bc..29e64e1c69a63 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 059f9a2f3938d..0302d06c27752 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 9484c0e3f58e7..4deeeeab874e2 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 7dd88929a4872..28cf4604b06e1 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 126f2e66941aa..b11cd1931c2e2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 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'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 5e8cd595229a8..b0c647e55b1c1 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 2778ac9e76ca0..b5c8abe5bdc11 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 2a306d5b8be99..c53a239ac8abd 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index ab6db1911f299..f006893227ee4 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index bc9998adf8264..f9ca03493ff54 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e658e75b26525..c79c79d1b8c3d 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index dffb5600e4688..028e4ad1ba327 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 390ccf22287bf..3a5c78b929f9b 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 4fd68649ef667..025c3895113bd 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 3f8e6b176d897..f894d4ca51f9e 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index aba40325cfdd7..68d654b64e011 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index a8b2f56c55361..1c7b9693072be 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index d632c7d30f399..efb9b69d7a5e6 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index feb94f13bd933..3e2a0d36fc45a 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 9033587e2df36..f5f0dfd4f9269 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a0eed471a0b16..3c3bded98fd74 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 3030617098bcf..689d95a5d8e07 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 543ded86b6c54..ac25ea56c2efb 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From 4897d1eb97800c7ab12cf9044177111ced1e14bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 17:20:28 +0100 Subject: [PATCH 009/117] Fix warning --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/core/lib/xcal.lib.php | 9 +++++---- .../eventorganization/class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- .../knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- .../recruitment/class/recruitmentcandidature.class.php | 2 +- .../recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 27 files changed, 31 insertions(+), 30 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 058c12b377f30..f8835a4d44ced 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index b8eead4838413..531937c699d4d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3e8a0c4dab240..21f32a19efc4d 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 4490852b2a8bc..29e64e1c69a63 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 059f9a2f3938d..0302d06c27752 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 9484c0e3f58e7..4deeeeab874e2 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 4ea8fffb327dc..bfca11682e40f 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -401,8 +401,8 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $startdate = $event["startdate"]; $summary = $event["summary"]; $url = $event["url"]; - $author = $event["author"]; - $category = $event["category"]; + $author = $event["author"]; + $category = empty($event["category"]) ? null : $event["category"]; if (!empty($event["image"])) { $image = $event["image"]; } @@ -419,9 +419,10 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "<![CDATA[".$summary."]]>\n"); fwrite($fichier, "\n"); fwrite($fichier, "\n"); - fwrite($fichier, "\n"); + if (!empty($category)) { + fwrite($fichier, "\n"); + } fwrite($fichier, "

'); } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 7dd88929a4872..28cf4604b06e1 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 126f2e66941aa..b11cd1931c2e2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 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'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 5e8cd595229a8..b0c647e55b1c1 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 2778ac9e76ca0..b5c8abe5bdc11 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 2a306d5b8be99..c53a239ac8abd 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index ab6db1911f299..f006893227ee4 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index bc9998adf8264..f9ca03493ff54 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e658e75b26525..c79c79d1b8c3d 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index dffb5600e4688..028e4ad1ba327 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 390ccf22287bf..3a5c78b929f9b 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 4fd68649ef667..025c3895113bd 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 3f8e6b176d897..f894d4ca51f9e 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index aba40325cfdd7..68d654b64e011 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index a8b2f56c55361..1c7b9693072be 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index d632c7d30f399..efb9b69d7a5e6 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index feb94f13bd933..3e2a0d36fc45a 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 9033587e2df36..f5f0dfd4f9269 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a0eed471a0b16..3c3bded98fd74 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 3030617098bcf..689d95a5d8e07 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 543ded86b6c54..ac25ea56c2efb 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From c171ce20650f362e81b34ca756046c3fe99c4e37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 19:04:05 +0100 Subject: [PATCH 010/117] Fix bad function --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index f8835a4d44ced..94fad45138da7 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 531937c699d4d..3b557456e77b8 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 21f32a19efc4d..040a06e62ca19 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 29e64e1c69a63..a7bde4a774647 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 0302d06c27752..734d78202a924 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 4deeeeab874e2..cd0b1a655a204 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 28cf4604b06e1..60b8114dd80e9 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b11cd1931c2e2..426ed9eaefc0a 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 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 (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index b0c647e55b1c1..7689312ec396f 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index b5c8abe5bdc11..da18ecd8a6e4b 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index c53a239ac8abd..ec0c67a0ad19d 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index f006893227ee4..f1127f67e5a20 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index f9ca03493ff54..01861a6b185ec 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index c79c79d1b8c3d..b9df29a9dafd2 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 028e4ad1ba327..2dcc3373f5e7c 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 3a5c78b929f9b..370c29f1dce9b 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 025c3895113bd..24fef99e5b879 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f894d4ca51f9e..c4e3c0fd3b8fa 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 68d654b64e011..e3f7457919f4b 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 1c7b9693072be..f037762b01fbf 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index efb9b69d7a5e6..d7f1db2a5649d 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 3e2a0d36fc45a..b3c9f92e12f98 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index f5f0dfd4f9269..19b1572e2beaa 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3c3bded98fd74..8f438adc5e4eb 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 689d95a5d8e07..d8f2a14a86130 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index ac25ea56c2efb..8e650fa9f3f9f 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From 628feb9c341580a03c7b989386f1c552f6ba7a7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 21:10:35 +0100 Subject: [PATCH 011/117] Fix warning --- htdocs/webservices/server_supplier_invoice.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 5b7a223a1c4a2..85744ccc24e33 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -422,11 +422,11 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) 'ref'=>$invoice->ref, 'ref_supplier'=>$invoice->ref_supplier, 'ref_ext'=>$invoice->ref_ext, - 'fk_user_author' => $invoice->fk_user_author, - 'fk_user_valid' => $invoice->fk_user_valid, - 'fk_thirdparty' => $invoice->fk_soc, + 'fk_user_author' => $invoice->user_creation_id, + 'fk_user_valid' => $invoice->user_validation_id, + 'fk_thirdparty' => $invoice->socid, 'type'=>$invoice->type, - 'status'=>$invoice->statut, + 'status'=>$invoice->status, 'total_net'=>$invoice->total_ht, 'total_vat'=>$invoice->total_tva, 'total'=>$invoice->total_ttc, From 26a3ca0413e8edf0a77e7311f75304f52ed83649 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 21:29:36 +0100 Subject: [PATCH 012/117] Fix warning php 8.1 --- htdocs/public/demo/index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index c71f1d86dc703..e8563e4a9d736 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -134,7 +134,6 @@ $modules = array(); $orders = array(); $categ = array(); -$dirmod = array(); $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. @@ -174,7 +173,6 @@ $filename[$i] = $modName; $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module //print "x".$modName." ".$orders[$i]."\n
"; - $dirmod[$i] = $dirroot; $j++; $i++; } From 0140f5057dbcc07b6cd677ba509a993ec4ebdf0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 21:37:38 +0100 Subject: [PATCH 013/117] Fix warning --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9aede3af25a9a..64652fd3dd11e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -713,7 +713,7 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) // If in demo mode, we check we go to home page through the public/demo/index.php page if (!empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') { // We ask index page if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/public/', $_SERVER['HTTP_REFERER'])) { - dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")"); + dol_syslog("Call index page from another url than demo page (call is done from page ".(empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFER']).")"); $url = ''; $url .= ($url ? '&' : '').($dol_hide_topmenu ? 'dol_hide_topmenu='.$dol_hide_topmenu : ''); $url .= ($url ? '&' : '').($dol_hide_leftmenu ? 'dol_hide_leftmenu='.$dol_hide_leftmenu : ''); From 72d84f546f56238f24499a1b4592a0451a80239a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 22:01:20 +0100 Subject: [PATCH 014/117] Fix can disable port on command line --- dev/initdemo/initdemopassword.sh | 112 ++++++++++++++++--------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/dev/initdemo/initdemopassword.sh b/dev/initdemo/initdemopassword.sh index bcf2b14887eb6..b70c97a831e87 100755 --- a/dev/initdemo/initdemopassword.sh +++ b/dev/initdemo/initdemopassword.sh @@ -5,15 +5,17 @@ # # Laurent Destailleur - eldy@users.sourceforge.net #------------------------------------------------------ -# Usage: initdemopassword.sh confirm +# Usage: initdemopassword.sh confirm # usage: initdemopassword.sh confirm base port login pass #------------------------------------------------------ +# shellcheck disable=2006,2034,2046,2064,2068,2086,2155,2166,2186,2172,2268 +# shellcheck disable=2012,2016,2154 export mydir=`echo "$0" | sed -e 's/initdemopassword.sh//'`; if [ "x$mydir" = 'x' -o "x$mydir" = 'x./' ] then - export mydir="." + export mydir="." fi export id=`id -u`; @@ -56,103 +58,107 @@ then fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$ trap "rm -f $fichtemp" 0 1 2 5 15 $DIALOG --title "Reset login password" --clear \ - --inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp + --inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp valret=$? case $valret in - 0) - base=`cat $fichtemp`;; - 1) - exit;; - 255) - exit;; + 0) + base=`cat $fichtemp` ;; + 1) + exit ;; + 255) + exit ;; esac rm $fichtemp - + # ---------------------------- database port DIALOG=${DIALOG=dialog} fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$ trap "rm -f $fichtemp" 0 1 2 5 15 $DIALOG --title "Reset login password" --clear \ - --inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp - + --inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp + valret=$? - + case $valret in - 0) - port=`cat $fichtemp`;; - 1) - exit;; - 255) - exit;; + 0) + port=`cat $fichtemp` ;; + 1) + exit ;; + 255) + exit ;; esac rm $fichtemp - - + + # ----------------------------- demo login DIALOG=${DIALOG=dialog} DIALOG="$DIALOG --ascii-lines" fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$ trap "rm -f $fichtemp" 0 1 2 5 15 $DIALOG --title "Reset login password" --clear \ - --inputbox "Login to reset :" 16 55 dolibarrdemologin 2> $fichtemp + --inputbox "Login to reset :" 16 55 dolibarrdemologin 2> $fichtemp valret=$? case $valret in - 0) - demologin=`cat $fichtemp`;; - 1) - exit;; - 255) - exit;; + 0) + demologin=`cat $fichtemp` ;; + 1) + exit ;; + 255) + exit ;; esac rm fichtemp - + # ----------------------------- demo pass DIALOG=${DIALOG=dialog} DIALOG="$DIALOG --ascii-lines" fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$ trap "rm -f $fichtemp" 0 1 2 5 15 $DIALOG --title "Reset login password" --clear \ - --inputbox "Pass to set :" 16 55 dolibarrdemopass 2> $fichtemp + --inputbox "Pass to set :" 16 55 dolibarrdemopass 2> $fichtemp valret=$? case $valret in - 0) - demopass=`cat $fichtemp`;; - 1) - exit;; - 255) - exit;; + 0) + demopass=`cat $fichtemp` ;; + 1) + exit ;; + 255) + exit ;; esac rm fichtemp - - + + export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' ` # ---------------------------- confirmation DIALOG=${DIALOG=dialog} $DIALOG --title "Reset login password" --clear \ - --yesno "Do you confirm ? \n Mysql database : '$base' \n Mysql port : '$port' \n Demo login: '$demologin' \n Demo password : '$demopass'" 15 55 - + --yesno "Do you confirm ? \n Mysql database : '$base' \n Mysql port : '$port' \n Demo login: '$demologin' \n Demo password : '$demopass'" 15 55 + case $? in - 0) echo "Ok, start process...";; - 1) exit;; - 255) exit;; + 0) echo "Ok, start process..." ;; + 1) exit ;; + 255) exit ;; esac fi # ---------------------------- run sql file +if [ "x$port" != "x0" ] +then + export Pport="-P$port" +fi if [ "x$passwd" != "x" ] then export passwd="-p$passwd" fi -#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" -#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile +#echo "mysql $Pport -u$admin $passwd $base < $mydir/$dumpfile" +#mysql $Pport -u$admin $passwd $base < $mydir/$dumpfile if [ "x${demopasshash}" != "xpassword_hash" ] then - echo '' > /tmp/tmp.php + echo '' > /tmp/tmp.php newpass=`php -f /tmp/tmp.php` else echo '' > /tmp/tmp.php @@ -160,22 +166,22 @@ else fi #rm /tmp/tmp.php -echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql -P$port $base" -echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql -P$port $base +echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql $Pport $base" +echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql $Pport $base export res=$? if [ $res -ne 0 ]; then - echo "Error to execute sql with mysql -P$port -u$admin -p***** $base" + echo "Error to execute sql with mysql $Pport -u$admin -p***** $base" exit -fi +fi if [ -s "$mydir/initdemopostsql.sql" ]; then echo A file initdemopostsql.sql was found, we execute it. - echo "mysql -P$port $base < \"$mydir/initdemopostsql.sql\"" - mysql -P$port $base < "$mydir/initdemopostsql.sql" + echo "mysql $Pport $base < \"$mydir/initdemopostsql.sql\"" + mysql $Pport $base < "$mydir/initdemopostsql.sql" else echo No file initdemopostsql.sql found, so no extra sql action done. -fi +fi if [ "x$res" = "x0" ] From 052cdd02596311db368e82746e7a3f13a782bbaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 16:35:01 +0100 Subject: [PATCH 015/117] FIX #28429 --- htdocs/comm/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index da07b9f9dd6da..bc9a1565dc896 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -591,7 +591,7 @@ addSummaryTableLine(3, $num, $nbofloop, $total, "NoIntervention"); finishSimpleTable(true); - print ""; + $db->free($resql); } } From 52d1fe8c6744b0e3a88b8522812a6241d1d42bc6 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:55:42 +0200 Subject: [PATCH 016/117] fix translation for non latin languages (#28437) * fix translation for non latin languages * fix translation for non latin languages --- htdocs/compta/resultat/index.php | 2 +- htdocs/core/class/html.formaccounting.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index c55dec68b4afb..871b096e4bd42 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -178,7 +178,7 @@ $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesAmountOnInOutBookkeepingRecord"); - $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')'; + $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("Chartofaccounts")).')'; $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 90b178040224c..b8b6cabe6c151 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -302,7 +302,7 @@ public function select_accounting_category($selected = '', $htmlname = 'account_ $out .= ''; //if ($user->admin && $help) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } else { - $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->trans("Accounting"), $langs->trans("Setup"), $langs->trans("AccountingCategories")); + $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("AccountingCategories")); } } else { dol_print_error($this->db); From bb12b0c8b957e0e2e5e11061f3d731a5c423d8c6 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Mon, 26 Feb 2024 22:59:27 +0100 Subject: [PATCH 017/117] fix: display root account according root label in balance bookkeeping (#28435) --- htdocs/accountancy/bookkeeping/balance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 01d89f1168d79..af317e7a36136 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -427,7 +427,7 @@ // Show first line of a break print ''; - print ''.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').''; + print ''.$root_account_number.($root_account_description ? ' - '.$root_account_description : '').''; print ''; $displayed_account = $root_account_number; From 39d873287938d5192b38c861595bf10331ab0fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:14:22 +0100 Subject: [PATCH 018/117] fix missing status if unread (status = 0) (#28443) --- htdocs/ticket/class/ticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d4d498ab18d12..186d1ce410f93 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1424,8 +1424,8 @@ public function LibStatut($status, $mode = 0, $notooltip = 0, $progress = 0) // phpcs:enable global $langs, $hookmanager; - $labelStatus = !empty($status) ? $this->labelStatus[$status] : ''; - $labelStatusShort = !empty($status) ? $this->labelStatusShort[$status] : ''; + $labelStatus = (isset($status) && !empty($this->labelStatus[$status])) ? $this->labelStatus[$status] : ''; + $labelStatusShort = (isset($status) && !empty($this->labelStatusShort[$status]))? $this->labelStatusShort[$status] : ''; switch ($status) { case self::STATUS_NOT_READ: From 7d28285ac7f41f9e59d03f8af0be50703080653c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 11:29:53 +0100 Subject: [PATCH 019/117] CSS --- htdocs/projet/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 5fa292da43908..6007b639120e7 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -277,11 +277,11 @@ // Label print ''; - print $projectstatic->title; + print dol_escape_htmltag($projectstatic->title); print ''; // Thirdparty - print ''; + print ''; if ($companystatic->id > 0) { print $companystatic->getNomUrl(1, 'company', 16); } @@ -344,7 +344,7 @@ print ''; print ''; print_liste_field_titre("OpenedProjectsByThirdparties", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder); - print_liste_field_titre("NbOfProjects", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Number", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right '); print "\n"; } From 0a345e37a0dca8f1293c9bfc0d86bbc3773d3721 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 13:01:42 +0100 Subject: [PATCH 020/117] Fix delete not used table --- .../template/sql/llx_c_action_trigger.sql | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql diff --git a/htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql b/htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql deleted file mode 100644 index 432846d122d14..0000000000000 --- a/htdocs/modulebuilder/template/sql/llx_c_action_trigger.sql +++ /dev/null @@ -1,17 +0,0 @@ --- --- Uncomment and run the script to declare triggers to be used by the agenda module for automatic logging of events into agenda (table llx_actioncomm). --- --- For example --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_DRAFT', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_CREATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_VALIDATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_MODIFY', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_ACCEPT', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_DENIED', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_REOPEN', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_UNVALIDATE', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- INSERT INTO `llx_c_action_trigger` (`rowid`, `elementtype`, `code`, `label`, `description`, `rang`) VALUES (NULL, 'mymodule', 'MYCLASSNAME_SENTBYMAIL', 'MYCLASSNAME create', 'A MYCLASSNAME is created', '0000000'); --- - - ---ADD Call trigger IN TABLE \ No newline at end of file From 2ddfe02e0c1c98106dc6bd5957814b59cc204fe8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 13:08:15 +0100 Subject: [PATCH 021/117] Doc --- htdocs/core/modules/modWebhook.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index 505b465bfbc89..56697702645e4 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -62,9 +62,9 @@ public function __construct($db) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleWebhookDesc' not found (Webhook is name of module). - $this->description = "WebhookDescription"; + $this->description = "WebHook"; // Used only if file README.md and README-LL.md not found. - $this->descriptionlong = "WebhookDescription"; + $this->descriptionlong = "Interface to catch dolibarr triggers and send data of the event to an external URL"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'dolibarr'; From aa37b755e06745752250e55bb8ee51169142dd41 Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Tue, 27 Feb 2024 07:03:53 -0600 Subject: [PATCH 022/117] Update paiement.php (#28449) PHP Warning: Undefined variable $totalrecucreditnote PHP Warning: Undefined variable $totalrecudeposits --- htdocs/fourn/facture/paiement.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index de1e9ae45aedf..007dd70dea068 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -602,6 +602,8 @@ function callForResult(imgId) $total = 0; $total_ttc = 0; $totalrecu = 0; + $totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote + $totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits while ($i < $num) { $objp = $db->fetch_object($resql); From d59e3e5bc8da8252bee5d8102f2e7bca21f51638 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 28 Feb 2024 18:54:41 +0100 Subject: [PATCH 023/117] FIX subscription must be editable when accounting isn't reconciled (#28469) --- htdocs/adherents/subscription/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index a9446083faf86..c258485760b87 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -358,7 +358,7 @@ print '
'; if ($user->hasRight('adherent', 'cotisation', 'creer')) { - if (!empty($bankline->rappro) || empty($bankline)) { + if (empty($bankline->rappro) || empty($bankline)) { print '"; } else { print '"; From 1e11de0624d3dea40c3eaa94cf7b56a93fbc1eb6 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:27:05 +0200 Subject: [PATCH 024/117] FIX #28491 (#28522) --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3d7460d34d9f1..521523f5acef2 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2554,7 +2554,7 @@ print '
'; @@ -1492,6 +1492,7 @@ $userstatic->firstname = $obj->firstname; $userstatic->email = $obj->user_email; $userstatic->statut = $obj->user_statut; + $userstatic->status = $obj->user_statut; $userstatic->entity = $obj->entity; $userstatic->photo = $obj->photo; $userstatic->office_phone = $obj->office_phone; From f875201b4687c9e860c80333a95c3b7409dbd2e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 18:59:57 +0100 Subject: [PATCH 052/117] Fix #19404 FIX #22721 --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 65a00f8affc7d..94db1f445acfd 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2691,7 +2691,7 @@ public function load_board($user) $sql .= " JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ff.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= ' WHERE ff.paye = 0'; - $sql .= ' AND ff.fk_statut > 0'; + $sql .= " AND ff.fk_statut IN (".self::STATUS_VALIDATED.")"; $sql .= " AND ff.entity = ".$conf->entity; if ($user->socid) { $sql .= ' AND ff.fk_soc = '.((int) $user->socid); From 21feee3bc8b2ebe8a87b8fa56f023faa5835ba44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 13:11:54 +0100 Subject: [PATCH 053/117] FIX Better test on validity of compute field syntax with parenthesis --- htdocs/core/lib/functions.lib.php | 42 +++++++++++++++++++------------ test/phpunit/SecurityTest.php | 15 +++++++++-- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1fe4661236e6d..c0ecd6acefc7f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9641,18 +9641,23 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' return ''; } } - $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); // accept parenthesis in '...->method(...' - $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' - $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' - $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + $savescheck = ''; + $scheck = $s; + while ($scheck && $savescheck != $scheck) { + $savescheck = $scheck; + $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $scheck); // accept parenthesis in '...->method(...' + $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' + $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' + $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + } //print 'scheck='.$scheck." : ".strpos($scheck, '(')."
\n"; if (strpos($scheck, '(') !== false) { if ($returnvalue) { - return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + return 'Bad string syntax to evaluate (mode 1, found call of a function or method without using the direct name of the function): '.$s; } else { - dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + dol_syslog('Bad string syntax to evaluate (mode 1, found call of a function or method without using the direct name of the function): '.$s); return ''; } } @@ -9672,18 +9677,23 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' return ''; } } - $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); // accept parenthesis in '...->method(...' - $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions - $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' - $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' - $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + $savescheck = ''; + $scheck = $s; + while ($scheck && $savescheck != $scheck) { + $savescheck = $scheck; + $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $scheck); // accept parenthesis in '...->method(...' + $scheck = preg_replace('/^\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '(...'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... ('. Must replace with __PARENTHESIS__ with a space after to allow following substitutions + $scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function(' + $scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function(' + $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + } //print 'scheck='.$scheck." : ".strpos($scheck, '(')."
\n"; if (strpos($scheck, '(') !== false) { if ($returnvalue) { - return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + return 'Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): '.$s; } else { - dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + dol_syslog('Bad string syntax to evaluate (mode 2, found call of a function or method without using the direct name of the function): '.$s); return ''; } } diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 4615efe8c229f..66a40206bb322 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -1061,6 +1061,10 @@ public function testDolEval() $langs=$this->savlangs; $db=$this->savdb; + // Declare classes found into string to evaluate + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $result=dol_eval('1==1', 1, 0); print "result1 = ".$result."\n"; $this->assertTrue($result); @@ -1069,8 +1073,15 @@ public function testDolEval() print "result2 = ".$result."\n"; $this->assertFalse($result); - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $s = '((($reloadedobj = new ClassThatDoesNotExists($db)) && ($reloadedobj->fetchNoCompute($objectoffield->fk_product) > 0)) ? \'1\' : \'0\')'; + $result3a = dol_eval($s, 1, 1, '2'); + print "result3a = ".$result."\n"; + $this->assertTrue(is_null($result3a)); + + $s = '((($reloadedobj = new Project($db)) && ($reloadedobj->fetchNoCompute($objectoffield->fk_product) > 0)) ? \'1\' : \'0\')'; + $result3b = dol_eval($s, 1, 1, '2'); + print "result3b = ".$result."\n"; + $this->assertEquals('0', $result3b); $s = '(($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"'; $result=dol_eval($s, 1, 1, '2'); From 16319e5103baf93a142eb12ec7b2bffdb5466b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Mar 2024 15:48:36 +0100 Subject: [PATCH 054/117] fix codespell (#28594) --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index e3438cad7e001..b8e2ec9e94017 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -900,7 +900,7 @@ public function deleteLine(User $user, $idline, $notrigger = false) } $productstatic = new Product($this->db); $fk_movement = GETPOST('fk_movement', 'int'); - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consummed under the one to delete + $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consumed under the one to delete $result = 0; From 41bdcff4da175afe13d4bb1e8d51bb38eb139723 Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Sun, 3 Mar 2024 09:58:52 -0600 Subject: [PATCH 055/117] Update facture.class.php (#28591) * Update facture.class.php FIX #22948 * Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 41daf8bd39c3a..73a184c96c01f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4167,8 +4167,8 @@ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_star $price = $pu; $remise = 0; if ($remise_percent > 0) { - $remise = round(($pu * $remise_percent / 100), 2); - $price = ($pu - $remise); + $remise = round(((float) $pu * (float) $remise_percent / 100), 2); + $price = ((float) $pu - $remise); } $price = price2num($price); From d199b042b4260c47f102369db1ca2df216f05858 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 18:50:28 +0100 Subject: [PATCH 056/117] Prepare 19.0.1 --- ChangeLog | 47 +++++++++++++++++++++++++++++++++++++++++ htdocs/filefunc.inc.php | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index afb30c7d89980..56ebe50a7f62a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,53 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 19.0.1 compared to 19.0.0 ***** + +FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269) +FIX: #22948 +FIX: #28205 +FIX: 28251 Fixing subpermission name on api_multicurrencies.class.php (#28252) +FIX: #28369 +FIX: #28429 +FIX: #28491 (#28522) +FIX: #28518 (#28520) +FIX: #28533 Mo::deleteLine removes the "main" MoLine if consumed line is delete (#28535) +FIX: #28564 +FIX: Adding the dependencies list feature for extrafields "select" (#28549) +FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523) +FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270) +FIX: avoid Unknown column 'pfp.ref_fourn' (#28145) +FIX: avoid warning "error parsing attribute name in Entity" (#28543) +FIX: Bad column for total in bom list +FIX: Bad condition on button back to draft on recruitment job. +FIX: Bad CRLF when sending text only content. Fix dol_htmlwithnojs() +FIX: Bad picto on list of permission of a user when user not admin +FIX: bad timzeone for the start/end date of an event +FIX: Better test on validity of compute field syntax with parenthesis +FIX: close #28279 +FIX: disabled pito of menu must be greyed. +FIX: Don't display column when it's out of date (#28271) +FIX: duplicate with lines: 414-416 (#28358) +FIX: Error When cloning fourn price no default value for tva_tx (#28368) +FIX: migration missing 2 columns in llx_resource and 1 in llx_user +FIX: missing trans +FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216) +FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211) +FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156) +FIX: Pb in redirect of a website page in USEDOLIBARRSERVER mode +FIX: PHP Warning: Undefined variable $lib (#28342) +FIX: Picto for mime +FIX: position of field in list of field in shipment list +FIX: postgresql error (#28542) +FIX: quote in sql request +FIX: Responsive on admin project +FIX: Shipment closing action has wrong value (#28174) +FIX: some tooltips has disappeared on invoice action button +FIX: Special code is now transmitted by args only in order supplier (#28546) +FIX: subscription must be editable when accounting isn't reconciled (#28469) +FIX: Value of field int = 0 from modulebuilder must nto be set to null + + ***** ChangeLog for 19.0.0 compared to 18.0.0 ***** For users: diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 948381bd82805..4c4df29af5092 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '19.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '19.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From af6a091ab2e6915325ad5c849247ca2a7854a163 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 18:55:10 +0100 Subject: [PATCH 057/117] Fix 19.0.1 --- ChangeLog | 2 +- htdocs/comm/card.php | 2 +- htdocs/core/class/commoninvoice.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56ebe50a7f62a..de0cb66b9686a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,7 +34,7 @@ FIX: Error When cloning fourn price no default value for tva_tx (#28368) FIX: migration missing 2 columns in llx_resource and 1 in llx_user FIX: missing trans FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216) -FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211) +FIX: Not truncate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211) FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156) FIX: Pb in redirect of a website page in USEDOLIBARRSERVER mode FIX: PHP Warning: Undefined variable $lib (#28342) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 39e9267cd161e..38fa513937683 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -219,7 +219,7 @@ if ($action == 'setassujtva' && $user->hasRight('societe', 'creer')) { $object->fetch($id); $object->tva_assuj = GETPOST('assujtva_value'); - $result = $object->update($object->id); + $result = $object->update($object->id, $user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 5c9d90b11cc3a..a7c5788aee39c 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1146,7 +1146,7 @@ public function makeStripeSepaRequest($fuser, $did, $type = 'direct-debit', $sou $sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one } if ($type != 'direct-debit') { - if ($$sourcetype == 'salary') { + if ($sourcetype == 'salary') { $sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one } else { $sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one From 17ff0972ab407eb7c55cce6ffa72553c1e001696 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Mar 2024 19:35:37 +0100 Subject: [PATCH 058/117] Fix use of invoke into computed fields --- htdocs/core/lib/functions.lib.php | 9 +++++++-- test/phpunit/SecurityTest.php | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cf8bb9b324e83..cbf8fee96e042 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9289,22 +9289,27 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' // We block use of php exec or php file functions $forbiddenphpstrings = array('$$'); - $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST')); + $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST', 'ReflectionFunction')); $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen"); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64_decode", "rawurldecode", "urldecode")); // decode string functions + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64_decode", "rawurldecode", "urldecode", "str_rot13", "hex2bin")); // decode string functions used to obfuscated function name $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $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")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities + $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function + $forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b'; + $forbiddenphpmethodsregex = '->('.implode('|', $forbiddenphpmethods).')'; + do { $oldstringtoclean = $s; $s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s); $s = preg_replace('/'.$forbiddenphpregex.'/i', '__forbiddenstring__', $s); + $s = preg_replace('/'.$forbiddenphpmethodsregex.'/i', '__forbiddenstring__', $s); //$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod( } while ($oldstringtoclean != $s); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 545306f57344e..fb3132a17ff55 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -960,6 +960,16 @@ public function testDolEval() print "result = ".$result."\n"; $this->assertEquals('Parent project not found', $result); + $s = 'new abc->invoke(\'whoami\')'; + $result=dol_eval($s, 1, 1, '2'); + print "result = ".$result."\n"; + $this->assertEquals('Bad string syntax to evaluate: new abc__forbiddenstring__(\'whoami\')', $result); + + $s = 'new ReflectionFunction(\'abc\')'; + $result=dol_eval($s, 1, 1, '2'); + print "result = ".$result."\n"; + $this->assertEquals('Bad string syntax to evaluate: new __forbiddenstring__(\'abc\')', $result); + $result=dol_eval('$a=function() { }; $a;', 1, 1, ''); print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); From e82c6af5bcc7dad4c68d4d11e57965e56c653844 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Mar 2024 14:02:49 +0100 Subject: [PATCH 059/117] FIX permission on payment file of a tax --- htdocs/core/lib/security.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 7eb552fac92b4..32a53dde33ddd 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -889,7 +889,10 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $feature = 'agenda'; $dbtablename = 'actioncomm'; } - if ($feature == 'payment_sc') { + if ($feature == 'payment_sc' && empty($parenttableforentity)) { + // If we check perm on payment page but $parenttableforentity not defined, we force value on parent table + $parenttableforentity = ''; + $dbtablename = "chargesociales"; $feature = "chargesociales"; $objectid = $object->fk_charge; } @@ -897,7 +900,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 0; // Array to define rules of checks to do - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for object Societe $checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object From 0c86f6456590a5a1eb72eb21f001141c082f1006 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Mar 2024 14:02:49 +0100 Subject: [PATCH 060/117] FIX permission on payment file of a tax --- htdocs/core/lib/security.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 2f4d4fe2f839a..7cd07b3edcd54 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -884,7 +884,10 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $feature = 'agenda'; $dbtablename = 'actioncomm'; } - if ($feature == 'payment_sc') { + if ($feature == 'payment_sc' && empty($parenttableforentity)) { + // If we check perm on payment page but $parenttableforentity not defined, we force value on parent table + $parenttableforentity = ''; + $dbtablename = "chargesociales"; $feature = "chargesociales"; $objectid = $object->fk_charge; } @@ -892,7 +895,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 0; // Array to define rules of checks to do - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for object Societe $checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object From db7a62f644ffcb1068535b2f56d5a6a5c10bd4aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Mar 2024 14:46:33 +0100 Subject: [PATCH 061/117] FIX fatal error Unsupported operand types when recording load payment --- htdocs/loan/payment/payment.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 6a136f8ba2e3d..d65f48665a384 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -114,16 +114,16 @@ if (!$error) { $paymentid = 0; - $pay_amount_capital = price2num(GETPOST('amount_capital')); - $pay_amount_insurance = price2num(GETPOST('amount_insurance')); + $pay_amount_capital = (float) price2num(GETPOST('amount_capital')); + $pay_amount_insurance = (float) price2num(GETPOST('amount_insurance')); // User can't set interest him self if schedule is set (else value in schedule can be incoherent) if (!empty($line)) { $pay_amount_interest = $line->amount_interest; } else { - $pay_amount_interest = price2num(GETPOST('amount_interest')); + $pay_amount_interest = (float) price2num(GETPOST('amount_interest')); } - $remaindertopay = price2num(GETPOST('remaindertopay')); - $amount = $pay_amount_capital + $pay_amount_insurance + $pay_amount_interest; + $remaindertopay = (float) price2num(GETPOST('remaindertopay')); + $amount = (float) price2num($pay_amount_capital + $pay_amount_insurance + $pay_amount_interest, 'MT'); // This term is allready paid if (!empty($line) && !empty($line->fk_bank)) { From a0444ef55d379a633554dfd32f1d914e2df07abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2024 17:58:43 +0100 Subject: [PATCH 062/117] fix can't delete pdf if ref is not encoded (#28630) --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ea9b87b1de6e7..c156eccb5f38d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4477,7 +4477,7 @@ function setRadioForTypeOfInvoice() { $file = GETPOST('file', 'alpha'); $formconfirm = $form->formconfirm( - $_SERVER["PHP_SELF"].'?facid='.$object->id.'&file='.$file, + $_SERVER["PHP_SELF"].'?facid='.$object->id.'&file='.urlencode($file), $langs->trans('DeleteFileHeader'), $langs->trans('DeleteFileText')."

".$file, 'remove_file', From f166f15f7d8dfd15ae2e53fec92935e4b815c6ab Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 4 Mar 2024 18:21:32 +0100 Subject: [PATCH 063/117] Qual: Backport/pre commit / log annotation simplification (#28614) * Qual: ci: Run pre-commit/php-cs with cache (#28079) This adds a hook to .pre-commit-config.yaml and updates the workflow to run php-cs with cache when it is run for all files. When running on changed files only, the cache is not useful. The php-codesniffer ruleset.xml was cleaned up (duplicates removal/formatted) * Fix: Make all 'relative paths' absolute (#28196) # Fix: Make all 'relative paths' absolute The phpcs ruleset xml file's relative exclude patterns are relative to the filename(s) provided on the command line. Hence with partial verifications, the path exclusion does not function as we would like. Removing the relative-path attribute from the patterns the exclusion works. At the same time, the patterns were optimized and a comment was added. * Qual: Optimize workflow (#28386) # Qual: Optimize workflow The log annotation based on the pre-commit logs is now simplified. --- .github/logToCs.py | 588 ------------------------------- .github/workflows/pre-commit.yml | 18 +- 2 files changed, 5 insertions(+), 601 deletions(-) delete mode 100755 .github/logToCs.py diff --git a/.github/logToCs.py b/.github/logToCs.py deleted file mode 100755 index 7befd310a0a76..0000000000000 --- a/.github/logToCs.py +++ /dev/null @@ -1,588 +0,0 @@ -#!/usr/bin/env python3 -# pylint: disable=invalid-name -""" -Convert a log to CheckStyle format. - -Url: https://github.com/mdeweerd/LogToCheckStyle - -The log can then be used for generating annotations in a github action. - -Note: this script is very young and "quick and dirty". - Patterns can be added to "PATTERNS" to match more messages. - -# Examples - -Assumes that logToCs.py is available as .github/logToCs.py. - -## Example 1: - - -```yaml - - run: | - pre-commit run -all-files | tee pre-commit.log - .github/logToCs.py pre-commit.log pre-commit.xml - - uses: staabm/annotate-pull-request-from-checkstyle-action@v1 - with: - files: pre-commit.xml - notices-as-warnings: true # optional -``` - -## Example 2: - - -```yaml - - run: | - pre-commit run --all-files | tee pre-commit.log - - name: Add results to PR - if: ${{ always() }} - run: | - .github/logToCs.py pre-commit.log | cs2pr -``` - -Author(s): - - https://github.com/mdeweerd - -License: MIT License - -""" - -import argparse -import datetime as dt -import json -import os -import re -import sys -import xml.etree.ElementTree as ET # nosec - - -def remove_prefix(string, prefix): - """ - Remove prefix from string - - Provided for backward compatibility. - """ - if prefix and string.startswith(prefix): - return string[len(prefix) :] - return string - - -def convert_notices_to_checkstyle(notices, root_path=None): - """ - Convert annotation list to CheckStyle xml string - """ - root = ET.Element("checkstyle") - for fields in notices: - add_error_entry(root, **fields, root_path=root_path) - return ET.tostring(root, encoding="utf_8").decode("utf_8") - - -def convert_lines_to_notices(lines): - """ - Convert provided message to CheckStyle format. - """ - notices = [] - for line in lines: - fields = parse_message(line) - if fields: - notices.append(fields) - return notices - - -def convert_text_to_notices(text): - """ - Convert provided message to CheckStyle format. - """ - return parse_file(text) - - -# Initial version for Checkrun from: -# https://github.com/tayfun/flake8-your-pr/blob/50a175cde4dd26a656734c5b64ba1e5bb27151cb/src/main.py#L7C1-L123C36 -# MIT Licence -class CheckRun: - """ - Represents the check run - """ - - GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN", None) - GITHUB_EVENT_PATH = os.environ.get("GITHUB_EVENT_PATH", None) - - URI = "https://api.github.com" - API_VERSION = "2022-11-28" - ACCEPT_HEADER_VALUE = "application/vnd.github+json" - AUTH_HEADER_VALUE = f"Bearer {GITHUB_TOKEN}" - # This is the max annotations Github API accepts in one go. - MAX_ANNOTATIONS = 50 - - def __init__(self): - """ - Initialise Check Run object with information from checkrun - """ - self.read_event_file() - self.read_meta_data() - - def read_event_file(self): - """ - Read the event file to get the event information later. - """ - if self.GITHUB_EVENT_PATH is None: - raise ValueError("Not running in github workflow") - with open(self.GITHUB_EVENT_PATH, encoding="utf_8") as event_file: - self.event = json.loads(event_file.read()) - - def read_meta_data(self): - """ - Get meta data from event information - """ - self.repo_full_name = self.event["repository"]["full_name"] - pull_request = self.event.get("pull_request") - print("%r", self.event) - if pull_request: - self.head_sha = pull_request["head"]["sha"] - else: - print("%r", self.event) - check_suite = self.event.get("check_suite", None) - if check_suite is not None: - self.head_sha = check_suite["pull_requests"][0]["base"]["sha"] - else: - self.head_sha = None # Can't annotate? - - def submit( # pylint: disable=too-many-arguments - self, - notices, - title=None, - summary=None, - text=None, - conclusion=None, - ): - """ - Submit annotations to github - - See: - https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28 - #update-a-check-run - - :param conclusion: success, failure - """ - # pylint: disable=import-outside-toplevel - import requests # Import here to not impose presence of module - - if self.head_sha is None: - return - - output = { - "annotations": notices[: CheckRun.MAX_ANNOTATIONS], - } - if title is not None: - output["title"] = title - if summary is not None: - output["summary"] = summary - if text is not None: - output["text"] = text - if conclusion is None: - # action_required, cancelled, failure, neutral, success - # skipped, stale, timed_out - if bool(notices): - conclusion = "failure" - else: - conclusion = "success" - - payload = { - "name": "log-to-pr-annotation", - "head_sha": self.head_sha, - "status": "completed", # queued, in_progress, completed - "conclusion": conclusion, - # "started_at": dt.datetime.now(dt.timezone.utc).isoformat(), - "completed_at": dt.datetime.now(dt.timezone.utc).isoformat(), - "output": output, - } - - # Create the check-run - response = requests.post( - f"{self.URI}/repos/{self.repo_full_name}/check-runs", - headers={ - "Accept": self.ACCEPT_HEADER_VALUE, - "Authorization": self.AUTH_HEADER_VALUE, - "X-GitHub-Api-Version": self.API_VERSION, - }, - json=payload, - timeout=30, - ) - print(response.content) - response.raise_for_status() - - -ANY_REGEX = r".*?" -FILE_REGEX = r"\s*(?P\S.*?)\s*?" -FILEGROUP_REGEX = r"\s*(?P\S.*?)\s*?" -EOL_REGEX = r"[\r\n]" -LINE_REGEX = r"\s*(?P\d+?)\s*?" -COLUMN_REGEX = r"\s*(?P\d+?)\s*?" -SEVERITY_REGEX = r"\s*(?Perror|warning|notice|style|info)\s*?" -MSG_REGEX = r"\s*(?P.+?)\s*?" -MULTILINE_MSG_REGEX = r"\s*(?P(?:.|.[\r\n])+)" -# cpplint confidence index -CONFIDENCE_REGEX = r"\s*\[(?P\d+)\]\s*?" - - -# List of message patterns, add more specific patterns earlier in the list -# Creating patterns by using constants makes them easier to define and read. -PATTERNS = [ - # beautysh - # File ftp.sh: error: "esac" before "case" in line 90. - re.compile( - f"^File {FILE_REGEX}:{SEVERITY_REGEX}:" - f" {MSG_REGEX} in line {LINE_REGEX}.$" - ), - # beautysh - # File socks4echo.sh: error: indent/outdent mismatch: -2. - re.compile(f"^File {FILE_REGEX}:{SEVERITY_REGEX}: {MSG_REGEX}$"), - # yamllint - # ##[group].pre-commit-config.yaml - # ##[error]97:14 [trailing-spaces] trailing spaces - # ##[endgroup] - re.compile(rf"^##\[group\]{FILEGROUP_REGEX}$"), # Start file group - re.compile( - rf"^##\[{SEVERITY_REGEX}\]{LINE_REGEX}:{COLUMN_REGEX}{MSG_REGEX}$" - ), # Msg - re.compile(r"^##(?P\[endgroup\])$"), # End file group - # File socks4echo.sh: error: indent/outdent mismatch: -2. - re.compile(f"^File {FILE_REGEX}:{SEVERITY_REGEX}: {MSG_REGEX}$"), - # Emacs style - # path/to/file:845:5: error - Expected 1 space after closing brace - re.compile( - rf"^{FILE_REGEX}:{LINE_REGEX}:{COLUMN_REGEX}:{SEVERITY_REGEX}" - rf"-?\s{MSG_REGEX}$" - ), - # ESLint (JavaScript Linter), RoboCop, shellcheck - # path/to/file.js:10:2: Some linting issue - # path/to/file.rb:10:5: Style/Indentation: Incorrect indentation detected - # path/to/script.sh:10:1: SC2034: Some shell script issue - re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{COLUMN_REGEX}: {MSG_REGEX}$"), - # Cpplint default output: - # '%s:%s: %s [%s] [%d]\n' - # % (filename, linenum, message, category, confidence) - re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{MSG_REGEX}{CONFIDENCE_REGEX}$"), - # MSVC - # file.cpp(10): error C1234: Some error message - re.compile( - f"^{FILE_REGEX}\\({LINE_REGEX}\\):{SEVERITY_REGEX}{MSG_REGEX}$" - ), - # Java compiler - # File.java:10: error: Some error message - re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{SEVERITY_REGEX}:{MSG_REGEX}$"), - # Python - # File ".../logToCs.py", line 90 (note: code line follows) - re.compile(f'^File "{FILE_REGEX}", line {LINE_REGEX}$'), - # Pylint, others - # path/to/file.py:10: [C0111] Missing docstring - # others - re.compile(f"^{FILE_REGEX}:{LINE_REGEX}: {MSG_REGEX}$"), - # Shellcheck: - # In script.sh line 76: - re.compile( - f"^In {FILE_REGEX} line {LINE_REGEX}:{EOL_REGEX}?" - f"({MULTILINE_MSG_REGEX})?{EOL_REGEX}{EOL_REGEX}" - ), - # eslint: - # /path/to/filename - # 14:5 error Unexpected trailing comma comma-dangle - re.compile( - f"^{FILE_REGEX}{EOL_REGEX}" - rf"\s+{LINE_REGEX}:{COLUMN_REGEX}\s+{SEVERITY_REGEX}\s+{MSG_REGEX}$" - ), -] - -# Exceptionnaly some regexes match messages that are not error. -# This pattern matches those exceptions -EXCLUDE_MSG_PATTERN = re.compile( - r"^(" - r"Placeholder pattern" # To remove on first message pattern - r")" -) - -# Exceptionnaly some regexes match messages that are not error. -# This pattern matches those exceptions -EXCLUDE_FILE_PATTERN = re.compile( - r"^(" - # Codespell: (appears as a file name): - r"Used config files\b" - r")" -) - -# Severities available in CodeSniffer report format -SEVERITY_NOTICE = "notice" -SEVERITY_WARNING = "warning" -SEVERITY_ERROR = "error" - - -def strip_ansi(text: str): - """ - Strip ANSI escape sequences from string (colors, etc) - """ - return re.sub(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])", "", text) - - -def parse_file(text): - """ - Parse all messages in a file - - Returns the fields in a dict. - """ - # pylint: disable=too-many-branches,too-many-statements - # regex required to allow same group names - try: - import regex # pylint: disable=import-outside-toplevel - except ImportError as exc: - raise ImportError( - "The 'parsefile' method requires 'python -m pip install regex'" - ) from exc - - patterns = [pattern.pattern for pattern in PATTERNS] - # patterns = [PATTERNS[0].pattern] - - file_group = None # The file name for the group (if any) - full_regex = "(?:(?:" + (")|(?:".join(patterns)) + "))" - results = [] - - for fields in regex.finditer( - full_regex, strip_ansi(text), regex.MULTILINE | regex.IGNORECASE - ): - if not fields: - continue - result = fields.groupdict() - - if len(result) == 0: - continue - - severity = result.get("severity", None) - file_name = result.get("file_name", None) - confidence = result.pop("confidence", None) - new_file_group = result.pop("file_group", None) - file_endgroup = result.pop("file_endgroup", None) - message = result.get("message", None) - - if new_file_group is not None: - # Start of file_group, just store file - file_group = new_file_group - continue - - if file_endgroup is not None: - file_group = None - continue - - if file_name is None: - if file_group is not None: - file_name = file_group - result["file_name"] = file_name - else: - # No filename, skip - continue - else: - if EXCLUDE_FILE_PATTERN.search(file_name): - # This file_name is excluded - continue - - if message is not None: - if EXCLUDE_MSG_PATTERN.search(message): - # This message is excluded - continue - - if confidence is not None: - # Convert confidence level of cpplint - # to warning, etc. - confidence = int(confidence) - - if confidence <= 1: - severity = SEVERITY_NOTICE - elif confidence >= 5: - severity = SEVERITY_ERROR - else: - severity = SEVERITY_WARNING - - if severity is None: - severity = SEVERITY_ERROR - else: - severity = severity.lower() - - if severity in ["info", "style"]: - severity = SEVERITY_NOTICE - - result["severity"] = severity - - results.append(result) - - return results - - -def parse_message(message): - """ - Parse message until it matches a pattern. - - Returns the fields in a dict. - """ - for pattern in PATTERNS: - fields = pattern.match(message, re.IGNORECASE) - if not fields: - continue - result = fields.groupdict() - if len(result) == 0: - continue - - if "confidence" in result: - # Convert confidence level of cpplint - # to warning, etc. - confidence = int(result["confidence"]) - del result["confidence"] - - if confidence <= 1: - severity = SEVERITY_NOTICE - elif confidence >= 5: - severity = SEVERITY_ERROR - else: - severity = SEVERITY_WARNING - result["severity"] = severity - - if "severity" not in result: - result["severity"] = SEVERITY_ERROR - else: - result["severity"] = result["severity"].lower() - - if result["severity"] in ["info", "style"]: - result["severity"] = SEVERITY_NOTICE - - return result - - # Nothing matched - return None - - -def add_error_entry( # pylint: disable=too-many-arguments - root, - severity, - file_name, - line=None, - column=None, - message=None, - source=None, - root_path=None, -): - """ - Add error information to the CheckStyle output being created. - """ - file_element = find_or_create_file_element( - root, file_name, root_path=root_path - ) - error_element = ET.SubElement(file_element, "error") - error_element.set("severity", severity) - if line: - error_element.set("line", line) - if column: - error_element.set("column", column) - if message: - error_element.set("message", message) - if source: - # To verify if this is a valid attribute - error_element.set("source", source) - - -def find_or_create_file_element(root, file_name: str, root_path=None): - """ - Find/create file element in XML document tree. - """ - - if root_path is not None: - file_name = remove_prefix(file_name, root_path) - for file_element in root.findall("file"): - if file_element.get("name") == file_name: - return file_element - file_element = ET.SubElement(root, "file") - file_element.set("name", file_name) - return file_element - - -def main(): - """ - Parse the script arguments and get the conversion done. - """ - parser = argparse.ArgumentParser( - description="Convert messages to Checkstyle XML format." - ) - parser.add_argument( - "input", help="Input file. Use '-' for stdin.", nargs="?", default="-" - ) - parser.add_argument( - "output", - help="Output file. Use '-' for stdout.", - nargs="?", - default="-", - ) - parser.add_argument( - "-i", - "--in", - dest="input_named", - help="Input filename. Overrides positional input.", - ) - parser.add_argument( - "-o", - "--out", - dest="output_named", - help="Output filename. Overrides positional output.", - ) - parser.add_argument( - "--root", - metavar="ROOT_PATH", - help="Root directory to remove from file paths." - " Defaults to working directory.", - default=os.getcwd(), - ) - parser.add_argument( - "--github-annotate", - action=argparse.BooleanOptionalAction, - help="Annotate when in Github workflow.", - # Currently disabled, - # Future: (os.environ.get("GITHUB_EVENT_PATH", None) is not None), - default=False, - ) - - args = parser.parse_args() - - if args.input == "-" and args.input_named: - with open( - args.input_named, encoding="utf_8", errors="surrogateescape" - ) as input_file: - text = input_file.read() - elif args.input != "-": - with open( - args.input, encoding="utf_8", errors="surrogateescape" - ) as input_file: - text = input_file.read() - else: - text = sys.stdin.read() - - root_path = os.path.join(args.root, "") - - try: - notices = convert_text_to_notices(text) - except ImportError: - notices = convert_lines_to_notices(re.split(r"[\r\n]+", text)) - - checkstyle_xml = convert_notices_to_checkstyle( - notices, root_path=root_path - ) - - if args.output == "-" and args.output_named: - with open(args.output_named, "w", encoding="utf_8") as output_file: - output_file.write(checkstyle_xml) - elif args.output != "-": - with open(args.output, "w", encoding="utf_8") as output_file: - output_file.write(checkstyle_xml) - else: - print(checkstyle_xml) - - if args.github_annotate: - checkrun = CheckRun() - checkrun.submit(notices) - - -if __name__ == "__main__": - main() diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d0cdcb90ef38a..1ae4d3387f8fe 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,7 +7,6 @@ jobs: pre-commit: runs-on: ubuntu-latest env: - LOG_TO_CS: .github/logToCs.py RAW_LOG: pre-commit.log CS_XML: pre-commit.xml steps: @@ -37,7 +36,7 @@ jobs: with: cache: pip python-version: "3.11" - - run: python -m pip install pre-commit regex + - run: python -m pip install pre-commit # Restore previous cache of precommit - uses: actions/cache/restore@v4 with: @@ -102,19 +101,12 @@ jobs: pre-commit run --hook-stage manual -a php-cs-with-cache | tee -a ${RAW_LOG} ls -l ~/.cache/pre-commit/ - # If error, we convert log in the checkstyle format - - name: Convert Raw Log to CheckStyle format - if: ${{ failure() }} - run: | - python ${LOG_TO_CS} ${RAW_LOG} ${CS_XML} - # Annotate the git sources with the log messages - - name: Annotate Source Code with Messages - uses: staabm/annotate-pull-request-from-checkstyle-action@v1 + - name: Convert Raw Log to Annotations + uses: mdeweerd/logToCheckStyle@v2024.2.9 if: ${{ failure() }} with: - files: ${{ env.CS_XML }} - notices-as-warnings: true # optional - prepend-filename: true # optional + in: ${{ env.RAW_LOG }} + # Save the precommit cache - uses: actions/cache/save@v4 if: ${{ ! cancelled() }} From d0c0dee616968d13f14385d975266c9857ba97a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2024 18:23:03 +0100 Subject: [PATCH 064/117] fix typo in ChangeLog (#28613) * fix typo in ChangeLog * Update ChangeLog --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index de0cb66b9686a..bb3afe1e22edc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,7 +24,7 @@ FIX: Bad column for total in bom list FIX: Bad condition on button back to draft on recruitment job. FIX: Bad CRLF when sending text only content. Fix dol_htmlwithnojs() FIX: Bad picto on list of permission of a user when user not admin -FIX: bad timzeone for the start/end date of an event +FIX: bad timezone for the start/end date of an event FIX: Better test on validity of compute field syntax with parenthesis FIX: close #28279 FIX: disabled pito of menu must be greyed. @@ -47,7 +47,7 @@ FIX: Shipment closing action has wrong value (#28174) FIX: some tooltips has disappeared on invoice action button FIX: Special code is now transmitted by args only in order supplier (#28546) FIX: subscription must be editable when accounting isn't reconciled (#28469) -FIX: Value of field int = 0 from modulebuilder must nto be set to null +FIX: Value of field int = 0 from modulebuilder must not be set to null ***** ChangeLog for 19.0.0 compared to 18.0.0 ***** From 55c0efae3fb5f8d387eec9674fa5c784a3caa9d2 Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:26:38 +0100 Subject: [PATCH 065/117] FIX: Special code is now transmitted by args only in order supplier (#28619) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/fourn/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 17b99779094b8..4fa93836b767a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1344,8 +1344,6 @@ $tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id); } - $object->special_code = $lines[$i]->special_code; - $result = $object->addline( $desc, $lines[$i]->subprice, @@ -1368,7 +1366,9 @@ $lines[$i]->fk_unit, 0, $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid, + -1, + $lines[$i]->special_code ); if ($result < 0) { From 6cc9ac55429f37b83f058993875e62181bfec534 Mon Sep 17 00:00:00 2001 From: Christian Humpel <78662388+Humml87@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:59:37 +0100 Subject: [PATCH 066/117] FIX: Count of virtual stock at Services and MoLine with disabled stock change (#28580) * fix the count of virtual stock * - fix "Found non sanitized string" ? --------- Co-authored-by: christian.humpel --- htdocs/product/class/product.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5288300c443cc..b959d87063f2d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3469,6 +3469,8 @@ public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirt // phpcs:enable global $conf, $user, $hookmanager, $action; + $serviceStockIsEnabled = isModEnabled("service") && getDolGlobalString('STOCK_SUPPORTS_SERVICES'); + $sql = "SELECT COUNT(DISTINCT m.fk_soc) as nb_customers, COUNT(DISTINCT m.rowid) as nb,"; $sql .= " COUNT(mp.rowid) as nb_rows, SUM(mp.qty) as qty, role"; $sql .= " FROM ".$this->db->prefix()."mrp_production as mp"; @@ -3480,6 +3482,7 @@ public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirt $sql .= " WHERE m.rowid = mp.fk_mo"; $sql .= " AND m.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'mrp').")"; $sql .= " AND mp.fk_product = ".((int) $this->id); + $sql .= " AND mp.disable_stock_change IN (0)"; if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) { $sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -3492,6 +3495,9 @@ public function load_stats_inproduction($socid = 0, $filtrestatut = '', $forVirt if (!empty($dateofvirtualstock)) { $sql .= " AND m.date_valid <= '".$this->db->idate($dateofvirtualstock)."'"; // better date to code ? end of production ? } + if (!$serviceStockIsEnabled) { + $sql .= "AND EXISTS (SELECT p.rowid FROM ".$this->db->prefix()."product AS p WHERE p.rowid = ".((int) $this->id)." AND p.fk_product_type IN (0))"; + } $sql .= " GROUP BY role"; $this->stats_mrptoconsume['customers'] = 0; From d7f3feba747b9177a80d11384cbb3bae84dc9642 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2024 03:57:56 +0100 Subject: [PATCH 067/117] Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f21e08e8261ab..6fe032f545666 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2224,7 +2224,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $tabsname = str_replace("@", "", $picto); } $out .= '
'; - $out .= ''; // Do not use "reposition" class in the "More". + $out .= ''; // Do not use "reposition" class in the "More". $out .= '
'; $out .= $outmore; $out .= '
'; From 26c307c0a422558d6224b9366bd938ccd3b6fb9d Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Tue, 5 Mar 2024 17:16:11 +0100 Subject: [PATCH 068/117] Fix extrafield ajax search default on edit (#28631) --- htdocs/core/class/html.form.class.php | 49 +++++++++++++++++---------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 29cb68f171d67..40e9391877132 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8014,22 +8014,22 @@ protected function constructMemberListOption(&$objp, &$opt, &$optJson, $selected * Can use autocomplete with ajax after x key pressed or a full combo, depending on setup. * This is the generic method that will replace all specific existing methods. * - * @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc. - * @param string $htmlname Name of HTML select component - * @param int $preselectedvalue Preselected value (ID of element) - * @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...) - * @param string $searchkey Search criteria - * @param string $placeholder Place holder - * @param string $morecss More CSS - * @param string $moreparams More params provided to ajax call - * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) - * @param int $disabled 1=Html component is disabled - * @param string $selected_input_value Value of preselected input text (for use with ajax) - * @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx' + * @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc. + * @param string $htmlname Name of HTML select component + * @param int $preSelectedValue Preselected value (ID of element) + * @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...) + * @param string $searchkey Search criteria + * @param string $placeholder Place holder + * @param string $morecss More CSS + * @param string $moreparams More params provided to ajax call + * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) + * @param int $disabled 1=Html component is disabled + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx' * @return string Return HTML string * @see selectForFormsList(), select_thirdparty_list() */ - public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '') + public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '') { global $conf, $extrafields, $user; @@ -8128,10 +8128,23 @@ public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showe if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) { // No immediate load of all database $placeholder = ''; - if ($preselectedvalue && empty($selected_input_value)) { - $objecttmp->fetch($preselectedvalue); + + if ($preSelectedValue && empty($selected_input_value)) { + $objecttmp->fetch($preSelectedValue); $selected_input_value = ($prefixforautocompletemode == 'company' ? $objecttmp->name : $objecttmp->ref); - //unset($objecttmp); + + $oldValueForShowOnCombobox = 0; + foreach ($objecttmp->fields as $fieldK => $fielV) { + if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue; + + if (!$oldValueForShowOnCombobox) { + $selected_input_value = ''; + } + + $selected_input_value .= $oldValueForShowOnCombobox ? ' - ' : ''; + $selected_input_value .= $objecttmp->$fieldK; + $oldValueForShowOnCombobox = empty($fielV['showoncombobox']) ? 0 : $fielV['showoncombobox']; + } } // Set url and param to call to get json of the search results @@ -8139,12 +8152,12 @@ public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showe $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); // Activate the auto complete using ajax call. - $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array()); + $out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0); $out .= ''; $out .= ''; } else { // Immediate load of table record. - $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); + $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); } return $out; From 75f1de8f8f5140235b45f80633f65192ab14b847 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 5 Mar 2024 18:07:05 +0100 Subject: [PATCH 069/117] Fix: Deposit lines are not created correctly (#28646) * FIX: The minimum price in proposals is not checked correctly * Fix: Deposit lines are not created correctly * Fix: Volver a dejar como estaba * Fix: Deposit lines are not created correctly --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0dd1b661b33ca..bb96c2c2f815a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2019 Ferran Marcet + * Copyright (C) 2014-2024 Ferran Marcet * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2022 Gauthier VERDOL @@ -1596,7 +1596,7 @@ null, 0, '', - 1 + (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)?0:1) ); } From 43b1adb4c6551cf26d5cd516f609af80b21301a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 01:40:06 +0100 Subject: [PATCH 070/117] Fix bad var name in security setup page --- htdocs/admin/system/security.php | 4 ++-- htdocs/langs/en_US/errors.lang | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 6ad04701a522e..199b715d2ef63 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -272,7 +272,7 @@ if (file_exists($installlock)) { // If install not locked, no need to show this. if (file_exists($upgradeunlock)) { print ''.$langs->trans("DolibarrUpgrade").': '; - print img_warning().' '.$langs->trans("UpgradeHasBeenUnlocked", $upgradeunlock); + print img_warning().' '.$langs->trans("WarningUpgradeHasBeenUnlocked", $upgradeunlock); print '
'; } } @@ -756,7 +756,7 @@ print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('>WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCEPP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"camera: (); microphone: ();\")
"; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b4883e7f6f49f..625cb2bfc51a6 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -343,6 +343,7 @@ WarningConfFileMustBeReadOnly=Warning, your config file (htdocs/conf/conf.php WarningsOnXLines=Warnings on %s source record(s) WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be chosen by default until you check your module setup. WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable the installation/migration tools by adding a file install.lock into directory %s. Omitting the creation of this file is a grave security risk. +WarningUpgradeHasBeenUnlocked=Warning, upgrade process has been unlocked for everybody WarningUntilDirRemoved=This security warning will remain active as long as the vulnerability is present. WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution. WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box. From 1552fac711177f376dee15e39812107619d681db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 01:54:41 +0100 Subject: [PATCH 071/117] Fix strict-origin --- htdocs/admin/system/security.php | 2 +- htdocs/main.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 199b715d2ef63..fce38310605aa 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -753,7 +753,7 @@ print '   ('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").'=\"strict-origin\" '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 548d2fb2099df..44b62e8bb8f3a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1669,9 +1669,9 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) // Referrer-Policy // Say if we must provide the referrer when we jump onto another web page. - // Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'same-origin' so browser doesn't send any referrer when going into another web site domain. + // Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'strict-origin' so browser doesn't send any referrer when going into another web site domain. if (!defined('MAIN_SECURITY_FORCERP')) { - $referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "same-origin"); + $referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "strict-origin"); header("Referrer-Policy: ".$referrerpolicy); } From 1a9fa740a5fbe8301a83851c76cdc7bd166be540 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 13:32:15 +0100 Subject: [PATCH 072/117] Fix quote --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index fce38310605aa..8aee55d46ba4d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -753,7 +753,7 @@ print '   ('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").'=\"strict-origin\" '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCERP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined")."=\"strict-origin\" ".$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; From f1aa29507a62786c8de29fb0afc5c38e477f04bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 15:01:25 +0100 Subject: [PATCH 073/117] Fix sec more complete list of forbidden function --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6fe032f545666..0298ce0d439fc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9738,6 +9738,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $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")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function From 2d9801ffe33c22ea9d6c65a0b5bdd49e487712be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 15:01:25 +0100 Subject: [PATCH 074/117] Fix sec more complete list of forbidden function --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cbf8fee96e042..181825a689e77 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9297,6 +9297,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); $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")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function From 91b994b89ce6a5263bdedd36dff1c43141f6767a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Mar 2024 17:20:44 +0100 Subject: [PATCH 075/117] Prepare 18.0.6 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index cba47566c2bac..9e1046d439f94 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '18.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '18.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 4dcf98b9f7d5e26dd4c4c62bc4a980e389cc61aa Mon Sep 17 00:00:00 2001 From: ATM-NicolasV <92087862+ATM-NicolasV@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:55:07 +0100 Subject: [PATCH 076/117] fix entity in sql from RemoveFromGroup (#28682) --- htdocs/user/class/user.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 1543d5798393e..0ec4d6fdf5ab4 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2377,7 +2377,11 @@ public function RemoveFromGroup($group, $entity, $notrigger = 0) $sql = "DELETE FROM ".MAIN_DB_PREFIX."usergroup_user"; $sql .= " WHERE fk_user = ".((int) $this->id); $sql .= " AND fk_usergroup = ".((int) $group); - $sql .= " AND entity = ".((int) $entity); + if (empty($entity)) { + $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. + } else { + $sql .= " AND entity = ".((int) $entity); + } $result = $this->db->query($sql); if ($result) { From 7bb55aa22528cf2ac35303a957113170ebc58af0 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:56:17 +0100 Subject: [PATCH 077/117] FIX : Translation for select (#28677) * FIX : Adding thez dependencies list feature for select fields * FIX : Adding some spaces * FIX : View * FIX : Translating --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 47060b949f464..9ef1f4c94f4cd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7330,7 +7330,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = $isDependList = 1; } $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); - $out .= '>'.$valb.''; + $out .= '>'.$langs->trans($valb).''; } $out .= ''; } elseif ($type == 'sellist') { @@ -7954,7 +7954,7 @@ public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix } elseif ($type == 'select') { $value = isset($param['options'][$value]) ? $param['options'][$value] : ''; if (strpos($value, "|") !== false) { - $value = explode('|', $value)[0]; + $value = $langs->trans(explode('|', $value)[0]); } } elseif ($type == 'sellist') { $param_list = array_keys($param['options']); From 2d8223eefb5a3e493a71a358626c64e051068034 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 16:16:49 +0100 Subject: [PATCH 078/117] Doc --- htdocs/admin/system/security.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 6ad04701a522e..e19463934af4b 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -341,12 +341,13 @@ } print '$dolibarr_main_stream_to_disable: '; +// $arrayofstreamtodisable is defined into filefunc.inc.php if (empty($dolibarr_main_stream_to_disable)) { print ''.$langs->trans("Undefined").' = '.join(', ', $arrayofstreamtodisable).''; } else { print join(', ', $dolibarr_main_stream_to_disable); } -print ' -> PHP streams allowed = '; +print ' -> Current PHP streams allowed = '; $arrayofstreams = stream_get_wrappers(); if (!empty($arrayofstreams)) { sort($arrayofstreams); From 8870be3c3d211385f7a7061fb5eef4ee5cb3790d Mon Sep 17 00:00:00 2001 From: Rikard Bosnjakovic Date: Thu, 7 Mar 2024 16:43:04 +0100 Subject: [PATCH 079/117] Update card.php (#28679) Fix #25130 Co-authored-by: Laurent Destailleur --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fd83a09ab0e90..45cbba2834420 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2762,7 +2762,7 @@ // Presend form $modelmail = 'shipping_send'; - $defaulttopic = $langs->trans('SendShippingRef'); + $defaulttopic = 'SendShippingRef'; $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; From cbd331256d937c92a384bf6183b277e4f4bb0678 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Thu, 7 Mar 2024 19:01:38 +0100 Subject: [PATCH 080/117] using note_public since note_private is not working (#28675) Co-authored-by: Jon Bendtsen --- htdocs/adherents/subscription/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index b2dc0a57a5357..3b59dab63a2f6 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -238,7 +238,7 @@ // Label print '
'; print ''; + print ''; // Bank line if (isModEnabled("banque") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) { @@ -334,7 +334,7 @@ print ''; // Label - print ''; + print ''; // Bank line if (isModEnabled("banque") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) { From 7f10566d5e4f2ab900457405956d0112f11a251f Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Thu, 7 Mar 2024 20:21:41 +0100 Subject: [PATCH 081/117] FIX 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684) this is a follow-up of PR #27008 --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 75874fbb86a80..eebb2b95b512c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1895,7 +1895,7 @@ public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger // Set new ref and define current statut if (!$error) { - $this->ref = $num; + $this->ref = $this->newref; $this->statut = self::STATUS_VALIDATED; //$this->date_validation=$now; this is stored into log table } From 2636a644612bd181698392e8fd5416451afe23fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Thu, 7 Mar 2024 20:43:45 +0100 Subject: [PATCH 082/117] Set import_key in import when update record (#28657) * Set import_key in import when update record * Update import_xlsx.modules.php --- htdocs/core/modules/import/import_csv.modules.php | 2 +- htdocs/core/modules/import/import_xlsx.modules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 124fe9f7bbcbb..0a0a1aeb07f72 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -963,7 +963,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji foreach ($data as $key => $val) { $set[] = $key." = ".$val; } - $sqlstart .= " SET ".implode(', ', $set); + $sqlstart .= " SET ".implode(', ', $set).", import_key = '".$this->db->escape($importid)."'"; if (empty($keyfield)) { $keyfield = 'rowid'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 14e4b561eae50..8d5157e63a4c8 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -1006,7 +1006,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji foreach ($data as $key => $val) { $set[] = $key." = ".$val; } - $sqlstart .= " SET " . implode(', ', $set); + $sqlstart .= " SET " . implode(', ', $set) . ", import_key = '" . $this->db->escape($importid) . "'"; if (empty($keyfield)) { $keyfield = 'rowid'; From 10aa278acae9ba7c49e916dde8fcdd01fed8b9a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 21:38:40 +0100 Subject: [PATCH 083/117] Fix add a type to allow sanitization of import rule='compute'. --- .../modules/import/import_csv.modules.php | 19 ++++++++++++++----- .../modules/import/import_xlsx.modules.php | 19 ++++++++++++++----- htdocs/core/modules/modAccounting.class.php | 12 ++++++------ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 0a0a1aeb07f72..aa979b5260a94 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -738,7 +738,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji // ... } - // Define $listfields and $listvalues to build SQL request + // Define $listfields and $listvalues to build the SQL request if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; @@ -765,7 +765,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $listfields[] = $fieldname; // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert if (empty($newval) && $arrayrecord[($key - 1)]['type'] < 0) { - $listvalues[] = ($newval == '0' ? $newval : "null"); + $listvalues[] = ($newval == '0' ? (int) $newval : "null"); } elseif (empty($newval) && $arrayrecord[($key - 1)]['type'] == 0) { $listvalues[] = "''"; } else { @@ -793,7 +793,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $lastinsertid = (isset($last_insert_id_array[$tmp[1]])) ? $last_insert_id_array[$tmp[1]] : 0; $keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $tmpkey); $listfields[] = $keyfield; - $listvalues[] = $lastinsertid; + $listvalues[] = (int) $lastinsertid; //print $tmpkey."-".$tmpval."-".$listfields."-".$listvalues."
";exit; } elseif (preg_match('/^const-/', $tmpval)) { $tmp = explode('-', $tmpval, 2); @@ -806,6 +806,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']); $class = $objimport->array_import_convertvalue[0][$fieldname]['class']; $method = $objimport->array_import_convertvalue[0][$fieldname]['method']; + $type = $objimport->array_import_convertvalue[0][$fieldname]['type']; $resultload = dol_include_once($file); if (empty($resultload)) { dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); @@ -818,8 +819,16 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji if (count($fieldArr) > 0) { $fieldname = $fieldArr[1]; } + + // Set $listfields and $listvalues $listfields[] = $fieldname; - $listvalues[] = $res; + if ($type == 'int') { + $listvalues[] = (int) $res; + } elseif ($type == 'double') { + $listvalues[] = (float) $res; + } else { + $listvalues[] = "'".$this->db->escape($res)."'"; + } } else { $this->errors[$error]['type'] = 'CLASSERROR'; $this->errors[$error]['lib'] = implode( @@ -961,7 +970,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $data = array_combine($listfields, $listvalues); $set = array(); foreach ($data as $key => $val) { - $set[] = $key." = ".$val; + $set[] = $key." = ".$val; // $val was escaped/sanitized previously } $sqlstart .= " SET ".implode(', ', $set).", import_key = '".$this->db->escape($importid)."'"; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 8d5157e63a4c8..e798fc659f076 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -781,7 +781,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji // ... } - // Define $listfields and $listvalues to build SQL request + // Define $listfields and $listvalues to build the SQL request if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; @@ -807,7 +807,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert if (empty($newval) && $arrayrecord[($key)]['type'] < 0) { - $listvalues[] = ($newval == '0' ? $newval : "null"); + $listvalues[] = ($newval == '0' ? (int) $newval : "null"); } elseif (empty($newval) && $arrayrecord[($key)]['type'] == 0) { $listvalues[] = "''"; } else { @@ -835,7 +835,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $lastinsertid = (isset($last_insert_id_array[$tmp[1]])) ? $last_insert_id_array[$tmp[1]] : 0; $keyfield = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key); $listfields[] = $keyfield; - $listvalues[] = $lastinsertid; + $listvalues[] = (int) $lastinsertid; //print $key."-".$val."-".$listfields."-".$listvalues."
";exit; } elseif (preg_match('/^const-/', $val)) { $tmp = explode('-', $val, 2); @@ -848,6 +848,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $file = (empty($objimport->array_import_convertvalue[0][$fieldname]['classfile']) ? $objimport->array_import_convertvalue[0][$fieldname]['file'] : $objimport->array_import_convertvalue[0][$fieldname]['classfile']); $class = $objimport->array_import_convertvalue[0][$fieldname]['class']; $method = $objimport->array_import_convertvalue[0][$fieldname]['method']; + $type = $objimport->array_import_convertvalue[0][$fieldname]['type']; $resultload = dol_include_once($file); if (empty($resultload)) { dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); @@ -859,8 +860,16 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji if (count($fieldArr) > 0) { $fieldname = $fieldArr[1]; } + + // Set $listfields and $listvalues $listfields[] = $fieldname; - $listvalues[] = $res; + if ($type == 'int') { + $listvalues[] = (int) $res; + } elseif ($type == 'double') { + $listvalues[] = (float) $res; + } else { + $listvalues[] = "'".$this->db->escape($res)."'"; + } } else { $this->errors[$error]['type'] = 'CLASSERROR'; $this->errors[$error]['lib'] = implode( @@ -1004,7 +1013,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $data = array_combine($listfields, $listvalues); $set = array(); foreach ($data as $key => $val) { - $set[] = $key." = ".$val; + $set[] = $key." = ".$val; // $val was escaped/sanitized previously } $sqlstart .= " SET " . implode(', ', $set) . ", import_key = '" . $this->db->escape($importid) . "'"; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 07591de93a7ba..f8788d09ba450 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -362,14 +362,14 @@ public function __construct($db) 'b.sens'=>'rule-computeDirection' ); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r]=array( - 'b.piece_num' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanValue', 'element' => 'Accountancy'), + 'b.piece_num' => array('rule' => 'compute', 'type' => 'int', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanValue', 'element' => 'Accountancy'), 'b.numero_compte'=>array('rule'=>'accountingaccount'), 'b.subledger_account'=>array('rule'=>'accountingaccount'), - 'b.debit' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanAmount', 'element' => 'Accountancy'), - 'b.credit' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanAmount', 'element' => 'Accountancy'), - 'b.multicurrency_amount' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanAmount', 'element' => 'Accountancy'), - 'b.montant' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeAmount', 'element' => 'Accountancy'), - 'b.sens' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeDirection', 'element' => 'Accountancy'), + 'b.debit' => array('rule' => 'compute', 'type' => 'double', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanAmount', 'element' => 'Accountancy'), + 'b.credit' => array('rule' => 'compute', 'type' => 'double', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanAmount', 'element' => 'Accountancy'), + 'b.multicurrency_amount' => array('rule' => 'compute', 'type' => 'double', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'cleanAmount', 'element' => 'Accountancy'), + 'b.montant' => array('rule' => 'compute', 'type' => 'double', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeAmount', 'element' => 'Accountancy'), + 'b.sens' => array('rule' => 'compute', 'type' => 'varchar', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeDirection', 'element' => 'Accountancy'), ); $this->import_regex_array[$r] = array( //'b.doc_date'=>'^\d{4}\d{2}\d{2}$', From 491e85037a9fb2974b021feab63c5776cbefe42b Mon Sep 17 00:00:00 2001 From: Can Arslan <138895927+mc2rcanarslan@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:09:54 -0700 Subject: [PATCH 084/117] FIX: PHP Warning: Undefined variable $mode (#28697) --- htdocs/fourn/paiement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 2c7009c8d4230..3021fbdc898e0 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -48,7 +48,7 @@ $massaction = GETPOST('massaction', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist'; - +$mode = GETPOST('mode', 'aZ'); $socid = GETPOST('socid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); From e74e638b26990d3e517579f6616616afa6f82860 Mon Sep 17 00:00:00 2001 From: Can Arslan <138895927+mc2rcanarslan@users.noreply.github.com> Date: Fri, 8 Mar 2024 04:28:31 -0700 Subject: [PATCH 085/117] FIX: skip adding tab if user doesn't have permission (#28698) verifCond function checks whether user has right and we should skip adding it if user doesn't have right --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0298ce0d439fc..846819f2433a7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10189,6 +10189,8 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $newtab[1] = $label; $newtab[2] = str_replace('+', '', $values[1]); $h++; + } else { + continue; } } elseif (count($values) == 5) { // case deprecated dol_syslog('Passing 5 values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING); From bcf6d7a2aa5b255516e46d69c9898d8bb1dde4a8 Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Fri, 8 Mar 2024 12:36:31 +0100 Subject: [PATCH 086/117] FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfert is allowed (#26217) --- htdocs/expedition/card.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 318d66635ec69..20c6a14b77da5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1424,7 +1424,7 @@ $nbofsuggested = 0; foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { - if ($stock_warehouse->real > 0) { + if ($stock_warehouse->real > 0 || !empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { $nbofsuggested++; } } @@ -1437,7 +1437,7 @@ } $tmpwarehouseObject->fetch($warehouse_id); - if ($stock_warehouse->real > 0) { + if ($stock_warehouse->real > 0 || !empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { $stock = + $stock_warehouse->real; // Convert it to number $deliverableQty = min($quantityToBeDelivered, $stock); $deliverableQty = max(0, $deliverableQty); @@ -1536,7 +1536,7 @@ // Define nb of lines suggested for this order line $nbofsuggested = 0; foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { - if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { + if (($stock_warehouse->real > 0 || !empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) && (count($stock_warehouse->detail_batch))) { $nbofsuggested+=count($stock_warehouse->detail_batch); } } @@ -1549,7 +1549,7 @@ } $tmpwarehouseObject->fetch($warehouse_id); - if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { + if (($stock_warehouse->real > 0 || !empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { $batchStock = + $dbatch->qty; // To get a numeric if (isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { @@ -1634,6 +1634,9 @@ $disabled = 'disabled="disabled"'; } print ' '; + if (empty($disabled) && !empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { + print ''; + } } else { print $langs->trans("NA"); } From 23723289c288410a54d594b9efc1938549475e08 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 8 Mar 2024 18:05:58 -0600 Subject: [PATCH 087/117] Update ticket.class.php update function (#28722) Default value for status to zero(0) instead of "null" --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 601806e023b6b..e1b496b692980 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -992,7 +992,7 @@ public function update($user = 0, $notrigger = 0) $sql .= " fk_user_assign=".(isset($this->fk_user_assign) ? $this->fk_user_assign : "null").","; $sql .= " subject=".(isset($this->subject) ? "'".$this->db->escape($this->subject)."'" : "null").","; $sql .= " message=".(isset($this->message) ? "'".$this->db->escape($this->message)."'" : "null").","; - $sql .= " fk_statut=".(isset($this->fk_statut) ? $this->fk_statut : "null").","; + $sql .= " fk_statut=".(isset($this->fk_statut) ? $this->fk_statut : "0").","; $sql .= " resolution=".(isset($this->resolution) ? $this->resolution : "null").","; $sql .= " progress=".(isset($this->progress) ? "'".$this->db->escape($this->progress)."'" : "null").","; $sql .= " timing=".(isset($this->timing) ? "'".$this->db->escape($this->timing)."'" : "null").","; From b601dabf6604e16561bcf102d18f32c4927dbf85 Mon Sep 17 00:00:00 2001 From: le-reparateur <162715304+le-reparateur@users.noreply.github.com> Date: Sat, 9 Mar 2024 15:14:23 +0100 Subject: [PATCH 088/117] Update fournisseur.product.class.php (#28729) * Update fournisseur.product.class.php #28710 * Update fournisseur.product.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/fourn/class/fournisseur.product.class.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index fd9e0245ad819..cd512972033bc 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -327,10 +327,10 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn $fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $multicurrency_code); } - $buyprice = price2num($buyprice, 'MU'); - $charges = price2num($charges, 'MU'); - $qty = price2num($qty, 'MS'); - $unitBuyPrice = price2num($buyprice / $qty, 'MU'); + $buyprice = (float) price2num($buyprice, 'MU'); + $charges = (float) price2num($charges, 'MU'); + $qty = (float) price2num($qty, 'MS'); + $unitBuyPrice = (float) price2num($buyprice / $qty, 'MU'); // We can have a puchase ref that need to buy 100 min for a given price and with a packaging of 50. //$packaging = price2num(((empty($this->packaging) || $this->packaging < $qty) ? $qty : $this->packaging), 'MS'); @@ -359,10 +359,6 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn $localtax2 = 0; // If = '' then = 0 } - // Check parameters - if ($buyprice != '' && !is_numeric($buyprice)) { - } - $this->db->begin(); if ($this->product_fourn_price_id > 0) { @@ -391,6 +387,7 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn } $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql .= " SET fk_user = ".((int) $user->id)." ,"; + $sql .= " datec = '".$this->db->idate($now)."' ,"; // Note: Even if this is an update, we update the creation date as the log of each change is tracked into product_fournisseur_log. $sql .= " ref_fourn = '".$this->db->escape($ref_fourn)."',"; $sql .= " desc_fourn = '".$this->db->escape($desc_fourn)."',"; $sql .= " price = ".((float) $buyprice).","; From cecd3bc1b61d7c065faae45cbe88dbfb8cd861ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Mar 2024 23:46:38 +0100 Subject: [PATCH 089/117] FIX Picto in top menu --- htdocs/core/menus/standard/auguria.lib.php | 2 ++ htdocs/core/menus/standard/eldy.lib.php | 2 ++ htdocs/core/menus/standard/empty.php | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 60480d6c9cbe3..dbed17b95d531 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -242,6 +242,8 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; } else { print ''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1cf504a30fde4..141e0e02c650f 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -656,6 +656,8 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, print '
'; if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; } else { print ''; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 542cb1a493af0..01282aff09ff7 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -523,7 +523,13 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class if ($showmode == 1) { print ''; print '
'; - print ''; + if (!empty($menuval['prefix']) && strpos($menuval['prefix'], ''; + } else { + print ''; + } print '
'; print '
'; if (!getDolGlobalString('THEME_TOPMENU_DISABLE_TEXT')) { From 8ef22dc461487bd9942cf8d2613f53056eb2f6eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 00:47:00 +0100 Subject: [PATCH 090/117] Fix css --- htdocs/bookmarks/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 7bebdcb2af7d3..8dd22d694caf2 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -228,6 +228,7 @@ print '
'; print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; if ($caneditfield) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); + print $formcompany->select_state_ajax('country_id', $object->state_id, $object->country_id, 'state_id'); } else { print $object->state; } From 042ef30a9f88e9a80c6d1631f2c06955d1ee8135 Mon Sep 17 00:00:00 2001 From: Hasanuzzaman Sattar Date: Thu, 29 Feb 2024 19:11:59 +0530 Subject: [PATCH 025/117] FIX #28518 (#28520) * #28518 * Update interface_50_modTicket_TicketEmail.class.php --------- Co-authored-by: Laurent Destailleur --- .../triggers/interface_50_modTicket_TicketEmail.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index f18526a9d199e..0afe5a7150b31 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -246,13 +246,15 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal')); if (empty($linked_contacts) && !empty($conf->global->TICKET_NOTIFY_AT_CLOSING) && !empty($object->fk_soc)) { $object->fetch_thirdparty(); - $linked_contacts[] = $object->thirdparty->email; + $linked_contacts[]['email'] = $object->thirdparty->email; } $contactid = GETPOST('contactid', 'int'); $res = 0; if ($contactid > 0) { + // TODO This security test has no sens. We must check that $contactid is inside $linked_contacts[]['id'] when $linked_contacts[]['source'] = 'external' or 'thirdparty' + // Refuse email if not $contact = new Contact($this->db); $res = $contact->fetch($contactid); if (! in_array($contact, $linked_contacts)) { From 700c0e3e736e220b56dd2df88d2421acd65f4b28 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:49:26 +0100 Subject: [PATCH 026/117] FIX : Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523) * FIX : Add new hidden conf "DISABLE_QTY_OVERWRITTEN" * FIX : Change conf name * FIX : PR returns --- htdocs/product/inventory/inventory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 4ca3768fa11aa..b924b9c442c92 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -1045,8 +1045,9 @@ function barcodeserialforproduct(tabproduct,index,element,barcodeproductqty,sele // Expected quantity = Quantity in stock when we start inventory print ''; $valuetoshow = $obj->qty_stock; + // For inventory not yet close, we overwrite with the real value in stock now - if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { + if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && !getDolGlobalString('DISABLE_QTY_OVERWRITE')) { if (isModEnabled('productbatch') && $product_static->hasbatch()) { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; } else { From 4c116e1577ff543fb15cc9b8cd1f3bc0564fb91f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 17:59:17 +0100 Subject: [PATCH 027/117] Doc --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2cb7b41316a00..8bc8cb9a9c174 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8850,7 +8850,7 @@ protected function isIndex($info) /** - * Function to prepare a part of the query for insert. + * Function to return the array of data key-value from the ->fields and all the ->properties of an object. * Note $this->${field} are set by the page that make the createCommon or the updateCommon. * $this->${field} should be a clean value. The page can run * From 284fb49f607b8dec04bf0234528273af3a62d04b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 19:35:34 +0100 Subject: [PATCH 028/117] Try a better fix for #28526 --- htdocs/core/class/commonobject.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8bc8cb9a9c174..ed3203848bc9e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -570,6 +570,19 @@ abstract class CommonObject public $user_modification_id; + /** + * @var int ID + * @deprecated Use $user_creation_id + */ + public $fk_user_creat; + + /** + * @var int ID + * @deprecated Use $user_modification_id + */ + public $fk_user_modif; + + public $next_prev_filter; /** @@ -9048,6 +9061,11 @@ public function createCommon(User $user, $notrigger = false) } if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; + $this->fk_user_creat = $user->id; + } + if (array_key_exists('user_modification_id', $fieldvalues) && !($fieldvalues['user_modification_id'] > 0)) { + $fieldvalues['user_modification_id'] = $user->id; + $this->user_modification_id = $user->id; } unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. if (array_key_exists('ref', $fieldvalues)) { From a0fc77cd76a5ca9b229d8503cc85ddc46bd84445 Mon Sep 17 00:00:00 2001 From: thomas-Ngr Date: Thu, 29 Feb 2024 19:40:51 +0100 Subject: [PATCH 029/117] Fix Form::load_cache_vatrates() countries dict (#28528) --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cd9f44130b9e3..e262eb163c9d7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6348,7 +6348,7 @@ public function load_cache_vatrates($country_code) if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) { $langs->load("errors"); $new_country_code = $reg[1]; - $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid'); + $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_country', 'code', 'rowid'); $this->error .= '
'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : '')); } $this->error .= ''; From ef050962977986488f94fbaaf8fa44d436c929d0 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Thu, 29 Feb 2024 20:15:23 +0100 Subject: [PATCH 030/117] Fix:False constant name (#28532) Conflicts: htdocs/mrp/class/mo.class.php Fix:False constant name --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index e3d3999196de4..2341f1fd406c9 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1631,8 +1631,8 @@ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hided if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (getDolGlobalString('MO_ADDON_PDF')) { - $modele = $conf->global->MO_ADDON_PDF; + } elseif (getDolGlobalString('MRP_MO_ADDON_PDF')) { + $modele = getDolGlobalString('MRP_MO_ADDON_PDF'); } } From 632b06c5d8560328c2f7a47472206ffb21678b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:22:38 +0100 Subject: [PATCH 031/117] ajout unitprice dans import FIX #28382 (#28531) --- htdocs/core/modules/modFacture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 34f303fec9c43..d26f893386e63 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -368,7 +368,7 @@ public function __construct($db) 'fd.remise_percent' => 'Reduc. (%)', // remise // fk_remise_except - // subprice + 'fd.subprice' => 'UnitPriceHT', // price 'fd.total_ht' => 'LineTotalHT', 'fd.total_tva' => 'LineTotalVAT', @@ -433,7 +433,7 @@ public function __construct($db) 'fd.remise_percent' => '0', // remise // fk_remise_except - // subprice + 'fd.subprice' => '100', // price 'fd.total_ht' => '100', 'fd.total_tva' => '21', From e6c4583bc46ed07aba68066517c32f4aa3a09117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:23:08 +0100 Subject: [PATCH 032/117] Prevent infinite loop with add notrigger parameter to the functions create, update & setMultiLangs (#28530) --- htdocs/categories/class/categorie.class.php | 23 +++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6e88c1d2373dc..063207be7d8cd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -416,12 +416,13 @@ public function fetch($id, $label = '', $type = null, $ref_ext = '') * Add category into database * * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int -1 : SQL error * -2 : new ID unknown * -3 : Invalid category * -4 : category already exists */ - public function create($user) + public function create($user, $notrigger = 0) { global $conf, $langs, $hookmanager; $langs->load('categories'); @@ -505,7 +506,7 @@ public function create($user) } } - if (!$error) { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CATEGORY_CREATE', $user); if ($result < 0) { @@ -536,11 +537,12 @@ public function create($user) * Update category * * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int 1 : OK * -1 : SQL error * -2 : invalid category */ - public function update(User $user) + public function update(User $user, $notrigger = 0) { global $langs; @@ -586,7 +588,7 @@ public function update(User $user) } } - if (!$error) { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CATEGORY_MODIFY', $user); if ($result < 0) { @@ -1913,10 +1915,11 @@ public function get_image_size($file) * Update ou cree les traductions des infos produits * * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * * @return int Return integer <0 if KO, >0 if OK */ - public function setMultiLangs($user) + public function setMultiLangs(User $user, $notrigger = 0) { global $langs; @@ -1971,10 +1974,12 @@ public function setMultiLangs($user) } // Call trigger - $result = $this->call_trigger('CATEGORY_SET_MULTILANGS', $user); - if ($result < 0) { - $this->error = $this->db->lasterror(); - return -1; + if (!$notrigger) { + $result = $this->call_trigger('CATEGORY_SET_MULTILANGS', $user); + if ($result < 0) { + $this->error = $this->db->lasterror(); + return -1; + } } // End call triggers From 2d936bf1c9f1ccba28596645854228e30e54fc61 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Mar 2024 12:38:06 +0100 Subject: [PATCH 033/117] FIX postgresql error (#28542) * FIX postgresql error * FIX better index name --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 5 ++++- htdocs/install/mysql/tables/llx_expensereport.key.sql | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index f528d39bdc62f..70bf4fe762886 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -204,7 +204,10 @@ ALTER TABLE llx_salary ADD COLUMN note_public text; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN element_type varchar(50) DEFAULT 'supplier_order' NOT NULL; -ALTER TABLE llx_expensereport DROP INDEX idx_expensereport_fk_refuse, ADD INDEX idx_expensereport_fk_refuse(fk_user_refuse); +-- VMYSQL4.1 DROP INDEX idx_expensereport_fk_refuse ON llx_expensereport; +-- VPGSQL8.2 DROP INDEX idx_expensereport_fk_refuse; + +ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_refuse(fk_user_refuse); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Société publique locale'); diff --git a/htdocs/install/mysql/tables/llx_expensereport.key.sql b/htdocs/install/mysql/tables/llx_expensereport.key.sql index 329bb9089ff95..8557fcee6664f 100644 --- a/htdocs/install/mysql/tables/llx_expensereport.key.sql +++ b/htdocs/install/mysql/tables/llx_expensereport.key.sql @@ -1,6 +1,6 @@ -- =================================================================== -- Copyright (C) 2005 Laurent Destailleur --- Copyright (C) 2008-2010 Regis Houssin +-- Copyright (C) 2008-2024 Regis Houssin -- -- 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 @@ -31,6 +31,5 @@ ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_ref --ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); --ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); ---ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_approve FOREIGN KEY (fk_user_approve) REFERENCES llx_user (rowid); ---ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_refuse FOREIGN KEY (fk_user_refuse) REFERENCES llx_user (rowid); - +--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_approve FOREIGN KEY (fk_user_approve) REFERENCES llx_user (rowid); +--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_refuse FOREIGN KEY (fk_user_refuse) REFERENCES llx_user (rowid); From 73359442d4044a7e881c7f09a48ac83a60cba5bc Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Fri, 1 Mar 2024 05:38:56 -0600 Subject: [PATCH 034/117] Update paiement.php (#28539) Fix #28485 --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 007dd70dea068..0e4245d9b2330 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -834,7 +834,7 @@ function callForResult(imgId) $text .= '
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed"); print ''; } - print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type, $langs->trans('PayedSuppliersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice); + print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id.'&socid='.$object->socid.'&type='.$object->type, $langs->trans('PayedSuppliersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice); } print ''; From 4b7d25975f41ae722cc929c918c89b04af9ef1ec Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Fri, 1 Mar 2024 05:45:08 -0600 Subject: [PATCH 035/117] Update html.form.class.php (#28540) * Update html.form.class.php Fix PHP Warning: Undefined array key "labeladddateof" * Update html.form.class.php * Update html.form.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8be98a0917350..29cb68f171d67 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7171,8 +7171,8 @@ public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empt $arrayofdateof = $adddateof; } foreach ($arrayofdateof as $valuedateof) { - $tmpadddateof = $valuedateof['adddateof'] != '' ? $valuedateof['adddateof'] : 0; - $tmplabeladddateof = $valuedateof['labeladddateof']; + $tmpadddateof = empty($valuedateof['adddateof']) ? 0 : $valuedateof['adddateof']; + $tmplabeladddateof = empty($valuedateof['labeladddateof']) ? '' : $valuedateof['labeladddateof']; $tmparray = dol_getdate($tmpadddateof); if (empty($tmplabeladddateof)) { $tmplabeladddateof = $langs->trans("DateInvoice"); From c069f3f161afe7dd811b836a244566ecdb46cd65 Mon Sep 17 00:00:00 2001 From: Christian Humpel <78662388+Humml87@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:47:37 +0100 Subject: [PATCH 036/117] FIX #28533 Mo::deleteLine removes the "main" MoLine if consumed line is delete (#28535) * fix #28533 * qual for github actions * fix use $this->db in classes --------- Co-authored-by: christian.humpel --- htdocs/mrp/class/mo.class.php | 152 +++++++++++++++++++++------------- htdocs/mrp/mo_production.php | 2 +- 2 files changed, 95 insertions(+), 59 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2341f1fd406c9..090bdc067c850 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -891,78 +891,58 @@ public function delete(User $user, $notrigger = false, $also_cancel_consumed_and */ public function deleteLine(User $user, $idline, $notrigger = false) { - global $langs; - $langs->loadLangs(array('stocks', 'mrp')); + $error = 0; if ($this->status < 0) { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } - $productstatic = new Product($this->db); - $fk_movement = GETPOST('fk_movement', 'int'); - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); - if (!empty($arrayoflines)) { - $this->db->begin(); - - $stockmove = new MouvementStock($this->db); - $stockmove->setOrigin($this->element, $this->id); + $moline = new MoLine($this->db); + $moline->fetch($idline); - if (!empty($fk_movement)) { - $moline = new MoLine($this->db); - $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement ='.$fk_movement)); - $moline = array_shift($TArrayMoLine); + $affectedLinkedMoLines; + // Check if it's linked or a main line + if (empty($moline->fk_mrp_production)) { + // Check if the main line has linked lines + $affectedLinkedMoLines = $this->fetchLinesLinked('consumed', $moline->id); + } - $movement = new MouvementStock($this->db); - $movement->fetch($fk_movement); - $productstatic->fetch($movement->product_id); - $qtytoprocess = $movement->qty; + $this->db->begin(); - // Reverse stock movement - $labelmovementCancel = $langs->trans("CancelProductionForRef", $productstatic->ref); - $codemovementCancel = $langs->trans("StockIncrease"); + // undo stockmovements and remove linked lines + if (!empty($affectedLinkedMoLines)) { + foreach ($affectedLinkedMoLines as $linkedLine) { + if (!$error) { + $linkedMoline = new MoLine($this->db); + $linkedMoline->fetch($linkedLine['rowid']); + $result = $linkedMoline->delete($user, $notrigger); - if (($qtytoprocess >= 0)) { - $idstockmove = $stockmove->reception($user, $movement->product_id, $movement->warehouse_id, $qtytoprocess, 0, $labelmovementCancel, '', '', $movement->batch, dol_now(), 0, $codemovementCancel); - } else { - $idstockmove = $stockmove->livraison($user, $movement->product_id, $movement->warehouse_id, $qtytoprocess, 0, $labelmovementCancel, dol_now(), '', '', $movement->batch, 0, $codemovementCancel); - } - if ($idstockmove < 0) { - $this->error++; - $this->db->rollback(); - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); - } else { - $this->db->commit(); + if ($result < 0) { + $error++; + setEventMessages($linkedMoline->error, $linkedMoline->errors, 'errors'); + } } - return $moline->delete($user, $notrigger); - } else { - foreach ($arrayoflines as $key => $arrayofline) { - $lineDetails = $arrayoflines[$key]; - $productstatic->fetch($lineDetails['fk_product']); - $qtytoprocess = $lineDetails['qty']; + } + } - // Reverse stock movement - $labelmovementCancel = $langs->trans("CancelProductionForRef", $productstatic->ref); - $codemovementCancel = $langs->trans("StockIncrease"); + if (!$error) { + $result = $moline->delete($user, $notrigger); - if ($qtytoprocess >= 0) { - $idstockmove = $stockmove->reception($user, $lineDetails['fk_product'], $lineDetails['fk_warehouse'], $qtytoprocess, 0, $labelmovementCancel, '', '', $lineDetails['batch'], dol_now(), 0, $codemovementCancel); - } else { - $idstockmove = $stockmove->livraison($user, $lineDetails['fk_product'], $lineDetails['fk_warehouse'], $qtytoprocess, 0, $labelmovementCancel, dol_now(), '', '', $lineDetails['batch'], 0, $codemovementCancel); - } - if ($idstockmove < 0) { - $this->error++; - $this->db->rollback(); - setEventMessages($stockmove->error, $stockmove->errors, 'errors'); - } else { - $this->db->commit(); - } - } - return $this->deleteLineCommon($user, $idline, $notrigger); + if ($result < 0) { + $error++; + setEventMessages($moline->error, $moline->errors, 'errors'); } + } + + if (!$error) { + $this->db->commit(); + $result = 1; } else { - return $this->deleteLineCommon($user, $idline, $notrigger); + $this->db->rollback(); + $result = -1; } + return $result; } @@ -2222,7 +2202,63 @@ public function update(User $user, $notrigger = false) */ public function delete(User $user, $notrigger = false) { - return $this->deleteCommon($user, $notrigger); - //return $this->deleteCommon($user, $notrigger, 1); + global $langs; + + $error = 0; + $result = -1; + + // the stockmovements it was created for this line revise + if (!empty($this->fk_warehouse)) { + $langs->loadLangs(array('stocks', 'mrp')); + + // load the mo for this line + $tmpmo = new Mo($this->db); + $tmpmo->fetch($this->fk_mo); + + // load the (old) linked stockmovement and the associated product + $linkedMovement = new MouvementStock($this->db); + $linkedMovement->fetch($this->fk_stock_movement); + $productForLinkedMovement = new Product($this->db); + $productForLinkedMovement->fetch($linkedMovement->product_id); + + // create new stockmovement to revise the linked stockmovement + $stockmove = new MouvementStock($this->db); + $stockmove->setOrigin($tmpmo->element, $tmpmo->id); + + // Reverse stock movement + $labelmovementCancel = $langs->trans("CancelProductionForRef", $productForLinkedMovement->ref); + $codemovementCancel = dol_print_date(dol_now(), 'dayhourlog'); + + $idstockmove = -1; + if (($linkedMovement->qty < 0)) { + $qtytoprocess = $linkedMovement->qty * -1; + $idstockmove = $stockmove->reception($user, $linkedMovement->product_id, $linkedMovement->warehouse_id, $qtytoprocess, 0, $labelmovementCancel, '', '', $linkedMovement->batch, dol_now(), 0, $codemovementCancel); + } else { + $idstockmove = $stockmove->livraison($user, $linkedMovement->product_id, $linkedMovement->warehouse_id, $linkedMovement->qty, 0, $labelmovementCancel, dol_now(), '', '', $linkedMovement->batch, 0, $codemovementCancel); + } + + if ($idstockmove < 0) { + $this->error++; + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + } + } + + if (!$error) { + $result = $this->deleteCommon($user, $notrigger); + if ($result < 0) { + $this->error++; + setEventMessages($stockmove->error, $stockmove->errors, 'errors'); + } + } + + if (!$error) { + $this->db->commit(); + $result = 1; + } else { + $this->db->rollback(); + $result = -1; + } + + return $result; } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0caba7cb77739..1dafabc87a77c 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1288,7 +1288,7 @@ // Action delete line if ($permissiontodelete) { - $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id).'&fk_movement='.((int) $line2['fk_stock_movement']); + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']); print '
'; print ''; print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); From 0ac22e1f75c15d268604f2e43c86db5b3f479f94 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Mar 2024 12:49:35 +0100 Subject: [PATCH 037/117] FIX avoid warning "error parsing attribute name in Entity" (#28543) --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8b109dbee3be8..a979f18e3a302 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7653,7 +7653,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' } else { $out = '
'.dol_nl2br($out).'
'; } - $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOXMLDECL); + $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL); $out = trim($dom->saveHTML()); // Remove the trick added to solve pb with text without parent tag From cb302fbb631854a1ea60f5e0421313a4defd2136 Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:55:07 +0100 Subject: [PATCH 038/117] FIX: Special code is now transmitted by args only in order supplier (#28546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/fourn/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index c9e5e8f4fee32..2c1e723df006f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1350,8 +1350,6 @@ $tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id); } - $object->special_code = $lines[$i]->special_code; - $result = $object->addline( $desc, $lines[$i]->subprice, @@ -1374,7 +1372,9 @@ $lines[$i]->fk_unit, 0, $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid, + -1, + $lines[$i]->special_code ); if ($result < 0) { From 17015095aa8aeecdcda3218f4d25eb15e71834b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 18:15:58 +0100 Subject: [PATCH 039/117] Add option to allow better compatibility with computed fields using unsecured chars --- htdocs/core/lib/functions.lib.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8b109dbee3be8..fa2d6f0f30f8d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9629,7 +9629,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' if ($onlysimplestring == '1') { // We must accept: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' // We must accept: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' - if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) { + $specialcharsallowed = '^$_+-.*>&|=!?():"\',/@'; + if (getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL')) { + $specialcharsallowed .= getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL'); + } + if (preg_match('/[^a-z0-9\s'.preg_quote($specialcharsallowed, '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; } else { @@ -9656,7 +9660,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' // We can exclude $ char that are not: $db, $langs, $leftmenu, $topmenu, $user, $langs, $objectoffield, $object..., } elseif ($onlysimplestring == '2') { // We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found" - if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@[]', '/').']/i', $s)) { + $specialcharsallowed = '^$_+-.*>&|=!?():"\',/@[]'; + if (getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL')) { + $specialcharsallowed .= getDolGlobalString('MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL'); + } + if (preg_match('/[^a-z0-9\s'.preg_quote($specialcharsallowed, '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; } else { From af8e086aacb29fd366d426b9a87c4693397ead85 Mon Sep 17 00:00:00 2001 From: Liammer <104431491+Liammer@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:24:31 +0100 Subject: [PATCH 040/117] Update adherent.class.php (#28554) To not send the Email to cancelled members. They already asked not to be members anymore. Sending reminders can be exhausting. --- htdocs/adherents/class/adherent.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8717ecd010a91..25fa2b6a257ca 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3102,6 +3102,7 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10') $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent'; $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only; + $sql .= " AND statut = 1"; $sql .= " AND datefin = '".$this->db->idate($datetosearchfor)."'"; //$sql .= " LIMIT 10000"; From 3c28480fda5f1c39a78ff5a3f6dccb3e6aa8fd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:26:36 +0100 Subject: [PATCH 041/117] Update list.php add some init field array (#28550) --- htdocs/compta/facture/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6a089f7a87dc6..a6fa25cfd13a6 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1821,6 +1821,9 @@ $totalarray['val']['f.total_tva'] = 0; $totalarray['val']['f.total_ht'] = 0; $totalarray['val']['f.total_ttc'] = 0; + $totalarray['val']['totalam'] = 0; + $totalarray['val']['rtp'] = 0; + $with_margin_info = false; if (isModEnabled('margin') && ( From de76330aae03c7a936f46716a6bde7149c9520a4 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:39:32 +0100 Subject: [PATCH 042/117] FIX : Adding the dependencies list feature for extrafields "select" (#28549) * FIX : Adding thez dependencies list feature for select fields * FIX : Adding some spaces * FIX : View --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 449bb20dbdc41..3fd14f2ca3c45 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7326,6 +7326,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = } $out .= '
'; print ''; print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); From b870a84d8a8084a9624c79aa8d2a59a18313d7b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2024 20:19:37 +0100 Subject: [PATCH 048/117] FIX #28564 --- htdocs/mrp/class/mo.class.php | 44 ++++++++++++++++++++++++++--------- htdocs/mrp/mo_production.php | 4 ++-- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 2341f1fd406c9..e3438cad7e001 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -900,17 +900,21 @@ public function deleteLine(User $user, $idline, $notrigger = false) } $productstatic = new Product($this->db); $fk_movement = GETPOST('fk_movement', 'int'); - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); + $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consummed under the one to delete - if (!empty($arrayoflines)) { - $this->db->begin(); + $result = 0; + $this->db->begin(); + + if (!empty($arrayoflines)) { + // If there is child lines $stockmove = new MouvementStock($this->db); $stockmove->setOrigin($this->element, $this->id); if (!empty($fk_movement)) { + // The fk_movement was not recorded so we try to guess the product and quantity to restore. $moline = new MoLine($this->db); - $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement ='.$fk_movement)); + $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement = '.(int) $fk_movement)); $moline = array_shift($TArrayMoLine); $movement = new MouvementStock($this->db); @@ -929,13 +933,12 @@ public function deleteLine(User $user, $idline, $notrigger = false) } if ($idstockmove < 0) { $this->error++; - $this->db->rollback(); setEventMessages($stockmove->error, $stockmove->errors, 'errors'); } else { - $this->db->commit(); + $result = $moline->delete($user, $notrigger); } - return $moline->delete($user, $notrigger); } else { + // Loop on each child lines foreach ($arrayoflines as $key => $arrayofline) { $lineDetails = $arrayoflines[$key]; $productstatic->fetch($lineDetails['fk_product']); @@ -945,6 +948,7 @@ public function deleteLine(User $user, $idline, $notrigger = false) $labelmovementCancel = $langs->trans("CancelProductionForRef", $productstatic->ref); $codemovementCancel = $langs->trans("StockIncrease"); + if ($qtytoprocess >= 0) { $idstockmove = $stockmove->reception($user, $lineDetails['fk_product'], $lineDetails['fk_warehouse'], $qtytoprocess, 0, $labelmovementCancel, '', '', $lineDetails['batch'], dol_now(), 0, $codemovementCancel); } else { @@ -952,17 +956,35 @@ public function deleteLine(User $user, $idline, $notrigger = false) } if ($idstockmove < 0) { $this->error++; - $this->db->rollback(); setEventMessages($stockmove->error, $stockmove->errors, 'errors'); } else { - $this->db->commit(); + $moline = new MoLine($this->db); + $moline->fetch($lineDetails['rowid']); + + $resdel = $moline->delete($user, $notrigger); + if ($resdel < 0) { + $this->error++; + setEventMessages($moline->error, $moline->errors, 'errors'); + } } } - return $this->deleteLineCommon($user, $idline, $notrigger); + + if (empty($this->error)) { + $result = $this->deleteLineCommon($user, $idline, $notrigger); + } } } else { - return $this->deleteLineCommon($user, $idline, $notrigger); + // No child lines + $result = $this->deleteLineCommon($user, $idline, $notrigger); + } + + if (!empty($this->error) || $result <= 0) { + $this->db->rollback(); + } else { + $this->db->commit(); } + + return $result; } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0caba7cb77739..d28b856e6a86c 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1278,7 +1278,7 @@ // Action Edit line if ($object->status == Mo::STATUS_DRAFT) { - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id); + $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line2['rowid']); print ''; print ''; print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit'); @@ -1288,7 +1288,7 @@ // Action delete line if ($permissiontodelete) { - $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id).'&fk_movement='.((int) $line2['fk_stock_movement']); + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line2['rowid']).'&fk_movement='.((int) $line2['fk_stock_movement']); print ''; print ''; print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); From cb6c65183dd57d62160f2fd92b2ed66efdaa0ebd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 13:53:10 +0100 Subject: [PATCH 049/117] Fix bad condition on project field --- htdocs/compta/sociales/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 69a6989153639..48e8b51087700 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -102,7 +102,7 @@ 'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30), 'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40), 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), - 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled('project'))), + 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled('project'))), 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), 'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"), 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), From 717297ef295f69c627295eff4f0dfdee3b37f2e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 14:49:27 +0100 Subject: [PATCH 050/117] FIX Wrong currency shown in TakePOS payment page --- htdocs/takepos/pay.php | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index f2e58f98573ac..df498a5fec7f3 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -248,6 +248,7 @@ function fetchConnectionToken() { } } } + ?> +currency != $_SESSION["takeposcustomercurrency"]) { + //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency + $showothercurrency = 1; + include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; + $multicurrency = new MultiCurrency($db); + $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); +} +?> +
- trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> + trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $conf->currency); + if ($showothercurrency) { + print '   (' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
total_ttc) { ?>
- trans('RemainToPay'); ?>: multicurrency_code); ?> + trans('RemainToPay'); ?>: multicurrency_code); + if ($showothercurrency) { + print '   (' . price($remaintopay * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
- trans("Received"); ?>: multicurrency_code); ?> + trans("Received"); ?>: multicurrency_code); + if ($showothercurrency) { + print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
- trans("Change"); ?>: multicurrency_code); ?> + trans("Change"); ?>: multicurrency_code); + if ($showothercurrency) { + print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')'; + } + ?>
global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { From 4b2fb64b51f6329119d15013a1f9b941cf2157a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Mar 2024 18:34:40 +0100 Subject: [PATCH 051/117] css --- htdocs/fourn/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index b61ec85ab9745..bdbc1777acd17 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1273,7 +1273,7 @@ } // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { - print '
'; + print ''; $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'center search_status width100 onrightofpage', 1); print '
'.$langs->trans("Label").''; - print '
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans("Label").''.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)).'
'.$langs->trans("Label").''.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_public)).'
'; + // Title print ''; + // URL print '\n"; print ''; @@ -778,6 +786,7 @@ print '
'; print ''; print ''; +print ''; print '
\n"; print ''; @@ -797,12 +806,13 @@ print '
'; print ''; print ''; +print ''; print '
'; print '\n"; print ''; From a0b26ae7cd293306e8908ff166e41bfc2cbe07e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 21:41:55 +0100 Subject: [PATCH 103/117] FIX Amount of localtaxes in foreign currency was wrong on screen and PDF --- htdocs/comm/propal/card.php | 8 ++++++-- htdocs/comm/propal/class/propal.class.php | 2 ++ htdocs/commande/card.php | 8 ++++++-- htdocs/commande/class/commande.class.php | 2 ++ htdocs/compta/facture/card.php | 8 ++++++-- htdocs/compta/facture/class/facture.class.php | 2 ++ .../commande/doc/pdf_einstein.modules.php | 17 +++++++++++++---- .../commande/doc/pdf_eratosthene.modules.php | 17 +++++++++++++---- .../modules/facture/doc/pdf_crabe.modules.php | 19 +++++++++++++------ .../facture/doc/pdf_sponge.modules.php | 19 +++++++++++++------ .../modules/propale/doc/pdf_azur.modules.php | 19 +++++++++++++------ .../modules/propale/doc/pdf_cyan.modules.php | 19 +++++++++++++------ 12 files changed, 102 insertions(+), 38 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3e201e1f683c5..97ed893601d0f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2857,7 +2857,9 @@ print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; @@ -2866,7 +2868,9 @@ print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ec2fa41b99157..48efe44c41c5e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -272,6 +272,8 @@ class Propal extends CommonObject public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + public $multicurrency_total_localtax1; // not in database + public $multicurrency_total_localtax2; // not in database /** diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 71aefc2e7084f..bf55cdd65e2be 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2770,7 +2770,9 @@ print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; @@ -2780,7 +2782,9 @@ print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6b6037d62d556..3ab9910376c0d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -275,6 +275,8 @@ class Commande extends CommonOrder public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + public $multicurrency_total_localtax1; // not in database + public $multicurrency_total_localtax2; // not in database //! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...) public $module_source; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 43b1087d89caa..4310d34084483 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4904,7 +4904,9 @@ function setRadioForTypeOfIncoice() { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; @@ -4913,7 +4915,9 @@ function setRadioForTypeOfIncoice() { print ''; print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); + + print ''; } print ''; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cf84bbd1b44d3..405d14e39eda7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -262,6 +262,8 @@ class Facture extends CommonInvoice public $multicurrency_total_ht; public $multicurrency_total_tva; public $multicurrency_total_ttc; + public $multicurrency_total_localtax1; // not in database + public $multicurrency_total_localtax2; // not in database /** * @var int Situation cycle reference number diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3f1a62c1b2b7e..b9d4661b679b2 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -988,8 +988,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1018,8 +1020,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1079,8 +1083,11 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1112,8 +1119,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index f6f9cf79bfa93..449d29f62a83b 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1194,8 +1194,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1224,8 +1226,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1285,8 +1289,11 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1318,8 +1325,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a0b26a8b17c84..9a8e48e6f8335 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1426,8 +1426,6 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull) { // Nothing to do } else { - // FIXME amount of vat not supported with multicurrency - //Local tax 1 before VAT //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1454,8 +1452,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1485,8 +1485,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1546,8 +1548,11 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1576,8 +1581,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } //} diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 57596f3edca70..1b583bab5f427 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1689,8 +1689,6 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull) { // Nothing to do } else { - // FIXME amount of vat not supported with multicurrency - //Local tax 1 before VAT //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1717,8 +1715,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1748,8 +1748,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1833,8 +1835,11 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1866,8 +1871,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 85576e467ec97..50a5af68ad43c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1168,8 +1168,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1186,8 +1188,6 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs if ($tvakey != 0) { // On affiche pas taux 0 //$this->atleastoneratenotnull++; - - $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); @@ -1200,8 +1200,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1260,8 +1262,11 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1292,8 +1297,10 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 153a0460d8403..67e49fca891ec 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1289,8 +1289,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1307,8 +1309,6 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan if ($tvakey != 0) { // On affiche pas taux 0 //$this->atleastoneratenotnull++; - - $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); @@ -1322,8 +1322,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1377,8 +1379,11 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } @@ -1410,8 +1415,10 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $totalvat .= vatrate(abs($tvakey), 1).$tvacompl; $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $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($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); } } } From 0903b4da87bde9285b5be6d8991ee989a44d8c13 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 12:35:19 +0100 Subject: [PATCH 104/117] disable auto correct login field on smartphone --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7f4605872484e..1567392285a89 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -180,7 +180,7 @@ } ?> -" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" /> +" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 6fe5ddad2d627..4b6cd2392f2eb 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -129,7 +129,7 @@
-" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" /> +" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" />
From 1c9129497ff25e1f06eb54a5d70b713838eec5b6 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 14 Mar 2024 12:36:01 +0100 Subject: [PATCH 105/117] autocomplete on --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 1567392285a89..cbb89e80b3bf3 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -180,7 +180,7 @@ } ?> -" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" /> +" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 4b6cd2392f2eb..8d78c4fa41a1d 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -129,7 +129,7 @@
-" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autocapitalize="off" autocomplete="off" spellcheck="false" autocorrect="off" /> +" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" />
From 05a9dc5f72b8a9f45f7d817c27a468399fb0ce15 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:33:38 +0100 Subject: [PATCH 106/117] Fix: Correction for batches with letters in Takepos --- htdocs/takepos/invoice.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d0e0d179efc59..cf3e3cde9b63e 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -3,6 +3,7 @@ * Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2021 Nicolas ZABOURI * Copyright (C) 2022-2023 Christophe Battarel + * Copyright (C) 2024 Ferran Marcet * * 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 @@ -923,7 +924,7 @@ function fail($message) if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch='".$db->escape($batch)."', fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); $db->query($sql); } From 3f4033a8e22d2925519a56f07d560b4a6548df14 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:39:08 +0100 Subject: [PATCH 107/117] Fix: Correction for batches with letters in Takepos --- .../class/multicurrency.class.php | 2 - htdocs/multicurrency/multicurrency_rate.php | 38 +------------------ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 81d85b7c470c2..5433bb23f2899 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -4,7 +4,6 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2024 Ferran Marcet * * 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 @@ -914,7 +913,6 @@ public function update($trigger = true) // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql .= " SET rate = ".((float) $this->rate); - $sql .= ", rate_indirect = ".((float) $this->rate_indirect); if (!empty($this->date_sync)) { $sql .= ", date_sync = '".$this->db->idate($this->date_sync)."'"; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 40fb99eba4a40..782834bbaa534 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -10,7 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Adolfo segura * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2024 Ferran Marcet + * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2023 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ $multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $dateinput = dol_mktime(0, 0, 0, GETPOST('dateinputmonth', 'int'), GETPOST('dateinputday', 'int'), GETPOST('dateinputyear', 'int')); $rateinput = price2num(GETPOST('rateinput', 'alpha')); -$rateindirectinput = price2num(GETPOST('rateindirectinput', 'alpha')); +$rateindirectinput = price2num(GETPOST('rateinidirectinput', 'alpha')); $optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -168,7 +168,6 @@ $currencyRate->date_sync = $dateinput; $currencyRate->fk_multicurrency = $fk_currency; $currencyRate->rate = $rateinput; - $currencyRate->rate_indirect = $rateindirectinput; $res = $currencyRate->update(); if ($res) { setEventMessages($langs->trans('successUpdateRate'), null); @@ -245,7 +244,6 @@ $search_date_sync = ""; $search_date_sync_end=""; $search_rate = ""; - $search_rate_indirect = ""; $search_code = ""; $search_array_options = array(); } @@ -349,9 +347,6 @@ if ($search_rate) { $sql .= natural_search('cr.rate', $search_rate, 1); } -if ($search_rate_indirect) { - $sql .= natural_search('cr.rate_indirect', $search_rate_indirect, 1); -} if ($search_code) { $sql .= natural_search('m.code', $search_code); } @@ -413,9 +408,6 @@ if ($search_rate) { $param = "&search_rate=".urlencode($search_rate); } - if ($search_rate_indirect) { - $param = "&search_rate_indirect=".urlencode($search_rate_indirect); - } if ($search_code != '') { $param.="&search_code=".urlencode($search_code); } @@ -510,12 +502,6 @@ print ''; print ''; } - // rate indirect - if (!empty($arrayfields['cr.rate_indirect']['checked'])) { - print '
'; - } // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -545,9 +531,6 @@ if (!empty($arrayfields['cr.rate']['checked'])) { print_liste_field_titre($arrayfields['cr.rate']['label'], $_SERVER["PHP_SELF"], "cr.rate", "", $param, "", $sortfield, $sortorder); } - if (!empty($arrayfields['cr.rate_indirect']['checked'])) { - print_liste_field_titre($arrayfields['cr.rate_indirect']['label'], $_SERVER["PHP_SELF"], "cr.rate_indirect", "", $param, "", $sortfield, $sortorder); - } // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); @@ -576,23 +559,6 @@ print ''; print ''; - // LRR Calculate Rate Direct - print ''; - print ''; print ''; - print ''; print ''; print '' . "\n"; + print '' . "\n"; // Lastname print '
'; if ($action == 'edit') { print ''; @@ -247,6 +248,7 @@ } print '
'; if ($action == 'edit') { print ''; @@ -255,7 +257,7 @@ if ($action == 'edit') { print ''; } - print ''; + print ''; if ($action == 'edit') { print 'url).'">'; } else { From 453eb9c242c3f75d96e1cadc0cfa4f70345f3317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Mar 2024 15:42:38 +0100 Subject: [PATCH 091/117] FIX: upload odt files should not start/end with space --- htdocs/admin/facture.php | 2 ++ htdocs/core/lib/files.lib.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 3384a0d31d685..19f1182e608d9 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -50,6 +50,8 @@ $scandir = GETPOST('scan_dir', 'alpha'); $type = 'invoice'; +$error = 0; + /* * Actions diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7152e2778bb4d..b170c4fc177cf 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1777,6 +1777,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess // var_dump($result);exit; if ($result >= 0) { $TFile = $_FILES[$varfiles]; + // Convert value of $TFile if (!is_array($TFile['name'])) { foreach ($TFile as $key => &$val) { $val = array($val); @@ -1791,13 +1792,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess } // Define $destfull (path to file including filename) and $destfile (only filename) - $destfull = $upload_dir."/".$TFile['name'][$i]; - $destfile = $TFile['name'][$i]; + $destfile = trim($TFile['name'][$i]); + $destfull = $upload_dir."/".$destfile; $destfilewithoutext = preg_replace('/\.[^\.]+$/', '', $destfile); if ($savingdocmask && strpos($savingdocmask, $destfilewithoutext) !== 0) { - $destfull = $upload_dir."/".preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); - $destfile = preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); + $destfile = trim(preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask)); + $destfull = $upload_dir."/".$destfile; } $filenameto = basename($destfile); @@ -1806,7 +1807,6 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess setEventMessages($langs->trans("ErrorFilenameCantStartWithDot", $filenameto), null, 'errors'); break; } - // dol_sanitizeFileName the file name and lowercase extension $info = pathinfo($destfull); $destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].($info['extension'] != '' ? ('.'.strtolower($info['extension'])) : '')); From 1431582b82c91c480662a6a7abebd4733006621d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2024 10:10:17 +0100 Subject: [PATCH 092/117] Fix cursor --- htdocs/admin/tools/dolibarr_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 3c70bdc74aa54..749674956c095 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -203,7 +203,7 @@ function hideoptions () { print ''; print '
'; -print img_picto('', 'setup', 'class="pictofixedwidth"').''.$langs->trans("ShowAdvancedOptions").'...'; +print img_picto('', 'setup', 'class="pictofixedwidth"').''.$langs->trans("ShowAdvancedOptions").'...'; print '
'; print ''; + print '
'; + } + print ''; print ''; print ''; From b9ed346711072c479607050e8c742751145d414d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2024 15:54:15 +0100 Subject: [PATCH 102/117] FIX edit bank suggested for credit transfer payment in invoice setup when bank is closed. --- htdocs/admin/facture.php | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 19f1182e608d9..7bf83eb4a9c29 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -618,13 +618,14 @@ print '
'; print ''; print ''; + print ''; print '
'; print ''; print ''; print ''; print ''; - print ''; + print ''; print "\n"; $listtype = array( @@ -660,6 +661,7 @@ print ''; print ''; +print ''; print '
'; print '
'.$langs->trans("Type").''.$langs->trans("Name").'
'; @@ -668,17 +670,16 @@ print ''; -print ''; +print ''; print "\n"; print ''; print ""; print ""; print "
'; print ''; print $langs->trans("PaymentMode").'
".$langs->trans("SuggestPaymentByRIBOnAccount").""; if (isModEnabled('banque')) { - $sql = "SELECT rowid, label"; + $sql = "SELECT rowid, label, clos"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; - $sql .= " WHERE clos = 0"; - $sql .= " AND courant = 1"; + $sql .= " WHERE courant = 1"; $sql .= " AND entity IN (".getEntity('bank_account').")"; $resql = $db->query($sql); if ($resql) { @@ -688,15 +689,19 @@ print '"; + print ajax_combobox("rib"); } else { print ''.$langs->trans("NoActiveBankAccountDefined").''; } @@ -736,6 +741,8 @@ } } print ""; +print ajax_combobox("chq", array(), 0, 0, 'resolve', -2); + print "
"; print '
'; @@ -758,12 +765,13 @@ print ''; print ''; print ''; +print ''; print '
'; print $langs->trans("ForceInvoiceDate"); print ''; print $form->selectyesno("forcedate", getDolGlobalInt('FAC_FORCE_DATE_VALIDATION', 0), 1); print ''; -print ''; +print ''; print "
'; print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; $variablename = 'INVOICE_FREE_TEXT'; @@ -789,7 +798,7 @@ print $doleditor->Create(); } print '
'; -print ''; +print ''; print "
'; print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print '
'; print ''; -print ''; +print ''; print "
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '
'; - print ''; - print '' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; - if (getDolGlobalString('MULTICURRENCY_USE_RATE_INDIRECT')) { - print ''; - } - print ''; print ''; print ''; From 7fddff930225e9ca90753967fa76effce2887850 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:40:14 +0100 Subject: [PATCH 108/117] Fix: Correction for batches with letters in Takepos --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- htdocs/multicurrency/multicurrency_rate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 5433bb23f2899..a7ef2153c9f6a 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -912,7 +912,7 @@ public function update($trigger = true) // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " SET rate = ".((float) $this->rate); + $sql .= "SET rate = ".((float) $this->rate); if (!empty($this->date_sync)) { $sql .= ", date_sync = '".$this->db->idate($this->date_sync)."'"; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 782834bbaa534..947c5ac3a2ba1 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -557,7 +557,7 @@ } print '' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; + print ''; print ''; print ''; From 54bdad710d1b074fe0fd3c0abe2a0748403f33a2 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:40:54 +0100 Subject: [PATCH 109/117] Fix: Correction for batches with letters in Takepos --- htdocs/multicurrency/multicurrency_rate.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 947c5ac3a2ba1..94c0438f71e80 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -558,7 +558,6 @@ print '' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; - print ''; print ''; print ''; From 9430bebbb1ddf25da9fccc7e175e0c29f263a146 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 14 Mar 2024 16:44:07 +0100 Subject: [PATCH 110/117] Fix: Correction so that warehouse does not have to be indicated if it is a service --- htdocs/expedition/class/expedition.class.php | 4 ++-- htdocs/takepos/invoice.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 9588e8c985269..0ec2cf6aa77d1 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2014-2017 Francis Appels * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2016-2022 Ferran Marcet + * Copyright (C) 2016-2024 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2020 Lenin Rivas @@ -920,7 +920,7 @@ public function addline($entrepot_id, $id, $qty, $array_options = 0) if (isModEnabled('stock') && !empty($orderline->fk_product)) { $fk_product = $orderline->fk_product; - if (!($entrepot_id > 0) && !getDolGlobalString('STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS')) { + if (!($entrepot_id > 0) && !getDolGlobalString('STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS') && !(getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES') && $line->product_type == Product::TYPE_SERVICE)) { $langs->load("errors"); $this->error = $langs->trans("ErrorWarehouseRequiredIntoShipmentLine"); return -1; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index cf3e3cde9b63e..d0e0d179efc59 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -3,7 +3,6 @@ * Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2021 Nicolas ZABOURI * Copyright (C) 2022-2023 Christophe Battarel - * Copyright (C) 2024 Ferran Marcet * * 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 @@ -924,7 +923,7 @@ function fail($message) if ($action=="setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch='".$db->escape($batch)."', fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); $db->query($sql); } From 16e5d08b36a2ae8539927a6aac2136323b0a47b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 23:39:16 +0100 Subject: [PATCH 111/117] FIX #yogosha21416 --- htdocs/societe/class/api_thirdparties.class.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index d01c109e8fbd0..849b507e517ad 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2018 Pierre Chéné - * Copyright (C) 2019 Cedric Ancelin - * Copyright (C) 2020-2021 Frédéric France - * Copyright (C) 2023 Alexandre Janniaux +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Pierre Chéné + * Copyright (C) 2019 Cedric Ancelin + * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2023 Alexandre Janniaux + * 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 @@ -48,7 +49,7 @@ class Thirdparties extends DolibarrApi */ public function __construct() { - global $db, $conf; + global $db; $this->db = $db; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; @@ -269,7 +270,7 @@ public function post($request_data = null) continue; } - $this->company->$field = $value; + $this->company->$field = $this->_checkValForAPI($field, $value, $this->company); } if ($this->company->create(DolibarrApiAccess::$user) < 0) { @@ -314,7 +315,7 @@ public function put($id, $request_data = null) continue; } - $this->company->$field = $value; + $this->company->$field = $this->_checkValForAPI($field, $value, $this->company); } if (isModEnabled('mailing') && !empty($this->company->email) && isset($this->company->no_email)) { From 7ecf1ac0824070a064ddc9f69a9b8f90f3cf603e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2024 23:43:25 +0100 Subject: [PATCH 112/117] Merge --- htdocs/core/modules/workstation/mod_workstation_standard.php | 0 htdocs/core/modules/workstation/modules_workstation.php | 0 htdocs/workstation/lib/workstation_workstation.lib.php | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 htdocs/core/modules/workstation/mod_workstation_standard.php mode change 100755 => 100644 htdocs/core/modules/workstation/modules_workstation.php mode change 100755 => 100644 htdocs/workstation/lib/workstation_workstation.lib.php diff --git a/htdocs/core/modules/workstation/mod_workstation_standard.php b/htdocs/core/modules/workstation/mod_workstation_standard.php old mode 100755 new mode 100644 diff --git a/htdocs/core/modules/workstation/modules_workstation.php b/htdocs/core/modules/workstation/modules_workstation.php old mode 100755 new mode 100644 diff --git a/htdocs/workstation/lib/workstation_workstation.lib.php b/htdocs/workstation/lib/workstation_workstation.lib.php old mode 100755 new mode 100644 From b1a880626c32f31bdfda3a4b31534c9965e90584 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Mar 2024 14:23:16 +0100 Subject: [PATCH 113/117] Look and feel v19 --- htdocs/public/eventorganization/attendee_new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 8cc4f573e38a1..a2175e26ae34f 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -803,7 +803,7 @@ function llxFooterVierge() // Firstname print '
' . $langs->trans("Firstname") . ''; - print '
' . $langs->trans("Lastname") . ''; From 4ee4d1678f422c7db25acfb1bcdc63cd35e3d493 Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano Date: Sat, 16 Mar 2024 16:59:31 +0000 Subject: [PATCH 114/117] fix #28892 change default table ref on modulebuilder new dictionaries --- htdocs/core/lib/modulebuilder.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 032f5fbb69606..fe584f278b8c0 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -1259,7 +1259,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul $dictionnaires['langs'] = $modulename.'@'.$modulename; $dictionnaires['tabname'][] = strtolower($namedic); $dictionnaires['tablib'][] = ucfirst(substr($namedic, 2)); - $dictionnaires['tabsql'][] = 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.strtolower($namedic).' as f'; + $dictionnaires['tabsql'][] = 'SELECT t.rowid as rowid, t.code, t.label, t.active FROM '.MAIN_DB_PREFIX.strtolower($namedic).' as t'; $dictionnaires['tabsqlsort'][] = (array_key_exists('label', $columns) ? 'label ASC' : ''); $dictionnaires['tabfield'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); $dictionnaires['tabfieldvalue'][] = (array_key_exists('code', $columns) && array_key_exists('label', $columns) ? 'code,label' : ''); From 7b8cbf0e5eeafc3a6641b5a1f00680cb9343b02e Mon Sep 17 00:00:00 2001 From: ksar Date: Sat, 16 Mar 2024 22:52:17 +0100 Subject: [PATCH 115/117] UPDATE: Doliwamp to PHP V7.4 UPDATE Doliwamp to PHP V7.4. Warning : You need to update the Micrsoft Visual C++ Redistributable for Visual Studio from 2015 to at least 2017 --- build/exe/doliwamp/Languages/MyCatalan.isl | 2 +- build/exe/doliwamp/Languages/MyEnglish.isl | 2 +- build/exe/doliwamp/Languages/MyFrench.isl | 54 +++++++++++----------- build/exe/doliwamp/Languages/MyGerman.isl | 2 +- build/exe/doliwamp/Languages/MySpanish.isl | 2 +- build/exe/doliwamp/doliwamp.iss | 8 ++-- build/makepack-howto.txt | 3 +- 7 files changed, 37 insertions(+), 36 deletions(-) diff --git a/build/exe/doliwamp/Languages/MyCatalan.isl b/build/exe/doliwamp/Languages/MyCatalan.isl index cb1066b5f91ef..c2f8ad5791d8d 100644 --- a/build/exe/doliwamp/Languages/MyCatalan.isl +++ b/build/exe/doliwamp/Languages/MyCatalan.isl @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reini OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr -DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp. +DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2017". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp. ContinueAnyway=Continua igualment (el procés d'instal·lació podria fallar sense aquest prerequisit) diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl index 2a6c8b9a4baea..566d4410334c2 100644 --- a/build/exe/doliwamp/Languages/MyEnglish.isl +++ b/build/exe/doliwamp/Languages/MyEnglish.isl @@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=DoliWamp installer will now start or restart Apache OldVersionFoundAndMoveInNew=An old database version has been found and moved to be used by the new Dolibarr version OldVersionFoundButFailedToMoveInNew=An old database version has been found but could not be moved to be used with the new Dolibarr version -DLLMissing=Your Windows installation is missing The "Microsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. +DLLMissing=Your Windows installation is missing The "Microsoft Visual C++ Redistributable for Visual Studio 2017" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170) and restart DoliWamp installation/upgrade after. ContinueAnyway=Continue anyway (install process may fail without this prerequisite) diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl index 6c6294fb7c415..ca38aa599e370 100644 --- a/build/exe/doliwamp/Languages/MyFrench.isl +++ b/build/exe/doliwamp/Languages/MyFrench.isl @@ -2,47 +2,47 @@ [CustomMessages] NameAndVersion=%1 version %2 -AdditionalIcons=Icônes supplémentaires : -CreateDesktopIcon=Créer une icône sur le &Bureau -CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide +AdditionalIcons=Icônes supplémentaires : +CreateDesktopIcon=Créer une icône sur le &Bureau +CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide ProgramOnTheWeb=Page d'accueil de %1 -UninstallProgram=Désinstaller %1 -LaunchProgram=Exécuter %1 +UninstallProgram=Désinstaller %1 +LaunchProgram=Exécuter %1 AssocFileExtension=&Associer %1 avec l'extension de fichier %2 AssocingFileExtension=Associe %1 avec l'extension de fichier %2... -YouWillInstallDoliWamp=Vous allez installer DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). -ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). -IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. -ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... -DoYouWantToStart=Voulez-vous démarrer le processus d'installation ? +YouWillInstallDoliWamp=Vous allez installer DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). +ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. +ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... +DoYouWantToStart=Voulez-vous démarrer le processus d'installation ? -TechnicalParameters=Paramètres techniques -IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. +TechnicalParameters=Paramètres techniques +IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. ; WARNING !!! STRINGS FOR THIS 4 STRINGS MUST BE LOWER THAN 70 CHARACTERS -SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): -ApachePort=Port Apache (première installation uniquement, le choix standard est 80): -MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): -MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): +SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): +ApachePort=Port Apache (première installation uniquement, le choix standard est 80): +MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): +MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): -FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... +FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... -PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? +PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? -FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? -ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? -ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : +FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : LaunchNow=Lancer Dolibarr maintenant -ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. +ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. -DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? +DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? -OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. -OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. +OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. +OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. -DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2015". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. -ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) +DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2017". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. +ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) diff --git a/build/exe/doliwamp/Languages/MyGerman.isl b/build/exe/doliwamp/Languages/MyGerman.isl index 132260b7273c1..7d7fa1662a8bf 100644 --- a/build/exe/doliwamp/Languages/MyGerman.isl +++ b/build/exe/doliwamp/Languages/MyGerman.isl @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=Die DoliWamp-Installation wird nun starten oder Apa OldVersionFoundAndMoveInNew=Eine alte Datenbankversion wurde gefunden und verschoben, um von der neuen Dolibarr-Version verwendet zu werden. OldVersionFoundButFailedToMoveInNew=Eine alte Datenbankversion wurde gefunden, konnte jedoch nicht verschoben werden, um mit der neuen Dolibarr-Version verwendet zu werden. -DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. +DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2017" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. ContinueAnyway=Fahren Sie trotzdem fort (der Installationsvorgang kann ohne diese Voraussetzung fehlschlagen). diff --git a/build/exe/doliwamp/Languages/MySpanish.isl b/build/exe/doliwamp/Languages/MySpanish.isl index 6880a9263e123..4500e7766722b 100644 --- a/build/exe/doliwamp/Languages/MySpanish.isl +++ b/build/exe/doliwamp/Languages/MySpanish.isl @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reinici OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr -DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp. +DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2017". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp. ContinueAnyway=Continua igualmente (el proceso de instalación podría fallar sin este prerequisito) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index beeec222c2a3a..1a14058de68e7 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -100,9 +100,9 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi ; Apache, Php, Mysql ; Put here path of Wampserver applications -; Value OK: apache 2.4.51, php 7.3.33, mariadb10.6.5 (wampserver3.2.6_x64.exe) +; Value OK: apache 2.4.51, php 7.4.26, mariadb10.6.5 (wampserver3.2.6_x64.exe) Source: "C:\wamp64\bin\apache\apache2.4.51\*.*"; DestDir: "{app}\bin\apache\apache2.4.51"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" -Source: "C:\wamp64\bin\php\php7.3.33\*.*"; DestDir: "{app}\bin\php\php7.3.33"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log" +Source: "C:\wamp64\bin\php\php7.4.26\*.*"; DestDir: "{app}\bin\php\php7.4.26"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log" Source: "C:\wamp64\bin\mariadb\mariadb10.6.5\*.*"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; Flags: ignoreversion recursesubdirs; Excludes: "my.ini,data\*,wampserver.conf,*.log,*_log,MySQLInstanceConfig.exe" ; Mysql data files (does not overwrite if exists) @@ -121,7 +121,7 @@ Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flag Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.51\conf"; Flags: ignoreversion; Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.0.45"; Flags: ignoreversion; Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mariadb\mariadb10.6.5"; Flags: ignoreversion; -Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.3.33"; Flags: ignoreversion; +Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php7.4.26"; Flags: ignoreversion; Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion; Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion; Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion; @@ -228,7 +228,7 @@ begin //version des applis, a modifier pour chaque version de WampServer 2 apacheVersion := '2.4.51'; - phpVersion := '7.3.33' ; + phpVersion := '7.4.26' ; mysqlVersion := '10.6.5'; smtpServer := 'localhost'; diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index ca228f804d026..4a1059bb47da7 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -29,12 +29,13 @@ Prerequisites to build autoexe DoliWamp package from Windows: > Install Perl for Windows (https://strawberryperl.com/) > Install isetup-5.5.8.exe (https://www.jrsoftware.org) +> Install Microsoft Visual C++ Redistributable 2017 (https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170) > Install WampServer-3.2.*-64.exe (Apache 2.4.51, PHP 7.3.33, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss) > Install GIT for Windows (https://git-scm.com/ => You must choose option "Add Git bash profile", "Git commit as-is") > Install Dolibarr current version: git clone https://github.com/dolibarr/dolibarr or git clone --branch X.Y https://github.com/dolibarr/dolibarr -> Add the path of PHP (C:\wamp64\bin\php\php7.3.33) and InnoSetup (C:\Program Files (x86)\Inno Setup 5) into the %PATH% of Windows. +> Add the path of PHP (C:\wamp64\bin\php\php7.4.26) and InnoSetup (C:\Program Files (x86)\Inno Setup 5) into the %PATH% of Windows. > Create a config file c:\dolibarr\dolibarr\htdocs\conf\conf.php with content Date: Sat, 16 Mar 2024 23:02:39 +0100 Subject: [PATCH 116/117] Update makepack-howto.txt --- build/makepack-howto.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 4a1059bb47da7..6a9543b5a8857 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -30,7 +30,7 @@ Prerequisites to build autoexe DoliWamp package from Windows: > Install Perl for Windows (https://strawberryperl.com/) > Install isetup-5.5.8.exe (https://www.jrsoftware.org) > Install Microsoft Visual C++ Redistributable 2017 (https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170) -> Install WampServer-3.2.*-64.exe (Apache 2.4.51, PHP 7.3.33, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss) +> Install WampServer-3.2.6-64.exe (Apache 2.4.51, PHP 7.4.26, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss) > Install GIT for Windows (https://git-scm.com/ => You must choose option "Add Git bash profile", "Git commit as-is") > Install Dolibarr current version: git clone https://github.com/dolibarr/dolibarr or git clone --branch X.Y https://github.com/dolibarr/dolibarr From 45d56dffd284f80de1f14466051a2ee14bdd7132 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Mar 2024 00:29:24 +0100 Subject: [PATCH 117/117] Make v19.0.1 --- ChangeLog | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb3afe1e22edc..b31afcad98160 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,9 +6,11 @@ English Dolibarr ChangeLog ***** ChangeLog for 19.0.1 compared to 19.0.0 ***** FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269) +FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684) FIX: #22948 +FIX: #24265 regression cannot see all product on takepos (#28753) FIX: #28205 -FIX: 28251 Fixing subpermission name on api_multicurrencies.class.php (#28252) +FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252) FIX: #28369 FIX: #28429 FIX: #28491 (#28522) @@ -17,6 +19,8 @@ FIX: #28533 Mo::deleteLine removes the "main" MoLine if consumed line is delete FIX: #28564 FIX: Adding the dependencies list feature for extrafields "select" (#28549) FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523) +FIX: Amount of localtaxes in foreign currency was wrong on screen and PDF +FIX: an error in a complex else condition FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270) FIX: avoid Unknown column 'pfp.ref_fourn' (#28145) FIX: avoid warning "error parsing attribute name in Entity" (#28543) @@ -24,30 +28,44 @@ FIX: Bad column for total in bom list FIX: Bad condition on button back to draft on recruitment job. FIX: Bad CRLF when sending text only content. Fix dol_htmlwithnojs() FIX: Bad picto on list of permission of a user when user not admin -FIX: bad timezone for the start/end date of an event +FIX: bad timzeone for the start/end date of an event FIX: Better test on validity of compute field syntax with parenthesis FIX: close #28279 +FIX: Count of virtual stock at Services and MoLine with disabled stock change (#28580) FIX: disabled pito of menu must be greyed. FIX: Don't display column when it's out of date (#28271) FIX: duplicate with lines: 414-416 (#28358) +FIX: edit bank suggested for credit transfer payment in invoice setup FIX: Error When cloning fourn price no default value for tva_tx (#28368) +FIX: fatal error Unsupported operand types when recording load payment +FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfert is allowed (#26217) FIX: migration missing 2 columns in llx_resource and 1 in llx_user FIX: missing trans FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216) -FIX: Not truncate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211) +FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211) +FIX: Option MAIN_DOC_USE_TIMING can be a string with date format FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156) FIX: Pb in redirect of a website page in USEDOLIBARRSERVER mode +FIX: permission on payment file of a tax FIX: PHP Warning: Undefined variable $lib (#28342) +FIX: PHP Warning: Undefined variable $mode (#28697) FIX: Picto for mime +FIX: Picto in top menu FIX: position of field in list of field in shipment list FIX: postgresql error (#28542) FIX: quote in sql request FIX: Responsive on admin project FIX: Shipment closing action has wrong value (#28174) +FIX: skip adding tab if user doesn't have permission (#28698) FIX: some tooltips has disappeared on invoice action button FIX: Special code is now transmitted by args only in order supplier (#28546) +FIX: Special code is now transmitted by args only in order supplier (#28619) FIX: subscription must be editable when accounting isn't reconciled (#28469) -FIX: Value of field int = 0 from modulebuilder must not be set to null +FIX: Translation for select (#28677) +FIX: upload odt files should not start/end with space +FIX: Value of field int = 0 from modulebuilder must nto be set to null +FIX: Wrong currency shown in TakePOS payment page +FIX: #yogosha21416 ***** ChangeLog for 19.0.0 compared to 18.0.0 *****