51 $this->family =
"srm";
52 $this->module_position =
'35';
53 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
56 $this->version =
'dolibarr';
58 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
59 $this->picto =
'supplier_proposal';
62 $this->dirs = array();
65 $this->config_page_url = array(
"supplier_proposal.php");
68 $this->hidden =
false;
69 $this->depends = array(
'modFournisseur');
70 $this->requiredby = array();
71 $this->conflictwith = array();
72 $this->phpmin = array(7, 0);
73 $this->langfiles = array(
"supplier_proposal");
76 $this->
const = array();
79 $this->
const[$r][0] =
"SUPPLIER_PROPOSAL_ADDON_PDF";
80 $this->
const[$r][1] =
"chaine";
81 $this->
const[$r][2] =
"aurore";
82 $this->
const[$r][3] =
'Name of submodule to generate PDF for supplier quotation request';
83 $this->
const[$r][4] = 0;
86 $this->
const[$r][0] =
"SUPPLIER_PROPOSAL_ADDON";
87 $this->
const[$r][1] =
"chaine";
88 $this->
const[$r][2] =
"mod_supplier_proposal_marbre";
89 $this->
const[$r][3] =
'Name of submodule to number supplier quotation request';
90 $this->
const[$r][4] = 0;
93 $this->
const[$r][0] =
"SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH";
94 $this->
const[$r][1] =
"chaine";
95 $this->
const[$r][2] =
"DOL_DATA_ROOT/doctemplates/supplier_proposals";
96 $this->
const[$r][3] =
"";
97 $this->
const[$r][4] = 0;
100 $this->boxes = array();
103 $this->rights = array();
104 $this->rights_class =
'supplier_proposal';
108 $this->rights[$r][0] = $this->numero + $r;
109 $this->rights[$r][1] =
'Read supplier proposals';
110 $this->rights[$r][3] = 0;
111 $this->rights[$r][4] =
'lire';
114 $this->rights[$r][0] = $this->numero + $r;
115 $this->rights[$r][1] =
'Create/modify supplier proposals';
116 $this->rights[$r][3] = 0;
117 $this->rights[$r][4] =
'creer';
120 $this->rights[$r][0] = $this->numero + $r;
121 $this->rights[$r][1] =
'Validate supplier proposals';
122 $this->rights[$r][3] = 0;
123 $this->rights[$r][4] =
'validate_advance';
126 $this->rights[$r][0] = $this->numero + $r;
127 $this->rights[$r][1] =
'Envoyer les demandes fournisseurs';
128 $this->rights[$r][3] = 0;
129 $this->rights[$r][4] =
'send_advance';
132 $this->rights[$r][0] = $this->numero + $r;
133 $this->rights[$r][1] =
'Delete supplier proposals';
134 $this->rights[$r][3] = 0;
135 $this->rights[$r][4] =
'supprimer';
138 $this->rights[$r][0] = $this->numero + $r;
139 $this->rights[$r][1] =
'Close supplier price requests';
140 $this->rights[$r][3] = 0;
141 $this->rights[$r][4] =
'cloturer';
144 $this->menu = array();
157 public function init($options =
'')
159 global $conf, $langs;
162 $this->
remove($options);
165 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt';
166 $dirodt = DOL_DATA_ROOT.
'/doctemplates/supplier_proposals';
167 $dest = $dirodt.
'/template_supplier_proposal.odt';
169 if (file_exists($src) && !file_exists($dest)) {
170 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
172 $result =
dol_copy($src, $dest, 0, 0);
174 $langs->load(
"errors");
175 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
181 "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),
182 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2]).
"','supplier_proposal',".((
int) $conf->entity).
")",
185 return $this->
_init($sql, $options);