diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 83c1a38ed0a..e16cbc29229 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1,20 +1,21 @@ - * 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * 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, see . -*/ + */ /** * \file holiday.class.php @@ -1182,12 +1183,12 @@ class Holiday extends CommonObject // On séléctionne les utilisateurs qui ne sont pas déjà dans le module $sql = "SELECT u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as u"; - $sql.= " WHERE u.fk_user NOT IN(".$listUsersDolibarr.")"; + $sql.= " WHERE u.fk_user NOT IN (".$listUsersDolibarr.")"; - $result = $this->db->query($sql); + $resql = $this->db->query($sql); // Si pas d'erreur SQL - if($result) { + if ($resql) { $i = 0; $num = $this->db->num_rows($resql); diff --git a/htdocs/holiday/common.inc.php b/htdocs/holiday/common.inc.php index d321d6d386e..21bd2d6e231 100644 --- a/htdocs/holiday/common.inc.php +++ b/htdocs/holiday/common.inc.php @@ -43,14 +43,14 @@ if (empty($conf->holiday->enabled)) } -$verifConf.= "SELECT value"; -$verifConf.= " FROM ".MAIN_DB_PREFIX."holiday_config"; -$verifConf.= " WHERE name = 'userGroup'"; +$sql = "SELECT value"; +$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config"; +$sql.= " WHERE name = 'userGroup'"; -$result = $db->query($verifConf); +$result = $db->query($sql); $obj = $db->fetch_object($result); -if($obj->value == NULL) +if ($obj->value == NULL) { llxHeader('',$langs->trans('CPTitreMenu')); print '
'; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index f528499cae0..38911ca13da 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -1,20 +1,21 @@ - * 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * 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, see . -*/ + */ /** * \file fiche.php @@ -33,14 +34,14 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; // Get parameters $myparam = GETPOST("myparam"); -$action=GETPOST('action'); -$id=GETPOST('id'); +$action=GETPOST('action', 'alpha'); +$id=GETPOST('id', 'int'); // Protection if external user if ($user->societe_id > 0) accessforbidden(); $user_id = $user->id; - +$now=dol_now(); /******************************************************************* @@ -50,7 +51,6 @@ $user_id = $user->id; // Si création de la demande if ($action == 'create') { - // Si pas le droit de créer une demande if(!$user->rights->holiday->write) { @@ -290,7 +290,6 @@ if ($action == 'confirm_send') $delayForRequest = $cp->getConfCP('delayForRequest'); //$delayForRequest = $delayForRequest * (60*60*24); - $now=dol_now(); $nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd'); // Si l'option pour avertir le valideur en cas de délai trop court @@ -703,11 +702,11 @@ if (empty($id) || $action == 'add' || $action == 'request') // Liste des utiliseurs du groupes choisi dans la config $idGroupValid = $cp->getConfCP('userGroup'); - $validator = new UserGroup($db,$idGroupValid); + $validator = new UserGroup($db, $idGroupValid); $valideurarray = $validator->listUsersForGroup(); print ''; - print $html->select_dolusers($valideur,"valideur",1,"",0,$valideurarray,''); + print $html->select_dolusers($validator->id, "valideur", 1, "", 0, $valideurarray); print ''; print ''; print ''; diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 4a10e6712d0..1c27e2978bf 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Dimitri Mouillard +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2012 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -71,6 +71,7 @@ $search_statut = GETPOST('select_statut'); $max_year = 5; $min_year = 10; +$filter=''; llxHeader(array(),$langs->trans('CPTitreMenu')); @@ -185,7 +186,7 @@ if($holiday_payes == '-1') $var=true; $num = count($holiday->holiday); $html = new Form($db); $htmlother = new FormOther($db); -print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num,$nbtotalofrecords); +print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num); print '
';