summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5fe26ce)
raw | patch | inline | side by side (parent: 5fe26ce)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 22 Aug 2005 12:50:36 +0000 (12:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 22 Aug 2005 12:50:36 +0000 (12:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1199 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/ogroups/class_phonequeue.inc | patch | blob | history |
diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc
index 7e2c822a11ba5afd86a8a7bd037687ca43787fdc..c5fb59f7e3ff720560ef8297eea19773daefac64 100644 (file)
/* attribute list for save action */
var $attributes= array( "goFonTimeOut","goFonMaxLen","goFonAnnounceFrequency","goFonDialOption_t","goFonDialOption_T",
- "goFonDialOption_h","goFonDialOption_r",
+ "goFonDialOption_h","goFonDialOption_r","cn",
"goFonDialOption_H","goFonMusiconHold","goFonWelcomeMusic","goFonQueueReportHold","goFonQueueYouAreNext",
"goFonQueueThereAre","goFonQueueCallsWaiting","goFonQueueThankYou","goFonQueueMinutes","goFonQueueSeconds","goFonQueueLessThan",
"telephoneNumber","goFonQueueLanguage","goFonQueueStrategy","goFonQueueAnnounceHoldtime","goFonQueueAnnounce","goFonDialOption","goFonQueueRetry");
$message[] = $this->is_number_used();
}
- if($this->generate_mysql_entension_entries()){
- $message[] = $this->generate_mysql_entension_entries();
+ if($this->generate_mysql_table_entries()){
+ $message[] = $this->generate_mysql_table_entries();
}
if(!((is_numeric($this->goFonTimeOut))||(empty($this->goFonTimeOut)))){
- function generate_mysql_entension_entries($save = false)
+ function generate_mysql_table_entries($save = false)
{
$SQL = array();
$i = 0;
$prio = 11;
- if(empty($this->cn)){
- $this->cn = $this->parent->by_object['ogroup']->cn;
- $this->attrs['cn'][0] = $this->parent->by_object['ogroup']->cn;
+ $delete = array();
+ if(!empty($this->parent->by_object['ogroup'])){
+ $new_cn = $this->parent->by_object['ogroup']->cn;
}
+ $old_cn = $this->cn;
+
+ $delete[]= "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$new_cn."';\n";
+ $delete[]= "DELETE FROM ".$a_SETUP['QUEUE_TABLE']." WHERE name='".$new_cn."'; \n";
+ $delete[]= "DELETE FROM ".$a_SETUP['QUEUE_MEMBER_TABLE']." WHERE queue_name='".$new_cn."';\n";
+ $delete[]= "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$old_cn."';\n";
+ $delete[]= "DELETE FROM ".$a_SETUP['QUEUE_TABLE']." WHERE name='".$old_cn."'; \n";
+ $delete[]= "DELETE FROM ".$a_SETUP['QUEUE_MEMBER_TABLE']." WHERE queue_name='".$old_cn."';\n";
// Delete old Entries
- $delete = array();
if(is_array($this->old_phone_numbers)){
foreach($this->old_phone_numbers as $phone){
$delete[]= "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$phone."';\n";
}
}
- $delete[]= "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$this->attrs['cn'][0]."';\n";
- $delete[]= "DELETE FROM ".$a_SETUP['QUEUE_TABLE']." WHERE name=\"".$this->attrs['cn'][0]."\"; \n";
- $delete[]= "DELETE FROM ".$a_SETUP['QUEUE_MEMBER_TABLE']." WHERE queue_name=\"".$this->attrs['cn'][0]."\";\n";
/* Perform queries to delte old entries */
foreach($delete as $query){
}
}
+ $this->attrs['cn'][0] = $new_cn;
+
/* Append new Member for this queue */
$i = 0;
$queueuser =array();
}
}
-
/* generate Extension entries, with priority */
$queueusers=0;
if(!$this->is_account) return;
$ldap= $this->config->get_ldap_link();
+ $this->generate_mysql_table_entries(true);
+
plugin::save();
$this->attrs['goFonDialOption'] = "";
- foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H") as $val){
+ foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H","cn") as $val){
$this->attrs['goFonDialOption'].=$this->$val;
unset($this->attrs[$val]);
}
- $this->generate_mysql_entension_entries(true);
if($this->attrs['goFonDialOption']=="") $this->attrs['goFonDialOption']=array();
if($this->goFonQueueAnnounceHoldtime != "no" ){
return( sprintf(_("Can't select database %s on %s."),$a_SETUP['DB'],$a_SETUP['SERVER']));
}
+ /* Remove all temporary attributes */
$tmp = array_flip($this->attributes);
- foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H") as $val){
+ foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H","cn") as $val){
unset($this->$val);
unset($this->attrs[$val]);
unset($tmp[$val]);