From 7c1445a8809b5649135d8fb09865669bc5f35a54 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Aug 2005 09:07:57 +0000 Subject: [PATCH] Saome changes, for queue attributes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1097 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_phonequeue.inc | 38 +++++++--------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc index 8e7f22723..37e716138 100644 --- a/plugins/admin/ogroups/class_phonequeue.inc +++ b/plugins/admin/ogroups/class_phonequeue.inc @@ -52,17 +52,18 @@ class phonequeue extends plugin /* Save initial account state */ $this->initially_was_account= $this->is_account; - if(isset($this->attrs['telephoneNumber'])){ - $this->telephoneNumber=$this->attrs['telephoneNumber']; - unset($this->telephoneNumber['count']); - } - + if($this->is_account){ + if(isset($this->attrs['telephoneNumber'])){ + $this->telephoneNumber=$this->attrs['telephoneNumber']; + unset($this->telephoneNumber['count']); + } - for($i = 0; $i < strlen($this->goFonDialOption); $i++){ - $name = "goFonDialOption_".$this->goFonDialOption[$i]; - $this->$name=$this->goFonDialOption[$i]; + for($i = 0; $i < strlen($this->goFonDialOption); $i++){ + $name = "goFonDialOption_".$this->goFonDialOption[$i]; + $this->$name=$this->goFonDialOption[$i]; + } } - + $this->old_phone_numbers = $this->telephoneNumber; } @@ -160,9 +161,6 @@ class phonequeue extends plugin function check() { $message= array(); - // if(empty($this->description)){ - // $message[] = _("You must specify a description for this queue"); - // } if($this->is_number_used()){ $message[] = $this->is_number_used(); @@ -221,8 +219,6 @@ class phonequeue extends plugin return( sprintf(_("Can't select database %s on %s."),$a_SETUP['DB'],$a_SETUP['SERVER'])); } - - if($save){ $i = 0; $prio = 11; @@ -232,11 +228,6 @@ class phonequeue extends plugin $this->attrs['cn'][0] = $this->parent->by_object['ogroup']->cn; } - if(empty($this->description)){ - $this->description = $this->parent->by_object['ogroup']->description; - $this->attrs['description'][0] = $this->parent->by_object['ogroup']->description; - } - // Delete old Entries $delete = array(); if(is_array($this->old_phone_numbers)){ @@ -315,7 +306,7 @@ class phonequeue extends plugin $a_ext[$i]['exten'] = $num; $a_ext[$i]['priority'] = 4; $a_ext[$i]['app'] = "SetCIDName"; - $a_ext[$i]['appdata'] = $this->attrs['description'][0]; + $a_ext[$i]['appdata'] = $this->parent->by_object['ogroup']->description; $i ++ ; $a_ext[$i]['context'] = 'GOsa'; $a_ext[$i]['exten'] = $num; @@ -475,7 +466,7 @@ class phonequeue extends plugin } $this->generate_mysql_entension_entries(true); if($this->attrs['goFonDialOption']=="") $this->attrs['goFonDialOption']=array(); - + /* Save data to LDAP */ $ldap->cd($this->dn); $ldap->modify($this->attrs); @@ -540,11 +531,6 @@ class phonequeue extends plugin $this->attrs['cn'][0] = $this->parent->by_object['ogroup']->cn; } - if(empty($this->description)){ - $this->description = $this->parent->by_object['ogroup']->description; - $this->attrs['description'][0] = $this->parent->by_object['ogroup']->description; - } - // Delete old Entries $delete = array(); foreach($this->old_phone_numbers as $phone){ -- 2.30.2