Skip to content
Snippets Groups Projects
Commit 2e3d25c0 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #3462 from grandoc/3.7

fix : Typo
parents 1f25ccf0 fed70b13
Branches
Tags
No related merge requests found
...@@ -141,7 +141,7 @@ class modHoliday extends DolibarrModules ...@@ -141,7 +141,7 @@ class modHoliday extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 20002; // Permission id (must not be already used) $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][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][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) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
......
...@@ -51,12 +51,12 @@ $now=dol_now(); ...@@ -51,12 +51,12 @@ $now=dol_now();
* Actions * Actions
*/ */
// Si création de la demande // If create a request
if ($action == 'create') if ($action == 'create')
{ {
$cp = new Holiday($db); $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))) if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
{ {
$error++; $error++;
...@@ -81,21 +81,21 @@ if ($action == 'create') ...@@ -81,21 +81,21 @@ if ($action == 'create')
$description = trim(GETPOST('description')); $description = trim(GETPOST('description'));
$userID = GETPOST('userID'); $userID = GETPOST('userID');
// Si pas de date de début // If no start date
if (empty($date_debut)) if (empty($date_debut))
{ {
header('Location: card.php?action=request&error=nodatedebut'); header('Location: card.php?action=request&error=nodatedebut');
exit; exit;
} }
// Si pas de date de fin // If no end date
if (empty($date_fin)) if (empty($date_fin))
{ {
header('Location: card.php?action=request&error=nodatefin'); header('Location: card.php?action=request&error=nodatefin');
exit; exit;
} }
// Si date de début après la date de fin // If start date after end date
if ($date_debut > $date_fin) if ($date_debut > $date_fin)
{ {
header('Location: card.php?action=request&error=datefin'); header('Location: card.php?action=request&error=datefin');
...@@ -110,7 +110,7 @@ if ($action == 'create') ...@@ -110,7 +110,7 @@ if ($action == 'create')
exit; 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); $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
if($nbopenedday < 0.5) if($nbopenedday < 0.5)
{ {
...@@ -118,7 +118,7 @@ if ($action == 'create') ...@@ -118,7 +118,7 @@ if ($action == 'create')
exit; exit;
} }
// Si pas de validateur choisi // If no validator designated
if ($valideur < 1) if ($valideur < 1)
{ {
header('Location: card.php?action=request&error=Valideur'); header('Location: card.php?action=request&error=Valideur');
...@@ -134,7 +134,7 @@ if ($action == 'create') ...@@ -134,7 +134,7 @@ if ($action == 'create')
$verif = $cp->create($userid); $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) if ($verif > 0)
{ {
header('Location: card.php?id='.$verif); header('Location: card.php?id='.$verif);
...@@ -142,7 +142,7 @@ if ($action == 'create') ...@@ -142,7 +142,7 @@ if ($action == 'create')
} }
else 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); header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error);
exit; exit;
} }
...@@ -162,7 +162,7 @@ if ($action == 'update') ...@@ -162,7 +162,7 @@ if ($action == 'update')
else if ($starthalfday == 'afternoon') $halfday=-1; else if ($starthalfday == 'afternoon') $halfday=-1;
else if ($endhalfday == 'morning') $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) if (! $user->rights->holiday->write)
{ {
header('Location: card.php?action=request&error=CantUpdate'); header('Location: card.php?action=request&error=CantUpdate');
...@@ -174,40 +174,40 @@ if ($action == 'update') ...@@ -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)); $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) 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) if ($canedit)
{ {
$valideur = $_POST['valideur']; $valideur = $_POST['valideur'];
$description = trim($_POST['description']); $description = trim($_POST['description']);
// Si pas de date de début // If no start date
if (empty($_POST['date_debut_'])) { if (empty($_POST['date_debut_'])) {
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut'); header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut');
exit; exit;
} }
// Si pas de date de fin // If no end date
if (empty($_POST['date_fin_'])) { if (empty($_POST['date_fin_'])) {
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin'); header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin');
exit; exit;
} }
// Si date de début après la date de fin // If start date after end date
if ($date_debut > $date_fin) { if ($date_debut > $date_fin) {
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin'); header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin');
exit; exit;
} }
// Si pas de valideur choisi // If no validator designated
if ($valideur < 1) { if ($valideur < 1) {
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur'); header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur');
exit; 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); $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
if ($nbopenedday < 0.5) if ($nbopenedday < 0.5)
{ {
...@@ -230,7 +230,7 @@ if ($action == 'update') ...@@ -230,7 +230,7 @@ if ($action == 'update')
} }
else 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); header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=SQL_Create&msg='.$cp->error);
exit; exit;
} }
...@@ -241,7 +241,7 @@ if ($action == 'update') ...@@ -241,7 +241,7 @@ if ($action == 'update')
} }
} }
// Si suppression de la demande // If delete of request
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes') if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes')
{ {
if($user->rights->holiday->delete) if($user->rights->holiday->delete)
...@@ -255,7 +255,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes') ...@@ -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)); $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) if ($cp->statut == 1 || $cp->statut == 3)
{ {
// Si l'utilisateur à le droit de lire cette demande, il peut la supprimer // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment