From 9ece1588755b26d32d2b5a565e0d59bc681b0264 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sun, 16 Jul 2006 12:02:22 +0000 Subject: [PATCH] mostly code simplifications. also: drop support for membres_only and advertise for events as it's not supported at all, easy to re-add and just confuses users. if we plan to add a feature, we have to add them fully or not, but not half, it's very confusing, and lead to bloated forms for nothing. git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@523 839d8a87-29fc-0310-9880-83ba4fa771e5 --- modules/xnetevents.php | 25 ++-- templates/xnet/groupe/listes-create.tpl | 102 ------------- templates/xnet/groupe/listes-sync.tpl | 48 ------- templates/xnet/groupe/listes.tpl | 119 ---------------- .../groupe/evt-modif.tpl => xnetevents/edit.tpl} | 158 ++++++++++++++------- templates/xnetevents/index.tpl | 2 +- upgrade/0.9.11/03_xnet.sql | 5 + upgrade/0.9.11/update.sh | 32 +++++ 8 files changed, 159 insertions(+), 332 deletions(-) delete mode 100644 templates/xnet/groupe/listes-create.tpl delete mode 100644 templates/xnet/groupe/listes-sync.tpl delete mode 100644 templates/xnet/groupe/listes.tpl rename templates/{xnet/groupe/evt-modif.tpl => xnetevents/edit.tpl} (57%) create mode 100644 upgrade/0.9.11/03_xnet.sql create mode 100755 upgrade/0.9.11/update.sh diff --git a/modules/xnetevents.php b/modules/xnetevents.php index f3df668..a863d50 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -242,7 +242,7 @@ class XnetEventsModule extends PLModule { global $globals; - new_groupadmin_page('xnet/groupe/evt-modif.tpl'); + new_groupadmin_page('xnetevents/edit.tpl'); $page->assign('logged', logged()); $page->assign('admin', may_update()); @@ -346,29 +346,29 @@ class XnetEventsModule extends PLModule $evt['fin'] = Post::get('fin_Year')."-".Post::get('fin_Month') . "-".Post::get('fin_Day')." ".Post::get('fin_Hour') . ":".Post::get('fin_Minute').":00"; - $evt['membres_only'] = Post::get('membres_only'); - $evt['advertise'] = Post::get('advertise'); $evt['show_participants'] = Post::get('show_participants'); $evt['noinvite'] = Post::get('noinvite'); if (!$short_name) { $short_name = ''; } $evt['short_name'] = $short_name; - $evt['deadline_inscription'] = Post::get('deadline', 'off') == 'on' ? null - : (Post::get('inscr_Year')."-".Post::get('inscr_Month') - ."-".Post::get('inscr_Day')); + $evt['deadline_inscription'] = null; + if (Post::get('deadline')) { + $evt['deadline_inscription'] = Post::get('inscr_Year')."-" + . Post::get('inscr_Month')."-" + . Post::get('inscr_Day'); + } // Store the modifications in the database - $globals->xdb->execute("REPLACE INTO groupex.evenements + $globals->xdb->execute("REPLACE INTO groupex.evenements SET eid={?}, asso_id={?}, organisateur_uid={?}, intitule={?}, paiement_id = {?}, descriptif = {?}, - debut = {?}, fin = {?}, - membres_only = {?}, advertise = {?}, show_participants = {?}, + debut = {?}, fin = {?}, show_participants = {?}, short_name = {?}, deadline_inscription = {?}, noinvite = {?}", $evt['eid'], $evt['asso_id'], $evt['organisateur_uid'], $evt['intitule'] , $evt['paiement_id'], $evt['descriptif'], $evt['debut'], $evt['fin'], - $evt['membres_only'], $evt['advertise'], $evt['show_participants'], + $evt['show_participants'], $evt['short_name'], $evt['deadline_inscription'], $evt['noinvite']); // if new event, get its id @@ -433,9 +433,8 @@ class XnetEventsModule extends PLModule if ($eid) { $res = $globals->xdb->query( "SELECT eid, intitule, descriptif, debut, fin, - membres_only, advertise, show_participants, - paiement_id, short_name, deadline_inscription, - noinvite + show_participants, paiement_id, short_name, + deadline_inscription, noinvite FROM groupex.evenements WHERE eid = {?}", $eid); $evt = $res->fetchOneAssoc(); diff --git a/templates/xnet/groupe/listes-create.tpl b/templates/xnet/groupe/listes-create.tpl deleted file mode 100644 index d717871..0000000 --- a/templates/xnet/groupe/listes-create.tpl +++ /dev/null @@ -1,102 +0,0 @@ -{**************************************************************************} -{* *} -{* Copyright (C) 2003-2006 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 *} -{* *} -{**************************************************************************} - -

{$asso.nom} : Création d'une liste de diffusion

- -

-Note : Les listes de diffusion sont un outil particulièrement adapté pour des -échanges entre 6 personnes, ou plus (newsletter, débat interne au groupe ...). En revanche, elles -s'avèrent peu praticables pour des discussions plus restreintes. Il est alors préférable -d'utiliser un alias, à la gestion beaucoup plus souple. -

-

-D'autre part, il est impossible d'inscrire une liste de diffusion à une autre liste de diffusion. -Si tu as besoin de cette fonctionnalité, il faut alors impérativement utiliser -un alias qui, lui, est capable de regrouper plusieurs listes. -

-
- - - - - - - - - - - - - - - - -
Caractéristiques de la Liste
Addresse souhaitée : - @{$asso.mail_domain} -
Sujet (bref) : - -
Propriétés : - - - - - - - - - - - - - - - - - - - -
visibilité : - publique - - privée -
diffusion : - libre - - restreinte - modérée -
inscription : - libre - - modérée -
-
-

-
- -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/listes-sync.tpl b/templates/xnet/groupe/listes-sync.tpl deleted file mode 100644 index 8244a22..0000000 --- a/templates/xnet/groupe/listes-sync.tpl +++ /dev/null @@ -1,48 +0,0 @@ -{**************************************************************************} -{* *} -{* Copyright (C) 2003-2006 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 *} -{* *} -{**************************************************************************} - -{include file='listes/header_listes.tpl' on='sync'} -

Non abonnés à la liste {$platal->argv[1]}@{$asso.mail_domain}

- -
- - - - - - - {foreach from=$not_in_list item=u} - - - - - {/foreach} - - - -
Membre
{$u.prenom} {$u.nom}
- -
- -
- -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/listes.tpl b/templates/xnet/groupe/listes.tpl deleted file mode 100644 index bd7db7c..0000000 --- a/templates/xnet/groupe/listes.tpl +++ /dev/null @@ -1,119 +0,0 @@ -{**************************************************************************} -{* *} -{* Copyright (C) 2003-2006 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 *} -{* *} -{**************************************************************************} - -{if $smarty.get.del_alias} - -

Est tu sur de supprimer l'alias {$smarty.get.del_alias} ?

-
-
- - -
-
-

[retour à la page des listes]

- -{else} - -

{$asso.nom} : Listes de diffusion

- -

Listes de diffusion du groupe {$asso.nom} :

- -

-Une liste dont la diffusion est modérée est une liste dont les mails sont validés -par les administrateurs avant d'être transmis aux membres de la liste. Une liste dont -l'inscription est modérée est une liste pour laquelle l'abonnement est soumis à -l'accord préalable des responsables du groupe. -

-

-La dernière colonne du tableau t'indique si tu es inscrit{if $smarty.session.femme}e{/if} ou non à -la liste. Dans le premier cas, une croix rouge te permet de te désabonner. Dans le second cas, une -croix verte te permet de t'inscrire, après accord des responsables si l'inscription est modérée. -

- - - - - - - - - - - {foreach from=$listes item=l} - - - - - - - - - {foreachelse} - - {/foreach} -
ListeDescriptionDiffusionInscriptionNb 
- [mail] - {$l.list} {if $l.priv}#{/if}{if $l.own}o{/if} - {$l.desc} - {if $l.diff eq 2}modérée{elseif $l.diff eq 1}restreinte{else}libre{/if} - {if $l.ins}modérée{else}libre{/if}{$l.nbsub} - {if $l.sub eq 2} - [désinscrire] - {elseif $l.sub eq 1} - [en attente] - {else} - [m'inscrire] - {/if} -
Pas de listes pour ce groupe
- -

-o: tu es {if $smarty.session.femme}modératrice{else}moderateur{/if} sur cette liste
-#: cette liste est invisible aux non-membres de la liste. S'en désabonner -t'empêcherait de t'y réabonner par la suite sans l'aide d'un administrateur. -

- -

Voici les alias existants pour le groupe {$asso.nom} :

- -{if $alias->total()} - - - Alias - - {iterate from=$alias item=a} - - {if $may_update} - - - - {else} - - {/if} - - {/iterate} -
[mail]{$a.alias}[supprimer][mail] {$a.alias}
-{else} -

Aucun alias pour ce groupe

-{/if} - -{/if} - -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/evt-modif.tpl b/templates/xnetevents/edit.tpl similarity index 57% rename from templates/xnet/groupe/evt-modif.tpl rename to templates/xnetevents/edit.tpl index b0013fc..728e251 100644 --- a/templates/xnet/groupe/evt-modif.tpl +++ b/templates/xnetevents/edit.tpl @@ -20,6 +20,26 @@ {* *} {**************************************************************************} + + +

{$asso.nom} : {$evt.intitule}

+

Un événement peut être une réunion, un séminaire, une conférence, un voyage promo, etc... Pour en organiser un et bénéficier des outils de suivi d'inscription et de @@ -35,75 +55,97 @@ restaurant.

+
+
-
- +
+ + + - + - - - - - - - - - + - + - - + - + - + - + - - - - +
Intitulé de l'événement : + Intitulé de l'événement : +
Evénement en raccourci (pour les mailings listes) :
Descriptif :
Date de début : + Raccourci :
+ (pour les mailings listes) +
- le - {html_select_date prefix='deb_' end_year='+5' day_value_format='%02d' field_order='DMY' field_separator=' / ' month_format='%m' time=$evt.debut} - à - {html_select_time use_24_hours=true display_seconds=false time=$evt.debut prefix='deb_' minute_interval=5} + +
(n'utiliser que chiffres, lettres, tiret et point. garder court)
Date de fin : + Descriptif : + - le - {html_select_date prefix='fin_' end_year='+5' day_value_format='%02d' field_order='DMY' field_separator=' / ' month_format='%m' time=$evt.fin} - à - {html_select_time use_24_hours=true display_seconds=false time=$evt.fin prefix='fin_' minute_interval=5} +
Fin des inscriptionspas de deadline - {html_select_date prefix='inscr_' end_year='+5' day_value_format='%02d' field_order='DMY' field_separator=' / ' month_format='%m' time=$evt.deadline_inscription} + + Date de début : + + le {html_select_date prefix='deb_' end_year='+5' day_value_format='%02d' + field_order='DMY' field_separator=' / ' month_format='%m' time=$evt.debut} + à {html_select_time use_24_hours=true display_seconds=false + time=$evt.debut prefix='deb_' minute_interval=5}
Ouvert aux membres du groupe uniquement : - oui - non + + Date de fin : + + le {html_select_date prefix='fin_' end_year='+5' day_value_format='%02d' + field_order='DMY' field_separator=' / ' month_format='%m' time=$evt.fin} + à {html_select_time use_24_hours=true display_seconds=false + time=$evt.fin prefix='fin_' minute_interval=5}
Annoncer l'événement publiquement sur le site : - oui - non + + Fin des inscriptions : + + + + Pas de deadline + + + le {html_select_date prefix='inscr_' end_year='+5' day_value_format='%02d' + field_order='DMY' field_separator=' / ' month_format='%m' time=$evt.deadline_inscription} + compris. +
Montrer la liste des participants à tous les membres : + + Options : + + Montrer la liste des inscrits aux membres : oui non -
Autoriser les invités : + +
+ Autoriser les invités : oui non
Référence de paiement : - Référence de paiement :
- - {foreach from=$moments item=i} {assign var='moment' value=$items[$i]}
diff --git a/templates/xnetevents/index.tpl b/templates/xnetevents/index.tpl index 77a5f19..605e040 100644 --- a/templates/xnetevents/index.tpl +++ b/templates/xnetevents/index.tpl @@ -133,7 +133,7 @@ - {if (!$e.membres_only or $is_member or $e.inscrit) and $e.inscr_open} + {if $e.inscr_open} diff --git a/upgrade/0.9.11/03_xnet.sql b/upgrade/0.9.11/03_xnet.sql new file mode 100644 index 0000000..fad1950 --- /dev/null +++ b/upgrade/0.9.11/03_xnet.sql @@ -0,0 +1,5 @@ +use groupex +alter table evenements drop column advertise; +alter table evenements drop column membres_only; +use x4dat + diff --git a/upgrade/0.9.11/update.sh b/upgrade/0.9.11/update.sh new file mode 100755 index 0000000..de82fc0 --- /dev/null +++ b/upgrade/0.9.11/update.sh @@ -0,0 +1,32 @@ +#!/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 + +########################################################### + +echo "we will now upgrade the search table (this may be a long operation) + +please hit ^D to continue +" + +cat + +pushd ../../bin +./search.rebuild_db.php +popd + +########################################################### + -- 2.1.4