diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index ba4f210793e..e4c09546e6e 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -248,7 +248,7 @@ if ($action == 'update') $object->halfday = $halfday; // Update - $verif = $object->update($user->id); + $verif = $object->update($user); if ($verif > 0) { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); @@ -285,7 +285,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights- // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer if ($canedit) { - $result=$object->delete($object->id); + $result=$object->delete($user); } else { @@ -318,7 +318,7 @@ if ($action == 'confirm_send') { $object->statut = 2; - $verif = $object->update($user->id); + $verif = $object->update($user); // Si pas d'erreur SQL on redirige vers la fiche de la demande if ($verif > 0) @@ -419,7 +419,7 @@ if ($action == 'confirm_valid') $object->fk_user_valid = $user->id; $object->statut = 3; - $verif = $object->update($user->id); + $verif = $object->update($user); // Si pas d'erreur SQL on redirige vers la fiche de la demande if ($verif > 0) @@ -506,7 +506,7 @@ if ($action == 'confirm_refuse') $object->statut = 5; $object->detail_refuse = $_POST['detail_refuse']; - $verif = $object->update($user->id); + $verif = $object->update($user); // Si pas d'erreur SQL on redirige vers la fiche de la demande if ($verif > 0) @@ -586,7 +586,7 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') $object->fk_user_cancel = $user->id; $object->statut = 4; - $result = $object->update($user->id); + $result = $object->update($user); if ($result >= 0 && $oldstatus == 3) // holiday was already validated, status 3, so we must increase back sold { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 5f244dcb9bf..ba36d911971 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -167,6 +167,14 @@ class Holiday extends CommonObject if (! $error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday"); + + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('HOLIDAY_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers + } } // Commit or rollback @@ -603,7 +611,13 @@ class Holiday extends CommonObject if (! $error) { - + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('HOLIDAY_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers + } } // Commit or rollback @@ -650,7 +664,13 @@ class Holiday extends CommonObject if (! $error) { - + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('HOLIDAY_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers + } } // Commit or rollback