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");
68 $this->
const = array();
75 $this->boxes = array();
78 $this->rights = array();
79 $this->rights_class =
'barcode';
82 $this->rights[$r][0] = 301;
83 $this->rights[$r][1] =
'Generate PDF sheets of barcodes';
84 $this->rights[$r][2] =
'r';
85 $this->rights[$r][3] = 0;
86 $this->rights[$r][4] =
'read';
89 $this->rights[$r][0] = 304;
90 $this->rights[$r][1] =
'Read barcodes';
91 $this->rights[$r][2] =
'r';
92 $this->rights[$r][3] = 0;
93 $this->rights[$r][4] =
'lire_advance';
96 $this->rights[$r][0] = 305;
97 $this->rights[$r][1] =
'Create/modify barcodes';
98 $this->rights[$r][2] =
'w';
99 $this->rights[$r][3] = 0;
100 $this->rights[$r][4] =
'creer_advance';
107 $this->menu[$r] = array(
108 'fk_menu'=>
'fk_mainmenu=tools',
110 'leftmenu'=>
'barcodeprint',
112 'titre'=>
'BarCodePrintsheet',
113 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
114 'url'=>
'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint',
117 'enabled'=>
'isModEnabled("barcode")',
118 'perms'=>
'$user->hasRight("barcode", "read")',
125 $this->menu[$r] = array(
126 'fk_menu'=>
'fk_mainmenu=home,fk_leftmenu=admintools',
128 'titre'=>
'MassBarcodeInit',
129 'url'=>
'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools',
132 'enabled'=>
'isModEnabled("barcode") && preg_match(\'/^(admintools|all)/\',$leftmenu)',
133 'perms'=>
'$user->admin',
149 public function init($options =
'')
152 $this->
remove($options);
155 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)",
'ignoreerror'=>1),
156 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
157 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
158 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)",
'ignoreerror'=>1),
159 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)",
'ignoreerror'=>1),
160 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",
'ignoreerror'=>1),
161 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)",
'ignoreerror'=>1),
162 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)
165 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)
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.