31 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
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).
")",
198 public function remove($options =
'')
201 "DELETE FROM ".MAIN_DB_PREFIX.
"rights_def WHERE module = 'askpricesupplier'"
_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.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
print *****$script_file(".$version.") pid 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.
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.