Skip to content

Commit

Permalink
correctifs, notamment pour compatibilité php8
Browse files Browse the repository at this point in the history
  • Loading branch information
ynaessens committed Feb 4, 2022
1 parent 28ce3bc commit 0b7078a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 30 deletions.
5 changes: 3 additions & 2 deletions day.php
Expand Up @@ -3,7 +3,7 @@
* day.php
* Permet l'affichage de la page planning en mode d'affichage "jour".
* Ce script fait partie de l'application GRR
* Dernière modification : $Date: 2022-01-13 11:27$
* Dernière modification : $Date: 2022-02-04 17:54$
* @author Laurent Delineau & JeromeB & Yan Naessens
* @copyright Copyright 2003-2022 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
Expand Down Expand Up @@ -164,7 +164,8 @@
$cellules = array();
$compteur = array();
$today = array();
foreach($res as $row)

for ($i = 0; ($row = grr_sql_row_keyed($res, $i)); $i++) // foreach($res as $row) nécessite de modifier contenu_cellule et contenu_popup
{
$start_t = max(round_t_down($row["start_time"], $resolution, $am7), $am7);
$end_t = min(round_t_up($row["end_time"], $resolution, $am7) - $resolution, $pm7);
Expand Down
39 changes: 17 additions & 22 deletions include/functions.inc.php
Expand Up @@ -2,7 +2,7 @@
/**
* include/functions.inc.php
* fichier Bibliothèque de fonctions de GRR
* Dernière modification : $Date: 2022-01-03 17:07$
* Dernière modification : $Date: 2022-01-14 18:18$
* @author JeromeB & Laurent Delineau & Marc-Henri PAMISEUX & Yan Naessens
* @copyright Copyright 2003-2022 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
Expand Down Expand Up @@ -652,23 +652,17 @@ function resaToModerate($user)
}
return $resas;
}
/*
Teste s'il reste ou non des plages libres sur une journée donnée pour un domaine donné.
Arguments :
$id_room : identifiant de la ressource
$month_week : mois
$day_week : jour
$year_week : année
Renvoie vrai s'il reste des plages non réservées sur la journée
Renvoie faux dans le cas contraire
/** fonction plages_libre_semaine_ressource($id_room, $month_week, $day_week, $year_week)
* Teste s'il reste ou non des plages libres sur une journée donnée pour une ressource donnée.
* Arguments :
* integer $id_room : identifiant de la ressource
* integer $month_week : mois
* integer $day_week : jour
* integer $year_week : année
* Renvoie un booléen :
* vrai s'il reste des plages non réservées sur la journée
* faux dans le cas contraire
*/
/**
* @param integer $id_room
* @param integer $month_week
* @param integer $day_week
* @param integer $year_week
* @return boolean
*/
function plages_libre_semaine_ressource($id_room, $month_week, $day_week, $year_week)
{
global $morningstarts, $eveningends, $eveningends_minutes, $resolution, $enable_periods;
Expand All @@ -681,14 +675,15 @@ function plages_libre_semaine_ressource($id_room, $month_week, $day_week, $year_
while ($t < $date_end)
{
$t_end = $t + $resolution;
$query = "SELECT id FROM ".TABLE_PREFIX."_entry WHERE room_id='".$id_room."' AND start_time <= ".$t." AND end_time >= ".$t_end." ";
$test = grr_sql_query1($query);
if ($test == -1)
{
$query = "SELECT end_time FROM ".TABLE_PREFIX."_entry WHERE room_id='".$id_room."' AND start_time <= ".$t." AND end_time >= ".$t_end." ";
$end_time = grr_sql_query1($query);
if ($end_time == -1){
$plage_libre = true;
break;
}
else{
$t = $end_time; // avance à la fin de la réservation trouvée
}
$t += $resolution;
}
return $plage_libre ;
}
Expand Down
8 changes: 4 additions & 4 deletions include/mrbs_sql.inc.php
Expand Up @@ -2,9 +2,9 @@
/**
* mrbs_sql.inc.php
* Bibliothèque de fonctions propres à l'application GRR
* Dernière modification : $Date: 2021-12-09 16:12$
* Dernière modification : $Date: 2022-02-04 17:55$
* @author JeromeB & Laurent Delineau & Marc-Henri PAMISEUX & Yan Naessens
* @copyright Copyright 2003-2021 Team DEVOME - JeromeB
* @copyright Copyright 2003-2022 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
*
* This file is part of GRR.
Expand Down Expand Up @@ -688,7 +688,7 @@ function mrbsGetRepeatEntryList($time, $enddate, $rep_type, $rep_opt, $max_ittr,
* 0 - An error occured while inserting the entry
* non-zero - The entry's ID
*/
function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks, $option_reservation,$overload_data, $moderate, $rep_jour_c, $courrier, $nbparticipantmax=0, $rep_month_abs1, $rep_month_abs2, $ignore=array())
function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks, $option_reservation,$overload_data, $moderate, $rep_jour_c, $courrier, $nbparticipantmax=0, $rep_month_abs1=0, $rep_month_abs2=1, $ignore=array())
{
global $max_rep_entrys, $id_first_resa;
$area = mrbsGetRoomArea($room_id);
Expand Down Expand Up @@ -759,7 +759,7 @@ function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate
* 0 - An error occured while inserting the entry
* non-zero - The entry's ID
*/
function grrCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks, $option_reservation,$overload_data, $moderate, $rep_jour_c, $courrier, $nbparticipantmax=0, $rep_month_abs1, $rep_month_abs2, $serie)
function grrCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks, $option_reservation,$overload_data, $moderate, $rep_jour_c, $courrier, $nbparticipantmax=0, $rep_month_abs1=0, $rep_month_abs2=1, $serie=array())
{
global $max_rep_entrys;
$area = mrbsGetRoomArea($room_id);
Expand Down
5 changes: 3 additions & 2 deletions index.php
Expand Up @@ -2,7 +2,7 @@
/**
* index.php
* Ce script fait partie de l'application GRR
* Dernière modification : $Date: 2022-01-13 12:26$
* Dernière modification : $Date: 2022-02-04 17:54$
* @author Laurent Delineau & JeromeB & Yan Naessens
* @copyright Copyright 2003-2022 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
Expand All @@ -25,6 +25,7 @@
require_once("./include/functions.inc.php");
require_once("./include/settings.class.php");
// Paramètres langage
$dbDb = (isset($dbDb))? $dbDb :'';
include "./include/language.inc.php";
// Dans le cas d'une base mysql, on teste la bonne installation de la base et on propose une installation automatisée.
if ($dbsys == "mysql")
Expand All @@ -34,7 +35,7 @@
$msg = '';
if (file_exists("./include/connect.inc.php"))
{
require_once("include/connect.inc.php");
require_once("./include/connect.inc.php");
$db = @mysqli_connect("$dbHost", "$dbUser", "$dbPass", "$dbDb", "$dbPort");
if ($db)
{
Expand Down

0 comments on commit 0b7078a

Please sign in to comment.