Code

Made conference languages selectable
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 30 Nov 2007 14:15:59 +0000 (14:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 30 Nov 2007 14:15:59 +0000 (14:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7965 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index bae719aaecb07dda6b51351cfffa757ffbf9fe5e..c79ce83f8088c4ca44abf95bc61faa208aeb5288 100644 (file)
@@ -61,6 +61,9 @@ class conference extends plugin
       "goFonConferenceOption_M","goFonConferenceOption_s","goFonConferenceOption_i","goFonConferenceOption_c","goFonHomeServer",
       "goFonConferenceOption_D","goFonConferenceOptionFormat","goFonConferenceOptionLifetime","telephoneNumber","goFonConferenceOwner");
 
+  var $language  = "de";
+  var $languages = array();
+
   var $objectclasses= array("top", "goFonConference");
 
   function conference (&$config, $dn, $plugin= NULL)
@@ -70,7 +73,9 @@ class conference extends plugin
     $this->ui                      = get_userinfo();
     $this->orig_dn             = $dn;
 
-    
+    $this->languages= get_languages(TRUE,TRUE);
+
+
     /* Check server configurations
      * Load all server configuration in $this->goFonHomeServers if available
      *  and use first server as default if necessary.
@@ -137,6 +142,10 @@ class conference extends plugin
       }
 
       $this->goFonConferenceOptionLifetime  = $tmp1[1];
+      if(isset($tmp1[2]) && isset($this->languages[$tmp1[2]])){
+        $this->language = $tmp1[2];
+      }
+  
       $this->old_tele_number                = $this->telephoneNumber;
     }
     $this->old_dn = $this->dn;
@@ -204,6 +213,8 @@ class conference extends plugin
         $tmp[$dn]  = $val['SERVER'];
       }
     }
+    $smarty->assign("language",$this->language);
+    $smarty->assign("languages",$this->languages);
     $smarty->assign("goFonHomeServers",$tmp);
     $smarty->assign("goFonConferenceOptions",              array("D"=>"Conference ","d"=>"Conference without PIN"));
     $smarty->assign("goFonConferenceOptionFormats",    array("WAV"=>"Wave","GSM"=>"GSM","WAV49"=>"Wave49"));
@@ -270,6 +281,11 @@ class conference extends plugin
   {
     if(isset($_POST['phoneConferenceGeneric'])){
 
+      /* Get selected language */
+      if(isset($_POST['language']) && isset($this->languages[get_post('language')])){
+        $this->language = get_post('language');
+      }
+
       /* Create a base backup and reset the
          base directly after calling plugin::save_object();
          Base will be set seperatly a few lines below */
@@ -480,7 +496,7 @@ class conference extends plugin
       $EXT[$i]['context'] = $context;
       $EXT[$i]['priority']= $i;
       $EXT[$i]['app']     ="SetLanguage";
-      $EXT[$i]['appdata'] ="de";
+      $EXT[$i]['appdata'] =$this->language;
       $i++;      
 
       if($this->goFonConferenceOption_r == "r"){
@@ -659,6 +675,7 @@ class conference extends plugin
     }
 
     $this->attrs['goFonConferenceOption'].="|".$this->goFonConferenceOptionLifetime;
+    $this->attrs['goFonConferenceOption'].="|".$this->language;
     unset($this->attrs['goFonConferenceOptionLifetime']);
 
     /* Write back to ldap */
index d35ea462400cada8514b5acbeb5cd6d06b021a00..63938a43c939a44a471aca91536267e28fa16d9e 100644 (file)
 {/render}
           </td>
         </tr>
+        <tr>
+          <td>{t}Language{/t}
+          </td>
+          <td>
+            <select name="language" title="{t}Select language{/t}">
+              {html_options options=$languages selected=$language}
+            </select>
+          </td>
+        </tr>
       </table>
     </td>
     <td style="border-left:1px solid #A0A0A0">