Merge remote branch 'origin/xorg/maint' into xorg/master
[platal.git] / include / validations / evts.inc.php
index ddfdef5..7dcbce0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -41,7 +41,7 @@ class EvtReq extends Validate
     // }}}
     // {{{ constructor
 
-    public function __construct($_titre, $_texte, $_pmin, $_pmax, $_expiration, $_comment, User &$_user, PlUpload &$upload = null)
+    public function __construct($_titre, $_texte, $_pmin, $_pmax, $_expiration, $_comment, User $_user, PlUpload $upload = null)
     {
         parent::__construct($_user, false, 'evts');
         $this->titre      = $_titre;
@@ -58,7 +58,7 @@ class EvtReq extends Validate
     // }}}
     // {{{ function readImage()
 
-    private function readImage(PlUpload &$upload)
+    private function readImage(PlUpload $upload)
     {
         if ($upload->exists() && $upload->isType('image')) {
             list($this->imgx, $this->imgy, $this->imgtype) = $upload->imageInfo();
@@ -122,10 +122,11 @@ class EvtReq extends Validate
 
     protected function _mail_body($isok)
     {
+        $you_have = ($this->formal ? 'vous aviez' : 'tu avais');
         if ($isok) {
-            return "  L'annonce que tu avais proposée ({$this->titre}) vient d'être validée.";
+            return "  L'annonce que $you_have proposée ({$this->titre}) vient d'être validée.";
         } else {
-            return "  L'annonce que tu avais proposée ({$this->titre}) a été refusée.";
+            return "  L'annonce que $you_have proposée ({$this->titre}) a été refusée.";
         }
     }
 
@@ -134,6 +135,7 @@ class EvtReq extends Validate
 
     public function commit()
     {
+        /* TODO: refines this filter on promotions by using userfilter. */
         if (XDB::execute("INSERT INTO  announces
                          SET  uid = {?}, creation_date=NOW(), titre={?}, texte={?},
                               expiration={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')",