Code

Closes #288 Made conferences language selectable
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 30 Nov 2007 14:20:15 +0000 (14:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 30 Nov 2007 14:20:15 +0000 (14:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7966 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index c4feeee8c28b71013480cb671829c924f38f1207..9a10edd434cb68308091afb412077d73b930e551 100644 (file)
@@ -60,6 +60,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)
@@ -69,7 +72,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.
@@ -139,6 +144,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;
@@ -187,6 +196,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"));
@@ -246,6 +257,12 @@ class conference extends plugin
   {
     plugin::save_object();
     if(isset($_POST['cn'])){
+
+      /* Get selected language */
+      if(isset($_POST['language']) && isset($this->languages[get_post('language')])){
+        $this->language = get_post('language');
+      }
+
       foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
             "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D","goFonPIN") as $attrs){
         if(isset($_POST[$attrs])){
@@ -429,7 +446,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"){
@@ -603,6 +620,7 @@ class conference extends plugin
     }
 
     $this->attrs['goFonConferenceOption'].="|".$this->goFonConferenceOptionLifetime;
+    $this->attrs['goFonConferenceOption'].="|".$this->language;
     unset($this->attrs['goFonConferenceOptionLifetime']);
 
     /* Write back to ldap */
index 3163499f3fc6ec1a3d253c29a6191d2f14b5f054..eeda339b0b17fa401dc26b8d4231c06302b3cadf 100644 (file)
                 </select>
        </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>