Code

Proxy Options (filter and quota) are now disabled, if assigned checkbox state is...
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 May 2005 13:05:49 +0000 (13:05 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 May 2005 13:05:49 +0000 (13:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@480 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/connectivity/class_proxyAccount.inc
plugins/personal/connectivity/proxy.tpl

index 727082d23c76a7f22ff42e3ee9481e04f2522426..b4766e4dcbc51aff9f45d301cccdd5ddc0db2a19 100644 (file)
@@ -48,8 +48,10 @@ class proxyAccount extends plugin
     foreach (array("F", "T", "B", "N") as $val){
       if (is_integer(strpos($this->gosaProxyAcctFlags, "$val"))) {
         $smarty->assign("filter$val", "checked");
+        $smarty->assign($val."state", "");
       } else {
         $smarty->assign("filter$val", "");
+        $smarty->assign($val."state", "disabled");
       }
     }
 
@@ -154,10 +156,14 @@ class proxyAccount extends plugin
       /* Save quota values */
       if (chkacl ($this->acl, "gosaProxyQuota") == ""){
         $old= $this->gosaProxyQuota;
-        $this->gosaProxyQuota= $_POST["quota_size"].$_POST["quota_unit"];
+        if(isset($_POST["quota_size"]) && isset($_POST["quota_unit"])){
+          $this->gosaProxyQuota= $_POST["quota_size"].$_POST["quota_unit"];
+        }
         $this->is_modified= ($old != $this->gosaProxyQuota)?TRUE:$this->is_modified;
         $old= $this->gosaProxyQuotaPeriod;
-        $this->gosaProxyQuotaPeriod = $_POST["gosaProxyQuotaPeriod"];
+        if(isset($_POST["gosaProxyQuotaPeriod"])){
+          $this->gosaProxyQuotaPeriod = $_POST["gosaProxyQuotaPeriod"];
+        }
         $this->is_modified= ($old != $this->gosaProxyQuotaPeriod)?TRUE:$this->is_modified;
       }
     }
index d2403c15de2325f236ad4293105868f0fdf4a624..24650cc0d3003449178afdfe188fce607fa00b8a 100644 (file)
@@ -1,4 +1,18 @@
-<h2>{if $tabbed eq 1}<input type="checkbox" name="proxy" value="B" {$proxyState} {$gosaProxyAcctFlagsACL} onclick="changeState('filterF'); changeState('filterT'); changeState('startHour'); changeState('startMinute'); changeState('stopHour'); changeState('stopMinute'); changeState('filterB'); changeState('quota_size'); changeState('quota_unit'); changeState('gosaProxyQuotaPeriod');">{/if}{t}Proxy account{/t}</h2>
+<h2>{if $tabbed eq 1}<input type="checkbox" id="proxy" name="proxy" value="B" {$proxyState} {$gosaProxyAcctFlagsACL} 
+       onclick="
+               changeState('filterF'); 
+               changeState('filterT'); 
+               changeState('filterB'); 
+               changeTripleSelectState('proxy', 'filterT', 'startHour'); 
+               changeTripleSelectState('proxy', 'filterT', 'startMinute'); 
+               changeTripleSelectState('proxy', 'filterT', 'stopHour'); 
+               changeTripleSelectState('proxy', 'filterT', 'stopMinute'); 
+               changeTripleSelectState('proxy', 'filterB', 'quota_size'); 
+               changeTripleSelectState('proxy', 'filterB', 'quota_unit'); 
+               changeTripleSelectState('proxy', 'filterB', 'gosaProxyQuotaPeriod');"
+       >
+       {/if}{t}Proxy account{/t}</h2>
+
 <table style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
  <tr>
    <td>
     </td></tr>
      <tr>
       <td width="50%">
-    <input type="checkbox" name="filterT" id="filterT" value="T" {$filterT} {$gosaProxyAcctFlagsACL} {$pstate}>
+    <input type="checkbox" name="filterT" id="filterT" value="T" {$filterT} {$gosaProxyAcctFlagsACL} {$pstate}
+       onclick="
+               changeSubselectState('filterT', 'startHour'); 
+               changeSubselectState('filterT', 'startMinute'); 
+               changeSubselectState('filterT', 'stopHour'); 
+               changeSubselectState('filterT', 'stopMinute'); 
+       ">
     {t}Limit proxy access to working time{/t}
     <br>
     <table style="margin-left:20px;">
      <tr>
       <td>
-        <select size="1" id="startHour" name="startHour" {$gosaProxyWorkingStartACL} {$pstate}>
+        <select size="1" id="startHour" name="startHour" {$gosaProxyWorkingStartACL} {$Tstate}>
          {html_options values=$hours output=$hours selected=$starthour}
         </select>
         &nbsp;:&nbsp;
-        <select size="1" id="startMinute" name="startMinute" {$gosaProxyWorkingStartACL} {$pstate}>
+        <select size="1" id="startMinute" name="startMinute" {$gosaProxyWorkingStartACL} {$Tstate}>
          {html_options values=$minutes output=$minutes selected=$startminute}
         </select>
         &nbsp;-&nbsp;
-        <select size="1" id="stopHour" name="stopHour" {$gosaProxyWorkingStopACL} {$pstate}>
+        <select size="1" id="stopHour" name="stopHour" {$gosaProxyWorkingStopACL} {$Tstate}>
          {html_options values=$hours output=$hours selected=$stophour}
         </select>
         &nbsp;:&nbsp;
-        <select size="1" id="stopMinute" name="stopMinute" {$gosaProxyWorkingStopACL} {$pstate}>
+        <select size="1" id="stopMinute" name="stopMinute" {$gosaProxyWorkingStopACL} {$Tstate}>
          {html_options values=$minutes output=$minutes selected=$stopminute}
         </select>
       </td>
      &nbsp;
    </td>
       <td>
-    <input type="checkbox" id="filterB" name="filterB" value="B" {$filterB} {$pstate} {$gosaProxyAcctFlagsACL}>
+    <input type="checkbox" id="filterB" name="filterB" value="B" {$filterB} {$pstate} {$gosaProxyAcctFlagsACL}
+       onclick="
+               changeSubselectState('filterB', 'quota_size'); 
+               changeSubselectState('filterB', 'quota_unit'); 
+               changeSubselectState('filterB', 'gosaProxyQuotaPeriod');
+       ">
     {t}Restrict proxy usage by quota{/t}
     <br>
     <table style="margin-left:20px;">
      <tr>
       <td>
-       <input name="quota_size" id="quota_size" size=7 maxlength=10 {$pstate} {$gosaProxyQuotaACL} value="{$quota_size}">
+       <input name="quota_size" id="quota_size" size=7 maxlength=10 {$Bstate} {$gosaProxyQuotaACL} value="{$quota_size}">
        &nbsp;
-       <select size="1" name="quota_unit" id="quota_unit" {$pstate} {$gosaProxyQuotaACL}>
+       <select size="1" name="quota_unit" id="quota_unit" {$Bstate} {$gosaProxyQuotaACL}>
        {html_options options=$quota_unit selected=$quota_u}
        </select>
-       {t}per{/t} <!-- {$pstate} -->
-       <select size="1" name="gosaProxyQuotaPeriod" id="gosaProxyQuotaPeriod" {$pstate} {$gosaProxyQuotaACL}>
+       {t}per{/t}
+       <select size="1" name="gosaProxyQuotaPeriod" id="gosaProxyQuotaPeriod" {$Bstate} {$gosaProxyQuotaACL}>
         {html_options options=$quota_time selected=$gosaProxyQuotaPeriod}
        </select>
       </td>