29 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
46 $this->family =
"technic";
48 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
51 $this->version =
'dolibarr';
52 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
53 $this->picto =
'barcode';
56 $this->dirs = array(
"/barcode/temp");
59 $this->depends = array();
60 $this->requiredby = array();
63 $this->config_page_url = array(
"barcode.php");
68 $this->
const = array();
75 $this->boxes = array();
78 $this->rights = array();
79 $this->rights_class =
'barcode';
81 $this->rights[1][0] = 301;
82 $this->rights[1][1] =
'Read barcodes';
83 $this->rights[1][2] =
'r';
84 $this->rights[1][3] = 1;
85 $this->rights[1][4] =
'lire_advance';
87 $this->rights[2][0] = 302;
88 $this->rights[2][1] =
'Create/modify barcodes';
89 $this->rights[2][2] =
'w';
90 $this->rights[2][3] = 0;
91 $this->rights[2][4] =
'creer_advance';
97 $this->menu[$r] = array(
98 'fk_menu'=>
'fk_mainmenu=tools',
100 'leftmenu'=>
'barcodeprint',
102 'titre'=>
'BarCodePrintsheet',
103 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
104 'url'=>
'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint',
107 'enabled'=>
'$conf->barcode->enabled',
108 'perms'=>
'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)',
115 $this->menu[$r] = array(
116 'fk_menu'=>
'fk_mainmenu=home,fk_leftmenu=admintools',
118 'titre'=>
'MassBarcodeInit',
119 'url'=>
'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools',
122 'enabled'=>
'$conf->barcode->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)',
123 'perms'=>
'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)',
139 public function init($options =
'')
142 $this->
remove($options);
145 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)",
'ignoreerror'=>1),
146 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
147 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
148 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)",
'ignoreerror'=>1),
149 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)",
'ignoreerror'=>1),
150 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",
'ignoreerror'=>1),
151 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)",
'ignoreerror'=>1),
152 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('QRCODE', 'Qr Code', 0, 'www.dolibarr.org', __ENTITY__)",
'ignoreerror'=>1)
155 return $this->
_init($sql, $options);
__construct($db)
Constructor.
$conf db
API class for accounts.
init($options= '')
Function called when module is enabled.
$conf db name
Only used if Module[ID]Name translation string is not found.
Class to describe Barcode.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
_init($array_sql, $options= '')
Enables a module.