Code

Fixed template
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2005 06:36:02 +0000 (06:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2005 06:36:02 +0000 (06:36 +0000)
Better check for undefined index goExportEntry in constructor
Buttons wasn't disabled / enabled correctly with the checkbox goShareServer

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1365 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servService.inc
plugins/admin/systems/main.inc
plugins/admin/systems/servservice.tpl

index 850a9551550e61b9f2ae218bd37b010e3bdb3c7f..2ee9fc90b1c99d0822027d216ca59339839ef690 100644 (file)
@@ -13,7 +13,7 @@ class servservice extends plugin
   var $goXdmcpIsEnabled = "";
   var $goFontPath       = "";
   var $goNTPServer      = "";
-  var $goShareServer      = "";
+  var $goShareServer    = false;
   var $goLdapServer     = "";
   var $goTerminalServer = "";
   var $goSyslogServer   = "";
@@ -57,17 +57,25 @@ class servservice extends plugin
 
     $tmp =array();
     $tmp2=array();
-    unset($this->attrs['goExportEntry']['count']);
-    if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){
-      foreach($this->attrs['goExportEntry'] as $entry){
-        $tmp2= split("\|",$entry);
-        $tmp[$tmp2[0]]= $entry;
+    if(isset($this->attrs['goExportEntry'])){
+      unset($this->attrs['goExportEntry']['count']);
+      if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){
+        foreach($this->attrs['goExportEntry'] as $entry){
+          $tmp2= split("\|",$entry);
+          $tmp[$tmp2[0]]= $entry;
+        }
       }
     }
     $this->goExportEntry = $tmp;
 
     /* Always is account... */
     $this->is_account= TRUE;
+
+    if(is_array($this->attrs['objectClass'])){ 
+      if(in_array("goShareServer",$this->attrs['objectClass'])){
+        $this->goShareServer = true;    
+      }
+    }
   }
 
   function addToList($entry){
@@ -182,8 +190,12 @@ class servservice extends plugin
       }
     }
 
-    if(!count($this->goExportEntry)){
+    if(!$this->goShareServer){
       $smarty->assign("goShareServerState", " disabled ");
+      $smarty->assign("goExportEntryACL", " disabled ");
+    }else{
+      $smarty->assign("goShareServerState", "  ");
+      $smarty->assign("goExportEntryACL", "  ");
     }
 
     /* Different handling for checkbox */
@@ -227,6 +239,12 @@ class servservice extends plugin
         $this->goXdmcpIsEnabled= "false";
       }
         
+      /* Save xdmcp is enabled flag */
+      if (isset($_POST['goShareServer'])){
+        $this->goShareServer = true;
+      } else {
+        $this->goShareServer = false;
+      }
     }
   }
 
index a0f26d1cc8dd7b890c305c2770b5e5a2d1a191c8..d4939a122f0c86a32cc8212815637dbe6df4e40a 100644 (file)
@@ -49,6 +49,9 @@ if ($remove_lock){
 
        /* Show and save dialog */
        $display.= $output;
+       $display.="<script language=\"JavaScript\" type=\"text/javascript\">
+            document.mainform.edit_finish.focus();
+         </script>";
        $_SESSION['systems']= $systems;
 }
 
index 9877289a30779965755ba477a51e05ba95875f5b..ee52e76dd0c612185700bfbfb8fb7e7d0c4f199d 100644 (file)
@@ -2,8 +2,8 @@
  <tr>
   <td style="vertical-align:top; border-right:1px solid #A0A0A0; padding-right:5px;" width="50%">
 
-   <input type=checkbox name="goShareServer" value="1" {$goShareServer} {$goShareServer}  
-                       onchange="changeState('goExportEntry');
+   <input type=checkbox name="goShareServer" value="1" {$goShareServer} 
+       onchange="changeState('goExportEntry');
                        changeState('NewNfsEditId');
                        changeState('DelNfsEntId');
                        changeState('NewNfsAddId');"> 
@@ -18,7 +18,7 @@
            </select>
        <br>    
                <input type="submit"    value="{t}Edit{/t}"     name="NewNfsEdit" {$goShareServer} {$goExportEntryACL}  id="NewNfsEditId"> 
-               <input type="submit"    value="{t}Add{/t}"              name="NewNfsAdd"  {$goShareServer} {$goExportEntryACL}  id="NewNfsAddId"> 
+               <input type="submit"    value="{t}Add{/t}"      name="NewNfsAdd"  {$goShareServer} {$goExportEntryACL}  id="NewNfsAddId"> 
                <input type="submit"    value="{t}Delete{/t}"   name="DelNfsEnt"  {$goShareServer} {$goExportEntryACL}  id="DelNfsEntId">
        </td>
        </tr>