-[valid_epouses]
-from="Equipe Polytechnique.org" <validation+epouse@polytechnique.org>
-cc="Equipe Polytechnique.org" <validation+epouse@polytechnique.org>
-
-[valid_evts]
-from="Equipe Polytechnique.org" <validation+evts@polytechnique.org>
-cc="Equipe Polytechnique.org" <validation+evts@polytechnique.org>
-
-[valid_sondages]
-from="Equipe Polytechnique.org" <validation+sondages@polytechnique.org>
-cc="Equipe Polytechnique.org" <validation+sondages@polytechnique.org>
-
[marketing_relance]
from=Pre-Inscription <register@polytechnique.org>
// le 'creation_date = creation_date' est indispensable pour que
// creation_date conserve sa valeur.
$req="UPDATE evenements
- SET creation_date = creation_date, validation_user_id = ".Session::getInt('uid').",
- validation_date = NULL, flags = CONCAT(flags,',valide')
+ SET creation_date = creation_date, flags = CONCAT(flags,',valide')
WHERE id = $evid
LIMIT 1";
$result = $globals->db->query ($req);
// le 'creation_date = creation_date' est indispensable pour que
// creation_date conserve sa valeur.
$req="UPDATE evenements
- SET creation_date = creation_date, validation_user_id = ".Session::getInt('uid').",
- validation_date = NULL, flags = REPLACE(flags, 'valide','')
+ SET creation_date = creation_date, flags = REPLACE(flags, 'valide','')
WHERE id = $evid
LIMIT 1";
$result = $globals->db->query ($req);
break;
case "Editer":
- $evt_req = $globals->db->query("SELECT titre, texte, peremption, promo_min, promo_max, validation_message FROM evenements WHERE id= $evid");
- list($titre, $texte, $peremption, $promo_min, $promo_max, $validation_message) = mysql_fetch_row($evt_req) ;
+ $evt_req = $globals->db->query("SELECT titre, texte, peremption, promo_min, promo_max FROM evenements WHERE id= $evid");
+ list($titre, $texte, $peremption, $promo_min, $promo_max) = mysql_fetch_row($evt_req) ;
$page->assign('mode', 'edit');
$page->assign('titre',$titre);
$page->assign('texte',$texte);
$page->assign('promo_min',$promo_min);
$page->assign('promo_max',$promo_max);
- $page->assign('validation_message',$validation_message);
$page->assign('peremption',$peremption);
$select = "";
$sql = "SELECT e.id, e.titre, e.texte,
DATE_FORMAT(e.creation_date,'%d/%m/%Y %T') AS creation_date,
- DATE_FORMAT(e.validation_date,'%d/%m/%Y %T') AS validation_date,
DATE_FORMAT(e.peremption,'%d/%m/%Y') AS peremption,
- e.promo_min, e.promo_max, e.validation_message, e.validation_user_id,
+ e.promo_min, e.promo_max,
FIND_IN_SET('valide', e.flags) AS fvalide,
FIND_IN_SET('archive', e.flags) AS farch,
u.promo, u.nom, u.prenom, a.alias AS forlife
$page->assign('action', strtolower($action));
if ($action=="Confirmer") {
- $sql = "INSERT INTO evenements
- SET user_id = ".Session::getInt('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_once("validations.inc.php");
- $evtreq = new evtreq(mysql_insert_id(), $titre, $texte, $promo_min,
- $promo_max, $peremption, $validation_message, Session::getInt('uid'));
- $evtreq->submit();
- $page->assign('ok', true);
- }
+ require_once("validations.inc.php");
+ $evtreq = new evtreq($titre, $texte, $promo_min, $promo_max,
+ $peremption, $validation_message, Session::getInt('uid'));
+ $evtreq->submit();
+ $page->assign('ok', true);
}
$select = "";
{ return 'include/form.valid.epouses.tpl'; }
// }}}
- // {{{ function handle_formu()
+ // {{{ function _mail_subj()
- function handle_formu()
+ function _mail_subj()
{
- if (Env::get('submit') != "Accepter" && Env::get('submit') != "Refuser") {
- return false;
- }
+ return "[Polytechnique.org/EPOUSE] Changement de nom de mariage";
+ }
- require_once("xorg.mailer.inc.php");
- $mymail = new XOrgMailer('valid.epouses.tpl');
- $mymail->assign('forlife', $this->forlife);
+ // }}}
+ // {{{ function _mail_body
- if (Env::get('submit') == "Accepter") {
- $mymail->assign('answer','yes');
- if ($this->oldepouse) {
- $mymail->assign('oldepouse',$this->oldalias);
+ function _mail_body($isok)
+ {
+ global $globals;
+ if ($isok) {
+ $res = " La demande de changement de nom de mariage que tu as demandée vient d'être effectuée.";
+ if ($this->oldalias) {
+ $res .= "\n\n Les alias {$this->oldalias}@{$globals->mail->domain} et @{$globals->mail->domain2} ont été supprimés.";
}
- $mymail->assign('epouse',$this->alias);
- $this->commit();
- } else { // c'était donc Refuser
- $mymail->assign('answer','no');
+ $res .= "\n\n Les alias {$this->alias}@{$globals->mail->domain} et @{$globals->mail->domain2} sont maintenant à ta disposition !";
+ } else {
+ return " La demande de changement de nom de mariage que tu avais faite a été refusée.";
}
-
- $mymail->send();
-
- $this->clean();
- return "Mail envoyé";
}
// }}}
$f = fopen("/tmp/flag_recherche","w");
fputs($f,"1");
fclose($f);
+ return true;
}
// }}}
// }}}
// {{{ constructor
- function EvtReq($_evtid,$_titre,$_texte,$_pmin,$_pmax,$_peremption,
- $_comment,$_uid,$_stamp=0) {
+ function EvtReq($_titre, $_texte, $_pmin, $_pmax, $_peremption, $_comment, $_uid) {
global $globals;
$this->Validate($_uid, false, 'evts', $_stamp);
- $this->evtid = $_evtid;
$this->titre = $_titre;
$this->texte = $_texte;
$this->pmin = $_pmin;
{ return 'include/form.valid.evts.tpl'; }
// }}}
- // {{{ function handle_formu()
-
- function handle_formu()
+ // {{{ function _mail_subj
+
+ function _mail_subj()
{
- global $globals;
- if (Post::has('action')) {
- require_once("xorg.mailer.inc.php");
- $mymail = new XOrgMailer('valid.evts.tpl');
- $mymail->assign('bestalias',$this->bestalias);
- $mymail->assign('titre',$this->titre);
+ return "[Polytechnique.org/EVENEMENTS] Proposition d'événement";
+ }
- $uid = Session::getInt('uid');
+ // }}}
+ // {{{ function _mail_body
- if (Env::get('action') == "Valider") {
- $globals->xdb->execute(
- "UPDATE evenements
- SET creation_date = creation_date, validation_user_id = {?},
- validation_date = NULL, flags = CONCAT(flags,',valide')
- WHERE id={?}
- LIMIT 1", $uid, $this->evtid);
- $mymail->assign('answer','yes');
- $mymail->send();
- } elseif (Env::get('action') == "Invalider") {
- $globals->xdb->execute(
- "UPDATE evenements
- SET creation_date = creation_date, validation_user_id = {?},
- validation_date = NULL, flags = REPLACE(flags,'valide','')
- WHERE id='{?}'
- LIMIT 1", $uid, $this->evtid);
- $mymail->assign('answer', 'no');
- $mymail->send();
- } elseif (Env::get('action') == "Supprimer") {
- $globals->xdb->execute("DELETE FROM evenements WHERE id={?} LIMIT 1", $this->evtid);
- }
-
- $this->clean();
+ function _mail_body($isok)
+ {
+ if ($isok) {
+ return " L'annonce que tu avais proposée ({$this->titre}) vient d'être validée.";
+ } else {
+ return " L'annonce que tu avais proposée ({$this->titre}) a été refusée.";
}
- return "";
}
// }}}
// {{{ function commit()
function commit()
- { }
+ {
+ global $globals;
+ $globals->xdb->execute(
+ "INSERT INTO evenements
+ SET user_id = {?}, creation_date=NULL, titre={?}, texte={?},
+ peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide')",
+ $this->_uid, $this->titre, $this->texte,
+ $this->peremption, $this->pmin, $this->pmax);
+ return true;
+ }
// }}}
}
<table class="bicol">
<tr>
<th>
- Posté par <a href="{"fiche.php"|url}?user={$ev.forlife}" class='popup2'>{$ev.prenom} {$ev.nom} (X{$ev.promo})</a>
- <a href="mailto:{$ev.forlife}@m4x.org">lui écrire</a>
+ Posté par <a href="{rel}/fiche.php?user={$ev.forlife}" class='popup2'>{$ev.prenom} {$ev.nom} (X{$ev.promo})</a>
</th>
</tr>
<tr class="{if $ev.fvalide}impair{else}pair{/if}">
<td>
- <strong>{$ev.titre}</strong><br />
- {$ev.texte|nl2br}<br />
- <hr />
+ <strong>{$ev.titre}</strong>
+ </td>
+ </tr>
+ <tr class="{if $ev.fvalide}impair{else}pair{/if}">
+ <td>
+ {tidy}{$ev.texte|nl2br}{/tidy}
+ </td>
+ </tr>
+ <tr class="{if $ev.fvalide}impair{else}pair{/if}">
+ <td>
Création : {$ev.creation_date}<br />
- {if $ev.fvalide}
- Validation : {$ev.validation_date}<br />
- {/if}
Péremption : {$ev.peremption}<br />
Promos : {$ev.promo_min} - {$ev.promo_max}<br />
- Message : {$ev.validation_message}
</td>
</tr>
<tr>
</select>
</td>
</tr>
- <tr>
- <td><strong>Message pour le validateur</strong></td>
- <td><textarea name="validation_message" cols="50" rows="7">{$validation_message}</textarea></td>
- </tr>
</table>
<div class="center">
***************************************************************************}
-<form action="{$smarty.server.PHP_SELF}" method="post">
- <table class="bicol" cellpadding="4" summary="Demande d'alias d'épouse">
- <tr>
- <td>Demandeur :</td>
- <td>
- <a href="{"fiche.php"|url}?user={$valid->forlife}" class="popup2">
- {$valid->prenom} {$valid->nom}
- </a>
- {if $valid->oldepouse}({$valid->oldepouse} - {$valid->oldalias}){/if}
- </td>
- </tr>
- <tr>
- <td>Épouse :</td>
- <td>{$valid->epouse}</td>
- </tr>
- <tr>
- <td>Nouvel alias :</td>
- <td>{$valid->alias|default:"<span class='erreur'>suppression</span>"}</td>
- </tr>
- {if $valid->homonyme}
- <tr>
- <td colspan="2">
- <span class="erreur">Probleme d'homonymie !
- <a href="{"fiche.php"|url}?user=$valid->homonyme" class="popup2">{$valid->homonyme}</a>
- </span>
- </td>
- </tr>
- {/if}
- <tr>
- <td class="middle">
- <input type="hidden" name="uid" value="{$valid->uid}" />
- <input type="hidden" name="type" value="{$valid->type}" />
- <input type="hidden" name="stamp" value="{$valid->stamp}" />
- <input type="submit" name="submit" value="Accepter" />
- <br /><br />
- <input type="submit" name="submit" value="Refuser" />
- </td>
- <td>
- <p>Raison du refus:</p>
- <textarea rows="5" cols="50" name="motif"></textarea>
- </td>
- </tr>
- </table>
-</form>
+<tr class="impair">
+ <td class="titre">Épouse :</td>
+ <td>{$valid->epouse}</td>
+</tr>
+<tr class="impair">
+ <td class="titre">Nouvel alias :</td>
+ <td>{$valid->alias|default:"<span class='erreur'>suppression</span>"}</td>
+</tr>
+{if $valid->homonyme}
+<tr class="impair">
+ <td colspan="2">
+ <span class="erreur">Probleme d'homonymie !
+ <a href="{rel}/fiche.php?user=$valid->homonyme" class="popup2">{$valid->homonyme}</a>
+ </span>
+ </td>
+</tr>
+{/if}
{* vim:set et sw=2 sts=2 sws=2: *}
***************************************************************************}
-<form action="{$smarty.server.PHP_SELF}" method="post">
- <table class="bicol">
- <tr>
- <th class="titre" colspan="2">Événement</th>
- </tr>
- <tr>
- <td colspan="2">
- Posté par <a href="{"fiche.php"|url}?user={$valid->bestalias}" class="popup2">
- {$valid->prenom} {$valid->nom} (X{$valid->promo})
- </a>
- [<a href="mailto:{$valid->bestalias}@polytechnique.org">lui écrire</a>]
- </td>
- </tr>
- <tr>
- <td class="titre">Titre</td>
- <td>{$valid->titre}</td>
- </tr>
- <tr>
- <td class="titre">Texte</td>
- <td>{$valid->texte}</td>
- </tr>
- <tr>
- <td class="titre">Péremption</td>
- <td>{$valid->peremption}</td>
- </tr>
- <tr>
- <td class="titre">Promos</td>
- <td>{$valid->pmin} - {$valid->pmax}</td>
- </tr>
- <tr>
- <td class="titre">Commentaire</td>
- <td>{$valid->comment}</td>
- </tr>
- <tr>
- <td class="center" colspan="2">
- <input type="hidden" name="uid" value="{$valid->uid}" />
- <input type="hidden" name="type" value="{$valid->type}" />
- <input type="hidden" name="stamp" value="{$valid->stamp}" />
- <input type="submit" name="action" value="Valider" />
- <input type="submit" name="action" value="Invalider" />
- <input type="submit" name="action" value="Supprimer" />
- </td>
- </tr>
- </table>
-</form>
+<tr class="impair">
+ <td class="titre">Titre</td>
+ <td>{$valid->titre}</td>
+</tr>
+<tr class="impair">
+ <td class="titre">Texte</td>
+ <td>{$valid->texte}</td>
+</tr>
+<tr class="impair">
+ <td class="titre">Péremption</td>
+ <td>{$valid->peremption|date_format:"%d %B %Y"}</td>
+</tr>
+<tr class="impair">
+ <td class="titre">Promos</td>
+ <td>{$valid->pmin} - {$valid->pmax}</td>
+</tr>
+<tr class="impair">
+ <td class="titre">Commentaire</td>
+ <td>{$valid->comment}</td>
+</tr>
{* vim:set et sw=2 sts=2 sws=2: *}
+++ /dev/null
-{***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program 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. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************}
-
-
-<form action="{$smarty.server.PHP_SELF}" method="post">
- <table class="bicol">
- <tr>
- <td>Demandeur :</td>
- <td>
- <a href="{"fiche.php"|url}?user={$valid->bestalias}" class="popup2">
- {$valid->prenom} {$valid->nom}
- </a>
- </td>
- </tr>
- <tr>
- <td>Motif :</td>
- <td>{$valid->comment|nl2br}
- </td>
- </tr>
- <tr>
- <td style="border-top:1px dotted inherit">
- Alias :
- </td>
- <td style="border-top:1px dotted inherit">
- <input type="text" name="alias" value="{$valid->alias}" />@polytechnique.org
- </td>
- </tr>
- <tr>
- <td>Topic :</td>
- <td><input type="text" name="topic" size="60" value="{$valid->topic}" />
- </td>
- </tr>
- <tr>
- <td>Propriétés :</td>
- <td>
- <input type="checkbox" name="publique" {if $valid->publique}checked="checked"{/if} />Publique
- <input type="checkbox" name="libre" {if $valid->libre}checked="checked"{/if} />Libre
- <input type="checkbox" name="freeins" {if $valid->freeins}checked="checked"{/if} />Freeins
- <input type="checkbox" name="archive" {if $valid->archive}checked="checked"{/if} />Archive
- </td>
- </tr>
- <tr>
- <td style="border-top:1px dotted inherit">Modéros :</td>
- <td style="border-top:1px dotted inherit">{$valid->moderos_txt}</td>
- </tr>
- <tr>
- <td>Membres :</td>
- <td>{$valid->membres_txt}</td>
- </tr>
- <tr>
- <td class="middle" style="border-top:1px dotted inherit">
- <input type="hidden" name="uid" value="{$valid->uid}" />
- <input type="hidden" name="type" value="{$valid->type}" />
- <input type="hidden" name="stamp" value="{$valid->stamp}" />
- <input type="submit" name="submit" value="Accepter" />
- <br /><br />
- <input type="submit" name="submit" value="Refuser" />
- </td>
- <td style="border-top:1px dotted inherit">
- <p>Explication complémentaire (refus ou changement de config, ...)</p>
- <textarea rows="5" cols="74" name=motif></textarea>
- </td>
- </tr>
- </table>
-</form>
-
-{* vim:set et sw=2 sts=2 sws=2: *}
+++ /dev/null
-{***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program 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. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************}
-
-{config_load file="mails.conf" section="valid_epouses"}
-{subject text="[Polytechnique.org/EPOUSE] Changement de nom de mariage de $forlife"}
-{from full=#from#}
-{to addr="$forlife@polytechnique.org"}
-{cc full=#cc#}
-{if $answer eq "yes"}
-Chère camarade,
-
- La demande de changement de nom de mariage que tu as demandée vient d'être effectuée.
-
-{if $oldepouse} Les alias {$oldepouse}@polytechnique.org et {$oldepouse}@m4x.org ont été supprimés.
-{/if}
- De plus, les alias {$epouse}@polytechnique.org et {$epouse}@m4x.org ont été créés.
-
-Cordialement,
-L'équipe X.org
-{elseif $answer eq 'no'}
-Chère camarade,
-
- La demande de changement de nom de mariage que tu avais faite a été refusée.
-{if $smarty.request.motif}
-La raison de ce refus est :
-{$smarty.request.motif|stripslashes}
-{/if}
-
-Cordialement,
-L'équipe X.org
-{/if}
-{* vim:set et sw=2 sts=2 sws=2: *}
+++ /dev/null
-{***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program 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. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************}
-
-{config_load file="mails.conf" section="valid_evts"}
-{subject text="[Polytechnique.org/EVENEMENTS] Proposition d'événement"}
-{from full=#from#}
-{to addr="$bestalias@polytechnique.org"}
-{cc full=#cc#}
-{if $answer eq "yes"}
-Cher(e) camarade,
-
- L'annonce que tu avais proposée ({$titre|strip_tags}) vient d'être validée.
-
-Cordialement,
-L'équipe X.org
-{elseif $answer eq 'no'}
-
-Cher(e) camarade,
-
- L'annonce que tu avais proposée ({$titre|strip_tags}) a été refusée.
-
-Cordialement,
-L'équipe X.org
-{/if}
-{* vim:set et sw=2 sts=2 sws=2: *}
--- /dev/null
+alter table evenements drop column validation_message;
+alter table evenements drop column validation_user_id;
+alter table evenements drop column validation_date;
--- /dev/null
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+mailman_stop
+mailman_templates
+mailman_start
+
+
+###########################################################
+for sql in *.sql
+do
+ echo -n $sql
+ $MYSQL x4dat < $sql &>/dev/null || echo -n " ERROR"
+ echo .
+done
+
+###########################################################
+