Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
2e3d25c0
Commit
2e3d25c0
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #3462 from grandoc/3.7
fix : Typo
parents
1f25ccf0
fed70b13
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/modules/modHoliday.class.php
+1
-1
1 addition, 1 deletion
htdocs/core/modules/modHoliday.class.php
htdocs/holiday/card.php
+20
-20
20 additions, 20 deletions
htdocs/holiday/card.php
with
21 additions
and
21 deletions
htdocs/core/modules/modHoliday.class.php
+
1
−
1
View file @
2e3d25c0
...
...
@@ -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 hol
l
idays 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)
...
...
This diff is collapsed.
Click to expand it.
htdocs/holiday/card.php
+
20
−
20
View file @
2e3d25c0
...
...
@@ -51,12 +51,12 @@ $now=dol_now();
* Actions
*/
//
Si
cr
é
at
ion d
e
l
a
demande
//
If
cr
e
ate 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 un
de
r
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment