';
+ }
+ $usertmp->fetch($obj->id_user);
+ $expensereportstatic->fk_user_author = $usertmp->getNomUrl(1);
- print '
';
- // Action column
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
+ // Output Kanban
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ if ($massactionbutton || $massaction) {
+ $selected = 0;
+
+ print $expensereportstatic->getKanbanView('');
}
- print ' ';
}
- print ' ';
- }
- // Ref
- if (!empty($arrayfields['d.ref']['checked'])) {
- print '';
- print '';
- print '';
- print $expensereportstatic->getNomUrl(1);
- print ' ';
- // Warning late icon and note
- print '';
- if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) {
- print img_warning($langs->trans("Late"));
+ if ($i == (min($num, $limit) - 1)) {
+ print '';
+ print ' ';
}
- if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) {
- print img_warning($langs->trans("Late"));
- }
- if (!empty($obj->note_private) || !empty($obj->note_public)) {
- print ' ';
- print ''.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').' ';
- print ' ';
- }
- print '';
- print '';
- $filename = dol_sanitizeFileName($obj->ref);
- $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($obj->ref);
- $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- print $formfile->getDocumentsLink($expensereportstatic->element, $filename, $filedir);
- print ' ';
- print '
';
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // User
- if (!empty($arrayfields['user']['checked'])) {
- print '';
- $usertmp->id = $obj->id_user;
- $usertmp->lastname = $obj->lastname;
- $usertmp->firstname = $obj->firstname;
- $usertmp->login = $obj->login;
- $usertmp->statut = $obj->statut;
- $usertmp->photo = $obj->photo;
- $usertmp->email = $obj->email;
- print $usertmp->getNomUrl(-1);
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Start date
- if (!empty($arrayfields['d.date_debut']['checked'])) {
- print ''.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // End date
- if (!empty($arrayfields['d.date_fin']['checked'])) {
- print ''.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Date validation
- if (!empty($arrayfields['d.date_valid']['checked'])) {
- print ''.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Date approval
- if (!empty($arrayfields['d.date_approve']['checked'])) {
- print ''.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Amount HT
- if (!empty($arrayfields['d.total_ht']['checked'])) {
- print ''.price($obj->total_ht)." \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'd.total_ht';
- }
- $totalarray['val']['d.total_ht'] += $obj->total_ht;
- }
- // Amount VAT
- if (!empty($arrayfields['d.total_vat']['checked'])) {
- print ''.price($obj->total_tva)." \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'd.total_tva';
- }
- $totalarray['val']['d.total_tva'] += $obj->total_tva;
- }
- // Amount TTC
- if (!empty($arrayfields['d.total_ttc']['checked'])) {
- print ''.price($obj->total_ttc)." \n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- if (!$i) {
- $totalarray['pos'][$totalarray['nbfield']] = 'd.total_ttc';
- }
- $totalarray['val']['d.total_ttc'] += $obj->total_ttc;
- }
-
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
-
- // Date creation
- if (!empty($arrayfields['d.date_create']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->date_create), 'dayhour');
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Date modification
- if (!empty($arrayfields['d.tms']['checked'])) {
- print '';
- print dol_print_date($db->jdate($obj->date_modif), 'dayhour');
- print ' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Status
- if (!empty($arrayfields['d.fk_statut']['checked'])) {
- print ''.$expensereportstatic->getLibStatut(5).' ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Action column
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
+ } else {
+ print ' ';
+ // Action column
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
}
- print ' ';
+ print ' ';
}
- print '';
+ // Ref
+ if (!empty($arrayfields['d.ref']['checked'])) {
+ print '';
+ print '';
+ print '';
+ print $expensereportstatic->getNomUrl(1);
+ print ' ';
+ // Warning late icon and note
+ print '';
+ if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) {
+ print img_warning($langs->trans("Late"));
+ }
+ if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) {
+ print img_warning($langs->trans("Late"));
+ }
+ if (!empty($obj->note_private) || !empty($obj->note_public)) {
+ print ' ';
+ print ''.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').' ';
+ print ' ';
+ }
+ print ' ';
+ print '';
+ $filename = dol_sanitizeFileName($obj->ref);
+ $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($obj->ref);
+ $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
+ print $formfile->getDocumentsLink($expensereportstatic->element, $filename, $filedir);
+ print ' ';
+ print '
';
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // User
+ if (!empty($arrayfields['user']['checked'])) {
+ print '';
+ $usertmp->id = $obj->id_user;
+ $usertmp->lastname = $obj->lastname;
+ $usertmp->firstname = $obj->firstname;
+ $usertmp->login = $obj->login;
+ $usertmp->statut = $obj->statut;
+ $usertmp->photo = $obj->photo;
+ $usertmp->email = $obj->email;
+ print $usertmp->getNomUrl(-1);
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Start date
+ if (!empty($arrayfields['d.date_debut']['checked'])) {
+ print ''.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // End date
+ if (!empty($arrayfields['d.date_fin']['checked'])) {
+ print ''.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Date validation
+ if (!empty($arrayfields['d.date_valid']['checked'])) {
+ print ''.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Date approval
+ if (!empty($arrayfields['d.date_approve']['checked'])) {
+ print ''.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Amount HT
+ if (!empty($arrayfields['d.total_ht']['checked'])) {
+ print ''.price($obj->total_ht)." \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'd.total_ht';
+ }
+ $totalarray['val']['d.total_ht'] += $obj->total_ht;
+ }
+ // Amount VAT
+ if (!empty($arrayfields['d.total_vat']['checked'])) {
+ print ''.price($obj->total_tva)." \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'd.total_tva';
+ }
+ $totalarray['val']['d.total_tva'] += $obj->total_tva;
+ }
+ // Amount TTC
+ if (!empty($arrayfields['d.total_ttc']['checked'])) {
+ print ''.price($obj->total_ttc)." \n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ if (!$i) {
+ $totalarray['pos'][$totalarray['nbfield']] = 'd.total_ttc';
+ }
+ $totalarray['val']['d.total_ttc'] += $obj->total_ttc;
+ }
+
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ // Fields from hook
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+
+ // Date creation
+ if (!empty($arrayfields['d.date_create']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_create), 'dayhour');
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Date modification
+ if (!empty($arrayfields['d.tms']['checked'])) {
+ print '';
+ print dol_print_date($db->jdate($obj->date_modif), 'dayhour');
+ print ' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Status
+ if (!empty($arrayfields['d.fk_statut']['checked'])) {
+ print ''.$expensereportstatic->getLibStatut(5).' ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Action column
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print ' ';
+ }
+ print ' ';
+ }
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+
+ print " \n";
}
- if (!$i) {
- $totalarray['nbfield']++;
- }
-
- print "