Code

Removed $config reference
[gosa.git] / plugins / admin / ogroups / class_phonequeue.inc
index da087b6efd9235da7752b7020fdae7713624a92f..827d2ad8a2309a5423a05e64214c9f073d56072e 100644 (file)
@@ -99,6 +99,9 @@ class phonequeue extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
       $this->is_account= !$this->is_account;
@@ -183,9 +186,8 @@ class phonequeue extends plugin
   /* Check formular input */
   function check()
   {
-    $message= array();
-  #fixme workaround : Tab is not initialised correct
-         if(!$this->is_account) return($message);
+    /* Call common method to give check the hook */
+    $message= plugin::check();
 
     if($this->is_number_used()){
       $message[] = $this->is_number_used();
@@ -222,8 +224,7 @@ class phonequeue extends plugin
     $SQL = array();
 
     if(!isset($_SESSION['config']->data['SERVERS']['FON'])){
-      return(_("There is currently no asterisk server defined. Possibly you are missing a server that handles the asterisk management (goFonServer). Your settings can't be saved to asterisk database."));
-      return(false);
+      return(_("There is currently no asterisk server defined. Your settings can't be saved."));
     }
 
     // Get Configuration for Mysql database Server
@@ -580,9 +581,10 @@ class phonequeue extends plugin
 
     /* Save data to LDAP */
     $ldap->cd($this->dn);
-    $ldap->modify($this->attrs);
+    $this->cleanup();
+    $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error());
+    show_ldap_error($ldap->get_error(), _("Saving phone queue failed"));
 
     /* Optionally execute a command after we're done */
     if ($this->initially_was_account == $this->is_account){
@@ -676,10 +678,30 @@ class phonequeue extends plugin
     @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
         $this->attributes, "Save");
     $ldap->cd($this->dn);
-    $ldap->modify($this->attrs);
-    show_ldap_error($ldap->get_error());
+    $this->cleanup();
+    $ldap->modify ($this->attrs); 
+
+    show_ldap_error($ldap->get_error(), _("Removing phone queue failed"));
+  }
+
+  
+  function getCopyDialog()
+  {
+    $str  = "";
+    $str .= _("Phone number");
+    $str .= "&nbsp;<input type='text' name='telephoneNumber' value='".$this->telephoneNumber."'>";
+    return($str);
   }
 
+
+  function saveCopyDialog()
+  {
+    if(isset($_POST['telephoneNumber'])){
+      $this->telephoneNumber = $_POST['telephoneNumber'];
+    }
+  }
+
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: