Fixes deletion of people inscriptions in events (Closes #1578)
authorBrice Gelineau <brice.gelineau@polytechnique.org>
Sun, 27 Nov 2011 07:55:57 +0000 (08:55 +0100)
committerBrice Gelineau <brice.gelineau@polytechnique.org>
Sun, 27 Nov 2011 08:00:45 +0000 (09:00 +0100)
Signed-off-by: Brice Gelineau <brice.gelineau@polytechnique.org>
ChangeLog
modules/xnetevents.php

index 886db4c..963fde8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@ Bug/Wish:
 
     * XnetEvent:
         - #1577: Fixes alternative payements given by admins               -GLN
+        - #1578: Fixes deletion of people inscriptions                     -GLN
 
 From 1.1.4 branch:
 
index f4c04ec..92f8e31 100644 (file)
@@ -603,7 +603,7 @@ class XnetEventsModule extends PLModule
 
             // change the number of personns coming with a participant
             if (Env::v('adm') == 'nbs' && $member) {
-                $res = XDB::query("SELECT paid
+                $res = XDB::query("SELECT SUM(paid)
                                      FROM group_event_participants
                                     WHERE uid = {?} AND eid = {?}",
                                   $member->uid, $evt['eid']);
@@ -625,7 +625,7 @@ class XnetEventsModule extends PLModule
                                  GROUP BY  uid',
                                   $member->uid, $evt['eid']);
                 $u = $res->fetchOneAssoc();
-                if ($u['cnt'] == 1 && $paid == 0 && Post::v('cancel')) {
+                if ($paid == 0 && Post::v('cancel')) {
                     XDB::execute("DELETE FROM group_event_participants
                                         WHERE uid = {?} AND eid = {?}",
                                     $member->uid, $evt['eid']);