migrate list creation.
[platal.git] / htdocs.net / groupe / evenements.php
index 5d76eff..6495182 100644 (file)
@@ -2,7 +2,7 @@
 require 'xnet.inc.php';
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -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,