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(7, 0);
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)) {
171 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
173 $result =
dol_copy($src, $dest,
'0', 0);
175 $langs->load(
"errors");
176 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
182 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = '".$this->db->escape($this->const[0][2]).
"' AND type = 'supplier_proposal' AND entity = ".((
int)
$conf->entity),
183 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2]).
"','supplier_proposal',".((
int)
$conf->entity).
")",
186 return $this->
_init($sql, $options);