Skip to content

Commit

Permalink
amélioration: reprise des paramètres en périodicité X Y du mois
Browse files Browse the repository at this point in the history
  • Loading branch information
ynaessens committed Aug 7, 2019
1 parent ac04604 commit 3964090
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
13 changes: 11 additions & 2 deletions edit_entry.php
Expand Up @@ -3,7 +3,7 @@
* edit_entry.php
* Interface d'édition d'une réservation
* Ce script fait partie de l'application GRR
* Dernière modification : $Date: 2019-03-31 18:00$
* Dernière modification : $Date: 2019-08-07 10:40$
* @author Laurent Delineau & JeromeB & Yan Naessens
* @copyright Copyright 2003-2019 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
Expand Down Expand Up @@ -54,6 +54,8 @@
else
$minute = NULL;
$rep_num_weeks = '';
$rep_month_abs1 = 0;
$rep_month_abs2 = 1;
global $twentyfourhour_format;
if (!isset($day) || !isset($month) || !isset($year))
{
Expand Down Expand Up @@ -171,8 +173,13 @@
$row = grr_sql_row($res, 0);
grr_sql_free($res);
$rep_type = $row[0];
if ($rep_type == 2)
if ($rep_type == 2) // périodidicté chaque semaine
$rep_num_weeks = $row[4];
if ($rep_type == 7) // périodidicté X Y du mois
{
$rep_month_abs1 = $row[4];
$rep_month_abs2 = $row[3];
}
if ($edit_type == "series")
{
$start_day = (int)strftime('%d', $row[1]);
Expand Down Expand Up @@ -1137,13 +1144,15 @@ function changeRoom( formObj)
for ($weekit = 0; $weekit < 6; $weekit++)
{
echo "<option value=\"".$weekit."\"";
if ($weekit == $rep_month_abs1) echo " selected='selected' ";
echo ">".get_vocab($monthlist[$weekit])."</option>\n";
}
echo '</select>'.PHP_EOL;
echo '<select class="form-control" name="rep_month_abs2" size="1" onfocus="check_8()" onclick="check_8()">'.PHP_EOL;
for ($weekit = 1; $weekit < 8; $weekit++)
{
echo "<option value=\"".$weekit."\"";
if ($weekit == $rep_month_abs2) echo " selected='selected' ";
echo ">".day_name($weekit)."</option>\n";
}
echo "</select>\n";
Expand Down
9 changes: 7 additions & 2 deletions include/mrbs_sql.inc.php
Expand Up @@ -2,7 +2,7 @@
/**
* mrbs_sql.inc.php
* Bibliothèque de fonctions propres à l'application GRR
* Dernière modification : $Date: 2019-02-16 16:20$
* Dernière modification : $Date: 2019-08-07 10:40$
* @author JeromeB & Laurent Delineau & Marc-Henri PAMISEUX & Yan Naessens
* @copyright Copyright 2003-2019 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
Expand Down Expand Up @@ -656,6 +656,11 @@ function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate
{
global $max_rep_entrys, $id_first_resa;
$area = mrbsGetRoomArea($room_id);
if ($rep_type == '7')
{
$rep_num_weeks = $rep_month_abs1;
$rep_opt = $rep_month_abs2;
}
$reps = mrbsGetRepeatEntryList($starttime, $rep_enddate, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks, $rep_jour_c, $area, $rep_month_abs1, $rep_month_abs2);
if (count($reps) > $max_rep_entrys)
return 0;
Expand All @@ -677,7 +682,7 @@ function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate
// s'il s'agit d'une modification d'une ressource déjà modérée et acceptée : on met à jour les infos dans la table ".TABLE_PREFIX."_entry_moderate
if ($moderate == 2)
moderate_entry_do($id_new_resa,1,"","no");
// On récupère l'id de la première réservation de la série et qui sera utilisé pour l'enoi d'un mail
// On récupère l'id de la première réservation de la série et qui sera utilisé pour l'envoi d'un mail
if ($i == 0)
$id_first_resa = $id_new_resa;
}
Expand Down

0 comments on commit 3964090

Please sign in to comment.