New: Add menu entry to barcode genration page.

This commit is contained in:
Laurent Destailleur 2014-01-04 12:29:20 +01:00
parent bea74e54c8
commit 6c3c66c45d
3 changed files with 14 additions and 9 deletions

View File

@ -8,6 +8,7 @@ For users:
- New: Add graph stats for suppliers orders in tab "stats" on products. - New: Add graph stats for suppliers orders in tab "stats" on products.
- New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you - New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you
use the "print" view on screen. use the "print" view on screen.
- New: Add menu entry to barcode genration page.
For translators: For translators:
- Update language files. - Update language files.

View File

@ -593,9 +593,11 @@ abstract class CommonObject
/** /**
* Load data for barcode * Load data for barcode into properties ->barcode_type*
* Properties ->barcode_type is used to find others.
* If not defined, ->element must be defined to know default barcode type.
* *
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
function fetch_barcode() function fetch_barcode()
{ {

View File

@ -96,14 +96,16 @@ class modBarcode extends DolibarrModules
// Main menu entries // Main menu entries
$r=0; $r=0;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry 'mainmenu'=>'tools',
'leftmenu'=>'barcodeprint',
'type'=>'left', // This is a Left menu entry
'titre'=>'BarCodePrintsheet', 'titre'=>'BarCodePrintsheet',
'url'=>'/barcode/printsheet.php', 'url'=>'/barcode/printsheet.php',
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200, 'position'=>200,
'enabled'=>'$leftmenu==\'modulesadmintools\' && $conf->barcode->enabled', // 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->barcode->enabled', // 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'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;