Code

Moved folder icon
[gosa.git] / gosa-core / plugins / admin / ogroups / class_ogroup.inc
index f15d1b37881981e9843ac3295346a2786599b3cf..ea6abd6375bf24de950235b5c5a17fad3af293b7 100644 (file)
@@ -187,7 +187,7 @@ class ogroup extends plugin
     /* Do we represent a valid group? */
     if (!$this->is_account){
       $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
-        _("This 'dn' is no object group.")."</b>";
+        msgPool::noValidExtension("object group")."</b>";
       return ($display);
     }
 
@@ -279,18 +279,56 @@ class ogroup extends plugin
 
       /* Show dialog */
       $smarty->assign("search_image", get_template_path('images/search.png'));
-      $smarty->assign("launchimage", get_template_path('images/small_filter.png'));
+      $smarty->assign("launchimage", get_template_path('images/lists/action.png'));
       $smarty->assign("tree_image", get_template_path('images/tree.png'));
       $smarty->assign("deplist", $this->config->idepartments);
       $smarty->assign("alphabet", generate_alphabet());
-      foreach( array("dselect", "regex", "accounts", "groups", "applications",
-            "departments", "servers", "workstations", "winstations", "terminals","subtrees",
-            "printers", "phones") as $type){
+      foreach( array("dselect", "regex", "subtrees") as $type){
         $smarty->assign("$type", $ogfilter[$type]);
       }
       $smarty->assign("hint", print_sizelimit_warning());
       $smarty->assign("apply", apply_filter());
 
+      /* Build up checkboxes 
+       */
+      $ar = array(
+          "departments" => array(
+            "T" => msgPool::selectToView(_("departments")),
+            "C" => (isset($ogfilter['departments']) && ($ogfilter['departments'])),
+            "L" => sprintf(_("Show %s"),_("departments"))),
+          "accounts" => array(
+            "T" => msgPool::selectToView(_("people")),
+            "C" => (isset($ogfilter['accounts']) && ($ogfilter['accounts'])),
+            "L" => sprintf(_("Show %s"),_("people"))),
+          "groups"=> array(
+            "T" => msgPool::selectToView(_("groups")),
+            "C" => (isset($ogfilter['groups']) && ($ogfilter['groups'])),
+            "L" => sprintf(_("Show %s"),_("groups"))),
+          "applications"=> array(
+            "T" => msgPool::selectToView(_("applications")),
+            "C" => (isset($ogfilter['applications']) && ($ogfilter['applications'])),
+            "L" => sprintf(_("Show %s"),_("applications"))),
+          "servers"=> array(
+            "T" => msgPool::selectToView(_("servers")),
+            "C" => (isset($ogfilter['servers']) && ($ogfilter['servers'])),
+            "L" => sprintf(_("Show %s"),_("servers"))),
+          "workstations"=> array(
+            "T" => msgPool::selectToView(_("workstations")),
+            "C" => (isset($ogfilter['workstations']) && ($ogfilter['workstations'])),
+            "L" => sprintf(_("Show %s"),_("workstations"))),
+          "terminals"=> array(
+            "T" => msgPool::selectToView(_("terminals")),
+            "C" => (isset($ogfilter['terminals']) && ($ogfilter['terminals'])),
+            "L" => sprintf(_("Show %s"),_("terminals"))),
+          "printers"=> array(
+            "T" => msgPool::selectToView(_("printer")),
+            "C" => (isset($ogfilter['printers']) && ($ogfilter['printers'])),
+            "L" => sprintf(_("Show %s"),_("printers"))),
+          "phones"=> array(
+            "T" => msgPool::selectToView(_("phones")),
+            "C" => (isset($ogfilter['phones']) && ($ogfilter['phones'])),
+            "L" => sprintf(_("Show %s"),_("phones"))));
+      $smarty->assign("checkboxes",$ar);
       $display= $smarty->fetch (get_template_path('ogroup_objects.tpl', TRUE, dirname(__FILE__)));
       return ($display);
     }
@@ -322,7 +360,7 @@ class ogroup extends plugin
       error_reporting(0);
       if (isset($type[1]) && preg_match('/[UGADSFOWTP]/', $type[1])){
         $p2= $conv[$type[1]];
-        $smarty->assign("combinedObjects", "$p1 "._("and")." $p2");
+        $smarty->assign("combinedObjects", sprintf("'%s' and '%s'", $p1, $p2));
       } else {
         $smarty->assign("combinedObjects", "$p1");
       }
@@ -463,7 +501,7 @@ class ogroup extends plugin
          it seams that this entry was removed 
        */ 
       /* Try to resolv the entry again, if it still fails, display error msg */
-      $ldap->cat($dn, array("cn", "sn", "givenName", "ou", "description", "objectClass"));
+      $ldap->cat($dn, array("cn", "sn", "givenName", "ou", "description", "objectClass", "macAddress"));
 
       /* It has failed, add entry with type flag I (Invalid)*/
       if (!$ldap->success()){
@@ -487,6 +525,13 @@ class ogroup extends plugin
           $this->objcache[$attrs["dn"]]= array("text" => "$name", "type" => "$type");
         }
         $this->objcache[$attrs["dn"]]['objectClass']  = $attrs['objectClass'];
+
+        if(isset($attrs['macAddress'][0])){
+          $this->objcache[$attrs["dn"]]['macAddress']  = $attrs['macAddress'][0];
+        }else{
+          $this->objcache[$attrs["dn"]]['macAddress']  = "";
+        }
+
         if(isset($attrs['uid'])){
           $this->objcache[$attrs["dn"]]['uid']          = $attrs['uid'];
         }