Code

Fixed sorting of DHCP list
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Aug 2007 12:37:40 +0000 (12:37 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Aug 2007 12:37:40 +0000 (12:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6987 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_dhcpNewSectionDialog.inc
plugins/admin/systems/class_servDHCP.inc

index 1b675e5d87e1863f60132c33ffa17cc15bafe6de..26188f5145a42d4461f05bb189b3b58040d50b22 100644 (file)
@@ -10,30 +10,26 @@ class dhcpNewSectionDialog extends plugin
   /* Mapping array */
   var $types= array();
   var $classtype= "";
-  static $sectionMap= array(  "dhcpService" => array("dhcpSharedNetwork", "dhcpSubnet", "dhcpGroup", "dhcpHost", "dhcpClass", "dhcpLeases"),
+  static $sectionMap= array(  "dhcpService" => array("dhcpSharedNetwork", "dhcpSubnet", "dhcpGroup", "dhcpHost", "dhcpClass"),
                               "dhcpClass" => array("dhcpSubClass"),
                               "dhcpSubClass" => array(),
-                              "dhcpLeases" => array(),
                               "dhcpHost" => array(),
                               "dhcpGroup" => array("dhcpHost"),
-                              "dhcpPool" => array("dhcpLeases"),
-                              "dhcpSubnet" => array("dhcpPool", "dhcpGroup", "dhcpHost", "dhcpClass", "dhcpLeases"),
+                              "dhcpPool" => array(),
+                              "dhcpSubnet" => array("dhcpPool", "dhcpGroup", "dhcpHost", "dhcpClass"),
                               "dhcpSharedNetwork" => array("dhcpSubnet", "dhcpPool"));
 
 
 
   function dhcpNewSectionDialog($type)
   {
-    $this->types= array(  "dhcpLog" => _("Logging"),
-                          "dhcpService" => _("Global options"),
+    $this->types= array(  "dhcpService" => _("Global options"),
                           "dhcpClass" => _("Class"),
                           "dhcpSubClass" => _("Subclass"),
-                          "dhcpLeases" => _("Lease"),
                           "dhcpHost" => _("Host"),
                           "dhcpGroup" => _("Group"),
                           "dhcpPool" => _("Pool"),
                           "dhcpSubnet" => _("Subnet"),
-                          "dhcpFailOverPeer" => _("Failover peer"),
                           "dhcpSharedNetwork" => _("Shared network"));
 
     $this->classtype= $type;
@@ -50,6 +46,7 @@ class dhcpNewSectionDialog extends plugin
     foreach ($sections as $section){
       $t_sections[$section]= $this->types[$section]; 
     }
+    asort($t_sections);
     $smarty->assign("sections", $t_sections);
     $smarty->assign("dhcpSectionACL", chkacl($this->acl,"DHCP"));
     $display.= $smarty->fetch(get_template_path('dhcpNewSection.tpl', TRUE));
index f4749767e77a0e04272883db875991ca9b27bada..30ebc6f7c193383265df868d8fbcf2031207405a 100644 (file)
@@ -77,9 +77,16 @@ class servdhcp extends plugin
         $data= $this->dialog->save();
         if ($this->current_object == ""){
           /* New object */
+          $newsects= array();
+          foreach ($this->dhcpSections as $key => $dsc){
+            $newsects[$key]= $dsc;
+            if ($key == $dn){
+              $spaces.= "&nbsp;&nbsp;&nbsp;&nbsp;";
+              $newsects[$data['dn']]= "$spaces$type '".preg_replace('/^[^=]+=([^,]+),.*$/', '\1', $data['dn'])."'";
+            }
+          }
           $this->dhcpObjectCache[$data['dn']]= $data;
-          $spaces.= "&nbsp;&nbsp;&nbsp;&nbsp;";
-          $this->dhcpSections[$data['dn']]= "$spaces$type '".preg_replace('/^[^=]+=([^,]+),.*$/', '\1', $data['dn'])."'";
+          $this->dhcpSections= $newsects;
         } else {
           if ($dn != $data['dn']){
             /* Old object, new name */