51 $this->family =
"crm";
52 $this->module_position =
'41';
54 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
55 $this->
description =
"Gestion des fiches d'intervention";
58 $this->version =
'dolibarr';
60 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
61 $this->picto =
"intervention";
64 $this->dirs = array(
"/ficheinter/temp");
67 $this->depends = array(
"modSociete");
68 $this->requiredby = array();
69 $this->conflictwith = array();
70 $this->langfiles = array(
"bills",
"companies",
"interventions");
73 $this->config_page_url = array(
"fichinter.php");
76 $this->
const = array();
79 if (!isset($conf->ficheinter) || !isset($conf->ficheinter->enabled)) {
81 $conf->ficheinter->enabled = 0;
84 $this->
const[$r][0] =
"FICHEINTER_ADDON_PDF";
85 $this->
const[$r][1] =
"chaine";
86 $this->
const[$r][2] =
"soleil";
89 $this->
const[$r][0] =
"FICHEINTER_ADDON";
90 $this->
const[$r][1] =
"chaine";
91 $this->
const[$r][2] =
"pacific";
95 $this->boxes = array(0=>array(
'file'=>
'box_ficheinter.php',
'enabledbydefaulton'=>
'Home'));
98 $this->rights = array();
99 $this->rights_class =
'ficheinter';
103 $this->rights[$r][0] = 61;
104 $this->rights[$r][1] =
'Lire les fiches d\'intervention';
105 $this->rights[$r][2] =
'r';
106 $this->rights[$r][3] = 0;
107 $this->rights[$r][4] =
'lire';
110 $this->rights[$r][0] = 62;
111 $this->rights[$r][1] =
'Creer/modifier les fiches d\'intervention';
112 $this->rights[$r][2] =
'w';
113 $this->rights[$r][3] = 0;
114 $this->rights[$r][4] =
'creer';
117 $this->rights[$r][0] = 64;
118 $this->rights[$r][1] =
'Supprimer les fiches d\'intervention';
119 $this->rights[$r][2] =
'd';
120 $this->rights[$r][3] = 0;
121 $this->rights[$r][4] =
'supprimer';
124 $this->rights[$r][0] = 67;
125 $this->rights[$r][1] =
'Exporter les fiches interventions';
126 $this->rights[$r][2] =
'r';
127 $this->rights[$r][3] = 0;
128 $this->rights[$r][4] =
'export';
131 $this->rights[$r][0] = 68;
132 $this->rights[$r][1] =
'Envoyer les fiches d\'intervention par courriel';
133 $this->rights[$r][2] =
'r';
134 $this->rights[$r][3] = 0;
135 $this->rights[$r][4] =
'ficheinter_advance';
136 $this->rights[$r][5] =
'send';
139 $this->rights[$r][0] = 69;
140 $this->rights[$r][1] =
'Valider les fiches d\'intervention ';
141 $this->rights[$r][2] =
'a';
142 $this->rights[$r][3] = 0;
143 $this->rights[$r][4] =
'ficheinter_advance';
144 $this->rights[$r][5] =
'validate';
147 $this->rights[$r][0] = 70;
148 $this->rights[$r][1] =
'Dévalider les fiches d\'intervention';
149 $this->rights[$r][2] =
'a';
150 $this->rights[$r][3] = 0;
151 $this->rights[$r][4] =
'ficheinter_advance';
152 $this->rights[$r][5] =
'unvalidate';
164 $this->export_code[$r] = $this->rights_class.
'_'.$r;
165 $this->export_label[$r] =
'InterventionCardsAndInterventionLines';
166 $this->export_permission[$r] = array(array(
"ficheinter",
"export"));
167 $this->export_fields_array[$r] = array(
168 's.rowid'=>
"IdCompany",
's.nom'=>
'CompanyName',
's.address'=>
'Address',
's.zip'=>
'Zip',
's.town'=>
'Town',
's.fk_pays'=>
'Country',
's.phone'=>
'Phone',
169 's.siren'=>
'ProfId1',
's.siret'=>
'ProfId2',
's.ape'=>
'ProfId3',
's.idprof4'=>
'ProfId4',
's.code_compta'=>
'CustomerAccountancyCode',
170 's.code_compta_fournisseur'=>
'SupplierAccountancyCode',
'f.rowid'=>
"InterId",
'f.ref'=>
"InterRef",
'f.datec'=>
"InterDateCreation",
171 'f.duree'=>
"InterDuration",
'f.fk_statut'=>
'InterStatus',
'f.description'=>
"InterNote");
172 $keyforselect =
'fichinter';
173 $keyforelement =
'intervention';
174 $keyforaliasextra =
'extra';
175 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
176 $this->export_fields_array[$r] += array(
177 'pj.ref'=>
'ProjectRef',
'pj.title'=>
'ProjectLabel',
178 'fd.rowid'=>
'InterLineId',
179 'fd.date'=>
"InterLineDate",
'fd.duree'=>
"InterLineDuration",
'fd.description'=>
"InterLineDesc"
181 $this->export_TypeFields_array[$r] = array(
182 's.rowid'=>
"Numeric",
's.nom'=>
'Text',
's.address'=>
'Text',
's.zip'=>
'Text',
's.town'=>
'Text',
's.fk_pays'=>
'List:c_country:label',
's.phone'=>
'Text',
's.siren'=>
'Text',
183 's.siret'=>
'Text',
's.ape'=>
'Text',
's.idprof4'=>
'Text',
's.code_compta'=>
'Text',
's.code_compta_fournisseur'=>
'Text',
184 'f.rowid'=>
'Numeric',
'f.ref'=>
"Text",
'f.datec'=>
"Date",
185 'f.duree'=>
"Duree",
'f.fk_statut'=>
'Numeric',
'f.description'=>
"Text",
'f.datee'=>
"Date",
'f.dateo'=>
"Date",
'f.fulldayevent'=>
"Text",
186 'pj.ref'=>
'Text',
'pj.title'=>
'Text',
187 'fd.rowid'=>
"Numeric",
'fd.date'=>
"Date",
'fd.duree'=>
"Duree",
'fd.description'=>
"Text",
'fd.total_ht'=>
"Numeric"
189 $this->export_entities_array[$r] = array(
190 's.rowid'=>
"company",
's.nom'=>
'company',
's.address'=>
'company',
's.zip'=>
'company',
's.town'=>
'company',
's.fk_pays'=>
'company',
's.phone'=>
'company',
191 's.siren'=>
'company',
's.siret'=>
'company',
's.ape'=>
'company',
's.idprof4'=>
'company',
's.code_compta'=>
'company',
192 's.code_compta_fournisseur'=>
'company',
'f.rowid'=>
"intervention",
'f.ref'=>
"intervention",
'f.datec'=>
"intervention",
'f.duree'=>
"intervention",
193 'f.fk_statut'=>
"intervention",
'f.description'=>
"intervention",
'pj.ref'=>
'project',
'pj.title'=>
'project',
'fd.rowid'=>
"inter_line",
'fd.date'=>
"inter_line",
194 'fd.duree'=>
'inter_line',
'fd.description'=>
'inter_line'
196 $this->export_dependencies_array[$r] = array(
'inter_line'=>
'fd.rowid');
197 $keyforselect =
'fichinterdet';
198 $keyforelement =
'inter_line';
199 $keyforaliasextra =
'extradet';
200 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
202 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
203 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'fichinter as f';
204 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'fichinter_extrafields as extra ON f.rowid = extra.fk_object';
205 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'projet as pj ON f.fk_projet = pj.rowid';
206 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'fichinterdet as fd ON f.rowid = fd.fk_fichinter';
207 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'fichinterdet_extrafields as extradet ON fd.rowid = extradet.fk_object,';
208 $this->export_sql_end[$r] .=
' '.MAIN_DB_PREFIX.
'societe as s';
209 $this->export_sql_end[$r] .=
' WHERE f.fk_soc = s.rowid';
210 $this->export_sql_end[$r] .=
' AND f.entity IN ('.getEntity(
'intervention').
')';