';
print '
';
@@ -281,8 +288,188 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
{
print '
'.$langs->trans("RIBControlError").'
';
}
+
+ print '
';
+
+ // Nbre max d'elements des petites listes
+ $MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+
+ /*
+ * Last salaries
+ */
+ if (! empty($conf->salaries->enabled) &&
+ ($user->rights->salaries->read || ($user->rights->salaries->read && $object->id == $user->id))
+ )
+ {
+ $salary = new PaymentSalary($db);
- print "
";
+ $sql = "SELECT ps.rowid, ps.datesp, ps.dateep, ps.amount";
+ $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as ps";
+ $sql.= " WHERE ps.fk_user = ".$object->id;
+ $sql.= " AND ps.entity = ".$conf->entity;
+ $sql.= " ORDER BY ps.datesp DESC";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $var=true;
+ $num = $db->num_rows($resql);
+
+ if ($num > 0)
+ {
+ print '
';
+
+ print '';
+ print ' | ';
+ print '
';
+ }
+
+ $i = 0;
+ while ($i < $num && $i < $MAXLIST)
+ {
+ $objp = $db->fetch_object($resql);
+
+ print '';
+ print '| ';
+ $salary->id = $objp->rowid;
+ $salary->ref = $objp->rowid;
+
+ print $salary->getNomUrl(1);
+ print ' | '.dol_print_date($db->jdate($objp->datesp),'day')." | \n";
+ print ''.dol_print_date($db->jdate($objp->dateep),'day')." | \n";
+ print ''.price($objp->amount).' |
';
+ $i++;
+ }
+ $db->free($resql);
+
+ if ($num > 0) print "
";
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ }
+
+ /*
+ * Last holidays
+ */
+ if (! empty($conf->holiday->enabled) &&
+ ($user->rights->holiday->read_all || ($user->rights->holiday->read && $object->id == $user->id))
+ )
+ {
+ $holiday = new Holiday($db);
+
+ $sql = "SELECT h.rowid, h.statut, h.fk_type, h.date_debut, h.date_fin, h.halfday";
+ $sql.= " FROM ".MAIN_DB_PREFIX."holiday as h";
+ $sql.= " WHERE h.fk_user = ".$object->id;
+ $sql.= " AND h.entity = ".$conf->entity;
+ $sql.= " ORDER BY h.date_debut DESC";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $var=true;
+ $num = $db->num_rows($resql);
+
+ if ($num > 0)
+ {
+ print '
';
+
+ print '';
+ print ' | ';
+ print '
';
+ }
+
+ $i = 0;
+ while ($i < $num && $i < $MAXLIST)
+ {
+ $objp = $db->fetch_object($resql);
+
+ print '';
+ print '| ';
+ $holiday->id = $objp->rowid;
+ $holiday->ref = $objp->rowid;
+ $holiday->fk_type = $objp->fk_type;
+ $nbopenedday=num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday);
+
+ print $holiday->getNomUrl(1);
+ print ' | '.dol_print_date($db->jdate($objp->date_debut),'day')." | \n";
+ print ''.$nbopenedday.' '.$langs->trans('DurationDays').' | ';
+ print ''.$holiday->LibStatut($objp->statut,5).' |
';
+ $i++;
+ }
+ $db->free($resql);
+
+ if ($num > 0) print "
";
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ }
+
+ /*
+ * Last expense report
+ */
+ if (! empty($conf->expensereport->enabled) &&
+ ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id))
+ )
+ {
+ $exp = new ExpenseReport($db);
+
+ $sql = "SELECT e.rowid, e.ref, e.fk_statut, e.date_debut, e.total_ttc";
+ $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as e";
+ $sql.= " WHERE e.fk_user_author = ".$object->id;
+ $sql.= " AND e.entity = ".$conf->entity;
+ $sql.= " ORDER BY e.date_debut DESC";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $var=true;
+ $num = $db->num_rows($resql);
+
+ if ($num > 0)
+ {
+ print '
';
+
+ print '';
+ print ' | ';
+ print '
';
+ }
+
+ $i = 0;
+ while ($i < $num && $i < $MAXLIST)
+ {
+ $objp = $db->fetch_object($resql);
+
+ print '';
+ print '| ';
+ $exp->id = $objp->rowid;
+ $exp->ref = $objp->ref;
+ $exp->fk_type = $objp->fk_type;
+
+ print $exp->getNomUrl(1);
+ print ' | '.dol_print_date($db->jdate($objp->date_debut),'day')." | \n";
+ print ''.price($objp->total_ttc).' | ';
+ print ''.$exp->LibStatut($objp->fk_statut,5).' |
';
+ $i++;
+ }
+ $db->free($resql);
+
+ if ($num > 0) print "
";
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+ }
+
+ print '