Backport
[platal.git] / include / validations / evts.inc.php
index 9bcba19..01c5658 100644 (file)
@@ -37,7 +37,6 @@ class EvtReq extends Validate
     // {{{ constructor
 
     function EvtReq($_titre, $_texte, $_pmin, $_pmax, $_peremption, $_comment, $_uid) {
-        global $globals;
         $this->Validate($_uid, false, 'evts');
         $this->titre      = $_titre;
         $this->texte      = $_texte;
@@ -54,6 +53,25 @@ class EvtReq extends Validate
     { return 'include/form.valid.evts.tpl'; }
 
     // }}}
+    // {{{ functon editor()
+
+    function editor()
+    { return 'include/form.valid.edit-evts.tpl'; }
+
+    // }}}
+    // {{{ function handle_editor()
+
+    function handle_editor()
+    {
+        $this->titre      = Env::v('titre');
+        $this->texte      = Env::v('texte');
+        $this->pmin       = Env::i('promo_min');
+        $this->pmax       = Env::i('promo_max');
+        $this->peremption = Env::v('peremption');
+        return true;
+    }
+
+    // }}}
     // {{{ function _mail_subj
     
     function _mail_subj()
@@ -78,7 +96,6 @@ class EvtReq extends Validate
 
     function commit()
     {
-        global $globals;
         return XDB::execute(
                 "INSERT INTO  evenements
                          SET  user_id = {?}, creation_date=NOW(), titre={?}, texte={?},