Commit ed47e41d authored by Aiguille's avatar Aiguille

fix form actualization for preview of news in edition mode

parent ef29af17
...@@ -213,14 +213,27 @@ if ( $_REQUEST["page"] == "edit" && $can_edit ) ...@@ -213,14 +213,27 @@ if ( $_REQUEST["page"] == "edit" && $can_edit )
NEWS_TYPE_HEBDO => "Séance hebdomadaire", NEWS_TYPE_HEBDO => "Séance hebdomadaire",
NEWS_TYPE_NOTICE => "Info/resultat") NEWS_TYPE_NOTICE => "Info/resultat")
,$news->type); ,$news->type);
// Prévisualisation
$frm->add_text_field("title", "Titre",$news->titre,true); if (isset($_REQUEST["preview"]))
$frm->add_entity_select("id_asso", "Association concernée", $site->db, "asso",$news->id_asso,true); {
$frm->add_entity_select("id_lieu", "Lieu", $site->db, "lieu",$news->id_lieu,true); $frm->add_text_field("title", "Titre",$news->titre,true);
$frm->add_text_field("tags", "Tags",$news->get_tags()); $frm->add_entity_select("id_asso", "Association concernée", $site->db, "asso",$news->id_asso,true);
$frm->add_text_area ("resume","Resume",$news->resume); $frm->add_entity_select("id_lieu", "Lieu", $site->db, "lieu",$news->id_lieu,true);
$frm->add_dokuwiki_toolbar('content'); $frm->add_text_field("tags", "Tags",$news->get_tags());
$frm->add_text_area ("content", "Contenu",$news->contenu,80,10,true); $frm->add_text_area ("resume","Resume",$news->resume);
$frm->add_dokuwiki_toolbar('content');
$frm->add_text_area ("content", "Contenu",$news->contenu,80,10,true);
}
else
{
$frm->add_text_field("title", "Titre de la nouvelle", $_REQUEST["title"], true);
$frm->add_entity_select("id_asso", "Association concernée", $site->db, "asso",$_REQUEST["id_asso"],true);
$frm->add_entity_select("id_lieu", "Lieu", $site->db, "lieu",false,true);
$frm->add_text_field("tags", "Tags",$_REQUEST["tags"]);
$frm->add_text_area ("resume","Resumé",$_REQUEST["resume"], 40, 3, true);
$frm->add_dokuwiki_toolbar('content');
$frm->add_text_area ("content", "Contenu",$_REQUEST["content"],80,10,true);
}
if( $site->user->is_in_group("moderateur_site") ) if( $site->user->is_in_group("moderateur_site") )
$frm->add_checkbox("automodere", "<b>Auto-modération</b>", true); $frm->add_checkbox("automodere", "<b>Auto-modération</b>", true);
...@@ -232,6 +245,7 @@ if ( $_REQUEST["page"] == "edit" && $can_edit ) ...@@ -232,6 +245,7 @@ if ( $_REQUEST["page"] == "edit" && $can_edit )
$req = new requete ( $site->db,"SELECT * FROM nvl_dates WHERE id_nouvelle='".$news->id."' ORDER BY date_debut_eve"); $req = new requete ( $site->db,"SELECT * FROM nvl_dates WHERE id_nouvelle='".$news->id."' ORDER BY date_debut_eve");
// Dates
$cts = new contents("Dates"); $cts = new contents("Dates");
if ( $req->lines > 0 ) if ( $req->lines > 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment