From 781c92a20c583a5081a3c8ac4f09b5bb33b494d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 15 Nov 2010 23:23:17 +0100 Subject: [PATCH] Fix payment-related lists (Closes #1291, #1295, 1314) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also fixes a minor bug with the "" tag in sent emails. Signed-off-by: Raphaël Barrois --- modules/payment.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/payment.php b/modules/payment.php index 8804a4f..b319240 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -310,15 +310,16 @@ class PaymentModule extends PLModule $res = XDB::query("SELECT mail, text, confirmation FROM payments WHERE id={?}", $ref); - if (!list($conf_mail, $conf_title, $conf_text) = $res->fetchOneRow()) { + if ($res->numRows() != 1) { cb_erreur("référence de commande inconnue"); } + list($conf_mail, $conf_title, $conf_text) = $res->fetchOneRow(); /* on extrait le montant */ if (Env::v('vads_currency') != "978") { cb_erreur("monnaie autre que l'euro"); } - $montant = sprintf("%.02f", ((float)Env::v('vads_amount'))/100) . " EUR"; + $montant = sprintf("%.02f", ((float)Env::v('vads_amount'))/100); /* on extrait le code de retour */ if (Env::v('vads_result') != "00") { @@ -335,7 +336,8 @@ class PaymentModule extends PLModule $res = XDB::query('SELECT eid FROM group_events WHERE paiement_id = {?}', $ref); - if ($eid = $res->fetchOneCell()) { + if ($res->numRows() == 1) { + $eid = $res->fetchOneCell(); require_once dirname(__FILE__) . '/xnetevents/xnetevents.inc.php'; $evt = get_event_detail($eid); subscribe_lists_event($user->id(), $evt, 1, $montant, true); @@ -343,7 +345,7 @@ class PaymentModule extends PLModule /* on genere le mail de confirmation */ $conf_text = str_replace( - array('', '', '', '', '', '', 'comment>'), + array('', '', '', '', '', '', ''), array($user->firstName(), $user->lastName(), $user->promo(), $montant, $user->isFemale() ? 'Chère' : 'Cher', $user->isFemale() ? 'Chère' : 'Cher', Env::v('comment')), $conf_text); -- 2.1.4