29 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
47 $this->family =
"technic";
49 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
52 $this->version =
'dolibarr';
53 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
54 $this->picto =
'barcode';
57 $this->dirs = array(
"/barcode/temp");
60 $this->depends = array();
61 $this->requiredby = array();
64 $this->config_page_url = array(
"barcode.php");
69 $this->
const = array();
76 $this->boxes = array();
79 $this->rights = array();
80 $this->rights_class =
'barcode';
82 $this->rights[1][0] = 300;
83 $this->rights[1][1] =
'Read barcodes';
84 $this->rights[1][2] =
'r';
85 $this->rights[1][3] = 1;
86 $this->rights[1][4] =
'lire_advance';
88 $this->rights[2][0] = 301;
89 $this->rights[2][1] =
'Create/modify barcodes';
90 $this->rights[2][2] =
'w';
91 $this->rights[2][3] = 0;
92 $this->rights[2][4] =
'creer_advance';
96 $this->menu[$r] = array(
'fk_menu'=>
'fk_mainmenu=tools',
98 'leftmenu'=>
'barcodeprint',
100 'titre'=>
'BarCodePrintsheet',
101 'url'=>
'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint',
104 'enabled'=>
'$conf->barcode->enabled',
105 'perms'=>
'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)',
110 $this->menu[$r] = array(
'fk_menu'=>
'fk_mainmenu=home,fk_leftmenu=admintools',
112 'titre'=>
'MassBarcodeInit',
113 'url'=>
'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools',
116 'enabled'=>
'$conf->barcode->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)',
117 'perms'=>
'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)',
132 public function init($options =
'')
135 $this->
remove($options);
138 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)",
'ignoreerror'=>1),
139 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
140 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)",
'ignoreerror'=>1),
141 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)",
'ignoreerror'=>1),
142 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)",
'ignoreerror'=>1),
143 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",
'ignoreerror'=>1),
144 array(
'sql'=>
"INSERT INTO ".MAIN_DB_PREFIX.
"c_barcode_type (code, libelle, coder, example, entity) VALUES ('DATAMATRIX', 'Datamatrix', 0, '1234567xyz', __ENTITY__)",
'ignoreerror'=>1),
145 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)
148 return $this->
_init($sql, $options);
__construct($db)
Constructor.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
init($options= '')
Function called when module is enabled.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
Class to describe Barcode.
_init($array_sql, $options= '')
Enables a module.