X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment.php;h=9de57d159a88bbfefa501b0ac06b5e8c60368830;hb=47fa97fed308292ab5e7bed6f870b39f55747aa8;hp=d71b26d02356f4a71fab1827b9ffc82178cdc1db;hpb=45a5307bafca8cee103f8d31e22984db81c28e7a;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index d71b26d..9de57d1 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -1,6 +1,6 @@ addTo($globals->money->email); $mymail->setFrom("webmaster@" . $globals->mail->domain); @@ -33,7 +34,7 @@ function cb_erreur($text) { /* sort en affichant une erreur */ function paypal_erreur($text, $send=true) { - global $page, $erreur; + global $page, $erreur, $globals; if ($erreur) return; $erreur = $text; if (!$send) return; @@ -45,7 +46,7 @@ function paypal_erreur($text, $send=true) $mymail->setTxtBody("\n\n".var_export($_REQUEST,true)); $mymail->send(); - $page->trig($text); + $page->trigError($text); } /* http://fr.wikipedia.org/wiki/Formule_de_Luhn */ @@ -71,6 +72,16 @@ function cle_accept($d1,$d2,$d3,$d4,$d5) return $alpha{$n-1}.$m1.$m2.$m3.$m4; } +/* decode the comment */ +function comment_decode($comment) { + $comment = urldecode($comment); + if (is_utf8($comment)) { + return $comment; + } else { + return utf8_encode($comment); + } +} + class PaymentModule extends PLModule { @@ -117,13 +128,13 @@ class PaymentModule extends PLModule $pay = new Payment($ref); if($pay->flags->hasflag('old')){ - $page->trig("La transaction selectionnée est périmée."); + $page->trigError("La transaction selectionnée est périmée."); $pay = new Payment(); } $val = Env::v('montant') != 0 ? Env::v('montant') : $pay->montant_def; if (($e = $pay->check($val)) !== true) { - $page->trig($e); + $page->trigError($e); } if ($op=='submit') { @@ -218,6 +229,7 @@ class PaymentModule extends PLModule $conf_text = str_replace("",$femme ? "Chère" : "Cher",$conf_text); $conf_text = str_replace("",$femme ? "Chère" : "Cher",$conf_text); + global $globals; $mymail = new PlMailer(); $mymail->setFrom($conf_mail); $mymail->addTo("\"$prenom $nom\" <$forlife@" . $globals->mail->domain . '>'); @@ -307,6 +319,7 @@ class PaymentModule extends PLModule $conf_text = str_replace("",$femme ? "Chère" : "Cher",$conf_text); $conf_text = str_replace("",$femme ? "Chère" : "Cher",$conf_text); + global $globals; $mymail = new PlMailer(); $mymail->setFrom($conf_mail); $mymail->addTo("\"$prenom $nom\" <$forlife@" . $globals->mail->domain . '>'); @@ -448,6 +461,7 @@ class PaymentModule extends PLModule $event[$pid]['paid'] += trim($p); } } + $page->register_modifier('decode_comment', 'decode_comment'); $page->assign('trans', $trans); $page->assign('event', $event); }