X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment.php;h=8ce2dbc2dc2f0347f49ddf126a2076bd9e035dee;hb=d655dba1a05100bdd309200eb20409e848abf98c;hp=137bbecc67749682586a12bbeb3858abf7b4a6da;hpb=42a50827dc2ac2b13ddaf77ea16c0989cd8b960d;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index 137bbec..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'), ); } @@ -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); @@ -321,6 +322,8 @@ class PaymentModule extends PLModule $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);