Fix deco javascript: current grade was not properly selected
[platal.git] / modules / payment / money.inc.php
index 595e9a9..a79f03a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -19,8 +19,6 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once dirname(__FILE__).'/../classes/Flagset.php';
-
 class Payment
 {
     // {{{ properties
@@ -39,7 +37,7 @@ class Payment
 
     // }}}
     // {{{ constructor
-    
+
     function Payment($ref=-1)
     {
         global $globals;
@@ -48,24 +46,22 @@ class Payment
                                        FROM  {$globals->money->mpay_tprefix}paiements WHERE id={?}", $r);
         list($this->id, $this->text, $this->url, $flags, $this->mail,
                 $this->montant_min, $this->montant_max, $this->montant_def, $this->asso_id) = $res->fetchOneRow();
-        
+
         $this->montant_min = (float)$this->montant_min;
         $this->montant_max = (float)$this->montant_max;
         $this->flags       = new Flagset($flags);
-
-        return $link;
     }
 
     // }}}
     // {{{ function check()
-    
+
     function check($value)
     {
         $v = (float)strtr($value, ',', '.');
         if ($this->montant_min > $v) {
-            return "Montant inférieur au minimum autorisé ({$this->montant_min}).";
+            return "Montant inférieur au minimum autorisé ({$this->montant_min}).";
         } elseif ($v > $this->montant_max) {
-            return "Montant supérieur au maximum autorisé ({$this->montant_max}).";
+            return "Montant supérieur au maximum autorisé ({$this->montant_max}).";
         } else {
             return true;
         }
@@ -76,7 +72,7 @@ class Payment
 
     function init($val, &$meth)
     {
-        require_once('money/'.$meth->inc);
+        require_once dirname(__FILE__).'/money/'.$meth->inc;
         $this->api = new $api($val);
     }
 
@@ -118,12 +114,12 @@ class PayMethod
         $i   = $id==-1 ? $globals->money->mpay_def_meth : $id;
         $res = XDB::query("SELECT id,text,include FROM {$globals->money->mpay_tprefix}methodes WHERE id={?}", $i);
         list($this->id, $this->text, $this->inc) = $res->fetchOneRow();
-    } 
+    }
 
     // }}}
 }
 
 // }}}
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>