From 715ce8b7459527bfd6b10613c77e5a3fcfbf9052 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Mon, 18 Mar 2024 15:22:00 +0100 Subject: [PATCH 1/9] Backport #23972 --- htdocs/includes/tcpdi/tcpdi_parser.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/includes/tcpdi/tcpdi_parser.php b/htdocs/includes/tcpdi/tcpdi_parser.php index 174c496d4f408..ef4162d5f4f96 100644 --- a/htdocs/includes/tcpdi/tcpdi_parser.php +++ b/htdocs/includes/tcpdi/tcpdi_parser.php @@ -715,8 +715,7 @@ protected function getRawObject($offset=0, $data=null) { $next = strcspn($data, "\r\n", $offset); if ($next > 0) { $offset += $next; - list($obj, $unused) = $this->getRawObject($offset, $data); - return $obj; + return $this->getRawObject($offset, $data); } break; } From 5f1796b39aca86d0261df8312b45d42d5bfeec0c Mon Sep 17 00:00:00 2001 From: Delthair <41671350+Delthair@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:49:12 +0100 Subject: [PATCH 2/9] FIX #29029 Impossible to delete an order line Impossible to delete a line because the code lead to add an error if the request is valid therefore leading to a rollback of the request --- 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 410713d7c122d..9a3319c813848 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4445,7 +4445,7 @@ public function delete(User $user, $notrigger = 0) dol_syslog("OrderLine::delete", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) { + if (!$resql) { $this->error = $this->db->lasterror(); $error++; } From 5378c85c5da5586931c9d8e93384db8376e9d781 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 24 Mar 2024 11:35:18 +0100 Subject: [PATCH 3/9] FIX missing hide "new" button where "product" or "service" module is disable --- htdocs/product/agenda.php | 2 +- htdocs/product/composition/card.php | 2 +- htdocs/product/document.php | 2 +- htdocs/product/fournisseurs.php | 2 +- htdocs/product/list.php | 4 ++-- htdocs/product/note.php | 2 +- htdocs/product/price.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stats/facture.php | 2 +- htdocs/product/stock/product.php | 2 +- htdocs/product/traduction.php | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index ed5d456b3a54a..8e15448517842 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -160,7 +160,7 @@ $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); print dol_get_fiche_head($head, 'agenda', $titre, -1, $picto); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = "fk_product_type = ".((int) $object->type); $shownav = 1; diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index f7ea2478da7c9..25ac2d9366411 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -226,7 +226,7 @@ * Product card */ if ($user->rights->produit->lire || $user->hasRight('service', 'lire')) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $shownav = 1; if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { diff --git a/htdocs/product/document.php b/htdocs/product/document.php index f7753432043cf..c38e30123d0d5 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -239,7 +239,7 @@ } - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = "fk_product_type = ".((int) $object->type); $shownav = 1; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b36c134d20b52..5812b019726f6 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -390,7 +390,7 @@ print dol_get_fiche_head($head, 'suppliers', $titre, -1, $picto); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = "fk_product_type = ".((int) $object->type); $shownav = 1; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index c8295800dcc64..e99857ee45406 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -848,11 +848,11 @@ $params['forcenohideoftext'] = 1; } -if ($type === "" || $type == Product::TYPE_PRODUCT) { +if ((isModEnabled('product') && $type === "") || $type == Product::TYPE_PRODUCT) { $label = 'NewProduct'; $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params); } -if ($type === "" || $type == Product::TYPE_SERVICE) { +if ((isModEnabled('service') && $type === "") || $type == Product::TYPE_SERVICE) { $label = 'NewService'; $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=1', '', $perm, $params); } diff --git a/htdocs/product/note.php b/htdocs/product/note.php index f8dab5e6bf389..13a611e9f2506 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -122,7 +122,7 @@ print dol_get_fiche_head($head, 'note', $titre, -1, $picto); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = "fk_product_type = ".((int) $object->type); $shownav = 1; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9dc217f782c8e..33f26a0dd3938 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -866,7 +866,7 @@ print dol_get_fiche_head($head, 'price', $titre, -1, $picto); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = "fk_product_type = ".((int) $object->type); $shownav = 1; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index a91927e77d4d1..93e3ef2d3e2b6 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -151,7 +151,7 @@ print dol_get_fiche_head($head, 'stats', $titre, -1, $picto); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', '', '', '', 0, '', '', 1); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index c5209b725b574..2c9befc5c4e9c 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -128,7 +128,7 @@ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $shownav = 1; if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index d52b15ca3079c..fe9d71aa52681 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -611,7 +611,7 @@ dol_htmloutput_events(); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $shownav = 1; if ($user->socid && !in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 1544df1ca2ca1..8fc7c41569225 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -212,7 +212,7 @@ print dol_get_fiche_head($head, 'translation', $titre, 0, $picto); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $shownav = 1; if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { From 6b723711635f7f16d2ab8351fd1e810ea18ab9a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Mar 2024 18:31:59 +0100 Subject: [PATCH 4/9] Fix warning --- htdocs/core/class/stats.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 801ce765a8c1d..cc12e5aeedf1a 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -158,8 +158,12 @@ public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, dol_mkdir($conf->user->dir_temp); } $fp = fopen($newpathofdestfile, 'w'); - fwrite($fp, json_encode($data)); - fclose($fp); + if ($fp) { + fwrite($fp, json_encode($data)); + fclose($fp); + } else { + dol_syslog("Failed to save cache file ".$newpathofdestfile); + } dolChmod($newpathofdestfile); $this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt; From 38156a84fcf063e764131f8e963d1e29a4ea98bc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 26 Mar 2024 20:40:26 +0100 Subject: [PATCH 5/9] FIX wrong sql request with product category filter --- htdocs/fourn/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 2f8fb164205cb..f071292aa33a7 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -628,17 +628,17 @@ $listofcategoryid = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product)"; + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { if ($searchCategoryProductOperator == 0) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; } else { $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); } } } if ($listofcategoryid) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } if ($searchCategoryProductOperator == 1) { if (!empty($searchCategoryProductSqlList)) { From d8e102a24c2d822e46ad52d6afccf515baba642f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 27 Mar 2024 01:14:05 +0100 Subject: [PATCH 6/9] FIX wrong stock permission number --- htdocs/core/modules/modStock.class.php | 151 ++++++++++++++----------- 1 file changed, 82 insertions(+), 69 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 439826effdf5d..9e55f9a77bb28 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -113,78 +113,91 @@ public function __construct($db) $this->rights = array(); $this->rights_class = 'stock'; - $this->rights[0][0] = 1001; - $this->rights[0][1] = 'Lire les stocks'; - $this->rights[0][2] = 'r'; - $this->rights[0][3] = 0; - $this->rights[0][4] = 'lire'; - $this->rights[0][5] = ''; - - $this->rights[1][0] = 1002; - $this->rights[1][1] = 'Creer/Modifier les stocks'; - $this->rights[1][2] = 'w'; - $this->rights[1][3] = 0; - $this->rights[1][4] = 'creer'; - $this->rights[1][5] = ''; - - $this->rights[2][0] = 1003; - $this->rights[2][1] = 'Supprimer les stocks'; - $this->rights[2][2] = 'd'; - $this->rights[2][3] = 0; - $this->rights[2][4] = 'supprimer'; - $this->rights[2][5] = ''; - - $this->rights[3][0] = 1004; - $this->rights[3][1] = 'Lire mouvements de stocks'; - $this->rights[3][2] = 'r'; - $this->rights[3][3] = 0; - $this->rights[3][4] = 'mouvement'; - $this->rights[3][5] = 'lire'; - - $this->rights[4][0] = 1005; - $this->rights[4][1] = 'Creer/modifier mouvements de stocks'; - $this->rights[4][2] = 'w'; - $this->rights[4][3] = 0; - $this->rights[4][4] = 'mouvement'; - $this->rights[4][5] = 'creer'; - - $this->rights[5][0] = 1011; - $this->rights[5][1] = 'inventoryReadPermission'; // Permission label - $this->rights[5][3] = 0; // Permission by default for new user (0/1) - $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $this->rights[6][0] = 1012; - $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label - $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $this->rights[6][0] = 1013; - $this->rights[6][1] = 'inventoryDeletePermission'; // Permission label - $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[6][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $r = 0; + + $this->rights[$r][0] = 1001; + $this->rights[$r][1] = 'Lire les stocks'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'lire'; + $this->rights[$r][5] = ''; + + $r++; + $this->rights[$r][0] = 1002; + $this->rights[$r][1] = 'Creer/Modifier les stocks'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'creer'; + $this->rights[$r][5] = ''; + + $r++; + $this->rights[$r][0] = 1003; + $this->rights[$r][1] = 'Supprimer les stocks'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'supprimer'; + $this->rights[$r][5] = ''; + $r++; + $this->rights[$r][0] = 1004; + $this->rights[$r][1] = 'Lire mouvements de stocks'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'mouvement'; + $this->rights[$r][5] = 'lire'; + + $r++; + $this->rights[$r][0] = 1005; + $this->rights[$r][1] = 'Creer/modifier mouvements de stocks'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'mouvement'; + $this->rights[$r][5] = 'creer'; + + $r++; + $this->rights[$r][0] = 1011; + $this->rights[$r][1] = 'inventoryReadPermission'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $r++; + $this->rights[$r][0] = 1012; + $this->rights[$r][1] = 'inventoryCreatePermission'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $r++; + $this->rights[$r][0] = 1013; + $this->rights[$r][1] = 'inventoryDeletePermission'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + // TODO and if MAIN_FEATURES_LEVEL >= 2 after module is activated ? if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $this->rights[8][0] = 1014; - $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label - $this->rights[8][3] = 0; // Permission by default for new user (0/1) - $this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $this->rights[9][0] = 1015; - $this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label - $this->rights[9][3] = 0; // Permission by default for new user (0/1) - $this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $this->rights[10][0] = 1016; - $this->rights[10][1] = 'inventoryDeletePermission'; // Permission label - $this->rights[10][3] = 0; // Permission by default for new user (0/1) - $this->rights[10][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[10][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $r++; + $this->rights[$r][0] = 1014; + $this->rights[$r][1] = 'inventoryValidatePermission'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $r++; + $this->rights[$r][0] = 1015; + $this->rights[$r][1] = 'inventoryChangePMPPermission'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $r++; + $this->rights[$r][0] = 1016; + $this->rights[$r][1] = 'inventoryDeletePermission'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) } // Main menu entries From f16b08fbdb8f8c78635c8d3280227c21ffb4c6e3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 27 Mar 2024 01:21:15 +0100 Subject: [PATCH 7/9] FIX peut pas faire mieux ! --- htdocs/core/modules/modStock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 9e55f9a77bb28..6d2dd563a7d5d 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -89,7 +89,7 @@ public function __construct($db) $this->const[$r][0] = "MOUVEMENT_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "stdmovement"; - $this->const[$r][3] = 'Name of PDF model of stock mouvement'; + $this->const[$r][3] = 'Name of PDF model of stock movement'; $this->const[$r][4] = 0; $r++; From 2ae4f94eed8e9dd6e9e02246df16b8c4a71a83dc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 27 Mar 2024 02:24:57 +0100 Subject: [PATCH 8/9] FIX inventoryDeletePermission id define twice --- htdocs/core/modules/modStock.class.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 6d2dd563a7d5d..a5ae3f31e53e6 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -191,13 +191,6 @@ public function __construct($db) $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $r++; - $this->rights[$r][0] = 1016; - $this->rights[$r][1] = 'inventoryDeletePermission'; // Permission label - $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) } // Main menu entries From dd42f45d1ab45e4b0c8646e9c8d3b3ede43f38d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2024 10:59:05 +0100 Subject: [PATCH 9/9] Fix precommit --- htdocs/core/modules/modStock.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index a5ae3f31e53e6..e9e9ccc79a6f0 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -116,7 +116,7 @@ public function __construct($db) $r = 0; $this->rights[$r][0] = 1001; - $this->rights[$r][1] = 'Lire les stocks'; + $this->rights[$r][1] = 'Read stocks'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; @@ -124,7 +124,7 @@ public function __construct($db) $r++; $this->rights[$r][0] = 1002; - $this->rights[$r][1] = 'Creer/Modifier les stocks'; + $this->rights[$r][1] = 'Create/Modify stocks'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; @@ -132,7 +132,7 @@ public function __construct($db) $r++; $this->rights[$r][0] = 1003; - $this->rights[$r][1] = 'Supprimer les stocks'; + $this->rights[$r][1] = 'Delete stock'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'supprimer'; @@ -140,7 +140,7 @@ public function __construct($db) $r++; $this->rights[$r][0] = 1004; - $this->rights[$r][1] = 'Lire mouvements de stocks'; + $this->rights[$r][1] = 'Read stock movements'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'mouvement'; @@ -148,7 +148,7 @@ public function __construct($db) $r++; $this->rights[$r][0] = 1005; - $this->rights[$r][1] = 'Creer/modifier mouvements de stocks'; + $this->rights[$r][1] = 'Create/modify stock movements'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'mouvement'; @@ -177,7 +177,6 @@ public function __construct($db) // TODO and if MAIN_FEATURES_LEVEL >= 2 after module is activated ? if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $r++; $this->rights[$r][0] = 1014; $this->rights[$r][1] = 'inventoryValidatePermission'; // Permission label