32include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
52 $this->family =
"srm";
53 $this->module_position =
'11';
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';
66 $this->config_page_url = array(
"supplier_proposal.php@supplier_proposal");
69 $this->hidden =
false;
71 $this->depends = array(
'modSupplierOrder');
73 $this->depends = array(
'modFournisseur');
75 $this->requiredby = [];
76 $this->conflictwith = [];
77 $this->langfiles = array(
"supplier_proposal");
82 "SUPPLIER_PROPOSAL_ADDON_PDF",
85 'Name of submodule to generate PDF for supplier quotation request',
89 "SUPPLIER_PROPOSAL_ADDON",
91 "mod_supplier_proposal_marbre",
92 'Name of submodule to number supplier quotation request',
96 "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH",
98 "DOL_DATA_ROOT".($conf->entity > 1 ?
'/'.$conf->entity :
'').
"/doctemplates/supplier_proposals",
108 $this->rights_class =
'supplier_proposal';
112 $this->rights[$r][0] = $this->numero + $r;
113 $this->rights[$r][1] =
'Read supplier proposals';
114 $this->rights[$r][3] = 0;
115 $this->rights[$r][4] =
'lire';
118 $this->rights[$r][0] = $this->numero + $r;
119 $this->rights[$r][1] =
'Create/modify supplier proposals';
120 $this->rights[$r][3] = 0;
121 $this->rights[$r][4] =
'creer';
124 $this->rights[$r][0] = $this->numero + $r;
125 $this->rights[$r][1] =
'Validate supplier proposals';
126 $this->rights[$r][3] = 0;
127 $this->rights[$r][4] =
'validate_advance';
130 $this->rights[$r][0] = $this->numero + $r;
131 $this->rights[$r][1] =
'Send supplier proposals';
132 $this->rights[$r][3] = 0;
133 $this->rights[$r][4] =
'send_advance';
136 $this->rights[$r][0] = $this->numero + $r;
137 $this->rights[$r][1] =
'Delete supplier proposals';
138 $this->rights[$r][3] = 0;
139 $this->rights[$r][4] =
'supprimer';
142 $this->rights[$r][0] = $this->numero + $r;
143 $this->rights[$r][1] =
'Close supplier price requests';
144 $this->rights[$r][3] = 0;
145 $this->rights[$r][4] =
'cloturer';
161 public function init($options =
'')
163 global
$conf, $langs;
166 $this->
remove($options);
169 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt';
170 $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/doctemplates/supplier_proposals';
171 $dest = $dirodt.
'/template_supplier_proposal.odt';
173 if (file_exists($src) && !file_exists($dest)) {
174 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
176 $result =
dol_copy($src, $dest,
'0', 0);
178 $langs->load(
"errors");
179 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
185 "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),
186 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2]).
"','supplier_proposal',".((
int)
$conf->entity).
")",
189 return $this->
_init($sql, $options);
202 public function remove($options =
'')
205 "DELETE FROM ".MAIN_DB_PREFIX.
"rights_def WHERE module = 'askpricesupplier'"
208 return $this->
_remove($sql, $options);
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
Class to describe and enable module SupplierProposal.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_copy($srcfile, $destfile, $newmask='0', $overwriteifexists=1, $testvirus=0, $indexdatabase=0)
Copy a file to another file.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
$conf db name
Only used if Module[ID]Name translation string is not found.