Code

added state changes and disabled state for checkbox-input filed combination.
authorhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Oct 2010 11:47:46 +0000 (11:47 +0000)
committerhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Oct 2010 11:47:46 +0000 (11:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20139 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_Groupware.inc
gosa-plugins/groupware/personal/groupware/generic.tpl

index 1445b4b98c7816603fda5fdbb49ca011444f1db7..01141cd9c6d5caed0019566e38ecf6a4dc65e697 100644 (file)
@@ -241,6 +241,9 @@ class Groupware extends plugin
      */
     function execute()
     {
+               echo "execute <pre>";
+               print_r($_POST);
+               echo "</pre>";
         // Register plugin execution 
         $display = plugin::execute();
 
@@ -294,12 +297,6 @@ class Groupware extends plugin
             $this->dialog = TRUE;
             return($this->filterManager->execute());
         }
-               /****************
-                       MailLimits
-               ****************/
-               
-
-               
                
         /****************
           Folder editor
@@ -532,6 +529,7 @@ class Groupware extends plugin
      */    
     function save_object()
     {
+               echo "save Object";
         if(isset($_POST['groupwarePluginPosted'])){
 
             // We ran into a communication error with the backend. 
@@ -851,7 +849,13 @@ class Groupware extends plugin
                
                //checks for feature "mailLimit"              
                if($this->isFeatureEnabled("mailLimit") && $this->hasFeaturebeenChanged("mailLimit")){
-                       $this->groupwareDao->save("mailLimit", $this->uid, array("receive"=>$this->mailLimitReceiveValue, "send"=>$this->mailLimitSendValue,));
+                       if(!$this->mailLimitReceiveEnabled){
+                               $this->mailLimitReceiveValue = 0;
+                       }
+                       if(!$this->mailLimitSendEnabled){
+                               $this->mailLimitSendValue = 0;
+                       }
+                       $this->groupwareDao->save("mailLimit", $this->uid, array( "send"=>$this->mailLimitSendValue, "receive"=>$this->mailLimitReceiveValue));
                }
                if($this->isFeatureEnabled("vacationMessage")&& $this->hasFeaturebeenChanged("vacationMessage")){
                        if($this->vacationEnabled){
@@ -1069,4 +1073,4 @@ class Groupware extends plugin
 }
 
 
-?>
\ No newline at end of file
+?>
index 150763d0f8e9828c948e499b00643c10c04d3dfa..fa074232b4202164ef31d884cdb54490839dda4c 100644 (file)
     <tr>
         <td>
             {render acl=$mailBoxWarnLimitACL}
-                <input id='mailBoxWarnLimitEnabled' value='1' name="mailBoxWarnLimitEnabled" value="1" 
+                <input id='mailBoxWarnLimitEnabled' value='1' name="mailBoxWarnLimitEnabled" onclick="changeState('mailBoxWarnLimitValue');" value="1" 
                     {if $mailBoxWarnLimitEnabled} checked {/if} class="center" type='checkbox'>
             {/render}
             <label for="mailBoxWarnLimitValue">{t}Warn user about a full mailbox when it reaches{/t}</label>
             {render acl=$mailBoxWarnLimitACL}
                 <input id="mailBoxWarnLimitValue" name="mailBoxWarnLimitValue" 
-                    size="6" align="middle" type='text' value="{$mailBoxWarnLimitValue}"  class="center"> {t}MB{/t}
+                    size="6" align="middle" type='text' value="{$mailBoxWarnLimitValue}" {if !$mailBoxWarnLimitEnabled} disabled {/if} class="center"> {t}MB{/t}
             {/render}
         </td>
     </tr>
     <tr>
         <td>
             {render acl=$mailBoxSendSizelimitACL}
-                <input id='mailBoxSendSizelimitEnabled' value='1' name="mailBoxSendSizelimitEnabled" value="1" 
+                <input id='mailBoxSendSizelimitEnabled' value='1' name="mailBoxSendSizelimitEnabled" onclick="changeState('mailBoxSendSizelimitValue');" value="1" 
                     {if $mailBoxSendSizelimitEnabled} checked {/if} class="center" type='checkbox'>
             {/render}
             <label for="mailBoxSendSizelimitValue">{t}Refuse incoming mails when mailbox size reaches{/t}</label>
             {render acl=$mailBoxSendSizelimitACL}
                 <input id="mailBoxSendSizelimitValue" name="mailBoxSendSizelimitValue" 
-                    size="6" align="middle" type='text' value="{$mailBoxSendSizelimitValue}"  class="center"> {t}MB{/t}
+                    size="6" align="middle" type='text' value="{$mailBoxSendSizelimitValue}" {if !$mailBoxSendSizelimitEnabled} disabled {/if}  class="center"> {t}MB{/t}
             {/render}
         </td>
     </tr>
     <tr>
         <td>
             {render acl=$mailBoxHardSizelimitACL}
-                <input id='mailBoxHardSizelimitEnabled' value='1' name="mailBoxHardSizelimitEnabled" value="1" 
+                <input id='mailBoxHardSizelimitEnabled' value='1' name="mailBoxHardSizelimitEnabled" onclick="changeState('mailBoxHardSizelimitValue');" value="1" 
                     {if $mailBoxHardSizelimitEnabled} checked {/if} class="center" type='checkbox'>
             {/render}
             <label for="mailBoxHardSizelimitValue">{t}Refuse to send and receive mails when mailbox size reaches{/t}</label>
             {render acl=$mailBoxHardSizelimitACL}
                 <input id="mailBoxHardSizelimitValue" name="mailBoxHardSizelimitValue" 
-                    size="6" align="middle" type='text' value="{$mailBoxHardSizelimitValue}"  class="center"> {t}MB{/t}
+                    size="6" align="middle" type='text' value="{$mailBoxHardSizelimitValue}"  {if !$mailBoxHardSizelimitEnabled} disabled {/if} class="center"> {t}MB{/t}
             {/render}
         </td>
     </tr>
     <tr>
         <td>
             {render acl=$mailBoxAutomaticRemovalACL}
-                <input id='mailBoxAutomaticRemovalEnabled' value='1' name="mailBoxAutomaticRemovalEnabled" value="1" 
+                <input id='mailBoxAutomaticRemovalEnabled' value='1' name="mailBoxAutomaticRemovalEnabled" onclick="changeState('mailBoxAutomaticRemovalValue');" value="1" 
                     {if $mailBoxAutomaticRemovalEnabled} checked {/if} class="center" type='checkbox'>
             {/render}
             <label for="mailBoxAutomaticRemovalValue">{t}Remove mails older than {/t}</label>
             {render acl=$mailBoxAutomaticRemovalACL}
                 <input id="mailBoxAutomaticRemovalValue" name="mailBoxAutomaticRemovalValue" 
-                    size="6" align="middle" type='text' value="{$mailBoxAutomaticRemovalValue}"  class="center"> {t}days{/t}
+                    size="6" align="middle" type='text' value="{$mailBoxAutomaticRemovalValue}" {if !$mailBoxAutomaticRemovalEnabled} disabled {/if}  class="center"> {t}days{/t}
             {/render}
         </td>
     </tr>
        {if $mailLimit_isActive}
     <tr>
         <td>
-                        <input id='mailLimitReceiveEnabled' value='1' name="mailLimitReceiveEnabled" value="1" 
+                        <input id='mailLimitReceiveEnabled' value='1' name="mailLimitReceiveEnabled" value="1" onclick="changeState('mailLimitReceiveValue');"
                     {if $mailLimitReceiveEnabled} checked {/if} class="center" type='checkbox'>
             <label for="mailLimit">{t}Mailbox size limits receiving mails{/t}</label>
                        <input id="mailLimitReceiveValue" name="mailLimitReceiveValue" 
-                    size="6" align="middle" type='text' value="{$mailLimitReceiveValue}"  class="center"> {t}kbyte{/t}
+                    size="6" align="middle" type='text' value="{$mailLimitReceiveValue}" {if !$mailLimitReceiveEnabled} disabled {/if} class="center"> {t}kbyte{/t}
                 </td>
     </tr>
        <tr>
         <td>
-                       <input id='mailLimitSendEnabled' value='1' name="mailLimitSendEnabled" value="1" 
+                       <input id='mailLimitSendEnabled' value='1' name="mailLimitSendEnabled" value="1" onclick="changeState('mailLimitSendValue');"
                     {if $mailLimitSendEnabled} checked {/if} class="center" type='checkbox'>
                        <label for="mailLimit">{t}Mailbox size limits sending mails{/t}</label>
                        <input id="mailLimitSendValue" name="mailLimitSendValue" 
-                    size="6" align="middle" type='text' value="{$mailLimitSendValue}"  class="center"> {t}kbyte{/t}
+                    size="6" align="middle" type='text' value="{$mailLimitSendValue}" {if !$mailLimitSendEnabled} disabled {/if} class="center"> {t}kbyte{/t}
         </td>
     </tr>
        {/if}