projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix networking display on profiles
[platal.git]
/
modules
/
xnetevents.php
diff --git
a/modules/xnetevents.php
b/modules/xnetevents.php
index
f99e8e8
..
0523d5e
100644
(file)
--- a/
modules/xnetevents.php
+++ b/
modules/xnetevents.php
@@
-154,8
+154,8
@@
class XnetEventsModule extends PLModule
}
$query = XDB::query(
}
$query = XDB::query(
- "SELECT
monta
nt
- FROM
{$globals->money->mpay_tprefix}
transactions AS t
+ "SELECT
amou
nt
+ FROM
payment_
transactions AS t
WHERE ref = {?} AND uid = {?}", $e['paiement_id'], S::v('uid'));
$montants = $query->fetchColumn();
WHERE ref = {?} AND uid = {?}", $e['paiement_id'], S::v('uid'));
$montants = $query->fetchColumn();
@@
-477,7
+477,7
@@
class XnetEventsModule extends PLModule
// get a list of all the payment for this asso
$res = XDB::iterator("SELECT id, text
// get a list of all the payment for this asso
$res = XDB::iterator("SELECT id, text
- FROM
{$globals->money->mpay_tprefix}paie
ments
+ FROM
pay
ments
WHERE asso_id = {?}", $globals->asso('id'));
$paiements = array();
while ($a = $res->next()) $paiements[$a['id']] = $a['text']; {
WHERE asso_id = {?}", $globals->asso('id'));
$paiements = array();
while ($a = $res->next()) $paiements[$a['id']] = $a['text']; {
@@
-577,7
+577,14
@@
class XnetEventsModule extends PLModule
GROUP BY uid",
$member->uid, $evt['eid']);
$u = $res->fetchOneAssoc();
GROUP BY uid",
$member->uid, $evt['eid']);
$u = $res->fetchOneAssoc();
- $u = $u['cnt'] ? $u['nb'] : null;
+ if ($u['cnt'] == 1 && $paid == 0 && Post::v('cancel')) {
+ XDB::execute("DELETE FROM group_event_participants
+ WHERE uid = {?} AND eid = {?}",
+ $member->uid, $evt['eid']);
+ $u = 0;
+ } else {
+ $u = $u['cnt'] ? $u['nb'] : null;
+ }
subscribe_lists_event($u, $member->uid, $evt, $paid);
}
subscribe_lists_event($u, $member->uid, $evt, $paid);
}
@@
-593,8
+600,8
@@
class XnetEventsModule extends PLModule
if ($evt['paiement_id']) {
$infos = User::getBulkUsersWithUIDs(
if ($evt['paiement_id']) {
$infos = User::getBulkUsersWithUIDs(
- XDB::fetchAllAssoc('SELECT t.uid, t.
monta
nt
- FROM
' . $globals->money->mpay_tprefix . '
transactions AS t
+ XDB::fetchAllAssoc('SELECT t.uid, t.
amou
nt
+ FROM
payment_
transactions AS t
LEFT JOIN group_event_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
WHERE t.ref = {?} AND ep.uid IS NULL',
$evt['eid'], $evt['paiement_id']),
LEFT JOIN group_event_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
WHERE t.ref = {?} AND ep.uid IS NULL',
$evt['eid'], $evt['paiement_id']),