summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0724b2a)
raw | patch | inline | side by side (parent: 0724b2a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 16 Aug 2005 13:31:19 +0000 (13:31 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 16 Aug 2005 13:31:19 +0000 (13:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1155 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/conference/class_phoneConferenceGeneric.inc | patch | blob | history | |
plugins/gofon/conference/generic.tpl | patch | blob | history |
diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc
index b277a3b4167e40b2d49c8e1e0455eda1c30765e4..c95a03717d68426eceaa274a49096ecd79b65af8 100644 (file)
var $goFonPIN = "";
var $goFonConferenceOption = "";
- var $goFonConferenceOption_D = ""; // Set PIN
+ var $goFonConferenceOption_P = ""; // Set PIN
var $goFonConferenceOption_r = ""; // record Conference
var $goFonConferenceOption_M = ""; // Play Music opn hold
var $goFonConferenceOption_s = ""; // activate menu
var $goFonConferenceOption_i = ""; // announce new and leaving user
var $goFonConferenceOption_c = ""; // Count User
- var $goFonConferenceOption_P = ""; // Conference Type, no PIN/PIN
+ var $goFonConferenceOption_D = ""; // Conference Type, no PIN/PIN
var $goFonConferenceOptionFormat = "";
var $goFonConferenceOptionLifetime = "";
- var $goFonConferenceOptionNumber = "";
+ var $telephoneNumber = "";
var $old_tele_number = false;
var $generate_error = "";
var $departments= array();
/* attribute list for save action */
- var $attributes= array("cn", "description", "goFonPIN","goFonConferenceOption_D","goFonConferenceOption_r",
+ var $attributes= array("cn", "description", "goFonPIN","goFonConferenceOption_P","goFonConferenceOption_r",
"goFonConferenceOption_M","goFonConferenceOption_s","goFonConferenceOption_i","goFonConferenceOption_c",
- "goFonConferenceOption_P","goFonConferenceOptionFormat","goFonConferenceOptionLifetime","goFonConferenceOptionNumber");
+ "goFonConferenceOption_D","goFonConferenceOptionFormat","goFonConferenceOptionLifetime","telephoneNumber");
var $objectclasses= array("top", "goFonConference");
for($i = 0 ; $i < strlen($tmp1[0]);$i++){
$varname = "goFonConferenceOption_".$tmp1[0][$i];
- $this->$varname = $tmp1[0][$i];
+ if($tmp1[0][$i]=="d"){
+ $this->goFonConferenceOption_D = $tmp1[0][$i];
+ }else{
+ $this->$varname = $tmp1[0][$i];
+ }
}
$this->goFonConferenceOptionLifetime = $tmp1[1];
- $this->goFonConferenceOptionNumber = $tmp1[2];
- $this->old_tele_number = $tmp1[2];
+ $this->old_tele_number = $this->telephoneNumber;
}
}
$this->config->make_idepartments();
$smarty= get_smarty();
- $smarty->assign("goFonConferenceOptions", array("P"=>"Conference ",""=>"Conference without PIN"));
+ $smarty->assign("goFonConferenceOptions", array("D"=>"Conference ","d"=>"Conference without PIN"));
$smarty->assign("goFonConferenceOptionFormats", array("WAV"=>"Wave","GSM"=>"GSM","WAV49"=>"Wave49"));
- $smarty->assign("goFonConferenceOption", $this->goFonConferenceOption_P);
+ $smarty->assign("goFonConferenceOption", $this->goFonConferenceOption_D);
foreach ($this->attributes as $val){
$smarty->assign("$val", $this->$val);
{
plugin::save_object();
if(isset($_POST['cn'])){
- foreach(array("goFonConferenceOption_D","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
- "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_P") as $attrs){
+ foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
+ "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D") as $attrs){
if(isset($_POST[$attrs])){
$this->$attrs = $_POST[$attrs];
}else{
function check()
{
$message= array();
-
+
+ if($this->is_number_used()){
+ $message[] = $this->is_number_used();
+ }
+
+ if((!empty($this->goFonPIN)||($this->goFonConferenceOption_P=="P"))&&($this->goFonConferenceOption_D=="d")){
+ $message[] =_("You have specified a conference 'without PIN' ... please leave the PIN fields empty.");
+ }
+
+ if((empty($this->goFonPIN))&&($this->goFonConferenceOption_P=="P")&&($this->goFonConferenceOption_D=="D")){
+ $message[]= _("Please enter a PIN.");
+ }
+
if(empty($this->cn)){
$message[] =_("Please enter a name for the conference.");
}
- if(!is_numeric($this->goFonConferenceOptionNumber)){
+ if(!is_numeric($this->telephoneNumber)){
$message[] =_("Only numeric chars are allowed in Number field.");
}
return false;
}
- if((!empty($this->goFonConferenceOptionNumber))&&($save==true)){
+ if((!empty($this->telephoneNumber))&&($save==true)){
$EXT=array();
$parameter ="";
- foreach(array("goFonConferenceOption_D","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
- "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_P") as $attrs){
+ foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
+ "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D") as $attrs){
$parameter .= $this->$attrs;
}
$i=1;
$context="GOsa";
// Set Language to German
- $EXT[$i]['exten'] =$this->goFonConferenceOptionNumber;
+ $EXT[$i]['exten'] =$this->telephoneNumber;
$EXT[$i]['context'] = $context;
$EXT[$i]['priority']= $i;
$EXT[$i]['app'] ="SetLanguage";
if($this->goFonConferenceOption_r == "r"){
// Recordingformat for conference
- $EXT[$i]['exten'] =$this->goFonConferenceOptionNumber;
+ $EXT[$i]['exten'] =$this->telephoneNumber;
$EXT[$i]['context'] =$context;
$EXT[$i]['priority']= $i;
$EXT[$i]['app'] ="Setvar";
}
// Answer Call
- $EXT[$i]['exten'] =$this->goFonConferenceOptionNumber;
+ $EXT[$i]['exten'] =$this->telephoneNumber;
$EXT[$i]['context'] =$context;
$EXT[$i]['priority']=$i;
$EXT[$i]['app'] ="answer";
$i++;
// Start Conference
- $EXT[$i]['exten'] =$this->goFonConferenceOptionNumber;
+ $EXT[$i]['exten'] =$this->telephoneNumber;
$EXT[$i]['context'] =$context;
$EXT[$i]['priority']=$i;
$EXT[$i]['app'] ="MeetMe";
- $EXT[$i]['appdata'] =$this->goFonConferenceOptionNumber."|".$parameter."|".$this->goFonPIN;
+
+ if(empty($this->goFonPIN)) {
+ $EXT[$i]['appdata'] =$this->telephoneNumber."|".$parameter;
+ }else{
+ $EXT[$i]['appdata'] =$this->telephoneNumber."|".$parameter."|".$this->goFonPIN;
+ }
$i++;
// Start Conference
$EXT[$i]['context'] =$context;
$EXT[$i]['priority']=1;
$EXT[$i]['app'] ="Goto";
- $EXT[$i]['appdata'] =$this->goFonConferenceOptionNumber."|1";
+ $EXT[$i]['appdata'] =$this->telephoneNumber."|1";
$SQL=array();
foreach($EXT as $keytop => $valtop){
return false;
}
- $SQL = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE (exten= '".$this->old_tele_number."') OR (exten='".$this->goFonConferenceOptionNumber."')";
+ $SQL = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE (exten= '".$this->old_tele_number."')
+ OR (exten='".$this->telephoneNumber."')
+ OR (exten='".$this->cn."')";
if($save){
@mysql_query($SQL);
}
}
- foreach($this->phoneNumbers as $num){
- if(!isset($this->cn)) $this->cn = "";
-
- if((isset($numbers[$num]))&&(($numbers[$num]['uid'][0]!=$this->uid))){
- if(isset($numbers[$num]['uid'][0])){
- return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
- }else{
- return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
- }
+ $num = $this->telephoneNumber;
+ if((isset($numbers[$num]))&&(($numbers[$num]['cn'][0]!=$this->cn))){
+ if(isset($numbers[$num]['uid'][0])){
+ return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
+ }else{
+ return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
}
}
}
-
/* Save to LDAP */
function save()
{
$this->SQL_add_me(true);
$this->attrs['goFonConferenceOption']="";
- foreach(array("goFonConferenceOption_D","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
- "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_P","goFonConferenceOptionFormat") as $attrs){
+ foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s",
+ "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D","goFonConferenceOptionFormat") as $attrs){
$this->attrs['goFonConferenceOption'] .= $this->$attrs;
unset($this->attrs[$attrs]);
}
$this->attrs['goFonConferenceOption'].="|".$this->goFonConferenceOptionLifetime;
unset($this->attrs['goFonConferenceOptionLifetime']);
- $this->attrs['goFonConferenceOption'].="|".$this->goFonConferenceOptionNumber;
- unset($this->attrs['goFonConferenceOptionNumber']);
-
-
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
$ldap->cat($this->dn);
index 167fa6fd7d3a6cd6e441fa987f8816a29f45e864..0cd720efb19c257c9a5ce1472730fa99e6101631 100644 (file)
<td colspan="2"><br></td>
</tr>
<tr>
- <td><LABEL for="goFonConferenceOption_P">{t}Base{/t}</LABEL>{$must}</td>
+ <td><LABEL for="goFonConferenceOption_D">{t}Base{/t}</LABEL>{$must}</td>
<td>
- <select id="goFonConferenceOption_P" size="1" name="goFonConferenceOption_P" title="{t}Choose subtree to place department in{/t}">
- {html_options options=$goFonConferenceOptions selected=$goFonConferenceOption_P}
+ <select id="goFonConferenceOption_D" size="1" name="goFonConferenceOption_D" title="{t}Choose subtree to place department in{/t}">
+ {html_options options=$goFonConferenceOptions selected=$goFonConferenceOption_D}
</select>
</td>
</tr>
{t}Number{/t}
</td>
<td>
- <input name="goFonConferenceOptionNumber" value="{$goFonConferenceOptionNumber}" {$goFonConferenceOptionNumberACL}>
+ <input name="telephoneNumber" value="{$telephoneNumber}" {$telephoneNumberACL}>
</td>
</tr>
</table>
<table summary="">
<tr>
<td colspan=2>
- <input type="checkbox" name="goFonConferenceOption_D" value="D" {$goFonConferenceOption_DCHK} {$goFonConferenceOption_DACL}>
+ <input type="checkbox" name="goFonConferenceOption_P" value="P" {$goFonConferenceOption_PCHK} {$goFonConferenceOption_PACL}>
{t}preset PIN{/t}
</td>
</tr>