Code

Added Department templates.
[gosa.git] / gosa-core / plugins / admin / departments / class_departmentGeneric.inc
index 62b3947afa36c125cbdbf6a937bd210935c13340..c8da2b281e438896435e5b869a3bd41f165ff4bc 100644 (file)
@@ -37,6 +37,7 @@ class department extends plugin
   var $view_logged = FALSE;
 
   var $type ="ou";
+  var $namingAttr = "ou";
 
        /* Headpage attributes */
        var $last_dep_sorting= "invalid";
@@ -60,7 +61,13 @@ class department extends plugin
                $this->ui= get_userinfo();
                $this->dn= $dn;
                $this->orig_dn= $dn;
-               $this->orig_ou= $this->ou;
+
+    /* Save current naming attribuet 
+     */
+    $nA      = $this->namingAttr;
+    $orig_nA = "orig_".$nA;
+    $this->$orig_nA = $this->$nA;
+
                $this->config= $config;
 
                /* Set base */
@@ -165,7 +172,18 @@ class department extends plugin
     }
 
     $smarty->assign("dep_type",$this->type);
-               return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
+
+    switch($this->type){
+      case 'c'        : $tpl ="country.tpl";break;
+      case 'o'        : $tpl ="organization.tpl";break;
+      case 'l'        : $tpl ="locality.tpl";break;
+      case 'ou'       : $tpl ="generic.tpl";break;
+      case 'alias'    : $tpl ="alias.tpl";break;
+      case 'referal'  : $tpl ="referal.tpl";break;
+      default  : $tpl ="generic.tpl";
+    }
+
+               return($smarty->fetch (get_template_path($tpl, TRUE)));
        }
 
        function clear_fields()