Code

Updated dns/dhcp client setup (termDNS).
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Sep 2007 06:32:20 +0000 (06:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 Sep 2007 06:32:20 +0000 (06:32 +0000)
Grey out dhcp and dns options, if there is currently no such service configured.

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

plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/network.tpl

index da1d331b61128193055248b5261ceaab70b58cb9..c1290e57287d3bb27bf30a345c2765adec9fcd50 100644 (file)
@@ -247,7 +247,7 @@ class termDNS extends plugin
     $smarty->assign("dhcp_is_Account",$this->dhcp_is_Account);
     $smarty->assign("dhcpParentNode", $this->dhcpParentNode);
     $smarty->assign("dhcpParentNodes",$this->dhcpParentNodes);
-
+    $smarty->assign("dhcpParentNodeCnt",count($this->dhcpParentNodes));
 
     /* There is no dns available 
      */
@@ -311,6 +311,7 @@ class termDNS extends plugin
 
       $smarty->assign("DNSAccount",$this->DNS_is_account);
       $smarty->assign("Zones",$this->Zones);
+      $smarty->assign("ZoneCnt",count($this->Zones));
       $smarty->assign("ZoneKeys",($this->Zones));
       $smarty->assign("IPisMust",(($this->IPisMust)||($this->DNS_is_account)));
 
index 035629fbfc7617d5a3a70e2b2c9a04626e72f187..cb6a7af4c1bc7d74ce09c736d2149462aa839e28 100644 (file)
@@ -23,6 +23,7 @@
         <tr>
           <td colspan=2 style='padding-top:12px;'>
             <table>
+              {if $dhcpParentNodeCnt}
               <tr>
                 <td>
                   <input onClick='document.mainform.submit();'
                   <input type='image' src='images/list_reload.png' class='center'>
                 </td>
               </tr>
+              {else}
+              <tr>
+                <td>
+                  <input type='checkbox' name='dummy' class='center' disabled>
+                  {t}Enable DHCP for this device{/t}
+                  <input type='image' src='images/list_reload.png' class='center'><br>
+                  <i>{t}No dhcp service present in your ldap database, you will have to setup the dhcp service first.{/t}</i>
+                </td>
+              </tr>
+              {/if}
               {if $dhcp_is_Account}
               <tr>
                 <td>&nbsp;</td>
     </td>
     {if $DNS_is_account==true}
                <td     style="width:50%;vertical-align:top;border-left:1px solid #b0b0b0;" valign="top">
-      <input type="checkbox" name="enableDNS" value="1" {$DNSaccountACL} 
+
+      {if $ZoneCnt}
         {if $DNSAccount == true}checked="checked"
-        onclick="toggle('test2');
-          changeState('zoneName');
-          changeState('dNSTTL');
-          changeState('AddNewRecord');
-          {$changeStateForRecords}
-      "/>
+        <input type="checkbox" name="enableDNS" value="1" {$DNSaccountACL} class='center' 
+          onclick="toggle('test2');
+            changeState('zoneName');
+            changeState('dNSTTL');
+            changeState('AddNewRecord');
+            {$changeStateForRecords} "/>
         {else}
-        onclick="toggle('test2');
-          changeState('zoneName');
-          changeState('dNSTTL');
-          changeState('AddNewRecord');
-      "/>
+        <input type="checkbox" name="enableDNS" value="1" {$DNSaccountACL} class='center'
+          onclick="toggle('test2');
+            changeState('zoneName');
+            changeState('dNSTTL');
+            changeState('AddNewRecord');
+        "/>
         {/if}
       {t}Enable DNS for this device{/t}
       <input type='image' src='images/list_reload.png' class='center' name="reloadThisDNSStuff" {$DNSaccountACL}/>
                                </tr>
                        </table>
       </div>
+    {else}        
+      <input type="checkbox" name="dummy" value="1" disabled class='center'>
+      {t}Enable DNS for this device{/t}
+      <input type='image' src='images/list_reload.png' class='center'><br>
+      <i>{t}No dns service present in your ldap database, you will have to setup the dns service first.{/t}</i>
+    {/if}
+
                </td>
     {/if}