From da196b868c376070e9bec899715ec82b9d64e0b7 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 2 Aug 2022 10:49:34 +0200 Subject: [PATCH 01/24] NEW : conf TIMESPENT_ALWAYS_UPDATE_THM, when it's on we always check current thm of user to update it in task time line --- htdocs/projet/class/task.class.php | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index d9ad1111fc7..70f8d998f4b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1724,26 +1724,32 @@ class Task extends CommonObjectLine $ret = -1; } - if ($ret == 1 && ($this->timespent_old_duration != $this->timespent_duration)) { - // Recalculate amount of time spent for task and update denormalized field - $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; - $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".((int) $this->id).")"; - if (isset($this->progress)) { - $sql .= ", progress = ".((float) $this->progress); // Do not overwrite value if not provided - } - $sql .= " WHERE rowid = ".((int) $this->id); + if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM))) { - dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); - if (!$this->db->query($sql)) { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - $ret = -2; + if($this->timespent_old_duration != $this->timespent_duration) { + // Recalculate amount of time spent for task and update denormalized field + $sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task"; + $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM " . MAIN_DB_PREFIX . "projet_task_time as ptt where ptt.fk_task = " . ((int)$this->id) . ")"; + if (isset($this->progress)) { + $sql .= ", progress = " . ((float)$this->progress); // Do not overwrite value if not provided + } + $sql .= " WHERE rowid = " . ((int)$this->id); + + dol_syslog(get_class($this) . "::updateTimeSpent", LOG_DEBUG); + if (!$this->db->query($sql)) { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + $ret = -2; + } } // Update hourly rate of this time spent entry, but only if it was not set initialy $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql .= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $this->timespent_fk_user).")"; // set average hour rate of user - $sql .= " WHERE (thm IS NULL OR thm = 0) AND rowid = ".((int) $this->timespent_id); + $sql .= " WHERE rowid = ".((int) $this->timespent_id); + if(empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { // then if not empty we always update, in case of new thm for user, or change user of task time line + $sql .= " AND (thm IS NULL OR thm = 0)"; + } dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG); if (!$this->db->query($sql)) { From e7242788b9690f2718b046f4e6f8ecdd80c34dad Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 2 Aug 2022 09:00:15 +0000 Subject: [PATCH 02/24] Fixing style errors. --- htdocs/projet/class/task.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 70f8d998f4b..52dd2aae311 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1725,15 +1725,14 @@ class Task extends CommonObjectLine } if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM))) { - - if($this->timespent_old_duration != $this->timespent_duration) { + if ($this->timespent_old_duration != $this->timespent_duration) { // Recalculate amount of time spent for task and update denormalized field $sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task"; - $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM " . MAIN_DB_PREFIX . "projet_task_time as ptt where ptt.fk_task = " . ((int)$this->id) . ")"; + $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM " . MAIN_DB_PREFIX . "projet_task_time as ptt where ptt.fk_task = " . ((int) $this->id) . ")"; if (isset($this->progress)) { - $sql .= ", progress = " . ((float)$this->progress); // Do not overwrite value if not provided + $sql .= ", progress = " . ((float) $this->progress); // Do not overwrite value if not provided } - $sql .= " WHERE rowid = " . ((int)$this->id); + $sql .= " WHERE rowid = " . ((int) $this->id); dol_syslog(get_class($this) . "::updateTimeSpent", LOG_DEBUG); if (!$this->db->query($sql)) { @@ -1747,7 +1746,7 @@ class Task extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql .= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $this->timespent_fk_user).")"; // set average hour rate of user $sql .= " WHERE rowid = ".((int) $this->timespent_id); - if(empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { // then if not empty we always update, in case of new thm for user, or change user of task time line + if (empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { // then if not empty we always update, in case of new thm for user, or change user of task time line $sql .= " AND (thm IS NULL OR thm = 0)"; } From 0898a99314c54b850276e02cea2541768d9b18b9 Mon Sep 17 00:00:00 2001 From: Faustin Date: Fri, 12 Aug 2022 11:00:02 +0200 Subject: [PATCH 03/24] Token now refresh before it expire --- htdocs/core/class/CMailFile.class.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 79291aacdf0..efc3c940862 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -885,6 +885,30 @@ class CMailFile $storage = new DoliStorage($db, $conf); try { + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + $expire = true; + // Is token expired or will token expire in the next 30 seconds + if (is_object($tokenobj)) { + $expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30)); + } + // Token expired so we refresh it + if (is_object($tokenobj) && $expire) { + $credentials = new Credentials( + getDolGlobalString('OAUTH_'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'_ID'), + getDolGlobalString('OAUTH_'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'_SECRET'), + getDolGlobalString('OAUTH_'.getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE').'_URLAUTHORIZE') + ); + $serviceFactory = new \OAuth\ServiceFactory(); + $oauthname = explode('-', $OAUTH_SERVICENAME); + // ex service is Google-Emails we need only the first part Google + $apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array()); + // We have to save the token because Google give it only once + $refreshtoken = $tokenobj->getRefreshToken(); + $tokenobj = $apiService->refreshAccessToken($tokenobj); + $tokenobj->setRefreshToken($refreshtoken); + $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); + } + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); if (is_object($tokenobj)) { $this->smtps->setToken($tokenobj->getAccessToken()); @@ -1001,7 +1025,7 @@ class CMailFile $oauthname = explode('-', $OAUTH_SERVICENAME); // ex service is Google-Emails we need only the first part Google $apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array()); - // il faut sauvegarder le refresh token car google ne le donne qu'une seule fois + // We have to save the token because Google give it only once $refreshtoken = $tokenobj->getRefreshToken(); $tokenobj = $apiService->refreshAccessToken($tokenobj); $tokenobj->setRefreshToken($refreshtoken); From 6dd17ead60219242d1ccfc39b65c59faa35d6b91 Mon Sep 17 00:00:00 2001 From: Faustin Date: Fri, 12 Aug 2022 11:42:23 +0200 Subject: [PATCH 04/24] expire was initiated as true instead of false --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index efc3c940862..d9a21fdb71e 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -886,7 +886,7 @@ class CMailFile $storage = new DoliStorage($db, $conf); try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); - $expire = true; + $expire = false; // Is token expired or will token expire in the next 30 seconds if (is_object($tokenobj)) { $expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30)); From 84ad951c4cb90c702db6ae431dfcf17bc060bf02 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 12 Aug 2022 15:12:35 +0200 Subject: [PATCH 05/24] Update and rename dev/resources/iso-normes/world_tax_rates.txt to dev/resources/iso-normes/tax/world_tax_rates.txt check websites move to /tax/ --- dev/resources/iso-normes/tax/world_tax_rates.txt | 10 ++++++++++ dev/resources/iso-normes/world_tax_rates.txt | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 dev/resources/iso-normes/tax/world_tax_rates.txt delete mode 100644 dev/resources/iso-normes/world_tax_rates.txt diff --git a/dev/resources/iso-normes/tax/world_tax_rates.txt b/dev/resources/iso-normes/tax/world_tax_rates.txt new file mode 100644 index 00000000000..0b3bc3f41e5 --- /dev/null +++ b/dev/resources/iso-normes/tax/world_tax_rates.txt @@ -0,0 +1,10 @@ +VAT Rates +--------- + +https://www.taxrates.cc/index.html +https://en.wikipedia.org/wiki/List_of_countries_by_tax_rates + +For India: VAT=IGST / CGST=Localtax1 / SGST=Localtax2 +see: + https://cleartax.in/s/what-is-sgst-cgst-igst + https://www.mastersindia.co/blog/what-is-cgst-sgst-igst-and-ugst/ diff --git a/dev/resources/iso-normes/world_tax_rates.txt b/dev/resources/iso-normes/world_tax_rates.txt deleted file mode 100644 index 508446b618a..00000000000 --- a/dev/resources/iso-normes/world_tax_rates.txt +++ /dev/null @@ -1,8 +0,0 @@ -VAT Rates ---------- - -http://www.taxrates.cc/index.html -https://en.wikipedia.org/wiki/List_of_countries_by_tax_rates - -For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst - From 7eec4b6e0dec28cb8b753a3e70be652f49b817f0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 12 Aug 2022 15:17:43 +0200 Subject: [PATCH 06/24] Update and rename dev/resources/iso-normes/vat_number_names.txt to dev/resources/iso-normes/tax/vat_number_names.txt add [de] label names add [it] IVA move to /tax/ --- dev/resources/iso-normes/{ => tax}/vat_number_names.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename dev/resources/iso-normes/{ => tax}/vat_number_names.txt (71%) diff --git a/dev/resources/iso-normes/vat_number_names.txt b/dev/resources/iso-normes/tax/vat_number_names.txt similarity index 71% rename from dev/resources/iso-normes/vat_number_names.txt rename to dev/resources/iso-normes/tax/vat_number_names.txt index b1e8d469ec8..77adda72e0d 100644 --- a/dev/resources/iso-normes/vat_number_names.txt +++ b/dev/resources/iso-normes/tax/vat_number_names.txt @@ -4,4 +4,5 @@ terms (en) VAT = Value Added Tax (fr) TVA = Taxe sur la Valeur Ajouté (es) NIF / CIF -(de) USt / MwSt +(de) USt / MwSt = UmsatzSteuer / Mehrwertsteuer +(it) IVA From 0066dfd87cac75756014b9e2eac0aa7a690066ea Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Fri, 12 Aug 2022 17:23:41 +0200 Subject: [PATCH 07/24] Fix : improve date library --- htdocs/core/lib/date.lib.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index fe21071901a..addf05883c7 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -182,7 +182,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) */ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0) { - $iResult = ($iHours * 3600) + ($iMinutes * 60) + $iSeconds; + $iResult = ((int)$iHours * 3600) + ((int)$iMinutes * 60) + (int)$iSeconds; return $iResult; } @@ -218,6 +218,7 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l if (empty($lengthOfWeek)) { $lengthOfWeek = 7; // 1 week = 7 days } + $nbHbyDay = $lengthOfDay / 3600; if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin' || $format == 'allhourminsec') { if ((int) $iSecond === 0) { @@ -265,11 +266,11 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l $sTime .= dol_print_date($iSecond, 'hourduration', true); } } elseif ($format == 'allhourminsec') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * 24 + $sDay * 24 + (int) floor($iSecond / 3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))).':'.sprintf("%02d", ((int) ($iSecond % 60))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))).':'.sprintf("%02d", ((int) ($iSecond % 60))); } elseif ($format == 'allhourmin') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * 24 + $sDay * 24 + (int) floor($iSecond / 3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600)/60))); } elseif ($format == 'allhour') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * 24 + $sDay * 24 + (int) floor($iSecond / 3600))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))); } } elseif ($format == 'hour') { // only hour part $sTime = dol_print_date($iSecond, '%H', true); @@ -855,6 +856,15 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', } // Fronleichnam } + + if (in_array('genevafast', $specialdayrule)) { + // Geneva fast in Switzerland (Thursday after the first sunday in September) + $date_1sunsept = strtotime('next thursday', strtotime('next sunday', mktime(0, 0, 0, 9, 1, $annee))); + $jour_1sunsept = date("d", $date_1sunsept); + $mois_1sunsept = date("m", $date_1sunsept); + if($jour_1sunsept == $jour && $mois_1sunsept == $mois) $ferie=true; + // Geneva fast in Switzerland + } } //print "ferie=".$ferie."\n"; From f61000f0c7146272c1548a574b594ffbfca52f36 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 12 Aug 2022 15:25:15 +0000 Subject: [PATCH 08/24] Fixing style errors. --- htdocs/core/lib/date.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index addf05883c7..490ac779a44 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -182,7 +182,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) */ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0) { - $iResult = ((int)$iHours * 3600) + ((int)$iMinutes * 60) + (int)$iSeconds; + $iResult = ((int) $iHours * 3600) + ((int) $iMinutes * 60) + (int) $iSeconds; return $iResult; } @@ -266,9 +266,9 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l $sTime .= dol_print_date($iSecond, 'hourduration', true); } } elseif ($format == 'allhourminsec') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))).':'.sprintf("%02d", ((int) ($iSecond % 60))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600) / 60))).':'.sprintf("%02d", ((int) ($iSecond % 60))); } elseif ($format == 'allhourmin') { - return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600)/60))); + return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))).':'.sprintf("%02d", ((int) floor(($iSecond % 3600)/60))); } elseif ($format == 'allhour') { return sprintf("%02d", ($sWeek * $lengthOfWeek * $nbHbyDay + $sDay * $nbHbyDay + (int) floor($iSecond/3600))); } @@ -862,7 +862,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $date_1sunsept = strtotime('next thursday', strtotime('next sunday', mktime(0, 0, 0, 9, 1, $annee))); $jour_1sunsept = date("d", $date_1sunsept); $mois_1sunsept = date("m", $date_1sunsept); - if($jour_1sunsept == $jour && $mois_1sunsept == $mois) $ferie=true; + if ($jour_1sunsept == $jour && $mois_1sunsept == $mois) $ferie=true; // Geneva fast in Switzerland } } From 7bac82bb13c4f1da61dc4e536a8714b193dcad05 Mon Sep 17 00:00:00 2001 From: Deefaze <6393617+Deefaze@users.noreply.github.com> Date: Fri, 12 Aug 2022 22:50:22 +0200 Subject: [PATCH 09/24] Update newonlinesign.php missing "commercial" language file for complete translation --- htdocs/public/onlinesign/newonlinesign.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 5e920444c35..5e30b0bc20e 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -54,7 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "members", "paybox", "propal")); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "members", "paybox", "propal", "commercial")); // Security check // No check on module enabled. Done later according to $validpaymentmethod From 618dcfb15995672e9102d766f8cef0c952e35442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 13 Aug 2022 12:10:46 +0200 Subject: [PATCH 10/24] php v8 warning --- .../usergroup/doc/doc_generic_usergroup_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index d56d8f8d4d1..df3804670ad 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -123,7 +123,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $texte .= ''; $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -169,7 +169,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { // Model for creation $list = ModelePDFUserGroup::liste_modeles($this->db); $texte .= ''; From 7d9f509a5704ec519f21a61ea284139c8852efa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 13 Aug 2022 12:14:21 +0200 Subject: [PATCH 11/24] php V8 warning --- .../core/modules/expensereport/mod_expensereport_sand.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index c403aa8c228..7045fc38898 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -82,7 +82,8 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport // Parametrage du prefix $texte .= ''; - $texte .= ''; + $mask=!empty($conf->global->EXPENSEREPORT_SAND_MASK)?$conf->global->EXPENSEREPORT_SAND_MASK:""; + $texte .= ''; $texte .= ''; @@ -128,8 +129,8 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = $conf->global->EXPENSEREPORT_SAND_MASK; - + $mask=!empty($conf->global->EXPENSEREPORT_SAND_MASK)?$conf->global->EXPENSEREPORT_SAND_MASK:""; + if (!$mask) { $this->error = 'NotConfigured'; return 0; From f9d44f42514dfd39e502ee8dbbffabfd830466d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 13 Aug 2022 12:17:19 +0200 Subject: [PATCH 12/24] php V8 warning --- htdocs/societe/admin/societe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index c57f1ac00da..e924f714843 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -713,7 +713,7 @@ foreach ($profid as $key => $val) { $i++; } -if ($conf->accounting->enabled) { +if (!empty($conf->accounting->enabled)) { print ''; print '\n"; print ''; From 15e5f6023538ed71877f84fc1114823a8bc0ee63 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 13 Aug 2022 10:18:47 +0000 Subject: [PATCH 13/24] Fixing style errors. --- htdocs/core/modules/expensereport/mod_expensereport_sand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 7045fc38898..8adf5663b58 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -130,7 +130,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport // We get cursor rule $mask=!empty($conf->global->EXPENSEREPORT_SAND_MASK)?$conf->global->EXPENSEREPORT_SAND_MASK:""; - + if (!$mask) { $this->error = 'NotConfigured'; return 0; From 29bfcfc02b1c7aada9c8aa6fa9b84ff242c9fe52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 13 Aug 2022 12:22:54 +0200 Subject: [PATCH 14/24] Update mod_propale_saphir.php --- htdocs/core/modules/propale/mod_propale_saphir.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index af7579fb142..1fae8ff5331 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -85,7 +85,8 @@ class mod_propale_saphir extends ModeleNumRefPropales // Parametrage du prefix $texte .= ''; - $texte .= ''; + $mask=!empty($conf->global->PROPALE_SAPHIR_MASK)?$conf->global->PROPALE_SAPHIR_MASK:""; + $texte .= ''; $texte .= ''; @@ -134,7 +135,7 @@ class mod_propale_saphir extends ModeleNumRefPropales require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask = $conf->global->PROPALE_SAPHIR_MASK; + $mask=!empty($conf->global->PROPALE_SAPHIR_MASK)?$conf->global->PROPALE_SAPHIR_MASK:""; if (!$mask) { $this->error = 'NotConfigured'; From a03ef11e0575c4c3472ec3035dd055584f428f1c Mon Sep 17 00:00:00 2001 From: jpb Date: Sat, 13 Aug 2022 14:02:10 +0200 Subject: [PATCH 15/24] add redirect on action confirm addconsumedline and addproduceline --- htdocs/mrp/mo_production.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0b6b27978ba..6584c80cc37 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -174,6 +174,8 @@ if (empty($reshook)) { } $action = ''; + // Redirect to refresh the tab information + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); } if (in_array($action, array('confirm_consumeorproduce', 'confirm_consumeandproduceall')) && $permissiontoproduce) { From 63d821d06f28c63bd3e3bf260b237e525d37c766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Sat, 13 Aug 2022 15:56:33 +0200 Subject: [PATCH 16/24] php V8 warning --- htdocs/product/fournisseurs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 9dfc90b86a4..7b3520cc707 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -913,10 +913,10 @@ END; 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), - 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15), - 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>16), + 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>0, 'position'=>15), + 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>0, 'position'=>16), 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17), - 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => $conf->barcode->enabled, 'checked'=>1, 'position'=>18), + 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>1, 'position'=>18), ); // fetch optionals attributes and labels From fd64b3baec67c462786d61bbacb0a219a27cf31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Sat, 13 Aug 2022 18:32:30 -0400 Subject: [PATCH 17/24] =?UTF-8?q?CLOSE=2021748=20Maillage=20sur=20ErrorPro?= =?UTF-8?q?ductAlreadyExists=20en=20cr=C3=A9ant=20produit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/card.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9137a3b7c10..a87920c43f2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -19,6 +19,7 @@ * Copyright (C) 2019-2022 Frédéric France * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin + * Copyright (C) 2022 Vincent de Grandpré * * 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 @@ -666,7 +667,20 @@ if (empty($reshook)) { if (count($object->errors)) { setEventMessages($object->error, $object->errors, 'errors'); } else { - setEventMessages($langs->trans($object->error), null, 'errors'); + if($object->error == 'ErrorProductAlreadyExists') { + // permet une action personnallisée quand il y a tentative d'ajouter un produit + // avec un numéro de référence existant. + $reshook = $hookmanager->executeHooks('onProductAlreadyExists', $parameters, $object, $action); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + if($object->error) { + // L'erreur de l'objet a pu être effacée par la fonction + setEventMessages($langs->trans($object->error), null, 'errors'); + } + } else { + setEventMessages($langs->trans($object->error), null, 'errors'); + } } $action = "create"; } From 142f2422675bf3d9872b6a666a150f5ab0f278b9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 13 Aug 2022 22:35:53 +0000 Subject: [PATCH 18/24] Fixing style errors. --- htdocs/product/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index a87920c43f2..c192b29eb7e 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -667,16 +667,16 @@ if (empty($reshook)) { if (count($object->errors)) { setEventMessages($object->error, $object->errors, 'errors'); } else { - if($object->error == 'ErrorProductAlreadyExists') { - // permet une action personnallisée quand il y a tentative d'ajouter un produit + if ($object->error == 'ErrorProductAlreadyExists') { + // permet une action personnallisée quand il y a tentative d'ajouter un produit // avec un numéro de référence existant. $reshook = $hookmanager->executeHooks('onProductAlreadyExists', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } - if($object->error) { + } + if ($object->error) { // L'erreur de l'objet a pu être effacée par la fonction - setEventMessages($langs->trans($object->error), null, 'errors'); + setEventMessages($langs->trans($object->error), null, 'errors'); } } else { setEventMessages($langs->trans($object->error), null, 'errors'); From 6278c1e0011faef8535252167f5c9f4b186e1333 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 14 Aug 2022 13:40:57 +0200 Subject: [PATCH 19/24] Update llx_20_c_departements.sql Greece --- .../mysql/data/llx_20_c_departements.sql | 142 +++++++++--------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 5bc9960d092..b0ffb509c18 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -59,6 +59,7 @@ -- Croatia -- France -- Germany +-- Greece -- Honduras -- Hungary -- Italy @@ -543,6 +544,76 @@ INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (5 INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'TH', 'THÜRINGEN', 'Thüringen'); +-- Greece Provinces (id country=102) +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('66', 10201, '', 0, '', 'Αθήνα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('67', 10205, '', 0, '', 'Δράμα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('01', 10205, '', 0, '', 'Έβρος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('02', 10205, '', 0, '', 'Θάσος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('03', 10205, '', 0, '', 'Καβάλα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('04', 10205, '', 0, '', 'Ξάνθη'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('05', 10205, '', 0, '', 'Ροδόπη'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('06', 10203, '', 0, '', 'Ημαθία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('07', 10203, '', 0, '', 'Θεσσαλονίκη'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('08', 10203, '', 0, '', 'Κιλκίς'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('09', 10203, '', 0, '', 'Πέλλα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('10', 10203, '', 0, '', 'Πιερία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('11', 10203, '', 0, '', 'Σέρρες'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('12', 10203, '', 0, '', 'Χαλκιδική'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('13', 10206, '', 0, '', 'Άρτα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('14', 10206, '', 0, '', 'Θεσπρωτία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('15', 10206, '', 0, '', 'Ιωάννινα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('16', 10206, '', 0, '', 'Πρέβεζα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('17', 10213, '', 0, '', 'Γρεβενά'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('18', 10213, '', 0, '', 'Καστοριά'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('19', 10213, '', 0, '', 'Κοζάνη'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('20', 10213, '', 0, '', 'Φλώρινα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('21', 10212, '', 0, '', 'Καρδίτσα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('22', 10212, '', 0, '', 'Λάρισα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('23', 10212, '', 0, '', 'Μαγνησία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('24', 10212, '', 0, '', 'Τρίκαλα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('25', 10212, '', 0, '', 'Σποράδες'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('26', 10212, '', 0, '', 'Βοιωτία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('27', 10202, '', 0, '', 'Εύβοια'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('28', 10202, '', 0, '', 'Ευρυτανία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('29', 10202, '', 0, '', 'Φθιώτιδα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('30', 10202, '', 0, '', 'Φωκίδα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('31', 10209, '', 0, '', 'Αργολίδα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('32', 10209, '', 0, '', 'Αρκαδία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('33', 10209, '', 0, '', 'Κορινθία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('34', 10209, '', 0, '', 'Λακωνία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('35', 10209, '', 0, '', 'Μεσσηνία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('36', 10211, '', 0, '', 'Αιτωλοακαρνανία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('37', 10211, '', 0, '', 'Αχαΐα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('38', 10211, '', 0, '', 'Ηλεία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('39', 10207, '', 0, '', 'Ζάκυνθος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('40', 10207, '', 0, '', 'Κέρκυρα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('41', 10207, '', 0, '', 'Κεφαλληνία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('42', 10207, '', 0, '', 'Ιθάκη'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('43', 10207, '', 0, '', 'Λευκάδα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('44', 10208, '', 0, '', 'Ικαρία'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('45', 10208, '', 0, '', 'Λέσβος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('46', 10208, '', 0, '', 'Λήμνος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('47', 10208, '', 0, '', 'Σάμος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('48', 10208, '', 0, '', 'Χίος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('49', 10210, '', 0, '', 'Άνδρος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('50', 10210, '', 0, '', 'Θήρα'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('51', 10210, '', 0, '', 'Κάλυμνος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('52', 10210, '', 0, '', 'Κάρπαθος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('53', 10210, '', 0, '', 'Κέα-Κύθνος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('54', 10210, '', 0, '', 'Κω'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('55', 10210, '', 0, '', 'Μήλος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('56', 10210, '', 0, '', 'Μύκονος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('57', 10210, '', 0, '', 'Νάξος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('58', 10210, '', 0, '', 'Πάρος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('59', 10210, '', 0, '', 'Ρόδος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('60', 10210, '', 0, '', 'Σύρος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('61', 10210, '', 0, '', 'Τήνος'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('62', 10204, '', 0, '', 'Ηράκλειο'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('63', 10204, '', 0, '', 'Λασίθι'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('64', 10204, '', 0, '', 'Ρέθυμνο'); +INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('65', 10204, '', 0, '', 'Χανιά'); + + -- Honduras Departamentos (id country=114) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'AT', '', 0, 'AT', 'Atlántida'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (11401, 'CH', '', 0, 'CH', 'Choluteca'); @@ -1444,77 +1515,6 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('Z', '402', '50', 1, 'ZARAGOZA', 'Zaragoza'); --- Provinces Greece (id country=102) -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('66', 10201, '', 0, '', 'Αθήνα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('67', 10205, '', 0, '', 'Δράμα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('01', 10205, '', 0, '', 'Έβρος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('02', 10205, '', 0, '', 'Θάσος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('03', 10205, '', 0, '', 'Καβάλα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('04', 10205, '', 0, '', 'Ξάνθη', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('05', 10205, '', 0, '', 'Ροδόπη', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('06', 10203, '', 0, '', 'Ημαθία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('07', 10203, '', 0, '', 'Θεσσαλονίκη', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('08', 10203, '', 0, '', 'Κιλκίς', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('09', 10203, '', 0, '', 'Πέλλα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('10', 10203, '', 0, '', 'Πιερία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('11', 10203, '', 0, '', 'Σέρρες', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('12', 10203, '', 0, '', 'Χαλκιδική', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('13', 10206, '', 0, '', 'Άρτα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('14', 10206, '', 0, '', 'Θεσπρωτία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('15', 10206, '', 0, '', 'Ιωάννινα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('16', 10206, '', 0, '', 'Πρέβεζα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('17', 10213, '', 0, '', 'Γρεβενά', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('18', 10213, '', 0, '', 'Καστοριά', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('19', 10213, '', 0, '', 'Κοζάνη', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('20', 10213, '', 0, '', 'Φλώρινα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('21', 10212, '', 0, '', 'Καρδίτσα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('22', 10212, '', 0, '', 'Λάρισα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('23', 10212, '', 0, '', 'Μαγνησία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('24', 10212, '', 0, '', 'Τρίκαλα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('25', 10212, '', 0, '', 'Σποράδες', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('26', 10212, '', 0, '', 'Βοιωτία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('27', 10202, '', 0, '', 'Εύβοια', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('28', 10202, '', 0, '', 'Ευρυτανία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('29', 10202, '', 0, '', 'Φθιώτιδα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('30', 10202, '', 0, '', 'Φωκίδα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('31', 10209, '', 0, '', 'Αργολίδα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('32', 10209, '', 0, '', 'Αρκαδία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('33', 10209, '', 0, '', 'Κορινθία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('34', 10209, '', 0, '', 'Λακωνία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('35', 10209, '', 0, '', 'Μεσσηνία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('36', 10211, '', 0, '', 'Αιτωλοακαρνανία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('37', 10211, '', 0, '', 'Αχαΐα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('38', 10211, '', 0, '', 'Ηλεία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('39', 10207, '', 0, '', 'Ζάκυνθος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('40', 10207, '', 0, '', 'Κέρκυρα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('41', 10207, '', 0, '', 'Κεφαλληνία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('42', 10207, '', 0, '', 'Ιθάκη', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('43', 10207, '', 0, '', 'Λευκάδα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('44', 10208, '', 0, '', 'Ικαρία', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('45', 10208, '', 0, '', 'Λέσβος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('46', 10208, '', 0, '', 'Λήμνος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('47', 10208, '', 0, '', 'Σάμος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('48', 10208, '', 0, '', 'Χίος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('49', 10210, '', 0, '', 'Άνδρος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('50', 10210, '', 0, '', 'Θήρα', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('51', 10210, '', 0, '', 'Κάλυμνος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('52', 10210, '', 0, '', 'Κάρπαθος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('53', 10210, '', 0, '', 'Κέα-Κύθνος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('54', 10210, '', 0, '', 'Κω', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('55', 10210, '', 0, '', 'Μήλος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('56', 10210, '', 0, '', 'Μύκονος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('57', 10210, '', 0, '', 'Νάξος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('58', 10210, '', 0, '', 'Πάρος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('59', 10210, '', 0, '', 'Ρόδος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('60', 10210, '', 0, '', 'Σύρος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('61', 10210, '', 0, '', 'Τήνος', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('62', 10204, '', 0, '', 'Ηράκλειο', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('63', 10204, '', 0, '', 'Λασίθι', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('64', 10204, '', 0, '', 'Ρέθυμνο', 1); -INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('65', 10204, '', 0, '', 'Χανιά', 1); - - - -- Provinces GB (id country=7) INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('701', 701, NULL, 0,NULL, 'Bedfordshire', 1); INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('702', 701, NULL, 0,NULL, 'Berkshire', 1); From 9a358f43eab73d6102f2c1a23548c742e0af048d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 14 Aug 2022 13:48:12 +0200 Subject: [PATCH 20/24] Update 16.0.0-17.0.0.sql sort alphabetical --- .../install/mysql/migration/16.0.0-17.0.0.sql | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 29543607ce2..5504c68a91e 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -34,6 +34,8 @@ -- Missing in v16 or lower +ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL; + ALTER TABLE llx_c_action_trigger MODIFY elementtype VARCHAR(64); ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles text; @@ -45,8 +47,6 @@ ALTER TABLE llx_c_email_templates ADD COLUMN content_lines text; ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; -ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL; - ALTER TABLE llx_user DROP COLUMN idpers1; ALTER TABLE llx_user DROP COLUMN idpers2; ALTER TABLE llx_user DROP COLUMN idpers3; @@ -54,31 +54,32 @@ ALTER TABLE llx_user DROP COLUMN idpers3; -- v17 -ALTER TABLE llx_facture ADD COLUMN close_missing_amount double(24, 8) after close_code; +ALTER TABLE llx_adherent ADD COLUMN default_lang VARCHAR(6) DEFAULT NULL AFTER datefin; -ALTER TABLE llx_facture_fourn ADD COLUMN close_missing_amount double(24, 8) after close_code; - --- Allow users to make subscriptions of any amount during membership subscription ALTER TABLE llx_adherent_type ADD COLUMN caneditamount integer DEFAULT 0 AFTER amount; - -ALTER TABLE llx_inventory ADD COLUMN categories_product VARCHAR(255) DEFAULT NULL AFTER fk_product; - -ALTER TABLE llx_ticket ADD COLUMN ip varchar(250); - -ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf; - -ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN port varchar(10) DEFAULT '993'; + -- Allow users to make subscriptions of any amount during membership subscription ALTER TABLE llx_bank ADD COLUMN position integer DEFAULT 0; ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product); -ALTER TABLE llx_recruitment_recruitmentcandidature ADD email_date datetime after email_msgid; -ALTER TABLE llx_ticket ADD email_date datetime after email_msgid; - INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT', 1, 1000, 'int', 0); -ALTER TABLE llx_adherent ADD COLUMN default_lang VARCHAR(6) DEFAULT NULL AFTER datefin; +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN port varchar(10) DEFAULT '993'; + +ALTER TABLE llx_facture ADD COLUMN close_missing_amount double(24, 8) after close_code; + +ALTER TABLE llx_facture_fourn ADD COLUMN close_missing_amount double(24, 8) after close_code; + +ALTER TABLE llx_inventory ADD COLUMN categories_product VARCHAR(255) DEFAULT NULL AFTER fk_product; --- Make sell-by or eat-by date mandatory ALTER TABLE llx_product ADD COLUMN sell_or_eat_by_mandatory tinyint DEFAULT 0 NOT NULL AFTER tobatch; + -- Make sell-by or eat-by date mandatory + +ALTER TABLE llx_recruitment_recruitmentcandidature ADD email_date datetime after email_msgid; + +ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf; + +ALTER TABLE llx_ticket ADD COLUMN ip varchar(250); + +ALTER TABLE llx_ticket ADD email_date datetime after email_msgid; From 912a1b3a7eba9d3b966c764f784b3a79aaf4557a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Aug 2022 15:13:15 +0200 Subject: [PATCH 21/24] Update mod_propale_saphir.php --- htdocs/core/modules/propale/mod_propale_saphir.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 1fae8ff5331..2cb10e3d932 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -85,7 +85,7 @@ class mod_propale_saphir extends ModeleNumRefPropales // Parametrage du prefix $texte .= ''; - $mask=!empty($conf->global->PROPALE_SAPHIR_MASK)?$conf->global->PROPALE_SAPHIR_MASK:""; + $mask = empty($conf->global->PROPALE_SAPHIR_MASK) ? '' : $conf->global->PROPALE_SAPHIR_MASK; $texte .= ''; $texte .= ''; @@ -135,7 +135,7 @@ class mod_propale_saphir extends ModeleNumRefPropales require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask=!empty($conf->global->PROPALE_SAPHIR_MASK)?$conf->global->PROPALE_SAPHIR_MASK:""; + $mask = empty($conf->global->PROPALE_SAPHIR_MASK) ? '' : $conf->global->PROPALE_SAPHIR_MASK; if (!$mask) { $this->error = 'NotConfigured'; From 4edafe1d756090831805d769401fed4e542b151d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Aug 2022 15:20:39 +0200 Subject: [PATCH 22/24] Update mod_expensereport_sand.php --- htdocs/core/modules/expensereport/mod_expensereport_sand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 8adf5663b58..d14f17de067 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -82,7 +82,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport // Parametrage du prefix $texte .= ''; - $mask=!empty($conf->global->EXPENSEREPORT_SAND_MASK)?$conf->global->EXPENSEREPORT_SAND_MASK:""; + $mask = empty($conf->global->EXPENSEREPORT_SAND_MASK) ? '' : $conf->global->EXPENSEREPORT_SAND_MASK; $texte .= ''; $texte .= ''; @@ -129,7 +129,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask=!empty($conf->global->EXPENSEREPORT_SAND_MASK)?$conf->global->EXPENSEREPORT_SAND_MASK:""; + $mask = empty($conf->global->EXPENSEREPORT_SAND_MASK) ? '' : $conf->global->EXPENSEREPORT_SAND_MASK; if (!$mask) { $this->error = 'NotConfigured'; From 7a22e6f33961fb1b5d199d824b2cd49bbac6f551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Sun, 14 Aug 2022 09:48:49 -0400 Subject: [PATCH 23/24] commentaires du code en anglais --- htdocs/product/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c192b29eb7e..42b3ee1ec9c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -668,14 +668,14 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } else { if ($object->error == 'ErrorProductAlreadyExists') { - // permet une action personnallisée quand il y a tentative d'ajouter un produit - // avec un numéro de référence existant. + // allow to hook on ErrorProductAlreadyExists in any module $reshook = $hookmanager->executeHooks('onProductAlreadyExists', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if ($object->error) { - // L'erreur de l'objet a pu être effacée par la fonction + // check again to prevent translation issue, + // as error may have been cleared in hook function setEventMessages($langs->trans($object->error), null, 'errors'); } } else { From 6c1289382c1660f6056f7952403056583174700c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 14 Aug 2022 13:49:28 +0000 Subject: [PATCH 24/24] Fixing style errors. --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 42b3ee1ec9c..d4baa9870ff 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -674,7 +674,7 @@ if (empty($reshook)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if ($object->error) { - // check again to prevent translation issue, + // check again to prevent translation issue, // as error may have been cleared in hook function setEventMessages($langs->trans($object->error), null, 'errors'); }
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
'.$langs->trans('CustomerAccountancyCodeShort')."
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'