diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index e45b40a3f57c070ab16ea56eaf0db159ae42fd67..bacbd28141bcfd8392166fc696397eab9abffae3 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -141,7 +141,7 @@ class modHoliday extends DolibarrModules $r++; $this->rights[$r][0] = 20002; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label + $this->rights[$r][1] = 'Create/modify holidays for everybody'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index bbffe26cf9ccf34367f01b9eefc7310c45f0509c..c887c111ed2c5e9d51a21bf0ba5769d07edde130 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -51,12 +51,12 @@ $now=dol_now(); * Actions */ -// Si création de la demande +// If create a request if ($action == 'create') { $cp = new Holiday($db); - // Si pas le droit de créer une demande + // If no right to create a request if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) { $error++; @@ -81,21 +81,21 @@ if ($action == 'create') $description = trim(GETPOST('description')); $userID = GETPOST('userID'); - // Si pas de date de début + // If no start date if (empty($date_debut)) { header('Location: card.php?action=request&error=nodatedebut'); exit; } - // Si pas de date de fin + // If no end date if (empty($date_fin)) { header('Location: card.php?action=request&error=nodatefin'); exit; } - // Si date de début après la date de fin + // If start date after end date if ($date_debut > $date_fin) { header('Location: card.php?action=request&error=datefin'); @@ -110,7 +110,7 @@ if ($action == 'create') exit; } - // Si aucun jours ouvrés dans la demande + // If there is no Business Days within request $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if($nbopenedday < 0.5) { @@ -118,7 +118,7 @@ if ($action == 'create') exit; } - // Si pas de validateur choisi + // If no validator designated if ($valideur < 1) { header('Location: card.php?action=request&error=Valideur'); @@ -134,7 +134,7 @@ if ($action == 'create') $verif = $cp->create($userid); - // Si pas d'erreur SQL on redirige vers la fiche de la demande + // If no SQL error we redirect to the request card if ($verif > 0) { header('Location: card.php?id='.$verif); @@ -142,7 +142,7 @@ if ($action == 'create') } else { - // Sinon on affiche le formulaire de demande avec le message d'erreur SQL + // Otherwise we display the request form with the SQL error message header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error); exit; } @@ -162,7 +162,7 @@ if ($action == 'update') else if ($starthalfday == 'afternoon') $halfday=-1; else if ($endhalfday == 'morning') $halfday=1; - // Si pas le droit de modifier une demande + // If no right to modify a request if (! $user->rights->holiday->write) { header('Location: card.php?action=request&error=CantUpdate'); @@ -174,40 +174,40 @@ if ($action == 'update') $canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all)); - // Si en attente de validation + // If under validation if ($cp->statut == 1) { - // Si c'est le créateur ou qu'il a le droit de tout lire / modifier + // If this is the requestor or has read/write rights if ($canedit) { $valideur = $_POST['valideur']; $description = trim($_POST['description']); - // Si pas de date de début + // If no start date if (empty($_POST['date_debut_'])) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut'); exit; } - // Si pas de date de fin + // If no end date if (empty($_POST['date_fin_'])) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin'); exit; } - // Si date de début après la date de fin + // If start date after end date if ($date_debut > $date_fin) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin'); exit; } - // Si pas de valideur choisi + // If no validator designated if ($valideur < 1) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur'); exit; } - // Si pas de jours ouvrés dans la demande + // If there is no Business Days within request $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if ($nbopenedday < 0.5) { @@ -230,7 +230,7 @@ if ($action == 'update') } else { - // Sinon on affiche le formulaire de demande avec le message d'erreur SQL + // Otherwise we display the request form with the SQL error message header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=SQL_Create&msg='.$cp->error); exit; } @@ -241,7 +241,7 @@ if ($action == 'update') } } -// Si suppression de la demande +// If delete of request if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes') { if($user->rights->holiday->delete) @@ -255,7 +255,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes') $canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all)); - // Si c'est bien un brouillon + // If this is a rough draft if ($cp->statut == 1 || $cp->statut == 3) { // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer