30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 if (!empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36 if (!empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
39 $langs->loadLangs(array(
'companies',
'bills',
'interventions'));
40 if (!empty($conf->projet->enabled)) $langs->load(
"projects");
41 if (!empty($conf->contrat->enabled)) $langs->load(
"contracts");
43 $action =
GETPOST(
'action',
'aZ09');
44 $massaction =
GETPOST(
'massaction',
'alpha');
45 $show_files =
GETPOST(
'show_files',
'int');
46 $confirm =
GETPOST(
'confirm',
'alpha');
47 $toselect =
GETPOST(
'toselect',
'array');
48 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'interventionlist';
50 $search_ref =
GETPOST(
'search_ref') ?
GETPOST(
'search_ref',
'alpha') :
GETPOST(
'search_inter',
'alpha');
51 $search_company =
GETPOST(
'search_company',
'alpha');
52 $search_desc =
GETPOST(
'search_desc',
'alpha');
53 $search_projet_ref =
GETPOST(
'search_projet_ref',
'alpha');
54 $search_contrat_ref =
GETPOST(
'search_contrat_ref',
'alpha');
55 $search_status =
GETPOST(
'search_status',
'alpha');
56 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
57 $optioncss =
GETPOST(
'optioncss',
'alpha');
58 $socid =
GETPOST(
'socid',
'int');
62 if ($user->socid) $socid = $user->socid;
65 $diroutputmassaction = $conf->ficheinter->dir_output.
'/temp/massgeneration/'.$user->id;
67 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
68 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71 if (empty($page) || $page == -1) { $page = 0; }
72 $offset = $limit * $page;
73 $pageprev = $page - 1;
74 $pagenext = $page + 1;
75 if (!$sortorder) $sortorder =
"DESC";
83 $hookmanager->initHooks(array(
'interventionlist'));
88 $extrafields->fetch_name_optionals_label($object->table_element);
90 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
93 $fieldstosearchall = array(
95 's.nom'=>
"ThirdParty",
96 'f.description'=>
'Description',
97 'f.note_public'=>
'NotePublic',
98 'fd.description'=>
'DescriptionOfLine',
100 if (empty($user->socid)) $fieldstosearchall[
"f.note_private"] =
"NotePrivate";
101 if (!empty($conf->global->FICHINTER_DISABLE_DETAILS)) unset($fieldstosearchall[
'fd.description']);
104 $arrayfields = array(
105 'f.ref'=>array(
'label'=>
'Ref',
'checked'=>1),
106 's.nom'=>array(
'label'=>
'ThirdParty',
'checked'=>1),
107 'pr.ref'=>array(
'label'=>
'Project',
'checked'=>1,
'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
108 'c.ref'=>array(
'label'=>
'Contract',
'checked'=>1,
'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)),
109 'f.description'=>array(
'label'=>
'Description',
'checked'=>1),
110 'f.datec'=>array(
'label'=>
'DateCreation',
'checked'=>0,
'position'=>500),
111 'f.tms'=>array(
'label'=>
'DateModificationShort',
'checked'=>0,
'position'=>500),
112 'f.note_public'=>array(
'label'=>
'NotePublic',
'checked'=>0,
'position'=>510,
'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),
113 'f.note_private'=>array(
'label'=>
'NotePrivate',
'checked'=>0,
'position'=>511,
'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))),
114 'f.fk_statut'=>array(
'label'=>
'Status',
'checked'=>1,
'position'=>1000),
115 'fd.description'=>array(
'label'=>
"DescriptionOfLine",
'checked'=>1,
'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
116 'fd.date'=>array(
'label'=>
'DateOfLine',
'checked'=>1,
'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
117 'fd.duree'=>array(
'label'=>
'DurationOfLine',
'checked'=>1,
'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
120 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
130 if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
131 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') { $massaction =
''; }
133 $parameters = array(
'socid'=>$socid);
134 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
135 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
140 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
143 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
146 $search_company =
"";
147 $search_projet_ref =
"";
148 $search_contrat_ref =
"";
152 $search_array_options = array();
156 $objectclass =
'Fichinter';
157 $objectlabel =
'Interventions';
158 $permissiontoread = $user->rights->ficheinter->lire;
159 $permissiontodelete = $user->rights->ficheinter->supprimer;
160 $uploaddir = $conf->ficheinter->dir_output;
161 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
172 $form =
new Form($db);
175 $companystatic =
new Societe($db);
176 if (!empty($conf->projet->enabled)) {
177 $projetstatic =
new Project($db);
179 if (!empty($conf->contrat->enabled)) {
180 $contratstatic =
new Contrat($db);
183 $title = $langs->trans(
"ListOfInterventions");
186 $varpage = empty($contextpage) ?
$_SERVER[
"PHP_SELF"] : $contextpage;
187 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
189 $atleastonefieldinlines = 0;
190 foreach ($arrayfields as $tmpkey => $tmpval)
192 if (preg_match(
'/^fd\./', $tmpkey) && !empty($arrayfields[$tmpkey][
'checked']))
194 $atleastonefieldinlines++;
200 $sql .=
" f.ref, f.rowid, f.fk_statut as status, f.description, f.datec as date_creation, f.tms as date_update, f.note_public, f.note_private,";
201 if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .=
" fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,";
202 $sql .=
" s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus";
203 if (!empty($conf->projet->enabled)) {
204 $sql .=
", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title";
206 if (!empty($conf->contrat->enabled)) {
207 $sql .=
", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_supplier, c.ref_supplier as contrat_ref_supplier";
210 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
211 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
' as options_'.$key :
'');
214 $parameters = array();
215 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
216 $sql .= $hookmanager->resPrint;
217 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter as f";
218 if (!empty($conf->projet->enabled)) {
219 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as pr on f.fk_projet = pr.rowid";
221 if (!empty($conf->contrat->enabled)) {
222 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"contrat as c on f.fk_contrat = c.rowid";
224 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (f.rowid = ef.fk_object)";
225 if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"fichinterdet as fd ON fd.fk_fichinter = f.rowid";
226 if (!$user->rights->societe->client->voir && empty($socid)) $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
227 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
228 $sql .=
" WHERE f.entity IN (".getEntity(
'intervention').
")";
229 $sql .=
" AND f.fk_soc = s.rowid";
233 if ($search_company) {
236 if ($search_projet_ref) {
239 if ($search_contrat_ref) {
243 if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .=
natural_search(array(
'f.description',
'fd.description'), $search_desc);
244 else $sql .=
natural_search(array(
'f.description'), $search_desc);
246 if ($search_status !=
'' && $search_status >= 0) {
247 $sql .=
' AND f.fk_statut = '.urlencode($search_status);
249 if (!$user->rights->societe->client->voir && empty($socid))
250 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
252 $sql .=
" AND s.rowid = ".$socid;
257 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
259 $parameters = array();
260 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
261 $sql .= $hookmanager->resPrint;
262 $sql .= $db->order($sortfield, $sortorder);
265 $nbtotalofrecords =
'';
266 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
268 $result = $db->query($sql);
269 $nbtotalofrecords = $db->num_rows($result);
270 if (($page * $limit) > $nbtotalofrecords)
277 $sql .= $db->plimit($limit + 1, $offset);
280 $resql = $db->query($sql);
283 $num = $db->num_rows(
$resql);
285 $arrayofselected = is_array($toselect) ? $toselect : array();
291 if (empty($search_company)) $search_company = $soc->name;
295 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.urlencode($contextpage);
296 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.urlencode($limit);
297 if ($sall) $param .=
"&sall=".urlencode($sall);
298 if ($socid) $param .=
"&socid=".urlencode($socid);
299 if ($search_ref) $param .=
"&search_ref=".urlencode($search_ref);
300 if ($search_company) $param .=
"&search_company=".urlencode($search_company);
301 if ($search_desc) $param .=
"&search_desc=".urlencode($search_desc);
302 if ($search_status !=
'' && $search_status > -1) $param .=
"&search_status=".urlencode($search_status);
303 if ($show_files) $param .=
'&show_files='.urlencode($show_files);
304 if ($optioncss !=
'') $param .=
'&optioncss='.urlencode($optioncss);
306 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
309 $arrayofmassactions = array(
310 'generate_doc'=>$langs->trans(
"ReGeneratePDF"),
311 'builddoc'=>$langs->trans(
"PDFMerge"),
314 if ($user->rights->ficheinter->supprimer) $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
315 if (in_array($massaction, array(
'presend',
'predelete'))) $arrayofmassactions = array();
316 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
320 $url = DOL_URL_ROOT.
'/fichinter/card.php?action=create';
321 if (!empty($socid)) $url .=
'&socid='.$socid;
322 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewIntervention'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->ficheinter->creer);
325 print '<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
326 if ($optioncss !=
'')
print '<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
327 print '<input type="hidden" name="token" value="'.newToken().
'">';
328 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
329 print '<input type="hidden" name="action" value="list">';
330 print '<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
331 print '<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
332 print '<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
334 print_barre_liste($title, $page,
$_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'commercial', 0, $newcardbutton,
'', $limit, 0, 0, 1);
336 $topicmail =
"Information";
337 $modelmail =
"intervention";
339 $trackid =
'int'.$object->id;
340 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
344 foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
345 print '<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
350 $parameters = array();
351 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
352 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
353 else $moreforfilter = $hookmanager->resPrint;
355 if (!empty($moreforfilter))
357 print '<div class="liste_titre liste_titre_bydiv centpercent">';
358 print $moreforfilter;
362 if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
364 print '<div class="div-table-responsive">';
365 print '<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
367 print '<tr class="liste_titre_filter">';
368 if (!empty($arrayfields[
'f.ref'][
'checked']))
370 print
'<td class="liste_titre">';
371 print
'<input type="text" class="flat" name="search_ref" value="'.$search_ref.
'" size="8">';
374 if (!empty($arrayfields[
's.nom'][
'checked']))
376 print
'<td class="liste_titre">';
377 print
'<input type="text" class="flat" name="search_company" value="'.$search_company.
'" size="10">';
380 if (!empty($arrayfields[
'pr.ref'][
'checked']))
382 print
'<td class="liste_titre">';
383 print
'<input type="text" class="flat" name="search_projet_ref" value="'.$search_projet_ref.
'" size="8">';
386 if (!empty($arrayfields[
'c.ref'][
'checked']))
388 print
'<td class="liste_titre">';
389 print
'<input type="text" class="flat" name="search_contrat_ref" value="'.$search_contrat_ref.
'" size="8">';
392 if (!empty($arrayfields[
'f.description'][
'checked']))
394 print
'<td class="liste_titre">';
395 print
'<input type="text" class="flat" name="search_desc" value="'.$search_desc.
'" size="12">';
399 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
402 $parameters = array(
'arrayfields'=>$arrayfields);
403 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
404 print $hookmanager->resPrint;
405 if (!empty($arrayfields[
'f.datec'][
'checked']))
408 print
'<td class="liste_titre">';
411 if (!empty($arrayfields[
'f.tms'][
'checked']))
414 print
'<td class="liste_titre">';
417 if (!empty($arrayfields[
'f.note_public'][
'checked']))
420 print
'<td class="liste_titre">';
423 if (!empty($arrayfields[
'f.note_private'][
'checked']))
426 print
'<td class="liste_titre">';
430 if (!empty($arrayfields[
'f.fk_statut'][
'checked']))
432 print
'<td class="liste_titre right">';
433 $tmp = $objectstatic->LibStatut(0);
434 $liststatus = $objectstatic->statuts_short;
435 if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) unset($liststatus[2]);
436 print $form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 1);
440 if (!empty($arrayfields[
'fd.description'][
'checked']))
442 print
'<td class="liste_titre"> </td>';
444 if (!empty($arrayfields[
'fd.date'][
'checked']))
446 print
'<td class="liste_titre"> </td>';
448 if (!empty($arrayfields[
'fd.duree'][
'checked']))
450 print
'<td class="liste_titre"> </td>';
452 print
'<td class="liste_titre maxwidthsearch">';
453 $searchpicto = $form->showFilterButtons();
459 print
'<tr class="liste_titre">';
460 if (!empty($arrayfields[
'f.ref'][
'checked']))
print_liste_field_titre($arrayfields[
'f.ref'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.ref",
"", $param,
'', $sortfield, $sortorder);
461 if (!empty($arrayfields[
's.nom'][
'checked']))
print_liste_field_titre($arrayfields[
's.nom'][
'label'],
$_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder);
462 if (!empty($arrayfields[
'pr.ref'][
'checked']))
print_liste_field_titre($arrayfields[
'pr.ref'][
'label'],
$_SERVER[
"PHP_SELF"],
"pr.ref",
"", $param,
'', $sortfield, $sortorder);
463 if (!empty($arrayfields[
'c.ref'][
'checked']))
print_liste_field_titre($arrayfields[
'c.ref'][
'label'],
$_SERVER[
"PHP_SELF"],
"c.ref",
"", $param,
'', $sortfield, $sortorder);
464 if (!empty($arrayfields[
'f.description'][
'checked']))
print_liste_field_titre($arrayfields[
'f.description'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.description",
"", $param,
'', $sortfield, $sortorder);
466 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
468 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
469 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
470 print $hookmanager->resPrint;
471 if (!empty($arrayfields[
'f.datec'][
'checked']))
print_liste_field_titre($arrayfields[
'f.datec'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
472 if (!empty($arrayfields[
'f.tms'][
'checked']))
print_liste_field_titre($arrayfields[
'f.tms'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
473 if (!empty($arrayfields[
'f.note_public'][
'checked']))
print_liste_field_titre($arrayfields[
'f.note_public'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.note_public",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
474 if (!empty($arrayfields[
'f.note_private'][
'checked']))
print_liste_field_titre($arrayfields[
'f.note_private'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.note_private",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
475 if (!empty($arrayfields[
'f.fk_statut'][
'checked']))
print_liste_field_titre($arrayfields[
'f.fk_statut'][
'label'],
$_SERVER[
"PHP_SELF"],
"f.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
477 if (!empty($arrayfields[
'fd.date'][
'checked']))
print_liste_field_titre($arrayfields[
'fd.date'][
'label'],
$_SERVER[
"PHP_SELF"],
"fd.date",
"", $param,
'', $sortfield, $sortorder,
'center ');
478 if (!empty($arrayfields[
'fd.duree'][
'checked']))
print_liste_field_titre($arrayfields[
'fd.duree'][
'label'],
$_SERVER[
"PHP_SELF"],
"fd.duree",
"", $param,
'', $sortfield, $sortorder,
'right ');
484 $totalarray = array();
485 while ($i < min($num, $limit))
487 $obj = $db->fetch_object(
$resql);
489 $objectstatic->id = $obj->rowid;
490 $objectstatic->ref = $obj->ref;
491 $objectstatic->statut = $obj->status;
492 $objectstatic->status = $obj->status;
494 $companystatic->name = $obj->name;
495 $companystatic->id = $obj->socid;
496 $companystatic->client = $obj->client;
497 $companystatic->fournisseur = $obj->fournisseur;
498 $companystatic->email = $obj->email;
499 $companystatic->status = $obj->thirdpartystatus;
501 print
'<tr class="oddeven">';
503 if (!empty($arrayfields[
'f.ref'][
'checked']))
507 print
'<table class="nobordernopadding"><tr class="nocellnopadd">';
509 print
'<td class="nobordernopadding nowrap">';
510 print $objectstatic->getNomUrl(1);
515 if (!empty($obj->note_private))
517 $warnornote .= ($warnornote ?
' ' :
'');
518 $warnornote .=
'<span class="note">';
519 $warnornote .=
'<a href="note.php?id='.$obj->rowid.
'">'.
img_picto($langs->trans(
"ViewPrivateNote"),
'object_generic').
'</a>';
520 $warnornote .=
'</span>';
524 print
'<td style="min-width: 20px" class="nobordernopadding nowrap">';
530 print
'<td width="16" class="right nobordernopadding hideonsmartphone">';
533 $urlsource =
$_SERVER[
'PHP_SELF'].
'?id='.$obj->rowid;
534 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
535 print
'</td></tr></table>';
538 if (!$i) $totalarray[
'nbfield']++;
540 if (!empty($arrayfields[
's.nom'][
'checked']))
543 print $companystatic->getNomUrl(1,
'', 44);
545 if (!$i) $totalarray[
'nbfield']++;
547 if (!empty($arrayfields[
'pr.ref'][
'checked']))
550 $projetstatic->id = $obj->projet_id;
551 $projetstatic->ref = $obj->projet_ref;
552 $projetstatic->title = $obj->projet_title;
553 if ($projetstatic->id > 0) {
554 print $projetstatic->getNomUrl(1,
'');
557 if (!$i) $totalarray[
'nbfield']++;
559 if (!empty($arrayfields[
'c.ref'][
'checked']))
562 $contratstatic->id = $obj->contrat_id;
563 $contratstatic->ref = $obj->contrat_ref;
564 $contratstatic->ref_customer = $obj->contrat_ref_customer;
565 $contratstatic->ref_supplier = $obj->contrat_ref_supplier;
566 if ($contratstatic->id > 0) {
567 print $contratstatic->getNomUrl(1,
'');
570 if (!$i) $totalarray[
'nbfield']++;
572 if (!empty($arrayfields[
'f.description'][
'checked']))
575 if (!$i) $totalarray[
'nbfield']++;
579 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
581 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
582 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
583 print $hookmanager->resPrint;
585 if (!empty($arrayfields[
'f.datec'][
'checked']))
587 print
'<td class="center">';
588 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
590 if (!$i) $totalarray[
'nbfield']++;
593 if (!empty($arrayfields[
'f.tms'][
'checked']))
595 print
'<td class="center">';
596 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
598 if (!$i) $totalarray[
'nbfield']++;
601 if (!empty($arrayfields[
'f.note_public'][
'checked']))
603 print
'<td class="center">';
606 if (!$i) $totalarray[
'nbfield']++;
609 if (!empty($arrayfields[
'f.note_private'][
'checked']))
611 print
'<td class="center">';
614 if (!$i) $totalarray[
'nbfield']++;
617 if (!empty($arrayfields[
'f.fk_statut'][
'checked']))
619 print
'<td class="right">'.$objectstatic->getLibStatut(5).
'</td>';
620 if (!$i) $totalarray[
'nbfield']++;
623 if (!empty($arrayfields[
'fd.description'][
'checked']))
625 print
'<td>'.dolGetFirstLineOfText($obj->descriptiondetail).
'</td>';
626 if (!$i) $totalarray[
'nbfield']++;
628 if (!empty($arrayfields[
'fd.date'][
'checked']))
630 print
'<td class="center">'.dol_print_date($db->jdate($obj->dp),
'dayhour').
"</td>\n";
631 if (!$i) $totalarray[
'nbfield']++;
633 if (!empty($arrayfields[
'fd.duree'][
'checked']))
635 print
'<td class="right">'.convertSecondToTime($obj->duree,
'allhourmin').
'</td>';
636 if (!$i) $totalarray[
'nbfield']++;
637 if (!$i) $totalarray[
'pos'][$totalarray[
'nbfield']] =
'fd.duree';
638 $totalarray[
'val'][
'fd.duree'] += $obj->duree;
641 print
'<td class="nowrap center">';
642 if ($massactionbutton || $massaction)
645 if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
646 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
649 if (!$i) $totalarray[
'nbfield']++;
653 $total += $obj->duree;
658 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
662 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
663 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
664 print $hookmanager->resPrint;
666 print
'</table>'.
"\n";
671 $hidegeneratedfilelistifempty = 1;
672 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
675 $urlsource =
$_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
676 $urlsource .= str_replace(
'&',
'&', $param);
678 $filedir = $diroutputmassaction;
679 $genallowed = $user->rights->ficheinter->lire;
680 $delallowed = $user->rights->ficheinter->creer;
682 print $formfile->showdocuments(
'massfilesarea_interventions',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'', null, $hidegeneratedfilelistifempty);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
Class to manage interventions.
dol_now($mode= 'auto')
Return date for now.
Class to manage contracts.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Class to manage projects.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
print $_SERVER["PHP_SELF"]
Edit parameters.
dolGetFirstLineOfText($text, $nboflines=1, $charset= 'UTF-8')
Return first line of text.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...