|
@@ -62,6 +62,12 @@ if ($user->societe_id > 0) accessforbidden();
|
|
|
$holiday = new Holiday($db);
|
|
|
$holidaystatic=new Holiday($db);
|
|
|
|
|
|
+// Update sold
|
|
|
+if (! empty($conf->holiday->enabled))
|
|
|
+{
|
|
|
+ $result = $holiday->updateBalance();
|
|
|
+}
|
|
|
+
|
|
|
$childids = $user->getAllChildIds();
|
|
|
$childids[]=$user->id;
|
|
|
|
|
@@ -145,8 +151,7 @@ $langs->load("boxes");
|
|
|
// Last leave requests
|
|
|
if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
|
|
|
{
|
|
|
- $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.photo, u.statut,";
|
|
|
- $sql.= " x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
|
|
|
+ $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.photo, u.statut, x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
|
|
|
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
|
|
$sql.= " WHERE u.rowid = x.fk_user";
|
|
|
$sql.= " AND x.entity = ".$conf->entity;
|
|
@@ -183,25 +188,23 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
|
|
|
while ($i < $num && $i < $max)
|
|
|
{
|
|
|
$obj = $db->fetch_object($result);
|
|
|
-
|
|
|
$holidaystatic->id=$obj->rowid;
|
|
|
$holidaystatic->ref=$obj->ref;
|
|
|
-
|
|
|
$userstatic->id=$obj->uid;
|
|
|
$userstatic->lastname=$obj->lastname;
|
|
|
$userstatic->firstname=$obj->firstname;
|
|
|
$userstatic->login=$obj->login;
|
|
|
$userstatic->photo=$obj->photo;
|
|
|
$userstatic->statut=$obj->statut;
|
|
|
-
|
|
|
- $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
|
|
|
- $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
|
|
|
-
|
|
|
print '<tr '.$bc[$var].'>';
|
|
|
print '<td>'.$holidaystatic->getNomUrl(1).'</td>';
|
|
|
print '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>';
|
|
|
print '<td>'.$typeleaves[$obj->fk_type]['label'].'</td>';
|
|
|
- print '<td>'.dol_print_date($obj->date_start,'day').' '.$langs->trans($listhalfday[$starthalfday]);
|
|
|
+
|
|
|
+ $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
|
|
|
+ $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
|
|
|
+
|
|
|
+ print '<td>'.dol_print_date($obj->date_start,'day').' '.$langs->trans($listhalfday[$endhalfday]);
|
|
|
print '<td>'.dol_print_date($obj->date_end,'day').' '.$langs->trans($listhalfday[$endhalfday]);
|
|
|
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
|
|
|
print '<td>'.$holidaystatic->LibStatut($obj->status,3).'</td>';
|