Commit 307b9cc6 authored by mbriand's avatar mbriand

nan mais faut pas rester tout seul, ca se fait pas ! (+bonus reindent)

parent 1893297c
......@@ -29,7 +29,7 @@ require_once($topdir . "include/entities/cotisation.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("gestion_ae"))
$site->error_forbidden();
$site->error_forbidden("accueil");
if ( $_REQUEST["action"] == "pdf" )
{
......@@ -63,7 +63,7 @@ if ( $_REQUEST["action"] == "pdf" )
}
$site->start_page ("none", "Cartes AE");
$site->start_page ("accueil", "Cartes AE");
$cts = new contents("Cartes AE");
......
......@@ -31,9 +31,9 @@ require_once($topdir."include/cts/board.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("moderateur_site") )
$site->error_forbidden();
$site->error_forbidden("accueil");
$site->start_page("none","Tâches courantes Com` AE");
$site->start_page("accueil","Tâches courantes Com` AE");
$cts = new contents("Tâches courantes de la Com` AE");
......
......@@ -30,9 +30,9 @@ require_once($topdir."include/cts/board.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("compta_admin") )
$site->error_forbidden();
$site->error_forbidden("accueil");
$site->start_page("none","Tâches courantes des trésoriers AE");
$site->start_page("accueil","Tâches courantes des trésoriers AE");
$cts = new contents("Tâches courantes des trésoriers AE");
......
......@@ -40,7 +40,7 @@ require_once($topdir. "include/entities/partenariat_utl.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("gestion_ae") )
$site->error_forbidden();
$site->error_forbidden("services");
if (date("m-d") < "02-15")
{
......@@ -71,7 +71,7 @@ $partenariats = array(1=> "Ce cotisant vient d'ouvrir un compte à la Société
2=> "Ce cotisant est à la SMEREB",
);
$site->start_page ("none", "Gestion des cotisations");
$site->start_page ("services", "Gestion des cotisations");
function add_search_form()
{
......@@ -231,7 +231,7 @@ elseif ( $_REQUEST["action"] == "savecotiz" )
if ( $user->id < 0 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
else
......@@ -449,7 +449,7 @@ elseif ( $_REQUEST["action"] == "searchstudent" )
$user->load_by_id($res['id_utl']);
if ( $user->id < 0 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
......@@ -595,7 +595,7 @@ elseif ( $_REQUEST["action"] == "newcotiz" )
$user->load_by_id($_REQUEST['id_utilisateur']);
if ( $user->id < 0 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
......
......@@ -31,14 +31,14 @@ $site = new site();
$elec = new election($site->db,$site->dbrw);
if ( !$site->user->is_in_group("gestion_ae") )
$site->error_forbidden();
$site->error_forbidden("accueil");
if ( isset($_REQUEST["id_election"]))
{
$elec->load_by_id($_REQUEST["id_election"]);
if ( $elec->id < 1 )
{
$site->error_not_found();
$site->error_not_found("accueil");
exit();
}
}
......@@ -125,7 +125,7 @@ if ( $elec->id > 0 )
}
}
$site->start_page("none","Election");
$site->start_page("accueil","Election");
$cts = new contents($elec->nom);
......@@ -234,7 +234,7 @@ if ( $elec->id > 0 )
exit();
}
$site->start_page("none","Gestion des elections");
$site->start_page("accueil","Gestion des elections");
$frm = new form("newelec","elections.php",true,"POST","Organiser une élection");
$frm->add_hidden("action","newelec");
......
......@@ -30,9 +30,9 @@ require_once($topdir."include/cts/board.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("gestion_ae") )
$site->error_forbidden("none","group","gestion_ae");
$site->error_forbidden("accueil","group","gestion_ae");
$site->start_page("none","Tâches courantes AE");
$site->start_page("accueil","Tâches courantes AE");
$cts = new contents("Tâches courantes AE");
......
......@@ -34,9 +34,9 @@ require_once($topdir."include/entities/files.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden();
$site->error_forbidden("accueil");
$site->start_page ("none", "Modération des affiches");
$site->start_page ("services", "Modération des affiches");
/*suppression via la sqltable */
if ((isset($_REQUEST['id_affiche']))
......
......@@ -36,7 +36,7 @@ require_once($topdir."include/entities/folder.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("moderateur_site") )
$site->error_forbidden();
$site->error_forbidden("fichiers");
if ( $_REQUEST["action"] == "foldermodere")
......@@ -80,7 +80,7 @@ elseif ( $_REQUEST["action"] == "filedelete")
}
}
$site->start_page("none","Modération des fichiers");
$site->start_page("fichiers","Modération des fichiers");
$cts = new contents("Modération");
$req = new requete($site->db,"SELECT d_folder.* " .
......
......@@ -33,7 +33,7 @@ require_once($topdir. "include/cts/planning.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("gestion_ae") )
$site->error_forbidden();
$site->error_forbidden("accueil");
$emp = new emprunt ( $site->db, $site->dbrw );
$asso = new asso($site->db);
......
......@@ -35,9 +35,9 @@ require_once($topdir . "include/entities/lieu.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden();
$site->error_forbidden("accueil");
$site->start_page ("none", "Modération des nouvelles");
$site->start_page ("accueil", "Modération des nouvelles");
/*suppression via la sqltable */
if ((isset($_REQUEST['id_nouvelle']))
......
......@@ -36,7 +36,7 @@ require_once($topdir. "include/cts/planning.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("gestion_ae") && !$site->user->is_in_group("bdf-bureau") )
$site->error_forbidden();
$site->error_forbidden("services");
$sfilter='';
$filter='';
......@@ -124,7 +124,7 @@ elseif ( $_REQUEST["action"] == "info")
if (isset($_REQUEST["notes"]))
$resa->set_notes($_REQUEST["notes"]);
$site->start_page("none","Moderation des reservations de salle");
$site->start_page("services","Moderation des reservations de salle");
$cts = new contents("Reservation n°".$resa->id);
......@@ -174,7 +174,7 @@ elseif ( $_REQUEST["action"] == "info")
exit();
}
$site->start_page("none","Moderation des reservations de salle");
$site->start_page("services","Moderation des reservations de salle");
if($site->user->is_in_group("gestion_ae"))
......
......@@ -29,7 +29,7 @@ require_once($topdir . "include/entities/tag.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden("none","group",8);
$site->error_forbidden("accueil","group",8);
if ( $_REQUEST["action"] == "modere" )
{
......@@ -50,7 +50,7 @@ elseif ( $_REQUEST["action"] == "delete" )
}
}
$site->start_page ("none", "Modération des tags");
$site->start_page ("accueil", "Modération des tags");
$cts = new contents("Modération des tags");
......
......@@ -33,10 +33,10 @@ $partenaires=array(1=>"Société Générale", 2=>"SMEREB");
$site = new site ();
if ( !$site->user->is_in_group("gestion_ae") )
$site->error_forbidden("none","group","gestion_ae");
$site->error_forbidden("services","group","gestion_ae");
$site->add_js("js/sqltable2.js");
$site->start_page("utl_partenariats","Partenariats en attente");
$site->start_page("services","Partenariats en attente");
$partenariat = new Partenariat($site->db, $site->dbrw);
if ($_REQUEST['action'] == "add")
......
......@@ -31,7 +31,7 @@ require_once($topdir."include/entities/files.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("gestion_ae"))
$site->error_forbidden();
$site->error_forbidden("accueil");
if ($_REQUEST['action'] == "pdf")
{
......@@ -58,7 +58,7 @@ if ($_REQUEST['action'] == "pdf")
exit();
}
$site->start_page("none", "Génération d'un planning de la semaine");
$site->start_page("accueil", "Génération d'un planning de la semaine");
/* Deuxième formulaire : on choisit les évènements
*/
......
......@@ -37,10 +37,10 @@ require_once($topdir. "include/cts/sqltable.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden();
$site->error_forbidden("accueil");
/* else */
$site->start_page ("none", "Gestion du site");
$site->start_page ("accueil", "Gestion du site");
/* objets graphiques de base */
......
......@@ -28,9 +28,9 @@ require_once($topdir. "include/entities/sondage.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden();
$site->error_forbidden("accueil");
$site->start_page ("none", "Sondages");
$site->start_page ("accueil", "Sondages");
if (isset($_REQUEST["addsdn"]) && $_REQUEST["question"] && $_REQUEST["end_date"])
{
......
......@@ -27,7 +27,7 @@ require_once($topdir . "include/graph.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("gestion_ae"))
$site->error_forbidden();
$site->error_forbidden("accueil");
function dec2hex($val)
{
......@@ -114,7 +114,7 @@ if (isset($_REQUEST['start']))
}
$site->start_page ("none", "statistiques du site");
$site->start_page ("accueil", "statistiques du site");
$cts = new contents("Classement");
......
......@@ -40,7 +40,7 @@ require_once($topdir."include/entities/books.inc.php");
$site = new site ();
if ( !$site->user->is_in_group("gestion_syscarteae") )
$site->error_forbidden();
$site->error_forbidden("accueil");
if ( $_REQUEST["action"] == "genfact" )
{
......@@ -209,7 +209,7 @@ elseif ( $_REQUEST["action"] == "genonefact" )
exit();
}
$site->start_page("none","Système carte AE");
$site->start_page("services","Système carte AE");
$cts = new contents("Système carte AE");
......
......@@ -27,9 +27,9 @@ require_once($topdir. "include/site.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden();
$site->error_forbidden("accueil");
$site->start_page ("none", "Planning / Photo de la semaine");
$site->start_page ("accueil", "Planning / Photo de la semaine");
$cts = new contents("Attention");
$cts->add_paragraph("La validité d'une photo de la semaine, de même que celle du planning est de UNE ".
......
......@@ -31,8 +31,8 @@ require_once($topdir."include/entities/folder.inc.php");
$site = new site ();
if (!$site->user->is_in_group ("moderateur_site"))
$site->error_forbidden();
$site->start_page("none","Weekmail");
$site->error_forbidden("accueil");
$site->start_page("accueil","Weekmail");
$cts = new contents('<a href="./index.php">gestion ae</a> / <a href="?">Weekmail</a>');
$list = new itemlist("Outils");
$list->add("<a href=\"?page=modere\">Modérer</a>");
......
......@@ -45,7 +45,7 @@ if ( isset($_REQUEST["id_affiche"]) )
$affiche->load_by_id($_REQUEST["id_affiche"]);
if ( $affiche->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
......@@ -239,7 +239,7 @@ if ( !$site->user->is_valid() )
$file = new dfile($site->db, $site->dbrw);
$site->start_page ("none", "Accueil affiches");
$site->start_page ("services", "Accueil affiches");
$suitable = false;
......
......@@ -63,7 +63,7 @@ if ( $site->user->is_valid() && $site->user->is_in_group("moderateur_site") )
foreach ($site->tab_array as $entry)
$sections[$entry[0]] = $entry[2];
$site->start_page("none","Nouveau");
$site->start_page("accueil","Nouveau");
$frm = new form("newarticle","article.php",true,"POST","Nouvelle page");
if ( isset($Erreur) )
$frm->error($Erreur);
......@@ -107,7 +107,7 @@ if ( isset($_REQUEST["name"]) )
if ( !$page->is_valid() )
{
$site->start_page("none","Erreur");
$site->start_page("accueil","Erreur");
$err = new error("Page inconnue","Merci de vérifier le lien que vous avez emprunté");
......
......@@ -67,7 +67,7 @@ else if ( isset($_REQUEST["id_asso"]) )
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
......
......@@ -35,14 +35,14 @@ $asso = new asso($site->db,$site->dbrw);
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
if ( !$site->user->is_in_group("gestion_ae") && !$asso->is_member_role($site->user->id,ROLEASSO_MEMBREBUREAU) )
$site->error_forbidden();
$site->error_forbidden("presentation");
$site->start_page("campagne","Campagnes de recrutement");
$site->start_page("presentation","Campagnes de recrutement");
$cts = new contents($asso->get_html_path());
$cts->add(new tabshead($asso->get_tabs($site->user),"cpg"));
......@@ -320,7 +320,7 @@ elseif(!is_null($cpg->id) && $_REQUEST["action"]=="edit" && $cpg->asso==$_REQUES
$cpg->load_by_id($_REQUEST["id_campagne"]);
if( $cpg->id == NULL){
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
$cpg->update_campagne($_REQUEST["nom"],$_REQUEST["description"],$cpg->date,$_REQUEST["end_date"]);
......
......@@ -41,7 +41,7 @@ $asso = new asso($site->db,$site->dbrw);
if ( !isset($_REQUEST["id_asso"]) )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
......@@ -50,7 +50,7 @@ $asso_parent = new asso($site->db);
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
......
......@@ -37,12 +37,12 @@ if ( isset($_REQUEST["id_asso"]) )
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
if ( !$site->user->is_in_group("gestion_ae") && !$asso->is_member_role($site->user->id,ROLEASSO_MEMBREBUREAU) )
$site->error_forbidden();
$site->error_forbidden("presentation");
$site->start_page("presentation",$asso->nom);
......
......@@ -30,11 +30,11 @@ $asso = new asso($site->db,$site->dbrw);
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
if ( !$site->user->is_in_group("gestion_ae") && !$asso->is_member_role($site->user->id,ROLEASSO_MEMBREBUREAU) )
$site->error_forbidden();
$site->error_forbidden("presentation");
$site->start_page("presentation",$asso->nom);
......
......@@ -81,7 +81,7 @@ $asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
......
......@@ -30,7 +30,7 @@ $asso = new asso($site->db,$site->dbrw);
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
......@@ -53,7 +53,7 @@ while ( $asso_parent->id > 0 )
}
/*if( !$site->user->ae && !$can_admin )
$site->error_forbidden("none","reserveAE");*/
$site->error_forbidden("presentation","reserveAE");*/
if ( $_REQUEST["action"]=="getallvcards" && !$limited )
{
......
......@@ -34,7 +34,7 @@ $user = new utilisateur($site->db);
if (!$asso->is_valid())
{
$site->error_not_found();
$site->error_not_found("presentation");
exit();
}
......
......@@ -31,11 +31,11 @@ $asso = new asso($site->db,$site->dbrw);
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
if ( !$site->user->is_in_group("gestion_ae") && !$asso->is_member_role($site->user->id,ROLEASSO_MEMBREBUREAU) )
$site->error_forbidden();
$site->error_forbidden("presentation");
$site->start_page("presentation",$asso->nom);
......
......@@ -39,17 +39,17 @@ $asso = new asso($site->db,$site->dbrw);
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
if ((!$site->user->is_in_group("gestion_ae"))
&& (!$asso->is_member_role($site->user->id,ROLEASSO_PRESIDENT)))
{
$site->error_forbidden();
$site->error_forbidden("presentation");
}
$site->start_page("Presentation", $asso->nom);
$site->start_page("presentation", $asso->nom);
if (isset($_POST['sendfaxsbmt']))
{
......
......@@ -39,12 +39,12 @@ $site->allow_only_logged_users("presentation");
$asso->load_by_id($_REQUEST["id_asso"]);
if ( $asso->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
if ( !$site->user->is_in_group("gestion_ae") && !$asso->is_member_role($site->user->id,ROLEASSO_MEMBREBUREAU) )
$site->error_forbidden();
$site->error_forbidden("presentation");
if (isset($_REQUEST['action']) && $_REQUEST['action']=="pdf")
{
......
......@@ -28,8 +28,8 @@ require_once($topdir . "include/entities/weekmail.inc.php");
require_once($topdir . "include/entities/asso.inc.php");
$site = new site();
$site->allow_only_logged_users('asso');
$site->start_page("weekmail",'Weekmail');
$site->allow_only_logged_users('services');
$site->start_page("services",'Weekmail');
// On récupère les asso dont le gus est au moins secrétaire
$req = new requete($site->db,
'SELECT `nom_asso`, `id_asso` '.
......
......@@ -35,7 +35,7 @@ $bat = new batiment($site->db,$site->dbrw);
$bat->load_by_id($_REQUEST["id_batiment"]);
if ( $bat->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
$sitebat->load_by_id($bat->id_site);
......@@ -50,7 +50,7 @@ if ( $_REQUEST["action"] == "addsalle" )
}
}
$site->start_page("none","Batiment ".$bat->nom);
$site->start_page("services","Batiment ".$bat->nom);
$cts = new contents($sitebat->get_html_link()." / ".$bat->get_html_link());
$cts->add_paragraph("Site : ".$sitebat->get_html_link());
$cts->add_paragraph("Voir aussi : <a href=\"sitebat.php\">Autre sites</a>");
......
......@@ -30,7 +30,7 @@ require_once($topdir. "include/cts/sqltable.inc.php");
$site = new site ();
if ( !$site->user->is_valid() )
$site->error_forbidden();
$site->error_forbidden("accueil");
$cpg = new campagne($site->db,$site->dbrw);
......
......@@ -27,10 +27,10 @@ require_once("include/comptes.inc.php");
$site = new sitecompta();
$site->allow_only_logged_users("none");
$site->allow_only_logged_users("services");
if ( !$site->user->is_in_group("compta_admin") )
$site->error_forbidden();
$site->error_forbidden("services");
if ($_REQUEST['action'] == "addcptasso")
......@@ -49,7 +49,7 @@ if ($_REQUEST['action'] == "addcptasso")
$site->start_page ("none",
$site->start_page ("accueil",
"Administration de la compta");
......
......@@ -26,7 +26,7 @@ require_once($topdir . "include/entities/asso.inc.php");
require_once($topdir . "include/cts/sqltable.inc.php");
$site = new sitecompta();
$site->allow_only_logged_users("none");
$site->allow_only_logged_users("services");
$budget = new budget($site->db,$site->dbrw);
$cla = new classeur_compta($site->db);
......@@ -37,7 +37,7 @@ $asso = new asso($site->db);
$budget->load_by_id($_REQUEST["id_budget"]);
if ( $budget->id < 1 )
{
$site->error_not_found();
$site->error_not_found("services");
exit();
}
$cla->load_by_id($budget->id_classeur);
......@@ -46,7 +46,7 @@ $cpbc->load_by_id($cptasso->id_cptbc);
$asso->load_by_id($cptasso->id_asso);
if ( !$site->user->is_in_group("compta_admin") && !$asso->is_member_role($site->user->id,ROLEASSO_TRESORIER) )
$site->error_forbidden();
$site->error_forbidden("services");
$site->set_current($asso->id,$asso->nom,$cla->id,$cla->nom,$cpbc->nom);
......@@ -97,7 +97,7 @@ elseif ( $_REQUEST["action"] == "edit" && !$budget->valide )
exit();
}
$site->start_page ("none", "Budget ".$budget->nom." dans classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")" );
$site->start_page ("services", "Budget ".$budget->nom." dans classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")" );
//$cts = new contents("Budget ".$budget->nom." dans classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")");
$cts = new contents("<a href=\"./\">Compta</a> / ".$cpbc->get_html_link()." / ".$cptasso->get_html_link()." / ".$cla->get_html_link()." / ".$budget->get_html_link());
......@@ -118,7 +118,7 @@ elseif ( $_REQUEST["action"] == "edit" && !$budget->valide )
exit();
}
$site->start_page ("none", "Budget ".$budget->nom." dans classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")" );
$site->start_page ("services", "Budget ".$budget->nom." dans classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")" );
$cts = new contents("<a href=\"./\">Compta</a> / ".$cpbc->get_html_link()." / ".$cptasso->get_html_link()." / ".$cla->get_html_link()." / ".$budget->get_html_link());
$cts->set_help_page("compta-budget");
......
......@@ -29,7 +29,7 @@ require_once($topdir . "include/cts/sqltable.inc.php");
$site = new sitecompta();
$site->allow_only_logged_users("none");
$site->allow_only_logged_users("services");
$op = new operation($site->db,$site->dbrw);
......@@ -67,7 +67,7 @@ $cpbc->load_by_id($cptasso->id_cptbc);
$asso->load_by_id($cptasso->id_asso);
if ( !$site->user->is_in_group("compta_admin") && !$asso->is_member_role($site->user->id,ROLEASSO_TRESORIER) )
$site->error_forbidden();
$site->error_forbidden("services");
$site->set_current($asso->id,$asso->nom,$cla->id,$cla->nom,$cpbc->nom);
......@@ -155,7 +155,7 @@ if ( $_REQUEST["action"] == "newop" && $GLOBALS["svalid_call"] )
$type_mouvement = $opstd->type_mouvement;
/* CODE DUPLIQUE PLUS LOIN */
$site->start_page ("none", "Classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")" );
$site->start_page ("services", "Classeur ".$cla->nom." ( ".$asso->nom ." - ". $cpbc->nom.")" );
$frm = new form("newopjum","classeur.php?id_classeur=".$cla->id,true,"POST","Opération jumelée");
$frm->add_hidden("action","newoplinked");
......@@ -274,7 +274,7 @@ else if ( $_REQUEST["action"] == "newoplinked" && ($op->is_valid()) && $GLOBALS[
$type_mouvement = $opstd->type_mouvement;