Example #1
0
 $tplArray['vocab']['en_attente_moderation'] = get_vocab('en_attente_moderation');
 $tplArray['vocab']['reservation_impossible'] = get_vocab('reservation_impossible');
 $tplArray['vocab']['cliquez_pour_effectuer_une_reservation'] = get_vocab('cliquez_pour_effectuer_une_reservation');
 $tplArray['vocab']['top_of_page'] = get_vocab('top_of_page');
 $li = 0;
 /* incrément des room accessibles, todo peut faire dvoublon avec $li, à refactoriser */
 $incrementRoomAccessible = 0;
 for ($ir = 0; $row = grr_sql_row($res, $ir); $ir++) {
     /* un tour de boucle par room */
     $verif_acces_ressource = verif_acces_ressource(getUserName(), $row['2']);
     if ($verif_acces_ressource) {
         /* l'incrément est différent de celui de la boucle si certaines room ne sont pas accessibles */
         $acces_fiche_reservation = verif_acces_fiche_reservation(getUserName(), $row['2']);
         $UserRoomMaxBooking = UserRoomMaxBooking(getUserName(), $row['2'], 1);
         $authGetUserLevel = authGetUserLevel(getUserName(), -1);
         $auth_visiteur = auth_visiteur(getUserName(), $row['2']);
         $tplArray['rooms'][$incrementRoomAccessible]['id'] = $row[2];
         $tplArray['rooms'][$incrementRoomAccessible]['capacity'] = $row[1];
         $tplArray['rooms'][$incrementRoomAccessible]['description'] = $row[3];
         //echo '<tr>'.PHP_EOL;
         /* remplacé par la class "table_stripped de bootstrap */
         /*if ($ir % 2 == 1) {
               echo tdcell('cell_hours');
           } else {
               echo tdcell('cell_hours2');
           }*/
         /*echo '<a title="'.htmlspecialchars(get_vocab('see_week_for_this_room')).'" href="week.php?year='.$year.'&amp;month='.$month.'&amp;day='.$day.'&amp;area='.$area.'&amp;room='.$row['2'].'">'.htmlspecialchars($row[0]).'</a><br />'.PHP_EOL;*/
         /**
          * Données pour la colonne qui affiche les rooms
          */
         $tplArray['rooms'][$incrementRoomAccessible]['linkTitle'] = htmlspecialchars(get_vocab('see_week_for_this_room'));
Example #2
0
File: day.php Project: swirly/GRR
             }
         }
         tdcell_rowspan($c, $cellules[$id]);
     }
     $compteur[$id] = 1;
 } else {
     tdcell($c);
 }
 if (!isset($id) || est_hors_reservation(mktime(0, 0, 0, $month, $day, $year), $area)) {
     $hour = date("H", $t);
     $minute = date("i", $t);
     $date_booking = mktime($hour, $minute, 0, $month, $day, $year);
     if (est_hors_reservation(mktime(0, 0, 0, $month, $day, $year), $area)) {
         echo '<img src="img_grr/stop.png" alt="' . get_vocab("reservation_impossible") . '"  title="' . get_vocab("reservation_impossible") . '" width="16" height="16" class="' . $class_image . '" />' . PHP_EOL;
     } else {
         if ((authGetUserLevel(getUserName(), -1) > 1 || auth_visiteur(getUserName(), $room) == 1) && UserRoomMaxBooking(getUserName(), $room, 1) != 0 && verif_booking_date(getUserName(), -1, $room, $date_booking, $date_now, $enable_periods) && verif_delais_max_resa_room(getUserName(), $room, $date_booking) && verif_delais_min_resa_room(getUserName(), $room, $date_booking) && ($statut_room[$room] == "1" || $statut_room[$room] == "0" && authGetUserLevel(getUserName(), $room) > 2) && $_GET['pview'] != 1) {
             if ($enable_periods == 'y') {
                 echo '<a href="edit_entry.php?room=' . $room . '&amp;period=' . $time_t_stripped . '&amp;year=' . $year . '&amp;month=' . $month . '&amp;day=' . $day . '&amp;page=day" title="' . get_vocab("cliquez_pour_effectuer_une_reservation") . '" ><span class="glyphicon glyphicon-plus"></span></a>' . PHP_EOL;
             } else {
                 echo '<a href="edit_entry.php?room=' . $room . '&amp;hour=' . $hour . '&amp;minute=' . $minute . '&amp;year=' . $year . '&amp;month=' . $month . '&amp;day=' . $day . '&amp;page=day" title="' . get_vocab("cliquez_pour_effectuer_une_reservation") . '" ><span class="glyphicon glyphicon-plus"></span></a>' . PHP_EOL;
             }
         } else {
             echo ' ';
         }
     }
     echo '</td>' . PHP_EOL;
 } else {
     if ($descr != "") {
         if (isset($today[$room][$t]["statut"]) && $today[$room][$t]["statut"] != '-') {
             echo '<img src="img_grr/buzy.png" alt="' . get_vocab("ressource actuellement empruntee") . '" title="' . get_vocab("ressource actuellement empruntee") . '" width="20" height="20" class="image" />' . PHP_EOL;
         }
Example #3
0
if ($_GET['pview'] == 1) {
    $class_image = "print_image";
} else {
    $class_image = "image";
}
//calcul de l'accès à la ressource en fonction du niveau de l'utilisateur
$verif_acces_ressource = verif_acces_ressource(getUserName(), $room);
//Calcul du niveau d'accès aux fiche de réservation détaillées des ressources
$acces_fiche_reservation = verif_acces_fiche_reservation(getUserName(), $room);
//calcul du test si l'utilisateur a la possibilité d'effectuer une réservation, compte tenu
//des limitations éventuelles de la ressources et du nombre de réservations déjà effectuées.
$UserRoomMaxBooking = UserRoomMaxBooking(getUserName(), $room, 1);
//calcul du niverau de droit de réservation
$authGetUserLevel = authGetUserLevel(getUserName(), -1);
//Determine si un visiteur peut réserver une ressource
$auth_visiteur = auth_visiteur(getUserName(), $room);
//Paramètres par défaut
if (empty($debug_flag)) {
    $debug_flag = 0;
}
if (empty($month) || empty($year) || !checkdate($month, 1, $year)) {
    $month = date("m");
    $year = date("Y");
}
if (!isset($day)) {
    $day = 1;
}
//Renseigne la session de l'utilisateur, sans identification ou avec identification.
if (Settings::get("authentification_obli") == 0 && getUserName() == '') {
    $type_session = "no_session";
} else {
Example #4
0
         if (!verif_delais_min_resa_room(getUserName(), $room_id, $reps[$i])) {
             $error_delais_min_resa_room = 'yes';
         }
         if (!verif_date_option_reservation($option_reservation, $reps[$i])) {
             $error_date_option_reservation = 'yes';
         }
         if (!verif_qui_peut_reserver_pour($room_id, getUserName(), $beneficiaire)) {
             $error_qui_peut_reserver_pour = 'yes';
         }
         if (!verif_heure_debut_fin($reps[$i], $reps[$i] + $diff, $area)) {
             $error_heure_debut_fin = 'yes';
         }
         ++$i;
     }
 } else {
     if (authGetUserLevel(getUserName(), -1) < 2 && auth_visiteur(getUserName(), $room_id) == 0) {
         $error_booking_room_out = 'yes';
     }
     if (isset($id) && $id != 0) {
         if (!verif_booking_date(getUserName(), $id, $room_id, $starttime, $date_now, $enable_periods, $endtime)) {
             $error_booking_in_past = 'yes';
         }
     } else {
         if (!verif_booking_date(getUserName(), -1, $room_id, $starttime, $date_now, $enable_periods)) {
             $error_booking_in_past = 'yes';
         }
     }
     if (!verif_duree_max_resa_area(getUserName(), $room_id, $starttime, $endtime)) {
         $error_duree_max_resa_area = 'yes';
     }
     if (!verif_delais_max_resa_room(getUserName(), $room_id, $starttime)) {
Example #5
0
  $type = $_GET["type"];
} else die();

if (isset($_GET['areas'])) {
  $areas = $_GET['areas'];
  settype($areas,"integer");
}
else die();
if (isset($_GET['room'])) {
  $room = $_GET['room'];
  if ($room != "") settype($room,"integer");
}
else die();


if ((authGetUserLevel(getUserName(),-1) < 2) and (auth_visiteur(getUserName(),$room) == 0))
{
    showAccessDenied("","","","","");
    exit();
}

if(authUserAccesArea(getUserName(), $areas)==0)
{
    showAccessDenied("","","","","");
    exit();
}

// Type de réservation
$qui_peut_reserver_pour  = grr_sql_query1("select qui_peut_reserver_pour from grr_room where id='".$room."'");
$aff_default=((authGetUserLevel(getUserName(),-1,"room") >= $qui_peut_reserver_pour) or (authGetUserLevel(getUserName(),$areas,"area") >= $qui_peut_reserver_pour));
$aff_type=max(authGetUserLevel(getUserName(),-1,"room"),authGetUserLevel(getUserName(),$areas,"area"));
Example #6
0
File: day.php Project: rhertzog/lcs
                $compteur[$id] = 1; // on incrémente le compteur initialement à zéro
            } else
                tdcell ($c); // il s'agit d'un créneau libre  -> <td> normal
            // Si $compteur[$id] a atteint == $cellules[$id]+1

            if ((!isset($id)) or (est_hors_reservation(mktime(0,0,0,$month,$day,$year),$area))) // Le créneau est libre
            {
                $hour = date("H",$t);
                $minute  = date("i",$t);
                $date_booking = mktime($hour, $minute, 0, $month, $day, $year);
                if (est_hors_reservation(mktime(0,0,0,$month,$day,$year),$area)) {
                    echo "<img src=\"img_grr/stop.png\" alt=\"".get_vocab("reservation_impossible")."\"  title=\"".get_vocab("reservation_impossible")."\" width=\"16\" height=\"16\" class=\"".$class_image."\"  />";
                    $tab[$tab_ligne][] = "<img src=\"img_grr/stop.png\" alt=\"".get_vocab("reservation_impossible")."\"  title=\"".get_vocab("reservation_impossible")."\" width=\"16\" height=\"16\" class=\"".$class_image."\"  />";
                } else

                if (((authGetUserLevel(getUserName(),-1) > 1) or (auth_visiteur(getUserName(),$room) == 1))
                 and (UserRoomMaxBooking(getUserName(), $room, 1) != 0)
                 and verif_booking_date(getUserName(), -1, $room, $date_booking, $date_now, $enable_periods)
                 and verif_delais_max_resa_room(getUserName(), $room, $date_booking)
                 and verif_delais_min_resa_room(getUserName(), $room, $date_booking)
                 and (($statut_room[$room] == "1") or
                  (($statut_room[$room] == "0") and (authGetUserLevel(getUserName(),$room) > 2) ))
                  and $_GET['pview'] != 1) {
                    if ($enable_periods == 'y') {
                        echo "<a href=\"edit_entry.php?room=$room&amp;period=$time_t_stripped&amp;year=$year&amp;month=$month&amp;day=$day&amp;page=day\" title=\"".get_vocab("cliquez_pour_effectuer_une_reservation")."\" ><img src=\"img_grr/new.png\" alt=\"".get_vocab("add")."\" width=\"16\" height=\"16\" class=\"".$class_image."\" /></a>";
                        $tab[$tab_ligne][] = "<a href=\"edit_entry.php?room=$room&amp;period=$time_t_stripped&amp;year=$year&amp;month=$month&amp;day=$day&amp;page=day\" title=\"".get_vocab("cliquez_pour_effectuer_une_reservation")."\" ><img src=\"img_grr/new.png\" class=\"".$class_image."\" alt=\"".get_vocab("add")."\" width=\"16\" height=\"16\" /></a>";
                    } else {
                        echo "<a href=\"edit_entry.php?room=$room&amp;hour=$hour&amp;minute=$minute&amp;year=$year&amp;month=$month&amp;day=$day&amp;page=day\" title=\"".get_vocab("cliquez_pour_effectuer_une_reservation")."\" ><img src=\"img_grr/new.png\" class=\"".$class_image."\" alt=\"".get_vocab("add")."\" /></a>";
                        $tab[$tab_ligne][] =  "<a href=\"edit_entry.php?room=$room&amp;hour=$hour&amp;minute=$minute&amp;year=$year&amp;month=$month&amp;day=$day&amp;page=day\" title=\"".get_vocab("cliquez_pour_effectuer_une_reservation")."\" ><img src=\"img_grr/new.png\" class=\"".$class_image."\" alt=\"".get_vocab("add")."\" /></a>";
                    }
                } else {
Example #7
0
     // Dans le cas d'une réservation avec périodicité, on  vérifie que les différents créneaux ne se chevaussent pas.
     if (!grrCheckOverlap($reps, $diff)) $error_chevaussement = 'yes';
     $i = 0;
     while (($i < count($reps)) and ($error_booking_in_past == 'no') and ($error_duree_max_resa_area == 'no') and ($error_delais_max_resa_room == 'no') and ($error_delais_min_resa_room == 'no') and ($error_date_option_reservation=='no') and ($error_qui_peut_reserver_pour=='no') and ($error_heure_debut_fin=='no')) {
         if ((authGetUserLevel(getUserName(),-1) < 2) and (auth_visiteur(getUserName(),$room_id) == 0)) $error_booking_room_out = 'yes';
         if (!(verif_booking_date(getUserName(), -1, $room_id, $reps[$i], $date_now, $enable_periods))) $error_booking_in_past = 'yes';
         if (!(verif_duree_max_resa_area(getUserName(), $room_id, $starttime, $endtime))) $error_duree_max_resa_aera = 'yes';
         if (!(verif_delais_max_resa_room(getUserName(), $room_id, $reps[$i]))) $error_delais_max_resa_room = 'yes';
         if (!(verif_delais_min_resa_room(getUserName(), $room_id, $reps[$i]))) $error_delais_min_resa_room = 'yes';
         if (!(verif_date_option_reservation($option_reservation, $reps[$i]))) $error_date_option_reservation = 'yes';
         if (!(verif_qui_peut_reserver_pour($room_id, getUserName(), $beneficiaire))) $error_qui_peut_reserver_pour = 'yes';
         if (!(verif_heure_debut_fin($reps[$i], $reps[$i]+$diff, $area))) $error_heure_debut_fin = 'yes';
         $i++;
     }
 } else {
     if ((authGetUserLevel(getUserName(),-1) < 2) and (auth_visiteur(getUserName(),$room_id) == 0)) $error_booking_room_out = 'yes';
     if (isset($id) and ($id!=0)) {
         if (!(verif_booking_date(getUserName(), $id, $room_id, $starttime, $date_now, $enable_periods, $endtime))) $error_booking_in_past = 'yes';
     } else {
         if (!(verif_booking_date(getUserName(), -1, $room_id, $starttime, $date_now, $enable_periods))) $error_booking_in_past = 'yes';
     }
     if (!(verif_duree_max_resa_area(getUserName(), $room_id, $starttime, $endtime))) $error_duree_max_resa_area = 'yes';
     if (!(verif_delais_max_resa_room(getUserName(), $room_id, $starttime))) $error_delais_max_resa_room = 'yes';
     if (!(verif_delais_min_resa_room(getUserName(), $room_id, $starttime))) $error_delais_min_resa_room = 'yes';
     if (!(verif_date_option_reservation($option_reservation, $starttime))) $error_date_option_reservation = 'yes';
     if (!(verif_qui_peut_reserver_pour($room_id, getUserName(), $beneficiaire))) $error_qui_peut_reserver_pour = 'yes';
     if (!(verif_heure_debut_fin($starttime, $endtime, $area))) $error_heure_debut_fin = 'yes';
     if (resa_est_hors_reservation2($starttime, $endtime, $area)) $error_heure_debut_fin = 'yes';
 }
 $statut_room = grr_sql_query1("select statut_room from ".TABLE_PREFIX."_room where id = '$room_id'");
 // on vérifie qu'un utilisateur non autorisé ne tente pas de réserver une ressource non disponible