X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fpaiements.inc.php;h=074c690cc27a70d22fd9cf7b9a6279384eaa1bfb;hb=34cfa5f470d5b6e1c1606f2784d63c83671db811;hp=0a3a9e4cb6c95515fc3404406a23df201c948a75;hpb=08cce2ff528b38bde27cdec6d6bc28d6af4a42d4;p=platal.git diff --git a/include/validations/paiements.inc.php b/include/validations/paiements.inc.php index 0a3a9e4..074c690 100644 --- a/include/validations/paiements.inc.php +++ b/include/validations/paiements.inc.php @@ -41,12 +41,13 @@ class PayReq extends Validate var $rules = "Laisser la validation à un trésorier"; // }}} // {{{ constructor - - function PayReq($_uid, $_intitule, $_site, $_montant, $_msg, $_montantmin=0, $_montantmax=999, $_asso_id = 0, $_evt = 0, $_stamp=0) + + function PayReq($_uid, $_intitule, $_site, $_montant, $_msg, + $_montantmin=0, $_montantmax=999, $_asso_id = 0, + $_evt = 0, $_stamp=0) { - global $globals; $this->Validate($_uid, false, 'paiements', $_stamp); - + $this->titre = $_intitule; $this->site = $_site; $this->msg_reponse = $_msg; @@ -68,7 +69,7 @@ class PayReq extends Validate // }}} // {{{ function same_event() - function same_event($evt, $asso_id) + static function same_event($evt, $asso_id) { $wevt = 's:3:"evt";s:'.strlen($evt+"").':"'.$evt.'"'; $wassoid = 's:7:"asso_id";s:'.strlen($asso_id + "").':"'.$asso_id.'"'; @@ -80,7 +81,6 @@ class PayReq extends Validate // supprime les demandes de paiments pour le meme evenement function submit() { - global $globals; if ($this->evt) { XDB::execute('DELETE FROM requests WHERE type={?} AND data LIKE {?}', 'paiements', PayReq::same_event($this->evt, $this->asso_id)); @@ -94,6 +94,28 @@ class PayReq extends Validate { return 'include/form.valid.paiements.tpl'; } // }}} + // {{{ function editor() + + function editor() + { + return 'include/form.valid.edit-paiements.tpl'; + } + + // }}} + // {{{ function handle_editor() + + function handle_editor() + { + $this->titre = Env::v('pay_titre'); + $this->site = Env::v('pay_site'); + $this->montant = Env::i('pay_montant'); + $this->montant_min = Env::i('pay_montant_min'); + $this->montant_max = Env::i('pay_montant_max'); + $this->msg_reponse = Env::v('pay_msg_reponse'); + return true; + } + + // }}} // {{{ function _mail_subj function _mail_subj()