Skip to content

Commit

Permalink
CGU et systeme de page
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeDevome committed Feb 15, 2018
1 parent d3c99fb commit c202e29
Show file tree
Hide file tree
Showing 15 changed files with 265 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Doc/index.htm
Expand Up @@ -759,7 +759,7 @@ <h3>3.1.1.Contenu / Apparence</h3>
<li>Choix de l'affichage de la gestion des salles par courrier.</li>
<li>Choix de l'affichage des vacances scolaires et les jours fériés.</li>
<li>Choix de la zone de vacances scolaires (France).</li>
<li>Paramétrage de l'outil "Stats" (valeur
<li>Paramétrage de l'outil "Recherche & Stats." (valeur
par défaut de l'intervalle de temps entre la date de début de recherche
et la date de fin).</li>
<li>Paramétrage de l'outil Formulaire de réservation.</li>
Expand Down
99 changes: 99 additions & 0 deletions admin/admin_cgu.php
@@ -0,0 +1,99 @@
<?php
/**
* admin_config1.php
* Interface permettant à l'administrateur la configuration de certains paramètres généraux
* Ce script fait partie de l'application GRR.
* Dernière modification : $Date: 2017-12-16 14:00$
* @author JeromeB
* @copyright Copyright 2003-2018 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
*
* This file is part of GRR.
*
* GRR 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.
*/

include "../include/admin.inc.php";
require_once("../include/pages.class.php");
$grr_script_name = "admin_cgu.php";
$back = '';
if (isset($_SERVER['HTTP_REFERER']))
$back = htmlspecialchars($_SERVER['HTTP_REFERER']);
$_SESSION['chemin_retour'] = "admin_cgu.php";
$day = date("d");
$month = date("m");
$year = date("Y");
check_access(6, $back);

if (!Pages::load()) {
die('Erreur chargement pages');
}

/* Enregistrement de la page */
if (isset($_POST['CGU'])) {
if (!Pages::set("CGU", $_POST['CGU'])) {
echo "Erreur lors de l'enregistrement de CGU !<br />";
die();
}
}
/**/

$msg = '';


// Si pas de problème, message de confirmation
if (isset($_POST['ok'])) {
$_SESSION['displ_msg'] = 'yes';
if ($msg == '') {
$msg = get_vocab('message_records');
}
Header('Location: '.'admin_cgu.php?msg='.$msg);
exit();
}
if ((isset($_GET['msg'])) && isset($_SESSION['displ_msg']) && ($_SESSION['displ_msg'] == 'yes')) {
$msg = $_GET['msg'];
} else {
$msg = '';
}

print_header('', '', '', $type = 'with_session');
affiche_pop_up($msg, 'admin');
// Affichage de la colonne de gauche
include 'admin_col_gauche.php';

echo '<form action="./admin_cgu.php" id="nom_formulaire" method="post" style="width: 100%;">'.PHP_EOL;
?>
<table class="table_adm">
<?php
if (Settings::get('use_fckeditor') == 1) {
echo '<script type="text/javascript" src="../js/ckeditor/ckeditor.js"></script>'.PHP_EOL;
}
echo '<h3>'.get_vocab('cgu_titre').'</h3>'.PHP_EOL;
echo get_vocab('cgu_grr');
if (Pages::get('use_fckeditor') != 1) {
echo ' '.get_vocab('description complete2');
}
if (Settings::get('use_fckeditor') == 1) {
echo '<textarea class="ckeditor" id="editor1" name="CGU" rows="20" cols="120">'.PHP_EOL;
echo htmlspecialchars(Pages::get('CGU'));
echo "</textarea>\n";
?>

<?php

} else {
echo "\n<textarea name=\"CGU\" rows=\"8\" cols=\"120\">".htmlspecialchars(Pages::get('CGU')).'</textarea>'.PHP_EOL;
}
echo '</p>'.PHP_EOL;

echo '<div id="fixe" style="text-align:center;">'.PHP_EOL;
echo '<input class="btn btn-primary" type="submit" name="ok" value="'.get_vocab('save').'" style="font-variant: small-caps;"/>'.PHP_EOL;
echo '</div>';
echo '</form>';

// fin de l'affichage de la colonne de droite
echo '</td></tr></table>';
?>
2 changes: 2 additions & 0 deletions admin/admin_col_gauche.php
Expand Up @@ -106,6 +106,8 @@ function affichetableau($liste,$titre='')
$liste[] = 'admin_view_connexions.php';
if (authGetUserLevel(getUserName(), -1, 'area') >= 4)
$liste[] = 'admin_calend.php';
if (authGetUserLevel(getUserName(), -1, 'area') >= 6)
$liste[] = 'admin_cgu.php';
if (authGetUserLevel(getUserName(), -1, 'area') >= 6)
$liste[] = 'admin_maj.php';
if (Settings::get("sso_ac_corr_profil_statut") == 'y') {
Expand Down
3 changes: 3 additions & 0 deletions admin/admin_maj.php
Expand Up @@ -829,6 +829,9 @@ function traite_requete($requete = "")
$result_inter .= traite_requete("UPDATE ".TABLE_PREFIX."_type_area SET `couleurhexa` = '#AA5050' WHERE couleur = '27';");
$result_inter .= traite_requete("UPDATE ".TABLE_PREFIX."_type_area SET `couleurhexa` = '#FFBB20' WHERE couleur = '28';");
$result_inter .= traite_requete("UPDATE ".TABLE_PREFIX."_type_area SET `couleurhexa` = '#CFCFCF' WHERE couleur > '28';");
$result_inter .= traite_requete("CREATE TABLE IF NOT EXISTS ".TABLE_PREFIX."_page (`nom` varchar(30) NOT NULL, `valeur` longtext NOT NULL);");
$result_inter .= traite_requete("INSERT INTO ".TABLE_PREFIX."_page (`nom`, `valeur`) VALUES ('CGU', 'Les CGU');");
$result_inter .= traite_requete("ALTER TABLE ".TABLE_PREFIX."_page ADD UNIQUE KEY `nom` (`nom`);");

if ($result_inter == '')
$result .= "<span style=\"color:green;\">Ok !</span><br />";
Expand Down
1 change: 1 addition & 0 deletions include/config.inc.php
Expand Up @@ -184,6 +184,7 @@

# Global settings array
$grrSettings = array();
$grrPages = array();

# Make sure notice errors are not reported
#error_reporting (E_ALL ^ E_NOTICE);
Expand Down
1 change: 1 addition & 0 deletions include/misc.inc.php
Expand Up @@ -55,6 +55,7 @@
"_j_useradmin_site",
"_j_site_area",
"_correspondance_statut",
"_page",
);

# Liste des feuilles de style
Expand Down
73 changes: 73 additions & 0 deletions include/pages.class.php
@@ -0,0 +1,73 @@
<?php
/* pages.class.php
* Permet de lire et d'écrire les paramètres dans la BDD (Table setting)
* Dernière modification : $Date: 2018-02-10 18:00$
* @author JeromeB
* @copyright Copyright 2003-2018 Team DEVOME - JeromeB
* @link http://www.gnu.org/licenses/licenses.html
*
* This file is part of GRR.
*
* GRR 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.
*/

class Pages {

static $grrPages;

public function __construct()
{
return self::load();
}


static function load()
{
$test = grr_sql_query1("SELECT nom FROM ".TABLE_PREFIX."_page WHERE nom = 'CGU'");
if ($test != -1)
$sql = "SELECT `nom`, `valeur` FROM ".TABLE_PREFIX."_page";
else
$sql = "SELECT `nom`, `valeur` FROM page";
$res = grr_sql_query($sql);
if (!$res)
return false;
if (grr_sql_count($res) == 0)
return false;
else
{
for ($i = 0; ($row = grr_sql_row($res, $i)); $i++)
self::$grrPages[$row[0]] = $row[1];
return true;
}
}

static function get($_name)
{
if (isset(self::$grrPages[$_name]))
return self::$grrPages[$_name];
}

static function set($_name, $_value)
{
if (isset(self::$grrPages[$_name]))
{
$sql = "UPDATE ".TABLE_PREFIX."_page set valeur = '" . protect_data_sql($_value) . "' where nom = '" . protect_data_sql($_name) . "'";
$res = grr_sql_query($sql);
if (!$res)
return false;
}
else
{
$sql = "INSERT INTO ".TABLE_PREFIX."_page set nom = '" . protect_data_sql($_name) . "', valeur = '" . protect_data_sql($_value) . "'";
$res = grr_sql_query($sql);
if (!$res)
return (false);
}
self::$grrPages[$_name] = $_value;
return true;
}
}
?>
9 changes: 7 additions & 2 deletions language/lang.de
Expand Up @@ -54,6 +54,7 @@ $vocab['admin_calendar_title.php'] = "Reservierung/Löschung in Blöcken";
$vocab['admin_calend_ignore.php'] = "Zeitplan ausser Reservierung";
$vocab['admin_calend_jour_cycle.php'] = "Calendrier des \"jours cycle\""; // A traduire
$vocab['admin_clean_accounts_desc'] = "L'action ci-dessous permet de <b>nettoyer</b> toutes les tables de liaison des comptes utilisateurs. Il s'agit d'une opération de maintenance, normalement inutile et sans conséquence sur le fonctionnement de GRR. <b>Par précaution, faites une sauvegarde de la base de données au préalable</b>"; // A traduire
$vocab['admin_cgu.php'] = "CGU"; // A traduire
$vocab['admin_config.php'] = "Allgemeine Konfiguration";
$vocab['admin_config1.php'] = "Inhalt / Aussehen";
$vocab['admin_config2.php'] = "Zugriff und Rechte";
Expand Down Expand Up @@ -196,6 +197,9 @@ $vocab['capacity_2'] = "Kapazität: ";
$vocab['CAS_SSO_explain'] = "Falls Sie ein <b>CAS</b> (Central Authentication Service) System benutzen, können Sie seine Berücksichtigung durch GRR hier unten einstellen. Siehe Bedienungsanleitung für umfangreichere Informationen.";
$vocab['causes_possibles'] = "Mögliche Gründe:";
$vocab['Cette journee ne correspond pas a un jour cycle'] = "Cette journée ne correspond pas à un jour cycle"; // A traduire
$vocab['cgu'] = "CGU"; // A traduire
$vocab['cgu_titre'] = "CGU : Condition Générale d'Utilisation"; // A traduire
$vocab['cgu_grr'] = "Vous pouvez modifier la page CGU. Vous êtes responsable du contenu.<br>Pour informations légales de GRR :<ul><li>Ni GRR, ni les developpeur sont responsables du contenu</li><li>GRR est un logiciel Open Source sous la licence GPL</li><li>Aucune donnée n'est récupéré de votre GRR par l'éditeur</li><li>Les mots de passe des utilisateurs sont cryptés</li><li>Les informations personnels des utilisateurs sont limités au nom, prénom et adresse email</li></ul>"; // A traduire
$vocab['champs_non_remplis'] = "Tous les champs n'ont pas été remplis."; // A traduire
$vocab['champ_confidentiel'] = "Champ confidentiel"; // A traduire
$vocab['champ_obligatoire'] = "obligatorisches Feld";
Expand Down Expand Up @@ -295,7 +299,7 @@ $vocab['del_entry_in_conflict'] = "Löschen Sie obige Reservierung(en) damit die
$vocab['del_user_succeed'] = "Ein Benutzer ist von der Liste gestrichen worden.";
$vocab['description'] = "Beschreibung:";
$vocab['description complete'] = "Komplette Beschreibung (auf dem Steckbrief sichtbar)";
$vocab['description complete2'] = " - Sie können HTML-Tags benutzen";
$vocab['description complete2'] = " Sie können HTML-Tags benutzen";
$vocab['deux_points'] = ": ";
$vocab['disable_login_off'] = "Die Verbindungen aktivieren";
$vocab['disable_login_on'] = "Die Verbindungen deaktivieren";
Expand Down Expand Up @@ -527,6 +531,7 @@ $vocab['match_entry'] = ""; // A traduire
$vocab['match_login'] = "Autor (Benutzername)";
$vocab['match_room'] = ""; // A traduire
$vocab['max_booking'] = "Maximale Reservierungsanzahl pro Benutzer (-1 wenn es keine Beschräkung gibt)";
$vocab['mentions_legal_connexion'] = "En vous connectant vous acceptez les CGU et la création d'un cookie pour l'identification."; // A traduire
$vocab['mess2_maj_base_locale'] = "Folgende Benutzer wurden aus GRR Datenbank gelöscht, als sie sich nicht mehr in der LCS Datenbank befinden.";
$vocab['mess3_maj_base_locale'] = "Es gibt keinen Benutzer in GRR Datenbank zu löschen.";
$vocab['message perso'] = "Message personnalisé"; // A traduire
Expand Down Expand Up @@ -562,7 +567,7 @@ $vocab['motif'] = "Grund";
$vocab['mrbs'] = "GRR (Gestion et Réservation de Ressources - Ressourcesverwaltung und Reservierung)";
$vocab['msg_del_bookings'] = "Achtung, die Änderungen der von Ihnen vorgenommenen Anfangs- und Enddaten der Reservierungen ziehen die endgültige Streichung der bereits vorgenommenen Reservierungen nach sich, die sich au&#x00DF;erhalb der neuen zulässigen Daten befinden!<br /><br />Wollen Sie wirklich fortfahren?";
$vocab['msg_explain_log'] = "Die in rot erscheinenden Daten markieren die nach einer zu langen Zeit der Inaktivität ausgeloggten Benutzer.<br />Die grün erscheinenden Zeilen markieren die zur Zeit verbundenen Benutzer.";
$vocab['msg_login1'] = "<b>GRR</b> ist eine PHP/MySql-Anwendung unter GPL Lizenz, die aus <a href='http://mrbs.sourceforge.net'>MRBS</a> adaptiert wurde.<br />Für alle Nachfragen bezüglich <b>GRR</b>, gehen Sie bitte auf die Webseite: ";
$vocab['msg_login1'] = "<b>GRR</b> ist unter GPL Lizenz, die aus <a href='http://mrbs.sourceforge.net'>MRBS</a> adaptiert wurde.<br />Für alle Nachfragen bezüglich <b>GRR</b>, gehen Sie bitte auf die Webseite: ";
$vocab['msg_login3'] = "Die Webseite ist im Moment nicht erreichbar. Bitte entschuldigen Sie die Störung!";
$vocab['msg_login_created'] = "Sie haben gerade einen neuen Benutzer erstellt. Bis auf weiteres gilt dieser Benutzer als aktiv.";
$vocab['msg_login_created_error'] = "Beim Erstellen eines neuen Benutzers ist ein Problem aufgetaucht! Wenden Sie sich bitte an den technischen Träger.";
Expand Down
11 changes: 8 additions & 3 deletions language/lang.en
Expand Up @@ -52,6 +52,7 @@ $vocab['admin_calendar_title.php'] = "Outright Reservation/Suppression ";
$vocab['admin_calend_ignore.php'] = "Calendar except reservation";
$vocab['admin_calend_jour_cycle.php'] = "Calendar of \"cycles days\"";
$vocab['admin_clean_accounts_desc'] = "L'action ci-dessous permet de <b>nettoyer</b> toutes les tables de liaison des comptes utilisateurs. Il s'agit d'une opération de maintenance, normalement inutile et sans conséquence sur le fonctionnement de GRR. <b>Par précaution, faites une sauvegarde de la base de données au préalable</b>"; // A traduire
$vocab['admin_cgu.php'] = "CGU"; // A traduire
$vocab['admin_config.php'] = "General configuration";
$vocab['admin_config1.php'] = "Contents / Appearance";
$vocab['admin_config2.php'] = "Access and rights";
Expand Down Expand Up @@ -194,6 +195,9 @@ $vocab['capacity_2'] = "Capacity: ";
$vocab['CAS_SSO_explain'] = "If you have a <b>CAS</b> environment (Central Authentification Service), you can activate the consideration of this service with <b>GRR</b> below. Consult the GRR instructions to know more.";
$vocab['causes_possibles'] = "Possibles causes:";
$vocab['Cette journee ne correspond pas a un jour cycle'] = "This day doesn't correspond to a cycle day";
$vocab['cgu'] = "CGU"; // A traduire
$vocab['cgu_titre'] = "CGU : Condition Générale d'Utilisation"; // A traduire
$vocab['cgu_grr'] = "Vous pouvez modifier la page CGU. Vous êtes responsable du contenu.<br>Pour informations légales de GRR :<ul><li>Ni GRR, ni les developpeur sont responsables du contenu</li><li>GRR est un logiciel Open Source sous la licence GPL</li><li>Aucune donnée n'est récupéré de votre GRR par l'éditeur</li><li>Les mots de passe des utilisateurs sont cryptés</li><li>Les informations personnels des utilisateurs sont limités au nom, prénom et adresse email</li></ul>"; // A traduire
$vocab['champs_non_remplis'] = "All required fields have not been filled.";
$vocab['champ_confidentiel'] = "Confidential area";
$vocab['champ_obligatoire'] = "Compulsory filling";
Expand Down Expand Up @@ -294,7 +298,7 @@ $vocab['del_entry_in_conflict'] = "Delete the reservation(s) above in order to c
$vocab['del_user_succeed'] = "A user has been deleted from the list.";
$vocab['description'] = "Description:";
$vocab['description complete'] = "Full description (visible in the presentation card)";
$vocab['description complete2'] = " - You can use HTML markers";
$vocab['description complete2'] = " You can use HTML markers";
$vocab['deux_points'] = ": ";
$vocab['disable_login_off'] = "Activate connections";
$vocab['disable_login_on'] = "Disable connections";
Expand Down Expand Up @@ -533,6 +537,7 @@ $vocab['match_entry'] = ""; // A traduire
$vocab['match_login'] = "Creator (login)";
$vocab['match_room'] = ""; // A traduire
$vocab['max_booking'] = "Max.number of reservations authorized for each user (-1 if no restriction)";
$vocab['mentions_legal_connexion'] = "En vous connectant vous acceptez les CGU et la création d'un cookie pour l'identification."; // A traduire
$vocab['mess2_maj_base_locale'] = "The following users have been deleted of the local base because they weren't present anymore in the LCS base:";
$vocab['mess3_maj_base_locale'] = "There is no user to delete of the local base";
$vocab['message perso'] = " Personalized Message";
Expand Down Expand Up @@ -568,7 +573,7 @@ $vocab['motif'] = "Reason";
$vocab['mrbs'] = "GRR (Gestion et Reservation de Ressources - Management and Reservation of Resources) ";
$vocab['msg_del_bookings'] = "Caution, the changes in reservation start and end dates that you have made are going to trigger definite deleting of reservations already made outside the new authorized dates!<br /><br />Are you sure you want to go on?";
$vocab['msg_explain_log'] = "Dates displayed in red represent users automatically disconnected after a too long delay of inactivity.<br />Lines displayed in green represent users currently connected.";
$vocab['msg_login1'] = "<b>GRR</b> is a PHP/MySql application under GPL licence, adapted from <a href='http://mrbs.sourceforge.net'>MRBS</a>.<br />To obtain information about <b>GRR</b>, go to the site: ";
$vocab['msg_login1'] = "<b>GRR</b> is under GPL licence, adapted from <a href='http://mrbs.sourceforge.net'>MRBS</a>.<br />To obtain information about <b>GRR</b>, go to the site: ";
$vocab['msg_login3'] = "The site is momentarily inaccessible. We apologize for any inconvenience!";
$vocab['msg_login_created'] = "You have created a new user. By default,this user is considered active.";
$vocab['msg_login_created_error'] = "A problem has occurred when creating a new user! Please contact technical support!";
Expand Down Expand Up @@ -685,7 +690,7 @@ $vocab['remplissage_description_complete0'] = "Le remplissage de la rubrique \"d
$vocab['remplissage_description_complete1'] = "Le remplissage de la rubrique \"description complète\" est obligatoire"; // A traduire
$vocab['remplissage_description_complete_msg'] = "Remplissage de la rubrique \"description complète\" dans le formulaire réservation"; // A traduire
$vocab['repeat_id'] = "periodicity No. ";
$vocab['report'] = "Search - Report";
$vocab['report'] = "Search & Report";
$vocab['report_and_summary'] = "Reservations and summary";
$vocab['report_end'] = "Search end date:";
$vocab['report_only'] = "Reservations details";
Expand Down

0 comments on commit c202e29

Please sign in to comment.