X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fxnetevents%2Fxnetevents.inc.php;h=48c0961c92ec30c7079fd009b8b82af84d1828fa;hb=1d49ff4ae684f13250408798f4b0a945797a5229;hp=fe8fc4a132c7ee4251b5cf05b05d4cb659f20352;hpb=5660032ac785d410f90e3f5b0d6948dc90b0cfea;p=platal.git diff --git a/modules/xnetevents/xnetevents.inc.php b/modules/xnetevents/xnetevents.inc.php index fe8fc4a..48c0961 100644 --- a/modules/xnetevents/xnetevents.inc.php +++ b/modules/xnetevents/xnetevents.inc.php @@ -1,6 +1,6 @@ fetchColumn()); @@ -70,8 +70,8 @@ function get_event_detail($eid, $item_id = false, $asso_id = null) $evt['moments'] = XDB::fetchAllAssoc('SELECT titre, details, montant, ei.item_id, nb, ep.paid, FIND_IN_SET(\'notify_payment\', ep.flags) AS notify_payment - FROM #groupex#.evenements_items AS ei - LEFT JOIN #groupex#.evenements_participants AS ep ON (ep.eid = ei.eid AND ep.item_id = ei.item_id + FROM group_event_items AS ei + LEFT JOIN group_event_participants AS ep ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?}) WHERE ei.eid = {?}', S::i('uid'), $evt['eid']); @@ -117,7 +117,7 @@ function get_event_participants(&$evt, $item_id, array $tri = array(), $count = $append = $item_id ? XDB::foramt(' AND ep.item_id = {?}', $item_id) : ''; $query = XDB::fetchAllAssoc('uid', 'SELECT ep.uid, SUM(ep.paid) AS paid, SUM(ep.nb) AS nb, FIND_IN_SET(\'notify_payment\', ep.flags) AS notify_payment - FROM #groupex#.evenements_participants AS ep + FROM group_event_participants AS ep WHERE ep.eid = {?} AND nb > 0 ' . $append . ' GROUP BY ep.uid', $eid); $uf = new UserFilter(new UFC_True(), $tri); @@ -152,8 +152,8 @@ function get_event_participants(&$evt, $item_id, array $tri = array(), $count = } $u['telepayment'] = $u['paid'] - $u['adminpaid']; $res_ = XDB::iterator('SELECT ep.nb, ep.item_id, ei.montant - FROM #groupex#.evenements_participants AS ep - INNER JOIN #groupex#.evenements_items AS ei ON (ei.eid = ep.eid AND ei.item_id = ep.item_id) + FROM group_event_participants AS ep + INNER JOIN group_event_items AS ei ON (ei.eid = ep.eid AND ei.item_id = ep.item_id) WHERE ep.eid = {?} AND ep.uid = {?}', $eid, $uid); while ($i = $res_->next()) { @@ -185,7 +185,7 @@ function subscribe_lists_event($participate, $uid, $evt, $paid, $payment = null) $email = $user->forlifeEmail(); } else { $res = XDB::query("SELECT email - FROM #groupex#.membres + FROM group_members WHERE uid = {?} AND asso_id = {?}", $uid, $globals->asso('id')); $email = $res->fetchOneCell(); @@ -226,7 +226,9 @@ function subscribe_lists_event($participate, $uid, $evt, $paid, $payment = null) subscribe($payed_list, $email); } else { unsubscribe($payed_list, $email); - subscribe($unpayed_list, $email); + if (!is_null($participate)) { + subscribe($unpayed_list, $email); + } } } // }}} @@ -256,7 +258,7 @@ function event_change_shortname(&$page, $eid, $old, $new) //vérifier que l'alias n'est pas déja pris if ($new && $old != $new) { $res = XDB::query('SELECT COUNT(*) - FROM #groupex#.evenements + FROM group_events WHERE short_name = {?}', $new); if ($res->fetchOneCell() > 0) { @@ -301,7 +303,7 @@ function event_change_shortname(&$page, $eid, $old, $new) foreach (array('-participants@', '-paye@', '-participants-non-paye@') as $v) { XDB::execute("INSERT IGNORE INTO virtual_redirect ( SELECT {?} AS vid, IF(al.alias IS NULL, a.email, CONCAT(al.alias, {?})) AS redirect - FROM #groupex#.evenements_participants AS ep + FROM group_event_participants AS ep LEFT JOIN #x4dat#.accounts AS a ON (ep.uid = a.uid) LEFT JOIN #x4dat#.aliases AS al ON (al.id = a.uid AND al.type = 'a_vie') WHERE ep.eid = {?} AND " . $where[$v] . " @@ -310,10 +312,10 @@ function event_change_shortname(&$page, $eid, $old, $new) } XDB::execute("INSERT IGNORE INTO virtual_redirect ( SELECT {?} AS vid, IF(al.alias IS NULL, a.email, CONCAT(al.alias, {?})) AS redirect - FROM #groupex#.membres AS m + FROM group_members AS m LEFT JOIN #x4dat#.accounts AS a ON (a.uid = m.uid) LEFT JOIN #x4dat#.aliases AS al ON (al.id = a.uid AND al.type = 'a_vie') - LEFT JOIN #groupex#.evenements_participants AS ep ON (ep.uid = m.uid AND ep.eid = {?}) + LEFT JOIN group_event_participants AS ep ON (ep.uid = m.uid AND ep.eid = {?}) WHERE m.asso_id = {?} AND ep.uid IS NULL GROUP BY m.uid)", $lastid['-absents@'], '@' . $globals->mail->domain, $eid, $globals->asso('id'));