31 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
52 $this->family =
"srm";
53 $this->module_position =
'35';
54 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
57 $this->version =
'dolibarr';
59 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
60 $this->picto =
'supplier_proposal';
63 $this->dirs = array();
66 $this->config_page_url = array(
"supplier_proposal.php");
69 $this->hidden =
false;
70 $this->depends = array(
'modFournisseur');
71 $this->requiredby = array();
72 $this->conflictwith = array();
73 $this->phpmin = array(5, 4);
74 $this->langfiles = array(
"supplier_proposal");
77 $this->
const = array();
80 $this->
const[$r][0] =
"SUPPLIER_PROPOSAL_ADDON_PDF";
81 $this->
const[$r][1] =
"chaine";
82 $this->
const[$r][2] =
"aurore";
83 $this->
const[$r][3] =
'Name of submodule to generate PDF for supplier quotation request';
84 $this->
const[$r][4] = 0;
87 $this->
const[$r][0] =
"SUPPLIER_PROPOSAL_ADDON";
88 $this->
const[$r][1] =
"chaine";
89 $this->
const[$r][2] =
"mod_supplier_proposal_marbre";
90 $this->
const[$r][3] =
'Name of submodule to number supplier quotation request';
91 $this->
const[$r][4] = 0;
94 $this->
const[$r][0] =
"SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH";
95 $this->
const[$r][1] =
"chaine";
96 $this->
const[$r][2] =
"DOL_DATA_ROOT/doctemplates/supplier_proposals";
97 $this->
const[$r][3] =
"";
98 $this->
const[$r][4] = 0;
101 $this->boxes = array();
104 $this->rights = array();
105 $this->rights_class =
'supplier_proposal';
109 $this->rights[$r][0] = $this->numero + $r;
110 $this->rights[$r][1] =
'Read supplier proposals';
111 $this->rights[$r][3] = 0;
112 $this->rights[$r][4] =
'lire';
115 $this->rights[$r][0] = $this->numero + $r;
116 $this->rights[$r][1] =
'Create/modify supplier proposals';
117 $this->rights[$r][3] = 0;
118 $this->rights[$r][4] =
'creer';
121 $this->rights[$r][0] = $this->numero + $r;
122 $this->rights[$r][1] =
'Validate supplier proposals';
123 $this->rights[$r][3] = 0;
124 $this->rights[$r][4] =
'validate_advance';
127 $this->rights[$r][0] = $this->numero + $r;
128 $this->rights[$r][1] =
'Envoyer les demandes fournisseurs';
129 $this->rights[$r][3] = 0;
130 $this->rights[$r][4] =
'send_advance';
133 $this->rights[$r][0] = $this->numero + $r;
134 $this->rights[$r][1] =
'Delete supplier proposals';
135 $this->rights[$r][3] = 0;
136 $this->rights[$r][4] =
'supprimer';
139 $this->rights[$r][0] = $this->numero + $r;
140 $this->rights[$r][1] =
'Close supplier price requests';
141 $this->rights[$r][3] = 0;
142 $this->rights[$r][4] =
'cloturer';
145 $this->menu = array();
158 public function init($options =
'')
160 global $conf, $langs;
163 $this->
remove($options);
166 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt';
167 $dirodt = DOL_DATA_ROOT.
'/doctemplates/supplier_proposals';
168 $dest = $dirodt.
'/template_supplier_proposal.odt';
170 if (file_exists($src) && !file_exists($dest))
172 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
174 $result =
dol_copy($src, $dest, 0, 0);
177 $langs->load(
"errors");
178 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
184 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = '".$this->db->escape($this->const[0][2]).
"' AND type = 'supplier_proposal' AND entity = ".$conf->entity,
185 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('".$this->
db->escape($this->
const[0][2]).
"','supplier_proposal',".$conf->entity.
")",
188 return $this->
_init($sql, $options);
201 public function remove($options =
'')
204 "DELETE FROM ".MAIN_DB_PREFIX.
"rights_def WHERE module = 'askpricesupplier'"
207 return $this->
_remove($sql, $options);
init($options= '')
Function called when module is enabled.
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
</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.
Class to describe and enable module SupplierProposal.
_init($array_sql, $options= '')
Enables a module.
__construct($db)
Constructor.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)