Import/Core_email.php
[Pman.Core] / Import / Core_notify.php
index a779748..59c8149 100644 (file)
@@ -53,8 +53,31 @@ class Pman_Core_Import_Core_notify extends Pman_Roo
             $enum->insert();
         }
         
+        $notify = DB_DataObject::factory('core_notify');
+        $notify->selectAdd();
+        $notify->selectAdd("
+            DISTINCT(evtype) AS evtype
+        ");
         
+        $types = $notify->fetchAll();
         
+        foreach ($types as $t){
+            $enum = DB_DataObject::factory('core_enum');
+            $enum->setFrom(array(
+                'etype' => $this->etype->name,
+                'name' => $t->evtype,
+                'active' => 1
+            ));
+            
+            if($enum->find(true)){
+                continue;
+            }
+            
+            $enum->display_name = $t->evtype;
+            $enum->insert();
+        }
+        
+        $this->jok('DONE');
         
         
     }
@@ -85,6 +108,8 @@ class Pman_Core_Import_Core_notify extends Pman_Roo
                 continue;
             }
             
+            $this->log("Processing $file");
+                    
             $this->defaults = array_merge($this->defaults, json_decode(file_get_contents($file), true)) ;
         }