From 64af15fa3bbfd3c638aa6ef580259650a2780b1c Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Thu, 21 Apr 2005 14:54:21 +0000 Subject: [PATCH] wish 300 notification des commentaires de validation git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-581 --- ChangeLog | 3 +++ include/validations.inc.php | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index d090889..654fc3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ New : Bug/Wish : + * Admin : + - #300: notify hotliners for validation comments. -Car + * Misc : - #290: date display with no preceding 0. -Car diff --git a/include/validations.inc.php b/include/validations.inc.php index 0ec9f3d..71e5258 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -168,8 +168,27 @@ class Validate return true; } + // ajout d'un commentaire if (Env::has('hold') && Env::has('comm')) { $this->comments[] = Array(Session::get('bestalias'), Env::get('comm')); + + // envoi d'un mail à hotliners + global $globals; + require_once('diogenes/diogenes.hermes.inc.php'); + $mailer = new HermesMailer; + $mailer->setSubject("Commentaires de validation {$this->type}"); + $mailer->setFrom("validation+{$this->type}@{$globals->mail->domain}"); + $mailer->addTo("hotliners@{$globals->mail->domain}"); + + $body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n" + . Session::get('bestalias')." a ajouté le commentaire :\n\n" + . Env::get('comm')."\n\n" + . "cf la discussion sur : ".$globals->baseurl."/admin/valider.php"; + + $mailer->setTxtBody(wordwrap($body)); + $mailer->send(); + + print_r(array($mailer)); $this->update(); $this->trig('commentaire ajouté'); return true; -- 2.1.4