29 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
50 $this->rights_class =
'mrp';
53 $this->family =
"products";
55 $this->module_position =
'66';
59 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
61 $this->
description =
"Module to Manage Manufacturing Orders (MO)";
63 $this->descriptionlong =
"Module to Manage Manufacturing Orders (MO)";
65 $this->version =
'dolibarr';
70 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
76 $this->module_parts = array(
110 'moduleforexternal' => 0,
114 $this->dirs = array(
"/mrp/temp");
116 $this->config_page_url = array(
"mrp.php");
119 $this->hidden =
false;
121 $this->depends = array(
'modBom');
122 $this->requiredby = array();
123 $this->conflictwith = array();
124 $this->langfiles = array(
"mrp");
125 $this->phpmin = array(5, 5);
126 $this->need_dolibarr_version = array(8, 0);
127 $this->warnings_activation = array();
128 $this->warnings_activation_ext = array();
137 $this->
const = array(
138 1=>array(
'MRP_MO_ADDON_PDF',
'chaine',
'alpha',
'Name of PDF model of MO', 0),
139 2=>array(
'MRP_MO_ADDON',
'chaine',
'mod_mo_standard',
'Name of numbering rules of MO', 0),
140 3=>array(
'MRP_MO_ADDON_PDF_ODT_PATH',
'chaine',
'DOL_DATA_ROOT/doctemplates/mrps',
'', 0)
149 if (!isset($conf->mrp) || !isset($conf->mrp->enabled)) {
150 $conf->mrp =
new stdClass();
151 $conf->mrp->enabled = 0;
155 $this->tabs = array();
183 $this->dictionaries = array();
210 $this->boxes = array(
211 0 => array(
'file' =>
'box_mos.php',
'note' =>
'',
'enabledbydefaulton' =>
'Home')
216 $this->cronjobs = array(
238 $this->rights = array();
242 $this->rights[$r][0] = $this->numero + $r;
243 $this->rights[$r][1] =
'Read Manufacturing Order';
244 $this->rights[$r][4] =
'read';
245 $this->rights[$r][5] =
'';
247 $this->rights[$r][0] = $this->numero + $r;
248 $this->rights[$r][1] =
'Create/Update Manufacturing Order';
249 $this->rights[$r][4] =
'write';
250 $this->rights[$r][5] =
'';
252 $this->rights[$r][0] = $this->numero + $r;
253 $this->rights[$r][1] =
'Delete Manufacturing Order';
254 $this->rights[$r][4] =
'delete';
255 $this->rights[$r][5] =
'';
260 $this->menu = array();
315 public function init($options =
'')
317 global $conf, $langs;
320 if ($result < 0)
return -1;
332 $this->
remove($options);
337 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/mrps/template_mo.odt';
338 $dirodt = DOL_DATA_ROOT.
'/doctemplates/mrps';
339 $dest = $dirodt.
'/template_mo.odt';
341 if (file_exists($src) && !file_exists($dest))
343 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
345 $result =
dol_copy($src, $dest, 0, 0);
348 $langs->load(
"errors");
349 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
359 return $this->
_init($sql, $options);
370 public function remove($options =
'')
373 return $this->
_remove($sql, $options);
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
init($options= '')
Function called when module is enabled.
</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.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
_remove($array_sql, $options= '')
Disable function.
Description and activation class for module Mrp.
__construct($db)
Constructor.
_init($array_sql, $options= '')
Enables a module.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
_load_tables($reldir)
Create tables and keys required by module.