From: hickert Date: Tue, 13 May 2008 12:34:26 +0000 (+0000) Subject: Allow saving voice mial context X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b623ec7e510bded9a00f6fbfc1ad3cd1bc2750b6;p=gosa.git Allow saving voice mial context git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@10882 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 4edb5afc1..cc75b6f3d 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -32,6 +32,7 @@ class phoneAccount extends plugin var $goFonHomeServers = array(); // Contains all available server configurations var $context = "default"; + var $voice_context = "default"; /* attribute list for save action */ var $CopyPasteVars = array("phoneNumbers","macroarray","macrostillavailable"/*"phoneNumbers" -Reset- */, @@ -263,9 +264,15 @@ class phoneAccount extends plugin if($r_con){ restore_error_handler(); $r_db = @mysql_select_db($cur_cfg['DB'],$r_con); - $query_tmp = "SELECT ".$cur_cfg['SIP_TABLE'].".context,".$cur_cfg['VOICE_TABLE'].".password - FROM ".$cur_cfg['VOICE_TABLE'].", ".$cur_cfg['SIP_TABLE']." - WHERE customer_id = sip_users.mailbox AND name='".$this->uid."'"; + $query_tmp = " + SELECT + ".$cur_cfg['VOICE_TABLE'].".context as 'v_context', + ".$cur_cfg['SIP_TABLE'].".context, + ".$cur_cfg['VOICE_TABLE'].".password + FROM ".$cur_cfg['VOICE_TABLE'].", + ".$cur_cfg['SIP_TABLE']." + WHERE customer_id = sip_users.mailbox AND name='".$this->uid."';"; + $res = mysql_query($query_tmp); $vp = mysql_fetch_assoc($res); @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query_tmp, "Database query"); @@ -275,6 +282,9 @@ class phoneAccount extends plugin if((isset($vp['context']))&&(!empty($vp['context']))){ $this->context = $vp['context']; } + if((isset($vp['v_context']))&&(!empty($vp['v_context']))){ + $this->voice_context = $vp['v_context']; + } } } $this->lastmacro=$this->macro; @@ -622,7 +632,7 @@ class phoneAccount extends plugin "mailbox" => $customer_id, "password" => $this->goFonVoicemailPIN, "fullname" => $CNname, - "context" => "default"; //$this->context, + "context" => $this->voice_context, "email" => $s_mail); /* Set pager number if available */ @@ -662,7 +672,7 @@ class phoneAccount extends plugin /********************** * Insert Voice mail entry **********************/ - $voice_data_array['context'] = "default";//$this->context; + $voice_data_array['context'] = $this->voice_context; /* There is currently no voice mail entry for this user. * We should create one @@ -894,6 +904,7 @@ class phoneAccount extends plugin /* Assign contexts */ $smarty->assign("contexts",$this->get_asterisk_contexts()); $smarty->assign("context" ,$this->context); + $smarty->assign("voice_context" ,$this->voice_context); $smarty->assign("goFonContextACL", chkacl($this->acl,"context")); /* Assing macroselectbox values */ @@ -1124,6 +1135,14 @@ class phoneAccount extends plugin $this->context= $_POST['context']; } + /* Save voice_context */ + if(isset($_POST['voice_context'])){ + if($this->voice_context != $_POST['voice_context']){ + $this->is_modified= TRUE; + } + $this->voice_context= $_POST['voice_context']; + } + if(isset($_POST['macro']) && $_POST['macro'] != $this->macro){ $this->is_modified =true; } diff --git a/plugins/gofon/phoneaccount/generic.tpl b/plugins/gofon/phoneaccount/generic.tpl index 3271b6882..e94a867a2 100644 --- a/plugins/gofon/phoneaccount/generic.tpl +++ b/plugins/gofon/phoneaccount/generic.tpl @@ -46,6 +46,15 @@ + + {t}Voicemail context{/t} + + + + +