X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations.inc.php;h=a49edce241b106938acd77e50f145b900f27e6f9;hb=ed5b9703b11935c123dae6eed496223591e1e7ed;hp=887d6e283d10db8f05bbd7fc85dea6737f07b012;hpb=c33efb7c45e4302b450f1d69e357339e1722eb90;p=platal.git diff --git a/include/validations.inc.php b/include/validations.inc.php index 887d6e2..a49edce 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'); @@ -177,7 +188,7 @@ class Validate $body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n" . S::v('bestalias')." a ajouté le commentaire :\n\n" . Env::v('comm')."\n\n" - . "cf la discussion sur : ".$globals->baseurl."/admin/valider.php"; + . "cf la discussion sur : ".$globals->baseurl."/admin/validate"; $mailer->setTxtBody(wordwrap($body)); $mailer->send(); @@ -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 */ @@ -313,6 +331,14 @@ class Validate } // }}} + // {{{ function id() + + function id() + { + return $this->uid . '_' . $this->type . '_' . $this->stamp; + } + + // }}} } foreach (glob(dirname(__FILE__).'/validations/*.inc.php') as $file) {