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");
79 "SUPPLIER_PROPOSAL_ADDON_PDF",
82 'Name of submodule to generate PDF for supplier quotation request',
86 "SUPPLIER_PROPOSAL_ADDON",
88 "mod_supplier_proposal_marbre",
89 'Name of submodule to number supplier quotation request',
93 "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH",
95 "DOL_DATA_ROOT".($conf->entity > 1 ?
'/'.$conf->entity :
'').
"/doctemplates/supplier_proposals",
102 $this->boxes = array();
105 $this->rights = array();
106 $this->rights_class =
'supplier_proposal';
110 $this->rights[$r][0] = $this->numero + $r;
111 $this->rights[$r][1] =
'Read supplier proposals';
112 $this->rights[$r][3] = 0;
113 $this->rights[$r][4] =
'lire';
116 $this->rights[$r][0] = $this->numero + $r;
117 $this->rights[$r][1] =
'Create/modify supplier proposals';
118 $this->rights[$r][3] = 0;
119 $this->rights[$r][4] =
'creer';
122 $this->rights[$r][0] = $this->numero + $r;
123 $this->rights[$r][1] =
'Validate supplier proposals';
124 $this->rights[$r][3] = 0;
125 $this->rights[$r][4] =
'validate_advance';
128 $this->rights[$r][0] = $this->numero + $r;
129 $this->rights[$r][1] =
'Send supplier proposals';
130 $this->rights[$r][3] = 0;
131 $this->rights[$r][4] =
'send_advance';
134 $this->rights[$r][0] = $this->numero + $r;
135 $this->rights[$r][1] =
'Delete supplier proposals';
136 $this->rights[$r][3] = 0;
137 $this->rights[$r][4] =
'supprimer';
140 $this->rights[$r][0] = $this->numero + $r;
141 $this->rights[$r][1] =
'Close supplier price requests';
142 $this->rights[$r][3] = 0;
143 $this->rights[$r][4] =
'cloturer';
146 $this->menu = array();
159 public function init($options =
'')
161 global $conf, $langs;
164 $this->
remove($options);
167 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt';
168 $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/doctemplates/supplier_proposals';
169 $dest = $dirodt.
'/template_supplier_proposal.odt';
171 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);
176 $langs->load(
"errors");
177 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
183 "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),
184 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2]).
"','supplier_proposal',".((
int) $conf->entity).
")",
187 return $this->
_init($sql, $options);