From: Stéphane Jacob Date: Mon, 19 Sep 2011 21:43:18 +0000 (+0200) Subject: Enables creation of public payments. X-Git-Tag: xorg/1.1.4~160 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;ds=sidebyside;h=0a9d877e8f1cb83f1883eb388c362936170bce95;p=platal.git Enables creation of public payments. Signed-off-by: Stéphane Jacob --- diff --git a/include/validations/paiements.inc.php b/include/validations/paiements.inc.php index 448167e..2ec3a98 100644 --- a/include/validations/paiements.inc.php +++ b/include/validations/paiements.inc.php @@ -37,6 +37,7 @@ class PayReq extends Validate public $asso; public $evt; public $evt_intitule; + public $public; public $rules = "Vérifier que les balises <salutation>, <prenom>, <nom>, <montant> et <comment> n'ont pas été modifiées. Vérifier que le demandeur n'a pas laissé les crochets []. @@ -46,7 +47,7 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais public function __construct(User $_user, $_intitule, $_site, $_montant, $_msg, $_montantmin=0, $_montantmax=999, $_asso_id = 0, - $_evt = 0, $_stamp=0) + $_evt = 0, $_public = false, $_stamp = 0) { parent::__construct($_user, false, 'paiements', $_stamp); @@ -58,6 +59,7 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais $this->montant = $_montant; $this->montant_min = $_montantmin; $this->montant_max = $_montantmax; + $this->public = $_public; if ($_asso_id) { $res = XDB::query("SELECT nom FROM groups WHERE id = {?}", $_asso_id); @@ -137,6 +139,7 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais $this->montant_min = Env::i('pay_montant_min'); $this->montant_max = Env::i('pay_montant_max'); $this->msg_reponse = Env::v('pay_msg_reponse'); + $this->public = (Env::v('pay_public') == 'yes'); return true; } @@ -167,10 +170,11 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais { $res = XDB::query("SELECT MAX(id) FROM payments"); $id = $res->fetchOneCell()+1; - $ret = XDB::execute('INSERT INTO payments (id, text, url, amount_def, amount_min, amount_max, mail, confirmation, asso_id) - VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', + $ret = XDB::execute('INSERT INTO payments (id, text, url, amount_def, amount_min, amount_max, mail, confirmation, asso_id, flags) + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})', $id, $this->titre, $this->site, $this->montant, $this->montant_min, - $this->montant_max, $this->user->bestEmail(), $this->msg_reponse, $this->asso_id); + $this->montant_max, $this->user->bestEmail(), $this->msg_reponse, $this->asso_id, + ($this->public ? 'public' : '')); if ($this->asso_id && $this->evt) { XDB::execute("UPDATE group_events SET paiement_id = {?} diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 480ced4..60a8460 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -463,7 +463,7 @@ class XnetEventsModule extends PLModule Post::v('intitule')." - ".$globals->asso('nom'), Post::v('site'), $money_defaut, Post::v('confirmation'), 0, 999, - $globals->asso('id'), $eid); + $globals->asso('id'), $eid, Post::v('payment_public') == 'yes'); if ($p->accept()) { $p->submit(); } else { diff --git a/templates/include/form.valid.edit-paiements.tpl b/templates/include/form.valid.edit-paiements.tpl index 4d91d37..bd9da07 100644 --- a/templates/include/form.valid.edit-paiements.tpl +++ b/templates/include/form.valid.edit-paiements.tpl @@ -31,5 +31,10 @@ Montant : (min  ->  max ) +
+Public : + + -  +
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/include/form.valid.paiements.tpl b/templates/include/form.valid.paiements.tpl index 58f5663..50080d3 100644 --- a/templates/include/form.valid.paiements.tpl +++ b/templates/include/form.valid.paiements.tpl @@ -59,4 +59,9 @@ {/if} {/if} + + Public : + {if $valid->public}Oui{else}Non{/if} + + {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/xnetevents/edit.tpl b/templates/xnetevents/edit.tpl index 99292bc..654aef5 100644 --- a/templates/xnetevents/edit.tpl +++ b/templates/xnetevents/edit.tpl @@ -201,6 +201,11 @@ Ton inscription à [METS LE NOM DE L'ÉVÉNEMENT ICI] a bien été enregistrée {$profile->fullName("promo")}{/if}
{assign var='asso_url' value=$globals->baseurl|cat:'/'|cat:$platal->ns} Page internet de l'événement :
+ Rendre public le télépaiement : + +  -  +
+ Attention : cela aura pour effet de rendre accessible ce télépaiement à tout le monde, même aux personnes non connectées.
Le nouveau paiement sera activé automatiquement après validation par le trésorier de Polytechnique.org, ce qui sera fait sous peu.