From df7f18d4d29218253a05b5f18408e7b7147c8268 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 5 Feb 2021 13:33:48 +0100 Subject: [PATCH 01/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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/52] 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 8d9ae906c8cbd1c410b7536a55408a27916213ff Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:15:45 +0100 Subject: [PATCH 23/52] 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 24/52] 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 25/52] 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 26/52] 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 27/52] 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 28/52] 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 29/52] 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 30/52] 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 31/52] 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 32/52] 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 33/52] 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 007e58782ac32a92815f97492956aced2e54be93 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 9 Feb 2021 14:26:46 +0100 Subject: [PATCH 34/52] 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 35/52] 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 075d2c3dedb081ba19e6e615630a38d4754c54fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 17:58:59 +0100 Subject: [PATCH 36/52] remove deprecated --- htdocs/comm/propal/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e823ec95cdc..ba78c711dcc 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2016 Marcos García - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2020 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -1557,12 +1557,11 @@ if ($action == 'create') } print ''."\n"; - if ($socid > 0) - { + if ($socid > 0) { // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); + $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); print ''; // Third party discounts info line @@ -1612,8 +1611,9 @@ if ($action == 'create') // Delivery delay print ''.$langs->trans('AvailabilityPeriod'); - if (!empty($conf->commande->enabled)) + if (!empty($conf->commande->enabled)) { print ' ('.$langs->trans('AfterOrder').')'; + } print ''; print img_picto('', 'clock').' '; $form->selectAvailabilityDelay('', 'availability_id', '', 1); From fb4aea8223b1d98ecfc247a0c27efd91cd51bd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 18:02:41 +0100 Subject: [PATCH 37/52] Update card.php --- htdocs/commande/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f6b3a1b3fa4..36dd3e03a99 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1603,7 +1603,7 @@ if ($action == 'create' && $usercancreate) // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); + $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); print ''; // Ligne info remises tiers @@ -1644,8 +1644,7 @@ if ($action == 'create' && $usercancreate) print ''; // Bank Account - if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) - { + if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; print img_picto('', 'bank_account'); $form->select_comptes($fk_account, 'fk_account', 0, '', 1); From 2c6656b2ad99a916d9d0ccee4716765ef4d4cc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 18:07:21 +0100 Subject: [PATCH 38/52] Update card.php --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 36dd3e03a99..f7cc3e7af47 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1603,7 +1603,7 @@ if ($action == 'create' && $usercancreate) // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); print ''; // Ligne info remises tiers From aecb185c8d1d1fb8b0e7e134ce0584c5e50a256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 18:07:58 +0100 Subject: [PATCH 39/52] Update card.php --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index ba78c711dcc..da97b627858 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1561,7 +1561,7 @@ if ($action == 'create') // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); print ''; // Third party discounts info line From da8c80071f4f61be024014465063e96a0074fb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 18:09:35 +0100 Subject: [PATCH 40/52] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4284b009019..f97ca3ca95b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1479,7 +1479,7 @@ class Form if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql .= " AND sp.statut <> 0"; $sql .= " ORDER BY sp.lastname ASC"; - dol_syslog(get_class($this)."::select_contacts", LOG_DEBUG); + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { From f8dd1a7fc73a9a6e22f6421e755424c5aded371f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 22:00:54 +0100 Subject: [PATCH 41/52] Update list.php --- htdocs/projet/list.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index b8ab088cf85..b6fee6adf7a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -563,11 +563,10 @@ if (!empty($arrayfields['p.title']['checked'])) if (!empty($arrayfields['s.nom']['checked'])) { print ''; - if ($socid > 0) - { + if ($socid > 0) { $tmpthirdparty = new Societe($db); $tmpthirdparty->fetch($socid); - $search_societe = $tmpthirdparty->nom; + $search_societe = $tmpthirdparty->name; } print ''; print ''; From 097ff0d7b60427707453c6c67e0e81813de8f586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 22:14:46 +0100 Subject: [PATCH 42/52] Update commande.class.php --- htdocs/commande/class/commande.class.php | 29 +++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 2946aea94b5..4c2f643df1c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2016-2018 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -126,6 +127,10 @@ class Commande extends CommonOrder * @var int Draft Status of the order */ public $brouillon; + + /** + * @var string Condition payment code + */ public $cond_reglement_code; /** @@ -166,8 +171,16 @@ class Commande extends CommonOrder */ public $availability; - public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...) + /** + * @var int Source demand reason Id + */ + public $demand_reason_id; + + /** + * @var string Source reason code. Why we receive order (after a phone campaign, ...) + */ public $demand_reason_code; + /** * @var int Date of order */ @@ -182,11 +195,15 @@ class Commande extends CommonOrder /** * @var int Date expected for delivery + * @see delivery_date * @deprecated */ - public $date_livraison; // deprecated; Use delivery_date instead. + public $date_livraison; - public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + /** + * @var int Date expected of shipment (date starting shipment, not the reception that occurs some days after) + */ + public $delivery_date; /** * @var int ID @@ -200,6 +217,9 @@ class Commande extends CommonOrder public $special_code; public $source; // Order mode. How we received order (by phone, by email, ...) + /** + * @var int Warehouse Id + */ public $warehouse_id; public $extraparams = array(); @@ -227,6 +247,9 @@ class Commande extends CommonOrder */ public $fk_multicurrency; + /** + * @var string multicurrency code + */ public $multicurrency_code; public $multicurrency_tx; public $multicurrency_total_ht; From 7bbd89393a39b7117b5d6a2754a56a16fb468326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:45:23 +0100 Subject: [PATCH 43/52] doxygen --- test/phpunit/AccountingAccountTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php index ce67dc0b839..52efe3a0147 100644 --- a/test/phpunit/AccountingAccountTest.php +++ b/test/phpunit/AccountingAccountTest.php @@ -189,7 +189,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase /** * testAccountingAccountUpdate * - * @param Object $localobject AccountingAccount + * @param AccountingAccount $localobject AccountingAccount * @return int ID accounting account * * @depends testAccountingAccountFetch From 62bfb7342301853a4c5faa5531ee6466ac9a8947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:46:26 +0100 Subject: [PATCH 44/52] Update ActionCommTest.php --- test/phpunit/ActionCommTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index db1ff5667ef..cb908416535 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -207,7 +207,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase /** * testActionCommUpdate * - * @param Object $localobject ActionComm + * @param ActionComm $localobject ActionComm * @return int Id action comm updated * * @depends testActionCommFetch From f1ce1ed9c8baed5565654cb424da379c0c4fa82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:48:28 +0100 Subject: [PATCH 45/52] Update BankAccountTest.php --- test/phpunit/BankAccountTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index 0c43d2e53e8..3e229d3b41c 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -180,7 +180,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase /** * testBankAccountOther * - * @param Object $localobject Object contract + * @param Account $localobject Account * @return int * * @depends testBankAccountFetch From 763b8f071eee7fa4e6678d35cec2b2335305b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:50:40 +0100 Subject: [PATCH 46/52] Update CommandeFournisseurTest.php --- test/phpunit/CommandeFournisseurTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 4c26edcd644..28fc9b8daac 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -272,7 +272,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase /** * testCommandeFournisseurValid * - * @param Object $localobject Supplier order + * @param CommandeFournisseur $localobject Supplier order * @return CommandeFournisseur Supplier order * * @depends testCommandeFournisseurFetch @@ -296,7 +296,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase /** * testCommandeFournisseurApprove * - * @param Object $localobject Supplier order + * @param CommandeFournisseur $localobject Supplier order * @return CommandeFournisseur Supplier order * * @depends testCommandeFournisseurValid @@ -320,7 +320,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase /** * testCommandeFournisseurCancel * - * @param Object $localobject Supplier order + * @param CommandeFournisseur $localobject Supplier order * @return CommandeFournisseur Supplier order * * @depends testCommandeFournisseurApprove @@ -344,7 +344,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase /** * testCommandeFournisseurOther * - * @param Object $localobject Supplier order + * @param CommandeFournisseur $localobject Supplier order * @return int Id of purchase order * * @depends testCommandeFournisseurCancel From db8afec96ba241a0b618ae0845addc43c7e5a6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:51:49 +0100 Subject: [PATCH 47/52] Update CommandeTest.php --- test/phpunit/CommandeTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index c735890b02e..4ab81d63524 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -180,7 +180,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase /** * testCommandeUpdate * - * @param Object $localobject Commande + * @param Commande $localobject Commande * @return Commande * * @depends testCommandeFetch @@ -205,7 +205,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase /** * testCommandeValid * - * @param Object $localobject Order + * @param Commande $localobject Order * @return Commande * * @depends testCommandeUpdate @@ -229,7 +229,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase /** * testCommandeCancel * - * @param Object $localobject Order + * @param Commande $localobject Order * @return Commande * * @depends testCommandeValid @@ -253,7 +253,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase /** * testCommandeOther * - * @param Object $localobject Order + * @param Commande $localobject Order * @return int Order id * * @depends testCommandeCancel From 9db3499aef3aca09753659e83e79bfec213fd3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:52:53 +0100 Subject: [PATCH 48/52] Update CommonInvoiceTest.php --- test/phpunit/CommonInvoiceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CommonInvoiceTest.php b/test/phpunit/CommonInvoiceTest.php index 9addda59cef..f4cfaefb809 100644 --- a/test/phpunit/CommonInvoiceTest.php +++ b/test/phpunit/CommonInvoiceTest.php @@ -17,7 +17,7 @@ */ /** - * \file test/phpunit/CommonObjectTest.php + * \file test/phpunit/CommonInvoiceTest.php * \ingroup test * \brief PHPUnit test * \remarks To run this script as CLI: phpunit filename.php From 4c17fefb95ecd78067b459ccf09a75a8ec1a2bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Feb 2021 23:54:53 +0100 Subject: [PATCH 49/52] Update CompanyBankAccountTest.php --- test/phpunit/CompanyBankAccountTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 17f6a9ccacf..8b78712209f 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -150,8 +150,8 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase /** * testCompanyBankAccountFetch * - * @param int $id Id of bank account - * @return Object Bank account object + * @param int $id Id of bank account + * @return CompanyBankAccount Bank account object * * @depends testCompanyBankAccountCreate * The depends says test is run only if previous is ok @@ -174,7 +174,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase /** * testCompanyBankAccountSetAsDefault * - * @param Object $localobject Bank account + * @param CompanyBankAccount $localobject Bank account * @return int * * @depends testCompanyBankAccountFetch @@ -196,7 +196,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase /** * testCompanyBankAccountUpdate * - * @param Object $localobject Bank account object + * @param CompanyBankAccount $localobject Bank account object * @return int * * @depends testCompanyBankAccountFetch @@ -221,7 +221,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase /** * testCompanyBankAccountOther * - * @param Object $localobject Bank account + * @param CompanyBankAccount $localobject Bank account * @return int * * @depends testCompanyBankAccountFetch From 653b0d6090f549b23bc6d3237ee75635fb651677 Mon Sep 17 00:00:00 2001 From: LAURIER Alexis <19586755+AlexisLaurier@users.noreply.github.com> Date: Wed, 10 Feb 2021 08:11:28 +0100 Subject: [PATCH 50/52] Add mass action on direct debit request list Add mass action on direct debit request list into direct debit voucher create page --- htdocs/compta/prelevement/create.php | 30 +++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index db751735bb0..f138975d361 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -47,6 +47,8 @@ $type = GETPOST('type', 'aZ09'); // Get supervariables $action = GETPOST('action', 'aZ09'); +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $mode = GETPOST('mode', 'alpha') ?GETPOST('mode', 'alpha') : 'real'; $format = GETPOST('format', 'aZ09'); $id_bankaccount = GETPOST('id_bankaccount', 'int'); @@ -61,6 +63,7 @@ $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard')); /* * Actions */ +if (GETPOST('cancel', 'alpha')) { $massaction = ''; } $parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -121,7 +124,9 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id); exit; } - } + $objectclass = "BonPrelevement"; + $uploaddir = $conf->prelevement->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -138,6 +143,12 @@ if ($type != 'bank-transfer') { $invoicestatic = new FactureFournisseur($db); } $bprev = new BonPrelevement($db); +$arrayofselected = is_array($toselect) ? $toselect : array(); +// List of mass actions available +$arrayofmassactions = array( +); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); llxHeader('', $langs->trans("NewStandingOrder")); @@ -273,7 +284,7 @@ print '
'; */ $sql = "SELECT f.ref, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,"; -$sql .= " pfd.date_demande, pfd.amount"; +$sql .= " pfd.rowid as request_row_id, pfd.date_demande, pfd.amount"; if ($type == 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; } else { @@ -332,7 +343,7 @@ if ($resql) if ($type == 'bank-transfer') { $title = $langs->trans("InvoiceWaitingPaymentByBankTransfer"); } - print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, '', '', $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, '', '', $limit); $tradinvoice = "Invoice"; if ($type == 'bank-transfer') { @@ -347,6 +358,10 @@ if ($resql) print ''.$langs->trans("RUM").''; print ''.$langs->trans("AmountTTC").''; print ''.$langs->trans("DateRequest").''; + if ($massactionbutton || $massaction ) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + print ''.$form->showCheckAddButtons('checkforselect', 1).''; + } print ''; if ($num) @@ -402,6 +417,15 @@ if ($resql) print ''; print dol_print_date($db->jdate($obj->date_demande), 'day'); print ''; + // Action column + if ($massactionbutton || $massaction ) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + print ''; + $selected = 0; + if (in_array($obj->request_row_id, $arrayofselected)) $selected = 1; + print ''; + print ''; + } print ''; $i++; } From 608a7152cf353b817e457b0d800c39f90ffdb460 Mon Sep 17 00:00:00 2001 From: LAURIER Alexis <19586755+AlexisLaurier@users.noreply.github.com> Date: Wed, 10 Feb 2021 08:15:16 +0100 Subject: [PATCH 51/52] Correct missing semi column --- htdocs/compta/prelevement/create.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index f138975d361..03bc3d8754e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -124,6 +124,7 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id); exit; } + } $objectclass = "BonPrelevement"; $uploaddir = $conf->prelevement->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; From ae192bf4c94ce3b305d5622e5d5cb402b57f6a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 10 Feb 2021 08:47:22 +0100 Subject: [PATCH 52/52] doxygen --- test/phpunit/ContratTest.php | 2 +- test/phpunit/ExpenseReportTest.php | 8 ++++---- test/phpunit/FactureFournisseurTest.php | 6 +++--- test/phpunit/FactureRecTest.php | 7 +------ test/phpunit/FactureTest.php | 8 ++++---- test/phpunit/FichinterTest.php | 2 +- test/phpunit/FilesLibTest.php | 2 -- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 5749d08cbae..cd21427eba7 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -176,7 +176,7 @@ class ContratTest extends PHPUnit\Framework\TestCase /** * testContratOther * - * @param Object $localobject Object contract + * @param Contract $localobject Object contract * @return int * * @depends testContratFetch diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index c24bf9d19e9..247a9dd1012 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -195,7 +195,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase /** * testExpenseReportValid * - * @param Object $localobject Supplier order + * @param ExpenseReport $localobject ExpenseReport * @return void * * @depends testExpenseReportFetch @@ -219,7 +219,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase /** * testExpenseReportApprove * - * @param Object $localobject Supplier order + * @param ExpenseReport $localobject ExpenseReport * @return void * * @depends testExpenseReportValid @@ -243,7 +243,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase /** * testExpenseReportCancel * - * @param Object $localobject Supplier order + * @param ExpenseReport $localobject ExpenseReport * @return void * * @depends testExpenseReportApprove @@ -267,7 +267,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase /** * testExpenseReportOther * - * @param Object $localobject Supplier order + * @param ExpenseReport $localobject ExpenseReport * @return void * * @depends testExpenseReportCancel diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index c7873ae3206..06d28a03067 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -175,7 +175,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase /** * testFactureFournisseurUpdate * - * @param Object $localobject Supplier invoice + * @param FactureFournisseur $localobject Supplier invoice * @return int * * @depends testFactureFournisseurFetch @@ -200,7 +200,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase /** * testFactureFournisseurValid * - * @param Object $localobject Supplier invoice + * @param FactureFournisseur $localobject Supplier invoice * @return void * * @depends testFactureFournisseurUpdate @@ -224,7 +224,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase /** * testFactureFournisseurOther * - * @param Object $localobject Supplier invoice + * @param FactureFournisseur $localobject Supplier invoice * @return void * * @depends testFactureFournisseurValid diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 459bea8ae87..2a0b8823973 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -152,15 +152,10 @@ class FactureRecTest extends PHPUnit\Framework\TestCase return $result; } - - - - - /** * Edit an object to test updates * - * @param mixed $localobject Object Facture + * @param Facture $localobject Object Facture * @return void */ public function changeProperties(&$localobject) diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 700507a4edf..ddb895d1b96 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -183,7 +183,7 @@ class FactureTest extends PHPUnit\Framework\TestCase /** * testFactureFetch * - * @param Object $localobject Invoice + * @param Facture $localobject Invoice * @return int * * @depends testFactureFetch @@ -208,7 +208,7 @@ class FactureTest extends PHPUnit\Framework\TestCase /** * testFactureValid * - * @param Object $localobject Invoice + * @param Facture $localobject Invoice * @return void * * @depends testFactureUpdate @@ -257,7 +257,7 @@ class FactureTest extends PHPUnit\Framework\TestCase /** * testFactureOther * - * @param Object $localobject Invoice + * @param Facture $localobject Invoice * @return int * * @depends testFactureValid @@ -345,7 +345,7 @@ class FactureTest extends PHPUnit\Framework\TestCase /** * Edit an object to test updates * - * @param mixed $localobject Object Facture + * @param Facture $localobject Object Facture * @return void */ public function changeProperties(&$localobject) diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index b2b0b3daf91..fb8cdd0b12e 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -200,7 +200,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase /** * testFichinterValid * - * @param Object $localobject Object intervention + * @param Fichinter $localobject Object intervention * @return int * * @depends testFichinterValid diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 5d73067760d..fddff66e9ea 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -1,6 +1,4 @@ * Copyright (C) 2012 Regis Houssin *