From a8c3c0731379cf45699a512a428b987d3ca479a8 Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Thu, 8 Jun 2006 12:30:42 +0000 Subject: [PATCH] bug 399, refuser les invites aux evenements xnet git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@310 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 1 + htdocs.net/groupe/evenements.php | 6 +++++- htdocs.net/groupe/evt-modif.php | 7 ++++--- templates/xnet/groupe/evenements.tpl | 15 ++++++++++----- templates/xnet/groupe/evt-modif.tpl | 6 ++++++ upgrade/0.9.10/03_xnet.sql | 2 ++ 6 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 upgrade/0.9.10/03_xnet.sql diff --git a/ChangeLog b/ChangeLog index f53d72f..fe6587c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,7 @@ Bug/Wish : - #377: Possibility to edit or del an ext user if email used twice. -Car - #378: Display group directory order by promo. -Car - #379, #383: Paiements table relook. -Car + - #399: Event can accept guests or not. -Car - #413: When creating a new event, datas don't disappear anymore. -Car From 0.9.8 Branch : diff --git a/htdocs.net/groupe/evenements.php b/htdocs.net/groupe/evenements.php index 5d76eff..1e07f7d 100644 --- a/htdocs.net/groupe/evenements.php +++ b/htdocs.net/groupe/evenements.php @@ -32,6 +32,7 @@ if (Env::has('ins')) { $res = $globals->xdb->query(" SELECT deadline_inscription, LEFT(NOW(), 10) AS now, + noinvite, membres_only FROM groupex.evenements WHERE eid = {?}", $eid); @@ -63,6 +64,9 @@ if (Env::has('ins')) { $inscriptions[$j] = 0; // avoid floating count if other field incorrect $inscriptions[$j] = floor($inscriptions[$j]); + // avoid invite if no invite allowed + if ($inscriptions[$j] > 1 && $e['noinvite']) + $inscriptions[$j] = 1; $total_inscr += $inscriptions[$j]; } $unsubscribing = ($total_inscr == 0); @@ -115,7 +119,7 @@ $evenements = $globals->xdb->iterator( e.debut, e.fin, LEFT(10,e.debut) AS debut_day, LEFT(10,e.fin) AS fin_day, - e.paiement_id, e.membres_only, + e.paiement_id, e.membres_only, e.noinvite, e.show_participants, u.nom, u.prenom, u.promo, a.alias, MAX(ep.nb) AS inscrit, MAX(ep.paid) AS paid, e.short_name, diff --git a/htdocs.net/groupe/evt-modif.php b/htdocs.net/groupe/evt-modif.php index 93321a3..87db40b 100644 --- a/htdocs.net/groupe/evt-modif.php +++ b/htdocs.net/groupe/evt-modif.php @@ -123,6 +123,7 @@ if (Post::get('intitule')) { $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')); @@ -133,12 +134,12 @@ if (Post::get('intitule')) { paiement_id = {?}, descriptif = {?}, debut = {?}, fin = {?}, membres_only = {?}, advertise = {?}, show_participants = {?}, - short_name = {?}, deadline_inscription = {?}", + 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['short_name'], $evt['deadline_inscription']); + $evt['short_name'], $evt['deadline_inscription'], $evt['noinvite']); // if new event, get its id if (!$eid) { @@ -218,7 +219,7 @@ while ($a = $res->next()) $paiements[$a['id']] = $a['text']; // when modifying an old event retreive the old datas if ($eid) { $res = $globals->xdb->query( - "SELECT eid, intitule, descriptif, debut, fin, membres_only, advertise, show_participants, paiement_id, short_name, deadline_inscription + "SELECT eid, intitule, descriptif, debut, fin, membres_only, advertise, show_participants, paiement_id, short_name, deadline_inscription, noinvite FROM groupex.evenements WHERE eid = {?}", $eid); $evt = $res->fetchOneAssoc(); diff --git a/templates/xnet/groupe/evenements.tpl b/templates/xnet/groupe/evenements.tpl index 8282772..830ecc1 100644 --- a/templates/xnet/groupe/evenements.tpl +++ b/templates/xnet/groupe/evenements.tpl @@ -105,15 +105,20 @@ Ev {if $e.inscr_open} non - seul
- 1}checked="checked"{/if}/>avec personnes + {if $e.noinvite} + oui + {else} + seul
+ 1}checked="checked"{/if}/>avec personnes + {/if} {else} {if !$m.nb} Je ne viendrai pas. {elseif $m.nb eq 1} - Je viendrai seul. + Je viendrai{if !$e.noinvite} seul{/if}. {else} Je viendrai avec {$m.nb} personne{if $m.nb > 2}s{/if} {/if} diff --git a/templates/xnet/groupe/evt-modif.tpl b/templates/xnet/groupe/evt-modif.tpl index d1facd5..d2312b6 100644 --- a/templates/xnet/groupe/evt-modif.tpl +++ b/templates/xnet/groupe/evt-modif.tpl @@ -96,6 +96,12 @@ + Autoriser les invités : + oui + non + + + Référence de paiement : diff --git a/upgrade/0.9.10/03_xnet.sql b/upgrade/0.9.10/03_xnet.sql new file mode 100644 index 0000000..8e3266a --- /dev/null +++ b/upgrade/0.9.10/03_xnet.sql @@ -0,0 +1,2 @@ +ALTER TABLE `evenements` ADD `noinvite` TINYINT NOT NULL; + -- 2.1.4