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,215 +31,215 @@ $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();
exit();
}
$elec->load_by_id($_REQUEST["id_election"]);
if ( $elec->id < 1 )
{
$site->error_not_found("accueil");
exit();
}
}
if ( $_REQUEST["action"] == "newelec" )
{
if ( !$_REQUEST["name"] )
$ErrorElec="Pécisez un nom";
elseif ( $_REQUEST["fin"] <= $_REQUEST["debut"] )
$ErrorElec="Dates et heures invalides";
else
$elec->new_election($_REQUEST["groupid"],$_REQUEST["debut"],$_REQUEST["fin"],$_REQUEST["name"]);
if ( !$_REQUEST["name"] )
$ErrorElec="Pécisez un nom";
elseif ( $_REQUEST["fin"] <= $_REQUEST["debut"] )
$ErrorElec="Dates et heures invalides";
else
$elec->new_election($_REQUEST["groupid"],$_REQUEST["debut"],$_REQUEST["fin"],$_REQUEST["name"]);
}
if ( $elec->id > 0 )
{
if ( $_REQUEST["action"] == "addposte" )
{
if ( !$_REQUEST["name"] )
$ErrorPoste = "Nom manquant";
else
$elec->add_poste( $_REQUEST["name"], $_REQUEST["description"]);
}
elseif ( $_REQUEST["action"] == "addliste" )
{
$user = new utilisateur($site->db);
$user->load_by_id($_REQUEST["id_utilisateur_head"]);
if ( !$user->is_valid() && !$user->ae)
$ErrorListe = "Tête de liste erronée ou non cotisante";
elseif ( !$_REQUEST["nom"])
$ErrorListe = "Précisez un nom";
else
{
$rq = $elec->add_liste($user->id,$_REQUEST["nom"]);
$id_liste = $rq->get_id();
$sql = new requete($site->db,"SELECT id_poste FROM vt_postes WHERE id_election='".$elec->id."'");
while ( list($id_poste) = $sql->get_row() )
{
if ( $_REQUEST["id_utilisateur_poste".$id_poste] )
{
$user->load_by_id($_REQUEST["id_utilisateur_poste".$id_poste]);
if ( $user->is_valid() & $user->ae)
$elec->add_candidat($user->id, $id_poste, $id_liste);
}
}
}
}
elseif ( $_REQUEST["action"] == "addcandidat" )
{
$user = new utilisateur($site->db);
$user->load_by_id($_REQUEST["id_utilisateur"]);
if ( $user->is_valid() && $user->ae)
{
$id_poste=$_REQUEST["id_poste"];
$id_liste=null;
if ( $_REQUEST["id_liste"] > 0 )
$id_liste=$_REQUEST["id_liste"];
$elec->add_candidat($user->id, $id_poste, $id_liste);
}
else
$ErrorCandidat = "Utilisateur iconnu ou non cotisant";
}
elseif ( $_REQUEST["action"] == "delete" )
{
if ( isset($_REQUEST["id_liste"]) )
$elec->remove_liste($_REQUEST["id_liste"]);
elseif ( isset($_REQUEST["id_poste"]))
$elec->remove_poste($_REQUEST["id_poste"]);
else
{
list($id_poste,$id_utilisateur) = explode(",",$_REQUEST["id_candidature"]);
$elec->remove_candidat($id_utilisateur,$id_poste);
}
}
$site->start_page("none","Election");
$cts = new contents($elec->nom);
$cts->add_paragraph("Election du ".date("d/m/Y H:s",$elec->debut)." au ".date("d/m/Y H:s",$elec->fin));
$cts->add_paragraph("<a href=\"../elections.php?id_election=".$elec->id."&page=results\">Resultats</a>");
$sql = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
while ( $row = $sql->get_row() )
$postes[$row["id_poste"]] = $row["nom_poste"];
$listes[0] = "Independant";
$sql = new requete($site->db,"SELECT * FROM vt_liste_candidat WHERE id_election='".$elec->id."'");
while ( $row = $sql->get_row() )
$listes[$row["id_liste"]] = $row["nom_liste"];
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`) as `nom_utilisateur`," .
"CONCAT(`vt_candidat`.`id_poste`,',',`utilisateurs`.`id_utilisateur`) as `id_candidature`, " .
"`vt_postes`.`nom_poste`, " .
"`vt_liste_candidat`.`nom_liste` " .
"FROM `vt_candidat` " .
"INNER JOIN `utilisateurs` ON `utilisateurs`.`id_utilisateur`=`vt_candidat`.`id_utilisateur` " .
"INNER JOIN `vt_postes` ON `vt_postes`.`id_poste`=`vt_candidat`.`id_poste` " .
"LEFT JOIN `vt_liste_candidat` ON `vt_liste_candidat`.`id_liste`=`vt_candidat`.`id_liste` " .
"WHERE `vt_postes`.`id_election`='".$elec->id."' " .
"ORDER BY `vt_candidat`.`id_poste`,`vt_liste_candidat`.`nom_liste`");
$tbl = new sqltable("lstcand","Candidats",$req,"elections.php?id_election=".$elec->id,"id_candidature",
array("nom_utilisateur"=>"Candidat","nom_poste"=>"Poste","nom_liste"=>"Liste"),
array("delete"=>"Supprimer"),array(),
array());
$cts->add($tbl,true);
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`) as `nom_utilisateur`," .
"`vt_liste_candidat`.`id_liste`, " .
"`vt_liste_candidat`.`nom_liste` " .
"FROM `vt_liste_candidat` " .
"INNER JOIN `utilisateurs` ON `utilisateurs`.`id_utilisateur`=`vt_liste_candidat`.`id_utilisateur` " .
"WHERE `vt_liste_candidat`.`id_election`='".$elec->id."' " .
"ORDER BY `vt_liste_candidat`.`nom_liste`");
$tbl = new sqltable("lstlst","Listes",$req,"elections.php?id_election=".$elec->id,"id_liste",
array("nom_liste"=>"Nom","nom_utilisateur"=>"Tête de liste"),
array("delete"=>"Supprimer"),array(),
array());
$cts->add($tbl,true);
$req = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
$tbl = new sqltable("lstpst","Postes",$req,"elections.php?id_election=".$elec->id,"id_poste",
array("nom_poste"=>"Nom du poste","description_poste"=>"Description"),
array("delete"=>"Supprimer"),array(),
array());
$cts->add($tbl,true);
$frm = new form("addposte","elections.php?id_election=".$elec->id,$ErrorPoste!="","POST","Ajouter un poste");
$frm->add_hidden("action","addposte");
if ( $ErrorPoste )
$frm->error($ErrorPoste);
$frm->add_text_field("name","Nom","",true);
$frm->add_text_area("description","Description");
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
$frm = new form("addliste","elections.php?id_election=".$elec->id,$ErrorListe!="","POST","Ajouter une liste");
$frm->add_hidden("action","addliste");
if ( $ErrorListe )
$frm->error($ErrorListe);
$frm->add_text_field("nom","Nom de la liste");
$frm->add_entity_smartselect("id_utilisateur_head","Tête de liste",new utilisateur($site->db));
if( count($postes) )
{
foreach ($postes as $id => $nom )
$frm->add_entity_smartselect("id_utilisateur_poste".$id,"Candidat $nom",new utilisateur($site->db));
}
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
if ( count($postes) )
{
$frm = new form("addcandidat","elections.php?id_election=".$elec->id,$ErrorCandidat!="","POST","Ajouter un candidat");
$frm->add_hidden("action","addcandidat");
if ( $ErrorCandidat )
$frm->error($ErrorCandidat);
$frm->add_entity_smartselect("id_utilisateur",
"Candidat",
new utilisateur($site->db));
$frm->add_select_field("id_poste","Poste",$postes);
$frm->add_select_field("id_liste","Liste",$listes);
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
}
$site->add_contents($cts);
$site->end_page();
exit();
if ( $_REQUEST["action"] == "addposte" )
{
if ( !$_REQUEST["name"] )
$ErrorPoste = "Nom manquant";
else
$elec->add_poste( $_REQUEST["name"], $_REQUEST["description"]);
}
elseif ( $_REQUEST["action"] == "addliste" )
{
$user = new utilisateur($site->db);
$user->load_by_id($_REQUEST["id_utilisateur_head"]);
if ( !$user->is_valid() && !$user->ae)
$ErrorListe = "Tête de liste erronée ou non cotisante";
elseif ( !$_REQUEST["nom"])
$ErrorListe = "Précisez un nom";
else
{
$rq = $elec->add_liste($user->id,$_REQUEST["nom"]);
$id_liste = $rq->get_id();
$sql = new requete($site->db,"SELECT id_poste FROM vt_postes WHERE id_election='".$elec->id."'");
while ( list($id_poste) = $sql->get_row() )
{
if ( $_REQUEST["id_utilisateur_poste".$id_poste] )
{
$user->load_by_id($_REQUEST["id_utilisateur_poste".$id_poste]);
if ( $user->is_valid() & $user->ae)
$elec->add_candidat($user->id, $id_poste, $id_liste);
}
}
}
}
elseif ( $_REQUEST["action"] == "addcandidat" )
{
$user = new utilisateur($site->db);
$user->load_by_id($_REQUEST["id_utilisateur"]);
if ( $user->is_valid() && $user->ae)
{
$id_poste=$_REQUEST["id_poste"];
$id_liste=null;
if ( $_REQUEST["id_liste"] > 0 )
$id_liste=$_REQUEST["id_liste"];
$elec->add_candidat($user->id, $id_poste, $id_liste);
}
else
$ErrorCandidat = "Utilisateur iconnu ou non cotisant";
}
elseif ( $_REQUEST["action"] == "delete" )
{
if ( isset($_REQUEST["id_liste"]) )
$elec->remove_liste($_REQUEST["id_liste"]);
elseif ( isset($_REQUEST["id_poste"]))
$elec->remove_poste($_REQUEST["id_poste"]);
else
{
list($id_poste,$id_utilisateur) = explode(",",$_REQUEST["id_candidature"]);
$elec->remove_candidat($id_utilisateur,$id_poste);
}
}
$site->start_page("accueil","Election");
$cts = new contents($elec->nom);
$cts->add_paragraph("Election du ".date("d/m/Y H:s",$elec->debut)." au ".date("d/m/Y H:s",$elec->fin));
$cts->add_paragraph("<a href=\"../elections.php?id_election=".$elec->id."&page=results\">Resultats</a>");
$sql = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
while ( $row = $sql->get_row() )
$postes[$row["id_poste"]] = $row["nom_poste"];
$listes[0] = "Independant";
$sql = new requete($site->db,"SELECT * FROM vt_liste_candidat WHERE id_election='".$elec->id."'");
while ( $row = $sql->get_row() )
$listes[$row["id_liste"]] = $row["nom_liste"];
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`) as `nom_utilisateur`," .
"CONCAT(`vt_candidat`.`id_poste`,',',`utilisateurs`.`id_utilisateur`) as `id_candidature`, " .
"`vt_postes`.`nom_poste`, " .
"`vt_liste_candidat`.`nom_liste` " .
"FROM `vt_candidat` " .
"INNER JOIN `utilisateurs` ON `utilisateurs`.`id_utilisateur`=`vt_candidat`.`id_utilisateur` " .
"INNER JOIN `vt_postes` ON `vt_postes`.`id_poste`=`vt_candidat`.`id_poste` " .
"LEFT JOIN `vt_liste_candidat` ON `vt_liste_candidat`.`id_liste`=`vt_candidat`.`id_liste` " .
"WHERE `vt_postes`.`id_election`='".$elec->id."' " .
"ORDER BY `vt_candidat`.`id_poste`,`vt_liste_candidat`.`nom_liste`");
$tbl = new sqltable("lstcand","Candidats",$req,"elections.php?id_election=".$elec->id,"id_candidature",
array("nom_utilisateur"=>"Candidat","nom_poste"=>"Poste","nom_liste"=>"Liste"),
array("delete"=>"Supprimer"),array(),
array());
$cts->add($tbl,true);
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`) as `nom_utilisateur`," .
"`vt_liste_candidat`.`id_liste`, " .
"`vt_liste_candidat`.`nom_liste` " .
"FROM `vt_liste_candidat` " .
"INNER JOIN `utilisateurs` ON `utilisateurs`.`id_utilisateur`=`vt_liste_candidat`.`id_utilisateur` " .
"WHERE `vt_liste_candidat`.`id_election`='".$elec->id."' " .
"ORDER BY `vt_liste_candidat`.`nom_liste`");
$tbl = new sqltable("lstlst","Listes",$req,"elections.php?id_election=".$elec->id,"id_liste",
array("nom_liste"=>"Nom","nom_utilisateur"=>"Tête de liste"),
array("delete"=>"Supprimer"),array(),
array());
$cts->add($tbl,true);
$req = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
$tbl = new sqltable("lstpst","Postes",$req,"elections.php?id_election=".$elec->id,"id_poste",
array("nom_poste"=>"Nom du poste","description_poste"=>"Description"),
array("delete"=>"Supprimer"),array(),
array());
$cts->add($tbl,true);
$frm = new form("addposte","elections.php?id_election=".$elec->id,$ErrorPoste!="","POST","Ajouter un poste");
$frm->add_hidden("action","addposte");
if ( $ErrorPoste )
$frm->error($ErrorPoste);
$frm->add_text_field("name","Nom","",true);
$frm->add_text_area("description","Description");
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
$frm = new form("addliste","elections.php?id_election=".$elec->id,$ErrorListe!="","POST","Ajouter une liste");
$frm->add_hidden("action","addliste");
if ( $ErrorListe )
$frm->error($ErrorListe);
$frm->add_text_field("nom","Nom de la liste");
$frm->add_entity_smartselect("id_utilisateur_head","Tête de liste",new utilisateur($site->db));
if( count($postes) )
{
foreach ($postes as $id => $nom )
$frm->add_entity_smartselect("id_utilisateur_poste".$id,"Candidat $nom",new utilisateur($site->db));
}
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
if ( count($postes) )
{
$frm = new form("addcandidat","elections.php?id_election=".$elec->id,$ErrorCandidat!="","POST","Ajouter un candidat");
$frm->add_hidden("action","addcandidat");
if ( $ErrorCandidat )
$frm->error($ErrorCandidat);
$frm->add_entity_smartselect("id_utilisateur",
"Candidat",
new utilisateur($site->db));
$frm->add_select_field("id_poste","Poste",$postes);
$frm->add_select_field("id_liste","Liste",$listes);
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
}
$site->add_contents($cts);
$site->end_page();
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");
if ( $ErrorElec )
$frm->error($ErrorElec);
$frm->error($ErrorElec);
$frm->add_text_field("name","Nom","",true);
$frm->add_datetime_field("debut","Date et heure de début",-1,true);
$frm->add_datetime_field("fin","Date et heure de fin",-1,true);
......@@ -250,9 +250,9 @@ $site->add_contents($frm);
$sql = new requete($site->db,"SELECT * FROM vt_election");
$tbl = new sqltable("lstelecs","Elections",$sql,"elections.php","id_election",
array("nom_elec"=>"Nom","date_debut"=>"De","date_fin"=>"A","id_groupe"=>"Groupe electeurs"),
array("admin"=>"Administrer"),array(),
array("id_groupe"=>$GLOBALS["groupscache"]));
array("nom_elec"=>"Nom","date_debut"=>"De","date_fin"=>"A","id_groupe"=>"Groupe electeurs"),
array("admin"=>"Administrer"),array(),
array("id_groupe"=>$GLOBALS["groupscache"]));
$site->add_contents($tbl);
......
......@@ -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']))
......@@ -49,7 +49,7 @@ if ((isset($_REQUEST['id_nouvelle']))
$news->delete ();
$site->add_contents (new contents("Suppression",
"<p>Suppression eff&eacute;ctu&eacute;e avec succ&egrave;s</p>"));
"<p>Suppression eff&eacute;ctu&eacute;e avec succ&egrave;s</p>"));
}
/* moderation */
......@@ -66,7 +66,7 @@ if ((isset($_REQUEST['id_nws']))
$news->load_by_id ($id);
$news->delete ();
$site->add_contents (new contents("Suppression",
"<p>Suppression eff&eacute;ctu&eacute;e avec succ&egrave;s</p>"));
"<p>Suppression eff&eacute;ctu&eacute;e avec succ&egrave;s</p>"));
}
/* accepte en moderation */
if (isset($_REQUEST['accept']))
......@@ -77,25 +77,25 @@ if ((isset($_REQUEST['id_nws']))
$news->load_by_id($id);
$news->save_news(
$_REQUEST['id_asso'],
$_REQUEST['nws_title'],
$_REQUEST['nws_sum'],
$_REQUEST['nws_cts'],
true,$site->user->id,$_REQUEST['type'],$lieu->id,$news->id_canal);
$site->add_contents (new contents("Mod&eacute;ration",
"<p>Mod&eacute;ration eff&eacute;ctu&eacute;e avec succ&egrave;s</p>"));
if ( isset($_REQUEST["dfile"]))
{
$fl = new dfile($site->db,$site->dbrw);
foreach($_REQUEST["dfile"]as $id=>$chk)
{
$fl->load_by_id($id);
$fl->set_modere();
}
}
$_REQUEST['id_asso'],
$_REQUEST['nws_title'],
$_REQUEST['nws_sum'],
$_REQUEST['nws_cts'],
true,$site->user->id,$_REQUEST['type'],$lieu->id,$news->id_canal);
$site->add_contents (new contents("Mod&eacute;ration",
"<p>Mod&eacute;ration eff&eacute;ctu&eacute;e avec succ&egrave;s</p>"));
if ( isset($_REQUEST["dfile"]))
{
$fl = new dfile($site->db,$site->dbrw);
foreach($_REQUEST["dfile"]as $id=>$chk)
{
$fl->load_by_id($id);
$fl->set_modere();
}
}
}
}
......@@ -111,25 +111,25 @@ if (isset($_REQUEST['id_nouvelle']) &&
$news->load_by_id ($_REQUEST['id_nouvelle']);
$site->add_contents(new contents ("Aper&ccedil;u de la nouvelle :",
"<p>Dans le cadre ci-dessous, vous allez avoir un ".
"aper&ccedil;u de la nouvelle</p>"));
"<p>Dans le cadre ci-dessous, vous allez avoir un ".
"aper&ccedil;u de la nouvelle</p>"));
$site->add_contents ($news->get_contents ());
/* on affiche un formulaire d'edition */
$form = new form ("edit_nws",
"moderenews.php?id_nws=".$_REQUEST['id_nouvelle'].
"&action=mod",
true,
"post",
"Edition de \"".$news->titre."\"");
"moderenews.php?id_nws=".$_REQUEST['id_nouvelle'].
"&action=mod",
true,
"post",
"Edition de \"".$news->titre."\"");
$form->add_select_field ("type",
"Type de nouvelle", array( 3 => "Appel/concours",
"Type de nouvelle", array( 3 => "Appel/concours",
1 => "Évenement ponctuel",
2 => "Séance hebdomadaire",
0 => "Info/résultat")
,$news->type);
,$news->type);
$form->add_entity_select("id_asso", "Association concern&eacute;e", $site->db, "asso",$news->id_asso,true);
$form->add_entity_select("id_lieu", "Lieu", $site->db, "lieu",$news->id_lieu,true);
......@@ -143,21 +143,21 @@ if (isset($_REQUEST['id_nouvelle']) &&
/* contenu */
$form->add_text_area ("nws_cts","Contenu :",$news->contenu,80,10,true);