From f101a9686db9661d6fc9e827f46738e3be4501e4 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Wed, 29 Dec 2004 08:43:31 +0000 Subject: [PATCH] lists + photos OK git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-166 --- configs/mails.conf | 8 -- htdocs/listes/create.php | 4 +- include/validations/listes.inc.php | 32 +++---- include/validations/photos.inc.php | 33 +++---- templates/include/form.valid.listes.tpl | 151 +++++++++++++------------------- templates/include/form.valid.photos.tpl | 35 ++------ templates/mails/valid.liste.tpl | 47 ---------- templates/mails/valid.photos.tpl | 43 --------- 8 files changed, 95 insertions(+), 258 deletions(-) delete mode 100644 templates/mails/valid.liste.tpl delete mode 100644 templates/mails/valid.photos.tpl diff --git a/configs/mails.conf b/configs/mails.conf index dc9692d..eb3eb1e 100644 --- a/configs/mails.conf +++ b/configs/mails.conf @@ -2,14 +2,6 @@ from="Equipe Polytechnique.org" cc="Equipe Polytechnique.org" -[valid_liste] -from="Equipe Polytechnique.org" -cc="Equipe Polytechnique.org" - -[valid_photos] -from="Equipe Polytechnique.org" -cc="Equipe Polytechnique.org" - [valid_evts] from="Equipe Polytechnique.org" cc="Equipe Polytechnique.org" diff --git a/htdocs/listes/create.php b/htdocs/listes/create.php index a04cc1a..b7413cd 100644 --- a/htdocs/listes/create.php +++ b/htdocs/listes/create.php @@ -22,8 +22,8 @@ require_once("xorg.inc.php"); new_skinned_page('listes/create.tpl', AUTH_MDP); -$owners = preg_split("/[\r\n]+/",Post::get('owners')); -$members = preg_split("/[\r\n]+/",Post::get('members')); +$owners = preg_split("/[\r\n]+/",Post::get('owners'), -1, PREG_SPLIT_NO_EMPTY); +$members = preg_split("/[\r\n]+/",Post::get('members'), -1, PREG_SPLIT_NO_EMPTY); if (Post::has('add_owner_sub') && Post::has('add_owner')) { require_once('user.func.inc.php'); diff --git a/include/validations/listes.inc.php b/include/validations/listes.inc.php index 56ff6d9..53187b1 100644 --- a/include/validations/listes.inc.php +++ b/include/validations/listes.inc.php @@ -67,33 +67,23 @@ class ListeReq extends Validate { return 'include/form.valid.listes.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/LISTES] Demande de la liste {$this->liste}"; + } - require_once("xorg.mailer.inc.php"); - $mymail = new XOrgMailer('valid.liste.tpl'); - $mymail->assign('alias', $this->liste); - $mymail->assign('bestalias', $this->bestalias); - $mymail->assign('motif', stripslashes(Env::get('motif'))); + // }}} + // {{{ function _mail_body - if (Env::get('submit') == "Accepter") { - $mymail->assign('answer', 'yes'); - if (!$this->commit()) { - return 'problème'; - } + function _mail_body($isok) + { + if ($isok) { + return " La mailing list {$this->liste} que tu avais demandée vient d'être créée."; } else { - $mymail->assign('answer', 'no'); + return " La demande que tu avais faite pour la mailing list {$this->liste} a été refusée."; } - $mymail->send(); - - //Suppression de la demande - $this->clean(); - return "Mail envoyé"; } // }}} diff --git a/include/validations/photos.inc.php b/include/validations/photos.inc.php index 717bffe..d6768fa 100644 --- a/include/validations/photos.inc.php +++ b/include/validations/photos.inc.php @@ -96,29 +96,23 @@ class PhotoReq extends Validate { return 'include/form.valid.photos.tpl'; } // }}} - // {{{ function handle_formu() - - function handle_formu () + // {{{ function _mail_subj + + function _mail_subj() { - if (Post::get('submit') != "Accepter" && Post::get('submit') != "Refuser") { - return false; - } - - require_once("xorg.mailer.inc.php"); - $mymail = new XOrgMailer('valid.photos.tpl'); - $mymail->assign('bestalias', $this->bestalias); + return "[Polytechnique.org/PHOTO] Changement de photo"; + } - if (Post::get('submit') == "Accepter") { - $mymail->assign('answer','yes'); - $this->commit(); + // }}} + // {{{ function _mail_body + + function _mail_body($isok) + { + if ($isok) { + return " La demande de changement de photo que tu as demandée vient d'être effectuée."; } else { - $mymail->assign('answer','no'); + return " La demande de changement de photo que tu avais faite a été refusée."; } - - $mymail->send(); - - $this->clean(); - return "Mail envoyé"; } // }}} @@ -133,6 +127,7 @@ class PhotoReq extends Validate $this->uid, $this->mimetype, $this->data, $this->x, $this->y); require_once('notifs.inc.php'); register_watch_op($this->uid,WATCH_FICHE); + return true; } // }}} diff --git a/templates/include/form.valid.listes.tpl b/templates/include/form.valid.listes.tpl index f104af7..da2c74a 100644 --- a/templates/include/form.valid.listes.tpl +++ b/templates/include/form.valid.listes.tpl @@ -1,93 +1,68 @@ {*************************************************************************** - * 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 * - ***************************************************************************} +* 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 * +***************************************************************************} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Demandeur : - - bestalias}" class="popup2"> - {$valid->bestalias} -
Liste :{$valid->liste}@polytechnique.org
Desc : - {$valid->desc} -
Propriétés : - - - - - - - - - - - - - -
visibilité:{if $valid->advertise}publique{else}privée{/if}
diffusion:{if $valid->modlevel eq 2}modérée{elseif $valid->modlevel}restreinte{else}libre{/if}
inscription:{if $valid->inslevel}modérée{else}libre{/if}
-
Getionnaires : - {foreach from=$valid->owners item=o} - {$o} - {/foreach} -
Membres : - {foreach from=$valid->members item=o} - {$o} - {/foreach} -
- - - - -

- -
- -
-
+ + Liste : + {$valid->liste}@polytechnique.org + + + Desc : + + {$valid->desc} + + + + Propriétés : + + + + + + + + + + + + + + +
visibilité:{if $valid->advertise}publique{else}privée{/if}
diffusion:{if $valid->modlevel eq 2}modérée{elseif $valid->modlevel}restreinte{else}libre{/if}
inscription:{if $valid->inslevel}modérée{else}libre{/if}
+ + + + Gestionnaires : + + {foreach from=$valid->owners item=o} + {$o} + {/foreach} + + + + Membres : + + {foreach from=$valid->members item=o} + {$o} + {/foreach} + + {* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/form.valid.photos.tpl b/templates/include/form.valid.photos.tpl index 5b095b6..06b6bc4 100644 --- a/templates/include/form.valid.photos.tpl +++ b/templates/include/form.valid.photos.tpl @@ -18,38 +18,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************} - -
- - - - - - - - - - + + -
Demandeur :bestalias}" class="popup2"> - {$valid->prenom} {$valid->nom} - -
- uid}" style="width:110px;" alt=" [ PHOTO ] " /> -   - uid}&req=true" style="width:110px;" alt=" [ PHOTO ] " /> -
- - - - -

- -
Photos -

Raison du refus:

- +  [ PHOTO ] +      +  [ PHOTO ]
-
{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/mails/valid.liste.tpl b/templates/mails/valid.liste.tpl deleted file mode 100644 index 6593d6f..0000000 --- a/templates/mails/valid.liste.tpl +++ /dev/null @@ -1,47 +0,0 @@ -{*************************************************************************** - * 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_liste"} -{subject text="[Polytechnique.org/LISTES] Demande de la liste $alias par $bestalias"} -{from full=#from#} -{to addr="$bestalias@polytechnique.org"} -{cc full=#cc#} -{if $answer eq "yes"} -Cher(e) camarade, - - La mailing list {$alias} que tu avais demandée vient d'être créée. -{if $motif} -Informations complémentaires: -{$motif|stripslashes} -{/if} - -Cordialement, -L'équipe X.org -{elseif $answer eq 'no'} -Cher(e) camarade, - - La demande que tu avais faite pour la mailing list {$alias} a été refusée. -La raison de ce refus est : -{$motif|stripslashes} - -Cordialement, -L'équipe X.org -{/if} -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/mails/valid.photos.tpl b/templates/mails/valid.photos.tpl deleted file mode 100644 index abd863d..0000000 --- a/templates/mails/valid.photos.tpl +++ /dev/null @@ -1,43 +0,0 @@ -{*************************************************************************** - * 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_photos"} -{subject text="[Polytechnique.org/PHOTO] Changement de photo de $bestalias"} -{from full=#from#} -{to addr="$bestalias@polytechnique.org"} -{cc full=#cc#} -{if $answer eq "yes"} -Cher(e) camarade, - - La demande de changement de photo que tu as demandée vient d'être effectuée. - -Cordialement, -L'équipe X.org -{elseif $answer eq 'no'} -Cher(e) camarade, - - La demande de changement de photo que tu avais faite a été refusée. -La raison de ce refus est : -{$smarty.request.motif|stripslashes} - -Cordialement, -L'équipe X.org -{/if} -{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4