DataObjects/Core_watch.php
[Pman.Core] / DataObjects / Core_enum.php
index 9003d2b..e13f4f2 100644 (file)
@@ -24,7 +24,7 @@ class Pman_Core_DataObjects_Core_enum extends DB_DataObject
     function applyFilters($q, $au)
     {
         
-        //DB_DataObject::debugLevel(1);
+//        DB_DataObject::debugLevel(1);
         if (!empty($q['query']['empty_etype'])) {
             $this->whereAdd("etype = ''");
         }
@@ -47,7 +47,8 @@ class Pman_Core_DataObjects_Core_enum extends DB_DataObject
             ");
             
         }
-        $this->autoJoin();
+        
+//        print_r($this);
         if(!empty($q['id'])){
             $this->id = $q['id'];
         }
@@ -75,7 +76,11 @@ class Pman_Core_DataObjects_Core_enum extends DB_DataObject
             CASE WHEN 
                 '$l' = 'en' THEN display_name 
             ELSE
-                cms_templatestr.txt
+                CASE WHEN cms_templatestr.txt IS NOT NULL AND cms_templatestr.txt != '' THEN
+                    cms_templatestr.txt
+                ELSE
+                    display_name
+                END
             END as  display_name_tr 
         ");