bug 399, refuser les invites aux evenements xnet
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 8 Jun 2006 12:30:42 +0000 (12:30 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 8 Jun 2006 12:30:42 +0000 (12:30 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@310 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
htdocs.net/groupe/evenements.php
htdocs.net/groupe/evt-modif.php
templates/xnet/groupe/evenements.tpl
templates/xnet/groupe/evt-modif.tpl
upgrade/0.9.10/03_xnet.sql [new file with mode: 0644]

index f53d72f..fe6587c 100644 (file)
--- 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 :
index 5d76eff..1e07f7d 100644 (file)
@@ -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,
index 93321a3..87db40b 100644 (file)
@@ -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();
index 8282772..830ecc1 100644 (file)
@@ -105,15 +105,20 @@ Ev
             {if $e.inscr_open}
               <input type="radio" name="moment{$e.eid}_{$m.item_id}" value="0"
               {if !$m.nb}checked="checked"{/if}/>non
-              <input type="radio" name="moment{$e.eid}_{$m.item_id}" value="1"
-              {if $m.nb eq 1}checked="checked"{/if}/>seul<br />
-              <input type="radio" name="moment{$e.eid}_{$m.item_id}" value="2"
-              {if $m.nb > 1}checked="checked"{/if}/>avec <input size="2" name="personnes{$e.eid}_{$m.item_id}" value="{if $m.nb > 1}{math equation="x - y" x=$m.nb y=1}{else}1{/if}"/> personnes
+              {if $e.noinvite}
+                  <input type="radio" name="moment{$e.eid}_{$m.item_id}" value="1"
+                  {if $m.nb eq 1}checked="checked"{/if}/>oui
+              {else}
+                  <input type="radio" name="moment{$e.eid}_{$m.item_id}" value="1"
+                  {if $m.nb eq 1}checked="checked"{/if}/>seul<br />
+                  <input type="radio" name="moment{$e.eid}_{$m.item_id}" value="2"
+                  {if $m.nb > 1}checked="checked"{/if}/>avec <input size="2" name="personnes{$e.eid}_{$m.item_id}" value="{if $m.nb > 1}{math equation="x - y" x=$m.nb y=1}{else}1{/if}"/> 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}
index d1facd5..d2312b6 100644 (file)
       </td>
     </tr>
     <tr>
+      <td colspan="2">Autoriser les invités :
+        <input type="radio" name="noinvite" value="0" {if !$evt.noinvite}checked="checked"{/if} /> oui
+        <input type="radio" name="noinvite" value="1" {if $evt.noinvite}checked="checked"{/if}/> non
+      </td>
+    </tr>
+    <tr>
       <td>Référence de paiement&nbsp;:
       </td>
       <td>
diff --git a/upgrade/0.9.10/03_xnet.sql b/upgrade/0.9.10/03_xnet.sql
new file mode 100644 (file)
index 0000000..8e3266a
--- /dev/null
@@ -0,0 +1,2 @@
+ALTER TABLE `evenements` ADD `noinvite` TINYINT NOT NULL;
+