projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes address search.
[platal.git]
/
modules
/
xnetevents
/
xnetevents.inc.php
diff --git
a/modules/xnetevents/xnetevents.inc.php
b/modules/xnetevents/xnetevents.inc.php
index
cc95c4d
..
fd92d22
100644
(file)
--- a/
modules/xnetevents/xnetevents.inc.php
+++ b/
modules/xnetevents/xnetevents.inc.php
@@
-27,11
+27,11
@@
function get_event_detail($eid, $item_id = false, $asso_id = null)
if (is_null($asso_id)) {
$asso_id = $globals->asso('id');
}
if (is_null($asso_id)) {
$asso_id = $globals->asso('id');
}
- $evt = XDB::fetchOneAssoc('SELECT SUM(nb) AS nb_tot, COUNT(DISTINCT ep.uid) AS nb, e.*,
+ $evt = XDB::fetchOneAssoc('SELECT SUM(nb) AS nb_tot, COUNT(DISTINCT ep.uid) AS nb, e.*,
SUM(IF(nb > 0, 1, 0)) AS user_count,
IF(e.deadline_inscription,
e.deadline_inscription >= LEFT(NOW(), 10),
1) AS inscr_open,
IF(e.deadline_inscription,
e.deadline_inscription >= LEFT(NOW(), 10),
1) AS inscr_open,
- LEFT(
10, e.debut) AS start_day, LEFT(10, e.fin
) AS last_day,
+ LEFT(
e.debut, 10) AS first_day, LEFT(e.fin, 10
) AS last_day,
LEFT(NOW(), 10) AS now,
ei.titre, e.subscription_notification
FROM group_events AS e
LEFT(NOW(), 10) AS now,
ei.titre, e.subscription_notification
FROM group_events AS e
@@
-59,6
+59,9
@@
function get_event_detail($eid, $item_id = false, $asso_id = null)
$evt['nb_tot'] = array_sum($res->fetchColumn());
$evt['titre'] = '';
$evt['item_id'] = 0;
$evt['nb_tot'] = array_sum($res->fetchColumn());
$evt['titre'] = '';
$evt['item_id'] = 0;
+ $evt['csv_name'] = urlencode($evt['intitule']);
+ } else {
+ $evt['csv_name'] = urlencode($evt['intitule'] . '.' . $evt['titre']);
}
$evt['moments'] = XDB::fetchAllAssoc('SELECT titre, details, montant, ei.item_id, nb,
}
$evt['moments'] = XDB::fetchAllAssoc('SELECT titre, details, montant, ei.item_id, nb,
@@
-76,25
+79,21
@@
function get_event_detail($eid, $item_id = false, $asso_id = null)
if ($m['montant']) {
$evt['money'] = true;
}
if ($m['montant']) {
$evt['money'] = true;
}
- $evt['paid']
= $m['paid'];
+ $evt['paid']
+
= $m['paid'];
$evt['notify_payment'] = $evt['notify_payment'] || $m['notify_payment'];
}
$evt['notify_payment'] = $evt['notify_payment'] || $m['notify_payment'];
}
- $montant
s = XDB::fetchColumn('SELECT
amount
+ $montant
= XDB::fetchOneCell('SELECT SUM(amount) AS sum_
amount
FROM payment_transactions AS t
WHERE ref = {?} AND uid = {?}',
$evt['paiement_id'], S::v('uid'));
FROM payment_transactions AS t
WHERE ref = {?} AND uid = {?}',
$evt['paiement_id'], S::v('uid'));
- $evt['telepaid'] = 0;
- foreach ($montants as $m) {
- $p = strtr(substr($m, 0, strpos($m, 'EUR')), ',', '.');
- $evt['paid'] += trim($p);
- $evt['telepaid'] += trim($p);
- }
+ $evt['telepaid'] = $montant;
+ $evt['paid'] += $montant;
$evt['organizer'] = User::getSilent($evt['uid']);
make_event_date($evt);
$evt['organizer'] = User::getSilent($evt['uid']);
make_event_date($evt);
- $evt['show_participants'] = ($evt['show_participants'] && (is_member() || may_update()));
+ $evt['show_participants'] = ($evt['show_participants'] &&
$GLOBALS['IS_XNET_SITE'] &&
(is_member() || may_update()));
return $evt;
}
return $evt;
}
@@
-102,7
+101,7
@@
function get_event_detail($eid, $item_id = false, $asso_id = null)
// }}}
// {{{ function get_event_participants()
// }}}
// {{{ function get_event_participants()
-function get_event_participants(&$evt, $item_id, array $tri = array(), $limit = null)
+function get_event_participants(&$evt, $item_id, array $tri = array(), $limit = null
, $offset = 0
)
{
global $globals;
{
global $globals;
@@
-117,7
+116,7
@@
function get_event_participants(&$evt, $item_id, array $tri = array(), $limit =
WHERE ep.eid = {?} AND nb > 0 ' . $append . '
GROUP BY ep.uid', $eid);
$uf = new UserFilter(new PFC_True(), $tri);
WHERE ep.eid = {?} AND nb > 0 ' . $append . '
GROUP BY ep.uid', $eid);
$uf = new UserFilter(new PFC_True(), $tri);
- $users = User::getBulkUsersWithUIDs($uf->filter(array_keys($query), new PlLimit($
coun
t, $offset)));
+ $users = User::getBulkUsersWithUIDs($uf->filter(array_keys($query), new PlLimit($
limi
t, $offset)));
$tab = array();
foreach ($users as $user) {
$uid = $user->id();
$tab = array();
foreach ($users as $user) {
$uid = $user->id();
@@
-137,14
+136,11
@@
function get_event_participants(&$evt, $item_id, array $tri = array(), $limit =
$u['adminpaid'] = $u['paid'];
$u['montant'] = 0;
if ($money && $pay_id) {
$u['adminpaid'] = $u['paid'];
$u['montant'] = 0;
if ($money && $pay_id) {
- $montant
s = XDB::fetchColumn('SELECT amount
+ $montant
= XDB::fetchOneCell('SELECT SUM(amount)
FROM payment_transactions AS t
WHERE ref = {?} AND uid = {?}',
$pay_id, $uid);
FROM payment_transactions AS t
WHERE ref = {?} AND uid = {?}',
$pay_id, $uid);
- foreach ($montants as $m) {
- $p = strtr(substr($m, 0, strpos($m, "EUR")), ",", ".");
- $u['paid'] += trim($p);
- }
+ $u['paid'] += $montant;
}
$u['telepayment'] = $u['paid'] - $u['adminpaid'];
$res_ = XDB::iterator('SELECT ep.nb, ep.item_id, ei.montant
}
$u['telepayment'] = $u['paid'] - $u['adminpaid'];
$res_ = XDB::iterator('SELECT ep.nb, ep.item_id, ei.montant
@@
-279,20
+275,23
@@
function event_change_shortname($page, $eid, $old, $new)
// if we have a first new short_name create the lists
$lastid = array();
$where = array(
// if we have a first new short_name create the lists
$lastid = array();
$where = array(
- $globals->xnet->participant_list => 'nb > 0',
- $globals->xnet->payed_list => '
paid > 0
',
- $globals->xnet->unpayed_list => '
nb > 0 AND paid = 0
'
+ $globals->xnet->participant_list => '
g.
nb > 0',
+ $globals->xnet->payed_list => '
(g.paid > 0 OR p.amount > 0)
',
+ $globals->xnet->unpayed_list => '
g.nb > 0 AND g.paid = 0 AND p.amount IS NULL
'
);
foreach (array($globals->xnet->participant_list, $globals->xnet->payed_list, $globals->xnet->unpayed_list) as $suffix) {
);
foreach (array($globals->xnet->participant_list, $globals->xnet->payed_list, $globals->xnet->unpayed_list) as $suffix) {
- $uids = XDB::fetchColumn('SELECT uid
- FROM group_event_participants
- WHERE eid = {?} AND ' . $where[$suffix],
+ $uids = XDB::fetchColumn('SELECT g.uid
+ FROM group_event_participants AS g
+ INNER JOIN group_events AS e ON (g.eid = e.eid)
+ LEFT JOIN payment_transactions AS p ON (e.paiement_id = p.ref AND g.uid = p.uid)
+ WHERE g.eid = {?} AND ' . $where[$suffix],
$eid);
foreach ($uids as $uid) {
add_to_list_alias($uid, $new . $suffix, $globals->xnet->evts_domain, 'event');
}
}
$eid);
foreach ($uids as $uid) {
add_to_list_alias($uid, $new . $suffix, $globals->xnet->evts_domain, 'event');
}
}
+
$uids = XDB::fetchColumn('SELECT m.uid
FROM group_members AS m
LEFT JOIN group_event_participants AS e ON (e.uid = m.uid AND e.eid = {?})
$uids = XDB::fetchColumn('SELECT m.uid
FROM group_members AS m
LEFT JOIN group_event_participants AS e ON (e.uid = m.uid AND e.eid = {?})
@@
-324,9
+323,8
@@
function make_event_date(&$e)
{
$start = strtotime($e['debut']);
$end = strtotime($e['fin']);
{
$start = strtotime($e['debut']);
$end = strtotime($e['fin']);
- $first_day = @strtotime($e['first_day']);
- $last_day = strtotime($e['last_day']);
- unset($e['debut'], $e['fin'], $e['first_day'], $e['last_day']);
+ $first_day = $e['first_day'];
+ $last_day = $e['last_day'];
$date = "";
if ($start && $end != $start) {
$date = "";
if ($start && $end != $start) {