diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 88b154f891eeb44e39c62a79256dd5f615a7bc8c..7f949501023a0e6860fea493aa4664197386796c 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -138,7 +138,7 @@ class modCron extends DolibarrModules 'url'=>'/cron/list.php?status=-2&leftmenu=admintools', 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>200, - 'enabled'=>'($leftmenu==\'admintools\' || $leftmenu==\'admintools_info\')', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'$conf->cron->enabled && preg_match(\'/^admintools/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php index b68148377c3fe5c796061ee22b8800d5b0b880c3..dce442720a31a243ae840fa398a54097a7750ffe 100644 --- a/htdocs/core/modules/modModuleBuilder.class.php +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -85,5 +85,19 @@ class modModuleBuilder extends DolibarrModules // Main menu entries //------------------ $this->menu = array(); + + $this->menu[$r]=array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', + 'type'=>'left', + 'titre'=>'ModuleBuilder', + 'mainmenu'=>'home', + 'leftmenu'=>'admintools_modulebuilder', + 'url'=>'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools_modulebuilder', + 'langs'=>'modulebuilder', + 'position'=>100, + 'perms'=>'1', + 'enabled'=>'$conf->modulebuilder->enabled && preg_match(\'/^admintools/\',$leftmenu) && ($user->admin || $conf->global->MODULEBUILDER_FOREVERYONE)', + 'target'=>'_modulebuilder', + 'user'=>0); + } } diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index fd101615809858b528c3f6f42b5d3b87e80026d8..89bf6115dae00e9c7a7efc8309303cb5699aaecb 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -111,7 +111,7 @@ class modPrinting extends DolibarrModules 'url'=>'/printing/index.php?mainmenu=home&leftmenu=admintools', 'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>300, - 'enabled'=>'$conf->printing->enabled && ($leftmenu==\'admintools\' || $leftmenu==\'admintools_info\')', + 'enabled'=>'$conf->printing->enabled && preg_match(\'/^admintools/\', $leftmenu)', 'perms'=>'$user->rights->printing->read', // Use 'perms'=>'1' if you want your menu with no permission rules 'target'=>'', 'user'=>0); // 0=Menu for internal users, 1=external users, 2=both diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3831fb49007c270609cd5d94dd0e2a587bba9ccb..b3f43698843c43df72f7339550045526aeb7dbda 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1664,7 +1664,7 @@ UserHasNoPermissions=This user has no permission defined TypeCdr=Use "None" if the date of payment term is date of invoice plus a delta in days (delta is field "Nb of days")<br>Use "At end of month", if, after delta, the date must be increased to reach the end of month (+ an optional "Offset" in days)<br>Use "Current/Next" to have payment term date being the first Nth of the month (N is stored into field "Nb of days") BaseCurrency=Reference currency of the company (go into setup of company to change this) WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016). -WarningInstallationMayBecomeNotCompliantWithLaw=You try to install the module <strong>%s</strong> that is an external module. Activate an external module only if it does not alterate negatively the behavior required by your country laws (%s). If the module bring a non legal feature, you are the only responsible for the use of a non-compliant software. +WarningInstallationMayBecomeNotCompliantWithLaw=You try to install the module %s that is an external module. Activating an external module means you trust the editor of the module and you are sure that this module does not alterate negatively the behavior of your application and is compliant with laws of your country (%s). If the module bring a non legal feature, you become responsible for the use of a non legal software. ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 53d727d9965a6798dd6ed1b530bcf7f9c96eb313..918f46a44b79b8b695c942d1b0c4492418b56327 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -763,6 +763,7 @@ DirectDownloadLink=Direct download link Download=Download ActualizeCurrency=Update currency rate Fiscalyear=Fiscal year +ModuleBuilder=Module Builder # Week day Monday=Monday Tuesday=Tuesday diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 6605a7b6a63e7122d504bccf47aa3befd2d4325d..9979760bc4fea37a074c7f5a9b5bbfba5cea0653 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -1,3 +1,2 @@ # Dolibarr language file - Source file is en_US - loan -ModuleBuilder=Module Builder ModuleBuilderDesc=This tools give you utilites to build your own module. Your modules will be generated into the first alternative directory: <strong>%s</strong>. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fe1ed01a68fc4fcf2189d5b955d5940338de41c0..88e2760ecb45297604d660da87c672acc832c57a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1440,7 +1440,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Link to module builder if (! empty($conf->modulebuilder->enabled)) { - $text ='<a href="'.DOL_URL_ROOT.'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_blank">'; + $text ='<a href="'.DOL_URL_ROOT.'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">'; //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); $text.='<span class="fa fa-bug atoplogin"></span>'; $text.='</a>';