From 6aa01fedfab0164e6b2c02289b715c2c522e94b2 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Wed, 27 Sep 2006 13:57:31 +0000 Subject: [PATCH] #468: can edit nl, events and payment requests before validation git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@918 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 9 +++++-- include/validations.inc.php | 18 ++++++++++++++ include/validations/evts.inc.php | 19 ++++++++++++++ include/validations/nl.inc.php | 19 ++++++++++++++ include/validations/paiements.inc.php | 22 +++++++++++++++++ templates/admin/valider.tpl | 16 ++++++++++++ templates/include/form.valid.edit-evts.tpl | 32 ++++++++++++++++++++++++ templates/include/form.valid.edit-nl.tpl | 29 ++++++++++++++++++++++ templates/include/form.valid.edit-paiements.tpl | 33 +++++++++++++++++++++++++ templates/include/form.valid.evts.tpl | 10 ++++---- 10 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 templates/include/form.valid.edit-evts.tpl create mode 100644 templates/include/form.valid.edit-nl.tpl create mode 100644 templates/include/form.valid.edit-paiements.tpl diff --git a/ChangeLog b/ChangeLog index f3a8b85..a60352a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ ================================================================================ -VERSION 0.9.11 ?? ?? 2006 +VERSION 0.9.12 ?? ?? 2006 -From 0.9.10 branch: +Bug/Wish: + + * Admin: + - #468: Can edit requests before validation -FRU + +From 0.9.11 branch: * Payment: - #482: fix action in the form. -MC diff --git a/include/validations.inc.php b/include/validations.inc.php index b3dddb1..4415ebc 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -67,6 +67,7 @@ class Validate var $unique; // enable the refuse button var $refuse = true; + var $type; var $comments = Array(); // the validations rules : comments for admins @@ -156,6 +157,16 @@ class Validate return true; } + // mise à jour des informations + if (Env::has('edit')) { + if ($this->handle_editor()) { + $this->update(); + $this->trig('requête mise à jour'); + return true; + } + return false; + } + // ajout d'un commentaire if (Env::has('hold') && Env::has('comm')) { $formid = Env::i('formid'); @@ -300,6 +311,13 @@ class Validate { return null; } // }}} + // {{{ function editor() + + /** nom du formulaire d'édition */ + function editor() + { return null; } + + // }}} // {{{ function answers() /** automatic answers table for this type of validation */ diff --git a/include/validations/evts.inc.php b/include/validations/evts.inc.php index 3d7f5fc..01c5658 100644 --- a/include/validations/evts.inc.php +++ b/include/validations/evts.inc.php @@ -53,6 +53,25 @@ class EvtReq extends Validate { return 'include/form.valid.evts.tpl'; } // }}} + // {{{ functon editor() + + function editor() + { return 'include/form.valid.edit-evts.tpl'; } + + // }}} + // {{{ function handle_editor() + + function handle_editor() + { + $this->titre = Env::v('titre'); + $this->texte = Env::v('texte'); + $this->pmin = Env::i('promo_min'); + $this->pmax = Env::i('promo_max'); + $this->peremption = Env::v('peremption'); + return true; + } + + // }}} // {{{ function _mail_subj function _mail_subj() diff --git a/include/validations/nl.inc.php b/include/validations/nl.inc.php index bd27e71..447c199 100644 --- a/include/validations/nl.inc.php +++ b/include/validations/nl.inc.php @@ -47,6 +47,25 @@ class NLReq extends Validate } // }}} + // {{{ function editor() + + function editor() + { + return 'include/form.valid.edit-nl.tpl'; + } + + // }}} + // {{{ function handle_editor() + + function handle_editor() + { + $this->art->_body = Env::v('nl_body'); + $this->art->_title = Env::v('nl_title'); + $this->art->_append = Env::v('nl_append'); + return true; + } + + // }}} // {{{ function _mail_subj function _mail_subj() diff --git a/include/validations/paiements.inc.php b/include/validations/paiements.inc.php index 4bb591b..02f1cbe 100644 --- a/include/validations/paiements.inc.php +++ b/include/validations/paiements.inc.php @@ -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() diff --git a/templates/admin/valider.tpl b/templates/admin/valider.tpl index 6e3cef7..15ecd4d 100644 --- a/templates/admin/valider.tpl +++ b/templates/admin/valider.tpl @@ -50,6 +50,22 @@ {include file=$valid->formu()} + {if $valid->editor()} + + +
+
+ {include file=$valid->editor()} + + + +
+ +
+
+ + + {/if} Commentaires {foreach from=$valid->comments item=c} diff --git a/templates/include/form.valid.edit-evts.tpl b/templates/include/form.valid.edit-evts.tpl new file mode 100644 index 0000000..8b1f8ce --- /dev/null +++ b/templates/include/form.valid.edit-evts.tpl @@ -0,0 +1,32 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + +
+ +
+Péremption : +Promos :  +min + -> max + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/form.valid.edit-nl.tpl b/templates/include/form.valid.edit-nl.tpl new file mode 100644 index 0000000..07300a7 --- /dev/null +++ b/templates/include/form.valid.edit-nl.tpl @@ -0,0 +1,29 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + +
+ +
+ + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/form.valid.edit-paiements.tpl b/templates/include/form.valid.edit-paiements.tpl new file mode 100644 index 0000000..90d27af --- /dev/null +++ b/templates/include/form.valid.edit-paiements.tpl @@ -0,0 +1,33 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + +
+ +
+Site : +
+Montant : +(min + ->  max ) + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/include/form.valid.evts.tpl b/templates/include/form.valid.evts.tpl index ab5b13c..e620e6b 100644 --- a/templates/include/form.valid.evts.tpl +++ b/templates/include/form.valid.evts.tpl @@ -21,23 +21,23 @@ {**************************************************************************} - + Titre {$valid->titre} - + Texte {$valid->texte|nl2br} - + Péremption {$valid->peremption|date_format} - + Promos {$valid->pmin} - {$valid->pmax} - + Commentaire {$valid->comment} -- 2.1.4