From df7f18d4d29218253a05b5f18408e7b7147c8268 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 5 Feb 2021 13:33:48 +0100 Subject: [PATCH 01/63] add hook to add directory into ECM auto files --- htdocs/core/class/hookmanager.class.php | 1 + htdocs/ecm/index_auto.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index d610203b3ad..9ecd6a659a1 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -161,6 +161,7 @@ class HookManager 'addMoreMassActions', 'addSearchEntry', 'addStatisticLine', + 'addSectionECMAuto', 'createDictionaryFieldlist', 'editDictionaryFieldlist', 'getFormMail', diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 452f06efb0a..cb5fb4852ea 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -81,6 +81,9 @@ $error = 0; * Actions */ +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('ecmautocard', 'globalcard')); + // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { @@ -327,6 +330,15 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) if (!empty($conf->mrp->enabled)) { $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); } if (!empty($conf->recruitment->enabled)) { $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); } $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Users"))); + + $parameters = array(); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) + { + $sectionauto[]=$hookmanager->resArray; + $rowspan += count($hookmanager->resArray); + } + } $head = ecm_prepare_dasboard_head(''); From 3b4f8c32f7124e39618973ade270387fa3731e20 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 6 Feb 2021 13:21:16 +0100 Subject: [PATCH 02/63] add hook to custom directory into automatic file ECM --- htdocs/core/ajax/ajaxdirpreview.php | 14 +++++++++++ htdocs/core/class/html.formfile.class.php | 25 +++++++++++++++++++ htdocs/core/modules/DolibarrModules.class.php | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 41e23819266..9575208f485 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -201,6 +201,13 @@ if ($type == 'directory') 'mrp-mo' ); + $parameters = array('modulepart'=>$module); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) + { + $automodules[]=$hookmanager->resArray['module']; + } + // TODO change for multicompany sharing if ($module == 'company') $upload_dir = $conf->societe->dir_output; elseif ($module == 'invoice') $upload_dir = $conf->facture->dir_output; @@ -220,6 +227,13 @@ if ($type == 'directory') elseif ($module == 'recruitment-recruitmentcandidature') $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature'; elseif ($module == 'banque') $upload_dir = $conf->bank->dir_output; elseif ($module == 'mrp-mo') $upload_dir = $conf->mrp->dir_output.'/mo'; + else { + $parameters = array('modulepart'=>$module); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { + $upload_dir = $hookmanager->resArray['directory']; + } + } // Automatic list if (in_array($module, $automodules)) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 6f31f0ff8de..c00318b4790 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1570,6 +1570,20 @@ class FormFile { include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; $object_instance = new Mo($this->db); + } else { + $parameters = array('modulepart'=>$modulepart); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) + { + if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) { + dol_include_once($hookmanager->resArray['classpath']); + if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) { + if (class_exists($hookmanager->resArray['classname'])) { + $object_instance = new ${$hookmanager->resArray['classname']}($this->db); + } + } + } + } } //var_dump($filearray); @@ -1623,6 +1637,17 @@ class FormFile 'banque'))) { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); } else { + $parameters = array('modulepart'=>$modulepart,'fullname'=>$file['fullname']); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) + { + if (array_key_exists('ref', $hookmanager->resArray) && !empty($hookmanager->resArray['ref'])) { + $ref = $hookmanager->resArray['ref']; + } + if (array_key_exists('id', $hookmanager->resArray) && !empty($hookmanager->resArray['id'])) { + $id = $hookmanager->resArray['id']; + } + } //print 'Error: Value for modulepart = '.$modulepart.' is not yet implemented in function list_of_autoecmfiles'."\n"; } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index da1e64ac56e..bbc9a1f801a 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1867,7 +1867,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->mainmenu = isset($this->menu[$key]['mainmenu']) ? $this->menu[$key]['mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu : ''); $menu->leftmenu = isset($this->menu[$key]['leftmenu']) ? $this->menu[$key]['leftmenu'] : ''; $menu->title = $this->menu[$key]['titre']; - $menu->prefix = $this->menu[$key]['prefix']; + if (array_key_exists('prefix', $this->menu[$key])) $menu->prefix = $this->menu[$key]['prefix']; $menu->url = $this->menu[$key]['url']; $menu->langs = $this->menu[$key]['langs']; $menu->position = $this->menu[$key]['position']; From 377427da1dd513642da843135f29543154ed1988 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 6 Feb 2021 13:25:35 +0100 Subject: [PATCH 03/63] add hook to custom directory into automatic file ECM --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c00318b4790..c9c895148bf 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1637,7 +1637,7 @@ class FormFile 'banque'))) { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); } else { - $parameters = array('modulepart'=>$modulepart,'fullname'=>$file['fullname']); + $parameters = array('modulepart'=>$modulepart,'fileinfo'=>$file); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { From cc6fd7952c53ec29e4e5296abd079a4a6b804e91 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 6 Feb 2021 12:28:00 +0000 Subject: [PATCH 04/63] Fixing style errors. --- htdocs/ecm/index_auto.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index cb5fb4852ea..ae7aa840ab9 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -338,7 +338,6 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) $sectionauto[]=$hookmanager->resArray; $rowspan += count($hookmanager->resArray); } - } $head = ecm_prepare_dasboard_head(''); From 39c3bcd265744c329a15366a2a9039151f15bb9a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 13:58:26 +0100 Subject: [PATCH 05/63] standardization, internationalisation --- htdocs/core/modules/cheque/modules_chequereceipts.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 66b2f9f7d82..bc552aec070 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -142,14 +142,14 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator global $conf; $type = 'chequereceipt'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); // TODO Remove this to use getListOfModels only - $liste = array('blochet'=>'blochet'); + $list = array('blochet'=>'blochet'); - return $liste; + return $list; } } From 11053fe0ed753684494ced5b728f245571f47937 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:00:26 +0100 Subject: [PATCH 06/63] standardization, internationalisation --- htdocs/core/modules/contract/modules_contract.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/contract/modules_contract.php b/htdocs/core/modules/contract/modules_contract.php index c259c247304..5e39dd7d587 100644 --- a/htdocs/core/modules/contract/modules_contract.php +++ b/htdocs/core/modules/contract/modules_contract.php @@ -57,12 +57,12 @@ abstract class ModelePDFContract extends CommonDocGenerator global $conf; $type = 'contract'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 55dd15cbf67f40c54d57edcacf92448fe69610f3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:01:10 +0100 Subject: [PATCH 07/63] standardization, internationalisation --- htdocs/core/modules/delivery/modules_delivery.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/delivery/modules_delivery.php b/htdocs/core/modules/delivery/modules_delivery.php index 80e2b092d42..a0d2da43494 100644 --- a/htdocs/core/modules/delivery/modules_delivery.php +++ b/htdocs/core/modules/delivery/modules_delivery.php @@ -55,12 +55,12 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator global $conf; $type = 'delivery'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From ff0c105207a3279b028d9beb3daaeda8bb119efe Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:01:50 +0100 Subject: [PATCH 08/63] standardization, internationalisation --- htdocs/core/modules/dons/modules_don.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index 73186354285..92982d91404 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -53,12 +53,12 @@ abstract class ModeleDon extends CommonDocGenerator global $conf; $type = 'donation'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From a8b72c98a214303f7eb2c4958fb810d7ffa6c422 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:03:13 +0100 Subject: [PATCH 09/63] standardization, internationalisation --- htdocs/core/modules/facture/modules_facture.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 775864eec52..03c65f3595c 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -60,12 +60,12 @@ abstract class ModelePDFFactures extends CommonDocGenerator global $conf; $type = 'invoice'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 858ebf5aafda09efce13e06f71df1bbeb2faf450 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:04:38 +0100 Subject: [PATCH 10/63] standardization, internationalisation --- htdocs/core/modules/member/modules_cards.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index a6de637b24f..0f4a04bcaf0 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -54,12 +54,12 @@ class ModelePDFCards global $conf; $type = 'member'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 4840fa82148b663c424b9e803975209f6dab4e74 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:05:19 +0100 Subject: [PATCH 11/63] standardization, internationalisation --- htdocs/core/modules/movement/modules_movement.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/movement/modules_movement.php b/htdocs/core/modules/movement/modules_movement.php index 80a61c75074..0116a87ff38 100644 --- a/htdocs/core/modules/movement/modules_movement.php +++ b/htdocs/core/modules/movement/modules_movement.php @@ -50,11 +50,11 @@ abstract class ModelePDFMovement extends CommonDocGenerator global $conf; $type = 'movement'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From fff2c1fbacfd57663770acbd62b58d4c8b776b69 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:06:22 +0100 Subject: [PATCH 12/63] standardization, internationalisation --- htdocs/core/modules/printsheet/modules_labels.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index c04d0acc4ed..9106c8f4eac 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -54,12 +54,12 @@ class ModelePDFLabels global $conf; $type = 'members_labels'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From a50ecdd1aad788f7eee4998dec5c62cebcec6299 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:06:55 +0100 Subject: [PATCH 13/63] standardization, internationalisation --- htdocs/core/modules/product/modules_product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 79950e4f14f..9322495b5b2 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -53,11 +53,11 @@ abstract class ModelePDFProduct extends CommonDocGenerator global $conf; $type = 'product'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + $list = getListOfModels($db, $type, $maxfilenamelength); + return $list; } } From ee50cee862a45b06344b707b76a4a84f165c5af1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:07:58 +0100 Subject: [PATCH 14/63] standardization, internationalisation --- htdocs/core/modules/product/modules_product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 9322495b5b2..e0141348568 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -163,7 +163,7 @@ abstract class ModeleProductCode public static function liste_modeles($db, $maxfilenamelength = 0) { // phpcs:enable - $liste = array(); + $list = array(); $sql = ""; $resql = $db->query($sql); @@ -172,13 +172,13 @@ abstract class ModeleProductCode $i = 0; while ($i < $num) { $row = $db->fetch_row($resql); - $liste[$row[0]] = $row[1]; + $list[$row[0]] = $row[1]; $i++; } } else { return -1; } - return $liste; + return $list; } /** From 2fc6d76029d94b905a89f8287ab1dcf5d8f1a3a0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:09:02 +0100 Subject: [PATCH 15/63] standardization, internationalisation --- htdocs/core/modules/project/modules_project.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 6f174a27d7a..c2d546348ff 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -106,12 +106,12 @@ abstract class ModelePDFProjects extends CommonDocGenerator global $conf; $type = 'project'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From ef3e7fa65ad0f9e47d27130ed82d79f83e334851 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:09:35 +0100 Subject: [PATCH 16/63] standardization, internationalisation --- htdocs/core/modules/project/task/modules_task.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 2600538f273..9addc4bc56e 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -52,12 +52,12 @@ abstract class ModelePDFTask extends CommonDocGenerator global $conf; $type = 'project_task'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From f47d5e6a69919f0b8a46fff435d2e24f090c0de0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:10:07 +0100 Subject: [PATCH 17/63] standardization, internationalisation --- htdocs/core/modules/propale/modules_propale.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 2127ff1f70c..ffcc13dc269 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -56,12 +56,12 @@ abstract class ModelePDFPropales extends CommonDocGenerator global $conf; $type = 'propal'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 3e9a6818f2fc860d7e38763d0ddc39aea872cf89 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:12:27 +0100 Subject: [PATCH 18/63] standardization, internationalisation --- .../propale/doc/doc_generic_proposal_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 7b2ac19a016..caaa92f8238 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -183,24 +183,24 @@ class doc_generic_proposal_odt extends ModelePDFPropales if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation - $liste = ModelePDFPropales::liste_modeles($this->db); + $list = ModelePDFPropales::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte .= $form->selectarray('value2', $liste, $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT); $texte .= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte .= $form->selectarray('value3', $liste, $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL); $texte .= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte .= $form->selectarray('value4', $liste, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED); $texte .= "
'; } From 1317b5cfac248e51eb6190242a46f691b954b6c8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:13:12 +0100 Subject: [PATCH 19/63] standardization, internationalisation --- htdocs/core/modules/reception/modules_reception.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/reception/modules_reception.php b/htdocs/core/modules/reception/modules_reception.php index 28b0bce6500..a7b7cae7344 100644 --- a/htdocs/core/modules/reception/modules_reception.php +++ b/htdocs/core/modules/reception/modules_reception.php @@ -46,12 +46,12 @@ abstract class ModelePdfReception extends CommonDocGenerator global $conf; $type = 'reception'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From c1bbd076dfc68c5f5876135b243fe76982e722cd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:13:49 +0100 Subject: [PATCH 20/63] standardization, internationalisation --- htdocs/core/modules/societe/modules_societe.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 03463f364bd..a84f5a35d70 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -51,12 +51,12 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator global $conf; $type = 'company'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From a2b5a3190dde1d0cc19de18b635aa7a95fb702d7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:14:40 +0100 Subject: [PATCH 21/63] standardization, internationalisation --- htdocs/core/modules/societe/modules_societe.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index a84f5a35d70..28d0120da72 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -168,7 +168,7 @@ abstract class ModeleThirdPartyCode public static function liste_modeles($db, $maxfilenamelength = 0) { // phpcs:enable - $liste = array(); + $list = array(); $sql = ""; $resql = $db->query($sql); @@ -177,13 +177,13 @@ abstract class ModeleThirdPartyCode $i = 0; while ($i < $num) { $row = $db->fetch_row($resql); - $liste[$row[0]] = $row[1]; + $list[$row[0]] = $row[1]; $i++; } } else { return -1; } - return $liste; + return $list; } /** From e1bf624e45cc40403cc688624a19897de59e6445 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:15:14 +0100 Subject: [PATCH 22/63] standardization, internationalisation --- htdocs/core/modules/stock/modules_stock.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php index cd4fed5665f..2c9f9e82591 100644 --- a/htdocs/core/modules/stock/modules_stock.php +++ b/htdocs/core/modules/stock/modules_stock.php @@ -43,11 +43,11 @@ abstract class ModelePDFStock extends CommonDocGenerator global $conf; $type = 'stock'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 67fe91f6aac61dbf32c503e667418acc5a5039d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Feb 2021 14:15:21 +0100 Subject: [PATCH 23/63] Prepare 13.0.1 --- ChangeLog | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3a591059b36..35dc54979a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,56 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 13.0.1 compared to 13.0.0 ***** + +FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already. +FIX: 11.0 when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion +FIX: 11.0 when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized +FIX: create MO, Column 'tms' cannot be null +FIX: #14290 #15900 +FIX: #16076 +FIX: #16077 +FIX: #16079 +FIX: #16080 +FIX: 16084 +FIX: #16107 +FIX: #16118 Timezone problem on some fields +FIX: #16131 +FIX: #16135 +FIX: #16143 +FIX: #16156 +FIX: #16160 +FIX: #16185 +FIX: #16189, fix download/see check deposit PDF +FIX: #16215 +FIX: Accountancy - label_operation is used instead of label_compte +FIX: Add critical price patch +FIX: Assignement of actors on tasks +FIX: Bad dates on info tabs +FIX: cash fence for takepos with multientity +FIX: CSRF errors on margin forms +FIX: encoding status in graph of vendor proposals +FIX: Fix detect dispached product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES) +FIX: Hide/Unhide external ICSS calendars +FIX: link to create event when task is in a project with a thirdparty +FIX: Localtax must be converted with price2num +FIX: manage price min for PRODUIT_CUSTOMER_PRICES +FIX: Missing language ico +FIX: Must not be able to edit vat of all lines if not draft +FIX: Bad "htdocs" found into a path +FIX: removed no more used proc update_modified_column_date_m on pgsql (its presence triggered errors) +FIX: Vulnerability report by Ricardo Matias +FIX: select default mail template +FIX: Select transport mode function when creating a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql +FIX: Merge of thirdparties : "unknow column fk_soc" + "Delivery" label +FIX: SQL Error in group by with postgres or mysql strict mode +FIX: takepos : load date function +FIX: Timeout during import +FIX: Trigger on expense report was not fired +FIX: User creation of expense report not visible +FIX: warning when adding a line if $remise_percent is an empty string + + ***** ChangeLog for 13.0.0 compared to 12.0.0 ***** For users: From 8d9ae906c8cbd1c410b7536a55408a27916213ff Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:15:45 +0100 Subject: [PATCH 24/63] standardization, internationalisation --- .../modules/supplier_order/modules_commandefournisseur.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index dcd48b25913..d7d28afa9e8 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -57,12 +57,12 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator global $conf; $type = 'order_supplier'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 663108d23902b17c3fd67acc34ecefce5205c87f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:16:17 +0100 Subject: [PATCH 25/63] standardization, internationalisation --- .../modules/supplier_payment/modules_supplier_payment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php index c5c5fd489f9..0d4cbaff529 100644 --- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php +++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php @@ -42,12 +42,12 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator global $conf; $type = 'supplier_payment'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 635260e59f2fae6fde1d6d56a20227e606119bcc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:16:47 +0100 Subject: [PATCH 26/63] standardization, internationalisation --- .../modules/supplier_proposal/modules_supplier_proposal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index 4e32817ff19..195533b1ce1 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -56,12 +56,12 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator global $conf; $type = 'supplier_proposal'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + return $list; } } From 182563329fb5093195672a34779692e9b9032591 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:17:38 +0100 Subject: [PATCH 27/63] standardization, internationalisation --- .../doc/doc_generic_supplier_proposal_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 8c42681e986..e54d9db3076 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -184,24 +184,24 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation - $liste = ModelePDFSupplierProposal::liste_modeles($this->db); + $list = ModelePDFSupplierProposal::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelSupplierProposalCreate").''; - $texte .= $form->selectarray('value2', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT); $texte .= "
'.$langs->trans("DefaultModelSupplierProposalToBill").''; - $texte .= $form->selectarray('value3', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL); $texte .= "
'.$langs->trans("DefaultModelSupplierProposalClosed").''; - $texte .= $form->selectarray('value4', $liste, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED); $texte .= "
'; } From 8fd7d3e586d2be72b793bc39a10159f5c554cea5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:18:27 +0100 Subject: [PATCH 28/63] standardization, internationalisation --- htdocs/core/modules/user/modules_user.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/user/modules_user.class.php b/htdocs/core/modules/user/modules_user.class.php index 2269d530c97..b0142687ce5 100644 --- a/htdocs/core/modules/user/modules_user.class.php +++ b/htdocs/core/modules/user/modules_user.class.php @@ -58,10 +58,10 @@ abstract class ModelePDFUser extends CommonDocGenerator global $conf; $type = 'user'; - $liste = array(); + $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste = getListOfModels($db, $type, $maxfilenamelength); - return $liste; + $list = getListOfModels($db, $type, $maxfilenamelength); + return $list; } } From 44f2269764a6430a6f7fc1245d6bd4556786b9b3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:19:17 +0100 Subject: [PATCH 29/63] standardization, internationalisation --- .../modules/user/doc/doc_generic_user_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 2e39bf53ea2..47e9e8bccc5 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -166,24 +166,24 @@ class doc_generic_user_odt extends ModelePDFUser if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation - $liste = ModelePDFUser::liste_modeles($this->db); + $list = ModelePDFUser::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte .= $form->selectarray('value2', $liste, $conf->global->USER_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, $conf->global->USER_ADDON_PDF_ODT_DEFAULT); $texte .= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte .= $form->selectarray('value3', $liste, $conf->global->USER_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, $conf->global->USER_ADDON_PDF_ODT_TOBILL); $texte .= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte .= $form->selectarray('value4', $liste, $conf->global->USER_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, $conf->global->USER_ADDON_PDF_ODT_CLOSED); $texte .= "
'; } From 66b06405d9df4580dcf71d6e35eab3578227d031 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:20:10 +0100 Subject: [PATCH 30/63] standardization, internationalisation --- .../usergroup/doc/doc_generic_usergroup_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 6fcc6160a97..4c718db5654 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 @@ -169,24 +169,24 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { // Model for creation - $liste = ModelePDFUserGroup::liste_modeles($this->db); + $list = ModelePDFUserGroup::liste_modeles($this->db); $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= ''; $texte .= ''; $texte .= '"; $texte .= '
'.$langs->trans("DefaultModelPropalCreate").''; - $texte .= $form->selectarray('value2', $liste, $conf->global->USERGROUP_ADDON_PDF_ODT_DEFAULT); + $texte .= $form->selectarray('value2', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_DEFAULT); $texte .= "
'.$langs->trans("DefaultModelPropalToBill").''; - $texte .= $form->selectarray('value3', $liste, $conf->global->USERGROUP_ADDON_PDF_ODT_TOBILL); + $texte .= $form->selectarray('value3', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_TOBILL); $texte .= "
'.$langs->trans("DefaultModelPropalClosed").''; - $texte .= $form->selectarray('value4', $liste, $conf->global->USERGROUP_ADDON_PDF_ODT_CLOSED); + $texte .= $form->selectarray('value4', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_CLOSED); $texte .= "
'; } From 2307275d61c7bc4f9f6eab67d1a1a8f160eef9bb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:21:39 +0100 Subject: [PATCH 31/63] standardization, internationalisation --- htdocs/expedition/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c13206e9450..0652424d919 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1013,12 +1013,12 @@ if ($action == 'create') // Document model include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; - $liste = ModelePdfExpedition::liste_modeles($db); - if (count($liste) > 1) + $list = ModelePdfExpedition::liste_modeles($db); + if (count($list) > 1) { print "".$langs->trans("DefaultModel").""; print ''; - print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF); + print $form->selectarray('model', $list, $conf->global->EXPEDITION_ADDON_PDF); print "\n"; } From a827a9ee6da75f1ce9b3497ac8e3310b15399c5a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:22:47 +0100 Subject: [PATCH 32/63] standardization, internationalisation --- htdocs/imports/import.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 344ede7d0cd..13f9a9558ba 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -502,8 +502,8 @@ if ($step == 2 && $datatoimport) print ''; print $langs->trans("FileMustHaveOneOfFollowingFormat"); print ''; - $liste = $objmodelimport->liste_modeles($db); - foreach ($liste as $key) + $list = $objmodelimport->liste_modeles($db); + foreach ($list as $key) { print ''; print ''.img_picto_common($key, $objmodelimport->getPictoForKey($key)).''; From 046affcd0d41a376f89709333f74571c34c03f1a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:24:53 +0100 Subject: [PATCH 33/63] standardization, internationalisation --- htdocs/imports/import.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 13f9a9558ba..1f8e6bb0bea 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -533,7 +533,7 @@ if ($step == 3 && $datatoimport) if ($separator) $param .= '&separator='.urlencode($separator); if ($enclosure) $param .= '&enclosure='.urlencode($enclosure); - $liste = $objmodelimport->liste_modeles($db); + $list = $objmodelimport->liste_modeles($db); llxHeader('', $langs->trans("NewImport"), 'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones'); @@ -731,7 +731,7 @@ if ($step == 3 && $datatoimport) if ($step == 4 && $datatoimport) { $model = $format; - $liste = $objmodelimport->liste_modeles($db); + $list = $objmodelimport->liste_modeles($db); // Create classe to use for import $dir = DOL_DOCUMENT_ROOT."/core/modules/import/"; @@ -1264,7 +1264,7 @@ if ($step == 5 && $datatoimport) } $model = $format; - $liste = $objmodelimport->liste_modeles($db); + $list = $objmodelimport->liste_modeles($db); // Create classe to use for import $dir = DOL_DOCUMENT_ROOT."/core/modules/import/"; @@ -1703,7 +1703,7 @@ if ($step == 6 && $datatoimport) } $model = $format; - $liste = $objmodelimport->liste_modeles($db); + $list = $objmodelimport->liste_modeles($db); $importid = GETPOST("importid", 'alphanohtml'); From f96f100c376afb70a6ab4426ee06cd7fdaa9b9f6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:25:41 +0100 Subject: [PATCH 34/63] standardization, internationalisation --- htdocs/imports/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index 4c556325b05..e27712a5e56 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -68,9 +68,9 @@ print ''; include_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'; $model = new ModeleImports(); -$liste = $model->liste_modeles($db); +$list = $model->liste_modeles($db); -foreach ($liste as $key) +foreach ($list as $key) { print ''; print ''.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).''; From abf2875eba6730526ada886f93aa25900371ec3d Mon Sep 17 00:00:00 2001 From: LAURIER Alexis <19586755+AlexisLaurier@users.noreply.github.com> Date: Tue, 9 Feb 2021 14:25:45 +0100 Subject: [PATCH 35/63] commande.class.php - move db->begin() into cloture A DB begin request was sent before executing the status guard. If the guard fails, we exited the method without closing it. And it will occur a bug to any further database operation. --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index fae2fefefaa..88ce1a6df9c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -742,11 +742,11 @@ class Commande extends CommonOrder if ($usercanclose) { - $this->db->begin(); if ($this->statut == self::STATUS_CLOSED) { return 0; } + $this->db->begin(); $now = dol_now(); From 007e58782ac32a92815f97492956aced2e54be93 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:26:46 +0100 Subject: [PATCH 36/63] standardization, internationalisation --- htdocs/reception/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 27ba05f24bb..41e8f60e634 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -860,13 +860,13 @@ if ($action == 'create') // Document model include_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php'; - $liste = ModelePdfReception::liste_modeles($db); + $list = ModelePdfReception::liste_modeles($db); - if (count($liste) > 1) + if (count($list) > 1) { print "".$langs->trans("DefaultModel").""; print ''; - print $form->selectarray('model', $liste, $conf->global->RECEPTION_ADDON_PDF); + print $form->selectarray('model', $list, $conf->global->RECEPTION_ADDON_PDF); print "\n"; } From 2e52d00951e4e821445f95557f9902b6c866a8d3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:28:18 +0100 Subject: [PATCH 37/63] standardization, internationalisation --- htdocs/supplier_proposal/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 05bc3aec44d..92d38c519de 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1216,9 +1216,9 @@ if ($action == 'create') print ''; print ''.$langs->trans("DefaultModel").''; print ''; - $liste = ModelePDFSupplierProposal::liste_modeles($db); + $list = ModelePDFSupplierProposal::liste_modeles($db); $preselected = ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_DEFAULT : $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF); - print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray('model', $list, $preselected, 0, 0, 0, '', 0, 0, 0, '', '', 1); print ""; // Project From 8d13e9231fe319dd09ed2b26a06c9319178caa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 15:05:32 +0100 Subject: [PATCH 38/63] remove debug --- htdocs/loan/schedule.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 5e27a48fa02..b9e6783ceca 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -48,7 +48,9 @@ $object->fetch($loanid); $echeances = new LoanSchedule($db); $echeances->fetchAll($object->id); -if ($object->paid > 0 && count($echeances->lines) == 0) $pay_without_schedule = 1; +if ($object->paid > 0 && count($echeances->lines) == 0) { + $pay_without_schedule = 1; +} /* * Actions @@ -86,8 +88,9 @@ if ($action == 'createecheancier' && empty($pay_without_schedule)) { $echeances->lines[] = $new_echeance; $i++; } - var_dump($result); - if ($result > 0) $db->commit(); + if ($result > 0) { + $db->commit(); + } } if ($action == 'updateecheancier' && empty($pay_without_schedule)) { From 07668167f6219cbed7b693b966d3cc4800277a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 15:18:07 +0100 Subject: [PATCH 39/63] Update card.php --- htdocs/intracommreport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 077f793d649..0226848bd48 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/intracommreport/class/intracommreport.class.php'; $langs->loadLangs(array("intracommreport")); -var_dump($_POST); + $action = GETPOST('action'); $exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB ou DES $year = GETPOSTINT('year'); From 21558dd0a623e3b3805a464e740a4eb2310669f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Feb 2021 17:52:33 +0100 Subject: [PATCH 40/63] Debug and enhance the feature to assign tasks on project assignation --- htdocs/core/class/commonobject.class.php | 6 +- htdocs/core/class/html.form.class.php | 22 ++- htdocs/core/class/html.formcompany.class.php | 5 +- htdocs/projet/contact.php | 170 ++++++++++--------- 4 files changed, 117 insertions(+), 86 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4ada3c368d0..cc67030ccf6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -970,7 +970,7 @@ abstract class CommonObject * @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL * @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) * @param int $notrigger Disable all triggers - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0 if already added, >0 if OK */ public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0) { @@ -1075,7 +1075,9 @@ abstract class CommonObject return -1; } } - } else return 0; + } else { + return 0; + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7fbff101859..4284b009019 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4308,7 +4308,7 @@ class Form * @param string $question Question * @param string $action Action * @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>)) - * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ... + * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', 'other' or 'onecolumn'... * @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0' * @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int|string $height Force height of box (0 = auto) @@ -4422,6 +4422,8 @@ class Form $moreonecolumn .= '
'; $moreonecolumn .= $input['value']; $moreonecolumn .= '
'."\n"; + } else { + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; } } } @@ -4449,16 +4451,24 @@ class Form } $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.$action.'&confirm=yes'; $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'confirm=no' : ''); + // Add input fields into list of fields to read during submit (inputok and inputko) - if (is_array($formquestion)) - { - foreach ($formquestion as $key => $input) - { + if (is_array($formquestion)) { + foreach ($formquestion as $key => $input) { //print "xx ".$key." rr ".is_array($input)."
\n"; - if (is_array($input) && isset($input['name'])) array_push($inputok, $input['name']); + // Add name of fields to propagate with the GET when submitting the form with button OK. + if (is_array($input) && isset($input['name'])) { + if (strpos($input['name'], ',') > 0) { + $inputok = array_merge($inputok, explode(',', $input['name'])); + } else { + array_push($inputok, $input['name']); + } + } + // Add name of fields to propagate with the GET when submitting the form with button KO. if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko, $input['name']); } } + // Show JQuery confirm box. $formconfirm .= '