Code

phonePIN is disabled if chkbox is not set
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Aug 2005 07:15:33 +0000 (07:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Aug 2005 07:15:33 +0000 (07:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1161 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/conference/class_phoneConferenceGeneric.inc
plugins/gofon/conference/generic.tpl

index 2b882da6b89dcf6cbca2de9a031385c89c1c6270..25e158d5b4d9ed7be926fbe6187fee23f2f74b3a 100644 (file)
@@ -121,6 +121,12 @@ class conference extends plugin
                        $smarty->assign($val."CHK", " checked ");
                }
        }
+  if($this->goFonConferenceOption_P != "P"){
+    $smarty->assign("goFonPINACL"," disabled ");
+    $smarty->assign("goFonPIN","");
+  }
+
        return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
   }
 
@@ -141,7 +147,7 @@ class conference extends plugin
     plugin::save_object();
     if(isset($_POST['cn'])){
       foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
-            "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D") as $attrs){
+            "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D","goFonPIN") as $attrs){
       if(isset($_POST[$attrs])){
         $this->$attrs = $_POST[$attrs];
       }else{
@@ -378,6 +384,9 @@ class conference extends plugin
   $this->SQL_remove_me(true);
   $this->SQL_add_me(true);
 
+  if(empty($this->goFonConferenceOption_P)){
+    $this->attrs['goFonPIN']=array();
+  }
   $this->attrs['goFonConferenceOption']="";
   foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
             "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D","goFonConferenceOptionFormat") as $attrs){
index b46b782590a31a9668363e02475d2a4d37293979..47d044978cdce84c66246918b934a5478e992af5 100644 (file)
@@ -87,7 +87,8 @@
        <table summary="">
     <tr>
        <td colspan=2>
-               <input type="checkbox" name="goFonConferenceOption_P" value="P" {$goFonConferenceOption_PCHK} {$goFonConferenceOption_PACL}> 
+               <input type="checkbox" onclick="changeState('goFonPIN');" name="goFonConferenceOption_P" 
+                                       value="P" {$goFonConferenceOption_PCHK} {$goFonConferenceOption_PACL}> 
                {t}preset PIN{/t}
        </td>
        </tr>
@@ -96,7 +97,7 @@
        &nbsp;  {t}PIN{/t}
        </td>
        <td>
-               <input type='text' name="goFonPIN" {$goFonPINACL} value="{$goFonPIN}">
+               <input type='text' name="goFonPIN" {$goFonPINACL} id="goFonPIN" value="{$goFonPIN}">
        </td>
        </tr>
        <tr>