diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index b790b9154e9..f8e444470c3 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -913,7 +913,7 @@ class Holiday extends CommonObject $new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth'); // On ajoute la modification dans le LOG - $this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('Event').': '.$langs->trans('HolidaysMonthlyUpdate'),$new_solde); + $this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('HolidaysMonthlyUpdate'),$new_solde); $i++; } @@ -1660,43 +1660,43 @@ class Holiday extends CommonObject $resql=$this->db->query($sql); // Si pas d'erreur SQL - if ($resql) { + if ($resql) { - $i = 0; - $tab_result = $this->logs; - $num = $this->db->num_rows($resql); + $i = 0; + $tab_result = $this->logs; + $num = $this->db->num_rows($resql); - // Si pas d'enregistrement - if(!$num) { + // Si pas d'enregistrement + if(!$num) { return 2; - } + } - // On liste les résultats et on les ajoutent dans le tableau - while($i < $num) { + // On liste les résultats et on les ajoutent dans le tableau + while($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); - $tab_result[$i]['rowid'] = $obj->rowid; - $tab_result[$i]['date_action'] = $obj->date_action; - $tab_result[$i]['fk_user_action'] = $obj->fk_user_action; - $tab_result[$i]['fk_user_update'] = $obj->fk_user_update; - $tab_result[$i]['type_action'] = $obj->type_action; - $tab_result[$i]['prev_solde'] = $obj->prev_solde; - $tab_result[$i]['new_solde'] = $obj->new_solde; + $tab_result[$i]['rowid'] = $obj->rowid; + $tab_result[$i]['date_action'] = $obj->date_action; + $tab_result[$i]['fk_user_action'] = $obj->fk_user_action; + $tab_result[$i]['fk_user_update'] = $obj->fk_user_update; + $tab_result[$i]['type_action'] = $obj->type_action; + $tab_result[$i]['prev_solde'] = $obj->prev_solde; + $tab_result[$i]['new_solde'] = $obj->new_solde; - $i++; - } - // Retourne 1 et ajoute le tableau à la variable - $this->logs = $tab_result; - return 1; - } - else - { - // Erreur SQL - $this->error="Error ".$this->db->lasterror(); - dol_syslog(get_class($this)."::fetchLog ".$this->error, LOG_ERR); - return -1; - } + $i++; + } + // Retourne 1 et ajoute le tableau à la variable + $this->logs = $tab_result; + return 1; + } + else + { + // Erreur SQL + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetchLog ".$this->error, LOG_ERR); + return -1; + } } /** diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index a1cacebc74c..1b1bd8635d1 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -71,7 +71,7 @@ if ($action == 'update' && isset($_POST['update_cp'])) $comment = (isset($_POST['note_holiday'][$userID]) ? ' ('.$_POST['note_holiday'][$userID].')' : ''); // We add the modification to the log - $holiday->addLogCP($user->id,$userID, $langs->trans('Event').': '.$langs->trans('ManualUpdate').$comment,$userValue); + $holiday->addLogCP($user->id,$userID, $langs->trans('ManualUpdate').$comment,$userValue); // Update of the days of the employee $holiday->updateSoldeCP($userID,$userValue); @@ -111,7 +111,7 @@ elseif($action == 'add_event') $new_holiday = $nb_holiday + $add_holiday; // On ajoute la modification dans le LOG - $holiday->addLogCP($user->id,$userCP, $langs->trans('Event').': '.$holiday->getNameEventCp($event),$new_holiday); + $holiday->addLogCP($user->id,$userCP, $holiday->getNameEventCp($event),$new_holiday); $holiday->updateSoldeCP($userCP,$new_holiday); diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 83523ea4557..624287d9bb4 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -380,7 +380,7 @@ if($action == 'confirm_valid') $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $cp->addLogCP($user->id,$cp->fk_user, $langs->trans('Event').': '.$langs->transnoentitiesnoconv("Holidays"),$newSolde); + $cp->addLogCP($user->id,$cp->fk_user, $langs->transnoentitiesnoconv("Holidays"),$newSolde); // Mise à jour du solde $cp->updateSoldeCP($cp->fk_user,$newSolde); diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index f184cdc201e..ea87ea6fda0 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -54,7 +54,7 @@ $month = GETPOST('month_start'); $year = GETPOST('year_start'); if(empty($month)) { - $month = date('m'); + $month = date('n'); } if(empty($year)) { $year = date('Y'); @@ -65,7 +65,7 @@ $sql.= " FROM llx_holiday cp"; $sql.= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid"; $sql.= " WHERE cp.statut = 3"; // Approved // TODO Use BETWEEN instead of date_format -$sql.= " AND (date_format(cp.date_debut, '%Y-%m') = '$year-$month' OR date_format(cp.date_fin, '%Y-%m') = '$year-$month')"; +$sql.= " AND (date_format(cp.date_debut, '%Y-%c') = '$year-$month' OR date_format(cp.date_fin, '%Y-%c') = '$year-$month')"; $sql.= " ORDER BY u.lastname,cp.date_debut"; $result = $db->query($sql); @@ -77,8 +77,9 @@ print '