29include_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");
70 0 => array(
'BARCODE_USE_ON_PRODUCT',
'chaine',
'1',
'Constant to activate barcode for products', 0)
74 $this->boxes = array();
77 $this->rights = array();
78 $this->rights_class =
'barcode';
81 $this->rights[$r][0] = 301;
82 $this->rights[$r][1] =
'Generate PDF sheets of barcodes';
83 $this->rights[$r][2] =
'r';
84 $this->rights[$r][3] = 0;
85 $this->rights[$r][4] =
'read';
88 $this->rights[$r][0] = 304;
89 $this->rights[$r][1] =
'Read barcodes';
90 $this->rights[$r][2] =
'r';
91 $this->rights[$r][3] = 0;
92 $this->rights[$r][4] =
'lire_advance';
95 $this->rights[$r][0] = 305;
96 $this->rights[$r][1] =
'Create/modify barcodes';
97 $this->rights[$r][2] =
'w';
98 $this->rights[$r][3] = 0;
99 $this->rights[$r][4] =
'creer_advance';
106 $this->menu[$r] = array(
107 'fk_menu'=>
'fk_mainmenu=tools',
109 'leftmenu'=>
'barcodeprint',
111 'titre'=>
'BarCodePrintsheet',
112 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
113 'url'=>
'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint',
116 'enabled'=>
'isModEnabled("barcode")',
117 'perms'=>
'$user->hasRight("barcode", "read")',
124 $this->menu[$r] = array(
125 'fk_menu'=>
'fk_mainmenu=home,fk_leftmenu=admintools',
127 'titre'=>
'MassBarcodeInit',
128 'url'=>
'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools',
131 'enabled'=>
'isModEnabled("barcode") && preg_match(\'/^(admintools|all)/\', $leftmenu)',
132 'perms'=>
'$user->admin',
148 public function init($options =
'')
151 $this->
remove($options);
154 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)",
'ignoreerror'=>1),
155 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
156 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
157 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)",
'ignoreerror'=>1),
158 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)",
'ignoreerror'=>1),
159 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",
'ignoreerror'=>1),
160 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)",
'ignoreerror'=>1),
161 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)
164 return $this->
_init($sql, $options);
_init($array_sql, $options='')
Enables a module.
Class to describe Barcode.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.