From: x2000habouzit Date: Mon, 19 Jul 2004 13:35:34 +0000 (+0000) Subject: evenements done X-Git-Tag: xorg/old~1789 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=01930e8e6c16ee46f60d7455e97d4f4e363f6165;p=platal.git evenements done --- diff --git a/etat_migration b/etat_migration index b6d11e5..e9ffa01 100644 --- a/etat_migration +++ b/etat_migration @@ -26,7 +26,6 @@ Etat | Ancien nom | Nouveau nom ; | step4.php | ; | tmpPWD.php | ------+-[ bordel ]--------------------------------+---------------- -; | evenements.php | ; | fiche_referent.php | ; | index.coupure.php | ; | mescontacts_pdf.php | @@ -146,6 +145,7 @@ xx | dons.php | - xx | emails.php | - xx | en-cours.php | docs/en-cours.php xx | ethique.php | docs/ethique.php +xx | evenements.php | xx | exit.php | - xx | faq.php | docs/faq.php xx | getphoto.php | - diff --git a/htdocs/evenements.php b/htdocs/evenements.php new file mode 100644 index 0000000..2285669 --- /dev/null +++ b/htdocs/evenements.php @@ -0,0 +1,64 @@ +assign('titre', $titre); +$page->assign('texte', $texte); +$page->assign('promo_min', $promo_min); +$page->assign('promo_max', $promo_max); +$page->assign('peremption', $peremption); +$page->assign('validation_message', $validation_message); +$page->assign('action', strtolower($action)); + +if ($action=="Confirmer") { + $sql = "INSERT INTO evenements set user_id = {$_SESSION['uid']}" + .", creation_date = NULL" + .", titre = '".addslashes($titre)."'" + .", texte = '".addslashes($texte)."'" + .", peremption = '".$peremption."'" + .", promo_min = '$promo_min', promo_max = '$promo_max'" + .", validation_message = '".addslashes($validation_message)."'" + .", validation_date = 0"; + + if ($res = $globals->db->query($sql)) { + require("validations.inc.php"); + $evtreq = new evtreq(mysql_insert_id(),$titre,$texte,$promo_min, + $promo_max,$peremption,$validation_message,$_SESSION['uid']); + $evtreq->submit(); + $page->assign('ok', true); + } +} + +$select = ""; +for ($i = 1 ; $i < 30 ; $i++) { + $p_stamp=date("Ymd",time()+3600*24*$i); + $year=substr($p_stamp,0,4); + $month=substr($p_stamp,4,2); + $day=substr($p_stamp,6,2); + + $select .= "\n"; +} +$page->assign('select',$select); +$page->run(); + +?> diff --git a/include/valid_evts.inc.php b/include/valid_evts.inc.php index 2cadbee..2296448 100644 --- a/include/valid_evts.inc.php +++ b/include/valid_evts.inc.php @@ -63,10 +63,11 @@ class EvtReq extends Validate { if($_REQUEST['action']=="Supprimer") { $globals->db->query("DELETE from evenements WHERE id='{$this->evtid}' LIMIT 1"); } - if ($_POST['action']!="Supprimer") + if ($_POST['action'] != "Supprimer") $mymail->send(); $this->clean(); } + return ""; } function commit() { diff --git a/templates/admin/evenements.tpl b/templates/admin/evenements.tpl index cc734b4..edb7a66 100644 --- a/templates/admin/evenements.tpl +++ b/templates/admin/evenements.tpl @@ -1,4 +1,4 @@ -{* $Id: evenements.tpl,v 1.2 2004-07-19 12:09:32 x2000habouzit Exp $ *} +{* $Id: evenements.tpl,v 1.3 2004-07-19 13:35:35 x2000habouzit Exp $ *} {dynamic} @@ -17,77 +17,7 @@ {if $mode} -
- - - - - - - - - - - - - -
Contenu du message
Titre - -
Texte
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
Informations complémentaires
- Promo min * (incluse) - - -  0 signifie pas de minimum -
- Promo max * (incluse) - - -  0 signifie pas de maximum -
- * sert à limiter l'affichage de l'annonce aux camarades appartenant à certaines promos seulement. -
- Dernier jour d'affichage - - -
Message pour le validateur
- -
- -
- -
- -
- +{include file="include/form.evenement.tpl"} {else} @@ -122,10 +52,10 @@ {else} {if $ev.fvalide} - - {else} + {else} + {/if} {/if} diff --git a/templates/evenements.tpl b/templates/evenements.tpl new file mode 100644 index 0000000..3a8a567 --- /dev/null +++ b/templates/evenements.tpl @@ -0,0 +1,78 @@ +{* $Id: evenements.tpl,v 1.1 2004-07-19 13:35:35 x2000habouzit Exp $ *} + +
+ Proposition d'information événementielle +
+ +{dynamic} + +{if $action eq "proposer"} + +

+Voici ton annonce : +

+ + + + + + + + +
{$titre|nl2br}
{$texte|nl2br}
+ +

+Ce message est à destination +{if $promo_min || $promo_max} +des promotions {if $promo_min}X{$promo_min}{/if} {if $promo_max}jusqu'à X{$promo_max}{else}et plus{/if} +{else} +de toutes les promotions +{/if} +et sera affiché sur la page d'accueil jusqu'au {$peremption|date_format:"%e %b %Y"} +

+ +{if $validation_message} +

+Tu as ajouté le message suivant à l'intention du validateur : {$validation_message|nl2br} +

+{/if} + +
+ + + + + + + + +
+ + +{elseif $action eq "confirmer"} + +{if $ok} +

+Ta proposition a bien été enregistrée, un administrateur va se charger de la valider aussi rapidement que possible. +

+

+Merci pour ta contribution à la vie du site! +

+

+Retour à la page d'accueil +

+{else} +

+Une erreur s'est produite pendant l'enregistrement de ta proposition. Merci de nous contacter! +

+{/if} + +{else} + +{include file="include/form.evenement.tpl"} + +{/if} + +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/form.evenement.tpl b/templates/include/form.evenement.tpl new file mode 100644 index 0000000..265ee85 --- /dev/null +++ b/templates/include/form.evenement.tpl @@ -0,0 +1,74 @@ +{* $Id: form.evenement.tpl,v 1.1 2004-07-19 13:35:36 x2000habouzit Exp $ *} + +
+ + + + + + + + + + + + + +
Contenu du message
Titre + +
Texte
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Informations complémentaires
+ Promo min * (incluse) + + +  0 signifie pas de minimum +
+ Promo max * (incluse) + + +  0 signifie pas de maximum +
+ * sert à limiter l'affichage de l'annonce aux camarades appartenant à certaines promos seulement. +
+ Dernier jour d'affichage + + +
Message pour le validateur
+ +
+ +
+ +
+ +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/form.valid.evts.tpl b/templates/include/form.valid.evts.tpl index 6311756..0344fdd 100644 --- a/templates/include/form.valid.evts.tpl +++ b/templates/include/form.valid.evts.tpl @@ -1,52 +1,48 @@ -{* $Id: form.valid.evts.tpl,v 1.2 2004-02-09 17:47:07 x2000habouzit Exp $ *} +{* $Id: form.valid.evts.tpl,v 1.3 2004-07-19 13:35:36 x2000habouzit Exp $ *} -
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Événement
- Posté par username"|url}"> - {$valid->prenom} {$valid->nom} (X{$valid->promo}) - - [lui écrire]" -
Titre{$valid->titre}
Texte{$valid->texte}
Péremption{$valid->peremption}
Promos{$valid->pmin} - {$valid->pmax}
Commentaire{$valid->comment}
- - - -
Événement
+ Posté par username"|url}"> + {$valid->prenom} {$valid->nom} (X{$valid->promo}) + + [lui écrire] +
Titre{$valid->titre}
Texte{$valid->texte}
Péremption{$valid->peremption}
Promos{$valid->pmin} - {$valid->pmax}
Commentaire{$valid->comment}
+ + + +