2
0
forked from Wavyzz/dolibarr

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

@@ -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()
{
@@ -2094,7 +2096,7 @@ abstract class CommonObject
}
$this->db->free($resql);
if ($numrows) return $numrows;
else return 0;
}
@@ -2150,7 +2152,7 @@ abstract class CommonObject
$error=0;
if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
if (! empty($this->array_options))
{
// Check parameters

View File

@@ -96,14 +96,16 @@ class modBarcode extends DolibarrModules
// Main menu entries
$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
'type'=>'left', // This is a Left menu entry
$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
'mainmenu'=>'tools',
'leftmenu'=>'barcodeprint',
'type'=>'left', // This is a Left menu entry
'titre'=>'BarCodePrintsheet',
'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,
'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.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'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
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++;