diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php
index 3a1b1ac2ea7..9690e93f3cc 100644
--- a/htdocs/holiday/admin/holiday.php
+++ b/htdocs/holiday/admin/holiday.php
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see .
*/
/**
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 69e5d9b0cfc..af159020ce5 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*/
/**
diff --git a/htdocs/holiday/class/holidayagenda.class.php b/htdocs/holiday/class/holidayagenda.class.php
index 5abe1eeaaa4..10c5946e5c1 100644
--- a/htdocs/holiday/class/holidayagenda.class.php
+++ b/htdocs/holiday/class/holidayagenda.class.php
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*/
/**
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index 4df02005b20..4c004235df8 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*/
/**
@@ -35,10 +34,12 @@ if ($user->societe_id > 0) accessforbidden();
// Si l'utilisateur n'a pas le droit de lire cette page
if(!$user->rights->holiday->define_holiday) accessforbidden();
+$action=GETPOST('action');
+
/*
* View
-*/
+ */
llxHeader($langs->trans('CPTitreMenu'));
@@ -49,8 +50,8 @@ $listUsers = $holiday->fetchUsers(false,false);
$userstatic=new User($db);
// Si il y a une action de mise à jour
-if(isset($_POST['action']) && $_POST['action'] == 'update' && isset($_POST['update_cp'])) {
-
+if ($action == 'update' && isset($_POST['update_cp']))
+{
$userID = array_keys($_POST['update_cp']);
$userID = $userID[0];
@@ -70,13 +71,13 @@ if(isset($_POST['action']) && $_POST['action'] == 'update' && isset($_POST['upda
$holiday->updateSoldeCP($userID,$userValue);
- print '
'."\n";
print '';
$i++;
diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php
index 59ed1816d25..69c36f8acc1 100644
--- a/htdocs/holiday/fiche.php
+++ b/htdocs/holiday/fiche.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2011 Dimitri Mouillard
+/* Copyright (C) 2007-2012 Laurent Destailleur
+ * Copyright (C) 2011 Dimitri Mouillard
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*/
/**
@@ -53,7 +52,7 @@ if ($action == 'add')
{
// Si pas le droit de créer une demande
- if(!$user->rights->holiday->create_edit_read)
+ if(!$user->rights->holiday->write)
{
header('Location: fiche.php?action=request&error=CantCreate');
exit;
@@ -142,7 +141,7 @@ if($action == 'update')
{
// Si pas le droit de modifier une demande
- if(!$user->rights->holiday->create_edit_read)
+ if(!$user->rights->holiday->write)
{
header('Location: fiche.php?action=request&error=CantUpdate');
exit;
@@ -244,7 +243,7 @@ if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes')
}
// Si envoi de la demande
-if ($_GET['action'] == 'confirm_send')
+if ($action == 'confirm_send')
{
$cp = new Holiday($db);
$cp->fetch($_GET['id']);
@@ -333,7 +332,7 @@ if ($_GET['action'] == 'confirm_send')
}
// Si Validation de la demande
-if($_GET['action'] == 'confirm_valid')
+if($action == 'confirm_valid')
{
$cp = new Holiday($db);
@@ -415,9 +414,9 @@ if($_GET['action'] == 'confirm_valid')
}
-if ($_GET['action'] == 'confirm_refuse')
+if ($action == 'confirm_refuse')
{
- if($_POST['action'] == 'confirm_refuse' && !empty($_POST['detail_refuse']))
+ if(!empty($_POST['detail_refuse']))
{
$cp = new Holiday($db);
$cp->fetch($_GET['id']);
@@ -492,7 +491,7 @@ if ($_GET['action'] == 'confirm_refuse')
}
// Si Validation de la demande
-if ($_GET['action'] == 'confirm_cancel' && $_GET['confirm'] == 'yes')
+if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes')
{
$cp = new Holiday($db);
$cp->fetch($_GET['id']);
@@ -571,11 +570,11 @@ if ($_GET['action'] == 'confirm_cancel' && $_GET['confirm'] == 'yes')
llxHeader($langs->trans('CPTitreMenu'));
-if ($_GET['action'] == 'request')
+if ($action == 'request')
{
// Si l'utilisateur n'a pas le droit de faire une demande
- if(!$user->rights->holiday->create_edit_read)
+ if(!$user->rights->holiday->write)
{
print '
';
print $langs->trans('CantCreateCP');
@@ -756,7 +755,7 @@ elseif(isset($_GET['id']))
// Utilisateur connecté
$userID = $user->id;
- print_fiche_titre($langs->trans('TitreRequestCP'));
+ //print_fiche_titre($langs->trans('TitreRequestCP'));
// Si il y a une erreur
if(isset($_GET['error'])) {
@@ -798,9 +797,10 @@ elseif(isset($_GET['id']))
}
// On vérifie si l'utilisateur à le droit de lire cette demande
- if($user->id == $cp->fk_user || $user->rights->holiday->lire_tous) {
+ if($user->id == $cp->fk_user || $user->rights->holiday->lire_tous)
+ {
- if($_GET['action'] == 'delete' && $cp->statut == 1) {
+ if ($action == 'delete' && $cp->statut == 1) {
if($user->rights->holiday->delete) {
$html = new Form($db);
@@ -843,10 +843,10 @@ elseif(isset($_GET['id']))
}
- print '