Code

Updated asterisk conference copy & paste
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Jun 2007 10:38:03 +0000 (10:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Jun 2007 10:38:03 +0000 (10:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6590 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/conference/class_phoneConferenceGeneric.inc

index 1714edca398964a2f7f8c818bbabdb2d73026997..24e0fa19b760ab2bc1ae8981b7ecd3f1cfccf996 100644 (file)
@@ -24,6 +24,7 @@ class conference extends plugin
   var $cn                                                = "";
   var $description             = "";
   var $base                              = "";
+  var $old_base            = "";
   var $ou                                              = "";
   var $goFonPIN                                = "";
   var $old_cn         = "";
@@ -140,6 +141,7 @@ class conference extends plugin
     }
     $this->old_dn = $this->dn;
     $this->old_cn = $this->cn;
+    $this->old_base = $this->base;
   }
 
 
@@ -387,11 +389,13 @@ class conference extends plugin
       $message[] = $str;
     }
 
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->base);
-    $ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn"));
-    if($ldap->count()){
-      $message[] =_("There is already a conference with this name in the current tree.");
+    if($this->old_cn != $this->cn || $this->base != $this->old_base){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->base);
+      $ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn"));
+      if($ldap->count()){
+        $message[] =_("There is already a conference with this name in the current tree.");
+      }
     }
     return $message;
   }
@@ -714,6 +718,17 @@ class conference extends plugin
     }
   }
 
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source) ;
+
+    $source_o = new conference($this->config,$source['dn']);
+  
+    foreach($this->attributes as $attr){
+      $this->$attr = $source_o->$attr;
+    }
+  }
+
 
   /* Return plugin informations for acl handling */
   function plInfo()