From 2ef787c7ffc0a86aa989acaf7602b056bd6c6243 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 11 Apr 2020 17:38:54 +0200 Subject: [PATCH] Remove expense report tab from user --- htdocs/core/modules/modExpenseReport.class.php | 2 +- htdocs/install/upgrade2.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index a17b935d709..d7a57f25818 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -102,7 +102,7 @@ class modExpenseReport extends DolibarrModules $r++; // Array to add new pages in new tabs - $this->tabs[] = array('data'=>'user:+expensereport:ExpenseReport:expensereport:$user->rights->expensereport->lire:/expensereport/list.php?mainmenu=hrm&id=__ID__'); + $this->tabs[] = array(); // Boxes $this->boxes = array(); // List of boxes diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 6825265b529..70f4bb32d19 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -477,6 +477,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_DON'=>'newboxdefonly', 'MAIN_MODULE_ECM'=>'newboxdefonly', 'MAIN_MODULE_EXTERNALSITE'=>'newboxdefonly', + 'MAIN_MODULE_EXPENSEREPORT'=>'newboxdefonly', 'MAIN_MODULE_FACTURE'=>'newboxdefonly', 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly', 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', @@ -4697,6 +4698,16 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->init($reloadmode); } } + elseif ($moduletoreload == 'MAIN_MODULE_EXPENSEREPORT') + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Expense Report module"); + $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modExpenseReport.class.php'; + if ($res) { + $mod = new modExpenseReport($db); + //$mod->remove('noboxes'); + $mod->init($reloadmode); + } + } elseif ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");