Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.8' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanjo Menent committed Aug 7, 2015
2 parents af55c84 + 38afb1a commit f695b5c
Showing 1 changed file with 40 additions and 39 deletions.
79 changes: 40 additions & 39 deletions htdocs/core/modules/modBarcode.class.php
@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -10,19 +11,19 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* \defgroup barcode Module barcode
* \brief Module pour gerer les codes barres
* \file htdocs/core/modules/modBarcode.class.php
* \ingroup barcode,produit
* \brief Fichier de description et activation du module Barcode
* \defgroup barcode Module barcode
* \brief Module pour gerer les codes barres
* \file htdocs/core/modules/modBarcode.class.php
* \ingroup barcode,produit
* \brief Fichier de description et activation du module Barcode
*/

include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
Expand All @@ -34,9 +35,9 @@ class modBarcode extends DolibarrModules
{

/**
* Constructor. Define names, constants, directories, boxes, permissions
* Constructor. Define names, constants, directories, boxes, permissions
*
* @param DoliDB $db Database handler
* @param DoliDB $db Database handler
*/
function __construct($db)
{
Expand All @@ -56,7 +57,7 @@ function __construct($db)
$this->dirs = array("/barcode/temp");

// Dependances
$this->depends = array(); // May be used for product or service or third party module
$this->depends = array(); // May be used for product or service or third party module
$this->requiredby = array();

// Config pages
Expand Down Expand Up @@ -90,43 +91,43 @@ function __construct($db)
$this->rights[2][3] = 0; // La permission est-elle une permission par defaut
$this->rights[2][4] = 'creer_advance';

// Main menu entries
$r=0;
$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?mainmenu=tools&leftmenu=barcodeprint',
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200,
'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
// Main menu entries
$r=0;
$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?mainmenu=tools&leftmenu=barcodeprint',
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200,
'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'=>'$user->rights->barcode->lire_advance', // 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++;

$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=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
'titre'=>'MassBarcodeInit',
'url'=>'/barcode/codeinit.php?mainmenu=home&leftmenu=modulesadmintools',
'langs'=>'products', // 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'=>300,
'enabled'=>'$conf->barcode->enabled && $leftmenu=="modulesadmintools"', // 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 && $leftmenu=="modulesadmintools"', // 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->barcode->creer_advance', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
$r++;
}


/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories.
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories.
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function init($options='')
{
Expand Down

0 comments on commit f695b5c

Please sign in to comment.