From bff6d838583f08251b39bf8626fab7684376c935 Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Sat, 18 Nov 2006 23:36:53 +0000 Subject: [PATCH] en partie #155 : ajoute un commentaire pour les paiements git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1106 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 3 +++ modules/payment.php | 13 +++++++------ modules/payment/money/cyberpaiement.inc.php | 2 +- modules/payment/money/paypal.inc.php | 6 +++--- templates/payment/index.tpl | 12 +++++++++++- upgrade/0.9.12/04_paiement.sql | 1 + 6 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 upgrade/0.9.12/04_paiement.sql diff --git a/ChangeLog b/ChangeLog index cb0a04d..6e14b7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,9 @@ Bug/Wish: - #520: Can moderate several mails at once -FRU - #532: Fix case sensitivity issues in emails processing. -FRU + * Payment: + - #155: Add a free comment for payments. -Car + * Profile: - #385: Add section, binets and groupes-X in vCard. -FRU - #451: vCard are RFC compliant. -FRU diff --git a/modules/payment.php b/modules/payment.php index ff5c432..8ce2dbc 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -123,6 +123,7 @@ class PaymentModule extends PLModule $val = floor($val).".".substr(floor(($val - floor($val))*100+100),1); $page->assign('montant',$val); + $page->assign('comment',Env::v('comment')); $page->assign('meth', $meth); $page->assign('pay', $pay); @@ -188,9 +189,9 @@ class PaymentModule extends PLModule } /* on fait l'insertion en base de donnees */ - XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle) - VALUES ({?},{?},{?},{?},{?},{?})", - $champ901, $uid, $ref, $champ200, $montant, $champ905); + XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle,comment) + VALUES ({?},{?},{?},{?},{?},{?},{?})", + $champ901, $uid, $ref, $champ200, $montant, $champ905,Env::v('comment')); /* on genere le mail de confirmation */ $conf_text = str_replace("",$prenom,$conf_text); @@ -277,9 +278,9 @@ class PaymentModule extends PLModule } /* on fait l'insertion en base de donnees */ - XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle) - VALUES ({?},{?},{?},{?},{?},{?})", - $no_transaction, $uid, $ref, $fullref, $montant, $clef); + XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle,comment) + VALUES ({?},{?},{?},{?},{?},{?},{?})", + $no_transaction, $uid, $ref, $fullref, $montant, $clef, Env::v('comment')); /* on genere le mail de confirmation */ $conf_text = str_replace("",$prenom,$conf_text); diff --git a/modules/payment/money/cyberpaiement.inc.php b/modules/payment/money/cyberpaiement.inc.php index 0030fc5..9a35d41 100644 --- a/modules/payment/money/cyberpaiement.inc.php +++ b/modules/payment/money/cyberpaiement.inc.php @@ -48,7 +48,7 @@ class CyberPayment global $globals; $roboturl = str_replace("https://","http://",$globals->baseurl) - ."/payment/cyber_return/".S::v('uid')."?CHAMPBPX"; + ."/payment/cyber_return/".S::v('uid')."?comment=".urlencode(Env::v('comment'))."&CHAMPBPX"; if (Cookie::has(session_name())) { $returnurl .= "?".SID; } diff --git a/modules/payment/money/paypal.inc.php b/modules/payment/money/paypal.inc.php index 910c016..edc5924 100644 --- a/modules/payment/money/paypal.inc.php +++ b/modules/payment/money/paypal.inc.php @@ -56,7 +56,7 @@ class PayPal $name = $req->fetchOneCell(); $roboturl = str_replace("https://","http://",$globals->baseurl) - ."/payment/paypal_return/".S::v('uid'); + ."/payment/paypal_return/".S::v('uid')."?comment=".urlencode(Env::v('comment')); $this->infos = Array(); @@ -78,9 +78,9 @@ class PayPal a.city, a.postcode AS zip, a.country, IF(t.tel, t.tel, q.profile_mobile) AS night_phone_b FROM auth_user_quick AS q - LEFT JOIN adresses AS a ON (q.user_id = a.uid) + LEFT JOIN adresses AS a ON (q.user_id = a.uid AND FIND_IN_SET('active', a.statut)) LEFT JOIN tels AS t ON (t.uid = a.uid AND t.adrid = a.adrid) - WHERE q.user_id = {?} AND FIND_IN_SET('active', a.statut) + WHERE q.user_id = {?} LIMIT 1", S::v('uid')); $this->infos['client']=array_merge($info_client, $res->fetchOneAssoc()); diff --git a/templates/payment/index.tpl b/templates/payment/index.tpl index 0fccf8c..a2726b3 100644 --- a/templates/payment/index.tpl +++ b/templates/payment/index.tpl @@ -37,6 +37,12 @@ Montant (euros) {$montant} +{if $comment} + + Commentaire + {$comment} + +{/if}   @@ -98,7 +104,7 @@ function payment_submit(form)

Si tu ne souhaites pas utiliser notre interface de télépaiement, tu peux virer directement la somme de ton choix sur notre compte - 30004 00314 00010016782 60. Nous veillerons à ce que ton paiement parvienne à + 30004 00314 00010016782 60. Nous veillerons à ce que ton paiement parvienne à son destinataire. Pense toutefois à le préciser dans le motif du versement.

@@ -132,6 +138,10 @@ function payment_submit(form) + Commentaire + + +   diff --git a/upgrade/0.9.12/04_paiement.sql b/upgrade/0.9.12/04_paiement.sql new file mode 100644 index 0000000..ffcd486 --- /dev/null +++ b/upgrade/0.9.12/04_paiement.sql @@ -0,0 +1 @@ +ALTER TABLE paiement.transactions ADD `comment` VARCHAR(255) NOT NULL DEFAULT ''; -- 2.1.4