Code

Removed chkbx and added inherited to select box
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 May 2006 08:59:38 +0000 (08:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 May 2006 08:59:38 +0000 (08:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3538 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc
plugins/admin/systems/workstationStartup.tpl

index ad9077747ed8082abc1b2b88b64c8e4e44e5e396..cf53ff2725840c274ab474c3c85a782d58ffbfd4 100644 (file)
@@ -43,7 +43,6 @@ class workstartup extends plugin
 
   
   /* FAI class selection */
-  var $FAIinherit                  = false; 
   var $InheritedFAIclass           = array();
   var $InheritedFAIrelease         = "";
   var $InheritedFAIdebianMirror    = "auto";
@@ -320,7 +319,7 @@ class workstartup extends plugin
     }
 
     if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
-      $this->FAIinherit =true;
+      $this->FAIdebianMirror = "inherited";
     }
   }
 
@@ -397,6 +396,8 @@ class workstartup extends plugin
   function selectFriendlyClasses(){
     $tmp=array();
 
+    if($this->FAIdebianMirror == "inherited") return($tmp);
+
     /* check if the current release exists,
         else select the first one ..
      */
@@ -677,14 +678,12 @@ class workstartup extends plugin
       $smarty->assign($val."ACL", chkacl($this->acl, $val));
     }
 
-    $smarty->assign("FAIinherit",$this->FAIinherit);
     $smarty->assign("FAIdebianMirrors",$this->getFAIdebianMirrors());
     $smarty->assign("FAIreleases",$this->getFAIreleases());
     $smarty->assign("FAIrelease",$this->FAIrelease);
     $smarty->assign("FAIclasses",$this->selectFriendlyClasses());
     $smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
     $smarty->assign("FAIclassKeys",$this->FAIclass);
-    $smarty->assign("InheritedFAIdebianMirror",$this->InheritedFAIdebianMirror);
     $smarty->assign("InheritedFAIrelease",$this->InheritedFAIrelease);
     
     $div = new divSelectBox("WSFAIscriptClasses");
@@ -696,7 +695,7 @@ class workstartup extends plugin
 
     $i = 1;
 
-    if($this->FAIinherit){
+    if($this->FAIdebianMirror == "inherited"){
       $tmp = $this->InheritedFAIclass;
     }else{
       $tmp = $this->FAIclass;
@@ -704,7 +703,7 @@ class workstartup extends plugin
 
     foreach($tmp as $class){
 
-      if($this->FAIinherit){
+      if($this->FAIdebianMirror == "inherited"){
         $str = "";
       }else{
         if($i==1){
@@ -780,6 +779,7 @@ class workstartup extends plugin
   function getFAIdebianMirrors()
   {
     $ret = array();
+    $ret['inherited']="["._("inherited")."]";
     $ret['auto']=_("automatic");
     $secs  = array();
 
@@ -816,6 +816,8 @@ class workstartup extends plugin
   {
     $ret = array();
 
+    if($this->FAIdebianMirror == "inherited") return(array());
+
     if(!isset($this->FAIServRepConfig[$this->FAIdebianMirror])){
       $this->FAIdebianMirror = "auto";
     }
@@ -879,13 +881,6 @@ class workstartup extends plugin
       $this->customParameters= $_POST["customParameters"];
     }
 
-    if(isset($_POST['WorkstationStarttabPosted'])){
-      if(isset($_POST['FAIinherit'])){
-        $this->FAIinherit = true;
-      }else{
-        $this->FAIinherit = false;
-      }
-    }
   }
 
 
@@ -961,7 +956,7 @@ class workstartup extends plugin
     
     $str = "";
 
-    if($this->FAIinherit){
+    if($this->FAIdebianMirror == "inherited"){
   
       $this->attrs['FAIclass'] = $this->attrs['FAIrelease'] =  $this->attrs['FAIdebianMirror'] = array(); 
 
index d27ce0b5df605114a52e93b79783205a09b17551..9466a5092669c249a311c3f9efd432bd8d20edcc 100644 (file)
   
   <td style="vertical-align:top;">
 
-       {if $FAIinherit == true}
+       {if $FAIdebianMirror == "inherited"}
 
                <table>
-                       <tr>
-                               <td>
-                               <input type="checkbox" value="1" name="FAIinherit" {if $FAIinherit == true}  checked {/if}
-                                 onClick="mainform.submit();">{t}Inherit FAI settings{/t}
-                               </td>
-                       </tr>
                        <tr>
                                <td>
                                        <h2><img class="center" alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}FAI server{/t}
@@ -54,8 +48,8 @@
                        </tr>
                        <tr>
                                <td>
-                                       <select name="FAIdebianMirror" disabled>
-                                               {html_options options=$InheritedFAIdebianMirror output=$InheritedFAIdebianMirror selected=$InheritedFAIdebianMirror}
+                                       <select name="FAIdebianMirror"   onchange='document.mainform.submit()'>
+                                               {html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
                                        </select>
                                </td>
                                <td>
        {else}
 
                <table>
-                       <tr>
-                               <td>
-                               <input type="checkbox" value="1" name="FAIinherit" {if $FAIinherit == true}  checked {/if}
-                                 onClick="mainform.submit();">{t}Inherit FAI settings{/t}
-                               </td>
-                       </tr>
                        <tr>
                                <td>
                                        <h2><img class="center" alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}FAI server{/t}