X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment.php;h=8ce2dbc2dc2f0347f49ddf126a2076bd9e035dee;hb=d655dba1a05100bdd309200eb20409e848abf98c;hp=b4d3b69981fafcbf7621f33b115edb816ebe63b6;hpb=924231449d16c87d373b7cce27efcf787ee3dcbc;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index b4d3b69..8ce2dbc 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -77,8 +77,8 @@ class PaymentModule extends PLModule { return array( 'payment' => $this->make_hook('payment', AUTH_MDP), - 'payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUB), - 'payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUB), + 'payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC), + 'payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC), 'admin/payments' => $this->make_hook('admin', AUTH_MDP, 'admin'), ); } @@ -88,7 +88,7 @@ class PaymentModule extends PLModule global $globals; require_once 'profil.func.inc.php' ; - require_once 'money.inc.php' ; + require_once dirname(__FILE__).'/payment/money.inc.php' ; $page->changeTpl('payment/index.tpl'); $page->assign('xorg_title','Polytechnique.org - Télépaiements'); @@ -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); @@ -316,11 +317,13 @@ class PaymentModule extends PLModule $page->assign('erreur', $erreur); } function handler_admin(&$page, $action = 'list', $id = null) { - require_once('../classes/PLTableEditor.php'); $page->assign('xorg_title','Polytechnique.org - Administration - Paiements'); $page->assign('title', 'Gestion des télépaiements'); $table_editor = new PLTableEditor('admin/payments','paiement.paiements','id'); $table_editor->add_join_table('paiement.transactions','ref',true); + $table_editor->add_sort_field('flags'); + $table_editor->add_sort_field('id', true, true); + $table_editor->on_delete("UPDATE paiement.paiements SET flags = 'old' WHERE id = {?}", "Le paiement a été archivé"); $table_editor->describe('text','intitulé',true); $table_editor->describe('url','site web',false); $table_editor->describe('montant_def','montant par défaut',false);