';
- print '| ';
- print '';
- print ' | ';
- print '';
- print ' | ';
- print '';
- print ' | ';
- if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
- {
- // Desc of line
- print ' | ';
- print ' | ';
+ if (! empty($arrayfields['f.ref']['checked']))
+ {
+ print '';
+ print '';
+ print ' | ';
+ }
+ if (! empty($arrayfields['s.nom']['checked']))
+ {
+ print '';
+ print '';
+ print ' | ';
+ }
+ if (! empty($arrayfields['f.description']['checked']))
+ {
+ print '';
+ print '';
+ print ' | ';
+ }
+ if (! empty($arrayfields['fd.description']['checked']))
+ {
+ // Desc of line
print ' | ';
+ }
+ if (! empty($arrayfields['fd.date']['checked']))
+ {
+ print ' | ';
+ }
+ if (! empty($arrayfields['fd.duree']['checked']))
+ {
+ print ' | ';
}
- print '';
- $liststatus=$interventionstatic->statuts_short;
- print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
- print ' | ';
+ // Extra fields
+ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+ {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ $align=$extrafields->getAlignFlag($key);
+ $typeofextrafield=$extrafields->attribute_type[$key];
+ print '';
+ if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')))
+ {
+ $crit=$val;
+ $tmpkey=preg_replace('/search_options_/','',$key);
+ $searchclass='';
+ if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
+ if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
+ print '';
+ }
+ print ' | ';
+ }
+ }
+ }
+ // Fields from hook
+ $parameters=array('arrayfields'=>$arrayfields);
+ $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ if (! empty($arrayfields['f.datec']['checked']))
+ {
+ // Date creation
+ print '';
+ print ' | ';
+ }
+ if (! empty($arrayfields['f.tms']['checked']))
+ {
+ // Date modification
+ print '';
+ print ' | ';
+ }
+ if (! empty($arrayfields['f.fk_statut']['checked']))
+ {
+ print '';
+ $liststatus=$interventionstatic->statuts_short;
+ print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
+ print ' | ';
+ }
print '';
$searchpitco=$form->showFilterAndCheckAddButtons(0);
print $searchpitco;
@@ -212,44 +367,129 @@ if ($result)
$var=True;
$total = 0;
$i = 0;
+ $totalarray=array();
while ($i < min($num, $limit))
{
- $objp = $db->fetch_object($result);
+ $obj = $db->fetch_object($result);
+
+ $interventionstatic->id=$obj->fichid;
+ $interventionstatic->ref=$obj->ref;
+ $interventionstatic->statut=$obj->fk_statut;
+
$var=!$var;
print " |
";
- print "| ";
- $interventionstatic->id=$objp->fichid;
- $interventionstatic->ref=$objp->ref;
- print $interventionstatic->getNomUrl(1);
- print " | \n";
- print '';
- $companystatic->name=$objp->name;
- $companystatic->id=$objp->socid;
- $companystatic->client=$objp->client;
- print $companystatic->getNomUrl(1,'',44);
- print ' | ';
- print ''.dol_trunc(dolGetFirstLineOfText($objp->description),48).' | ';
- if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
+ if (! empty($arrayfields['f.ref']['checked']))
{
- //print ''.dol_trunc(dol_escape_htmltag(dolGetFirstLineOfText($objp->descriptiondetail)),48).' | ';
- print ''.dolGetFirstLineOfText($objp->descriptiondetail).' | ';
- print ''.dol_print_date($db->jdate($objp->dp),'dayhour')." | \n";
- print ''.convertSecondToTime($objp->duree).' | ';
+ print "";
+ print $interventionstatic->getNomUrl(1);
+ print " | \n";
+ if (! $i) $totalarray['nbfield']++;
+ }
+ if (! empty($arrayfields['s.nom']['checked']))
+ {
+ print '';
+ $companystatic->name=$obj->name;
+ $companystatic->id=$obj->socid;
+ $companystatic->client=$obj->client;
+ print $companystatic->getNomUrl(1,'',44);
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ if (! empty($arrayfields['f.description']['checked']))
+ {
+ print ''.dol_trunc(dolGetFirstLineOfText($obj->description),48).' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ if (! empty($arrayfields['fd.description']['checked']))
+ {
+ //print ''.dol_trunc(dol_escape_htmltag(dolGetFirstLineOfText($obj->descriptiondetail)),48).' | ';
+ print ''.dolGetFirstLineOfText($obj->descriptiondetail).' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ if (! empty($arrayfields['fd.date']['checked']))
+ {
+ print ''.dol_print_date($db->jdate($obj->dp),'dayhour')." | \n";
+ if (! $i) $totalarray['nbfield']++;
+ }
+ if (! empty($arrayfields['fd.duree']['checked']))
+ {
+ print ''.convertSecondToTime($obj->duree, 'allhourmin').' | ';
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totaldurationfield']=$totalarray['nbfield'];
+ $totalarray['totalduration']+=$obj->duree;
}
- print ''.$interventionstatic->LibStatut($objp->fk_statut,5).' | ';
- print ' | ';
+ // Extra fields
+ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+ {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ if (! empty($arrayfields["ef.".$key]['checked']))
+ {
+ print 'getAlignFlag($key);
+ if ($align) print ' align="'.$align.'"';
+ print '>';
+ $tmpkey='options_'.$key;
+ print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ }
+ }
+ // Fields from hook
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+ $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ // Date creation
+ if (! empty($arrayfields['f.datec']['checked']))
+ {
+ print '';
+ print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Date modification
+ if (! empty($arrayfields['f.tms']['checked']))
+ {
+ print '';
+ print dol_print_date($db->jdate($obj->date_update), 'dayhour');
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Status
+ if (! empty($arrayfields['f.fk_statut']['checked']))
+ {
+ print ''.$interventionstatic->LibStatut($obj->fk_statut,5).' | ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ // Action column
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
+
print "
\n";
- $total += $objp->duree;
+ $total += $obj->duree;
$i++;
}
- $rowspan=3;
- if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
+
+ // Show total line
+ if (isset($totalarray['totalduration']))
{
- print '