Merge branch 'platal-0.9.17'
[platal.git] / include / validations.inc.php
index cf2f77c..d5cd9e0 100644 (file)
@@ -117,7 +117,7 @@ abstract class Validate
                 $this->uid, $this->type, $this, $this->stamp);
 
         global $globals;
-        update_NbValid();
+        $globals->updateNbValid();
         return true;
     }
 
@@ -140,6 +140,8 @@ abstract class Validate
      */
     public function clean()
     {
+        global $globals;
+
         if ($this->unique) {
             $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}',
                                     $this->uid, $this->type);
@@ -147,7 +149,7 @@ abstract class Validate
             $success =  XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
                                       $this->uid, $this->type, $this->stamp);
         }
-        update_NbValid();
+        $globals->updateNbValid();
         return $success;
     }
 
@@ -211,7 +213,7 @@ abstract class Validate
             if ($this->commit()) {
                 $this->sendmail(true);
                 $this->clean();
-                $this->trigSuccess('Mail de validation envoyé');
+                $this->trigSuccess('Email de validation envoyé');
                 return true;
             } else {
                 $this->trigError('Erreur lors de la validation');
@@ -223,7 +225,7 @@ abstract class Validate
             if (Env::v('comm')) {
                 $this->sendmail(false);
                 $this->clean();
-                $this->trigSuccess('Mail de refus envoyé');
+                $this->trigSuccess('Email de refus envoyé');
                 return true;
             } else {
                 $this->trigError('pas de motivation pour le refus !!!');