wish 300 notification des commentaires de validation
authorPascal Corpet <pascal.corpet@m4x.org>
Thu, 21 Apr 2005 14:54:21 +0000 (14:54 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:42 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-581

ChangeLog
include/validations.inc.php

index d090889..654fc3f 100644 (file)
--- 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
 
index 0ec9f3d..71e5258 100644 (file)
@@ -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;