Code

Updated msgDialog call to msg_dialog
[gosa.git] / gosa-plugins / gofax / gofax / faxaccount / class_gofaxAccount.inc
index 63f22cee6057f5290813c78acabf700fe59a1154..ff46610246200f0235b0ad4a79581a997e7cf9b4 100644 (file)
@@ -6,12 +6,6 @@ class gofaxAccount extends plugin
   var $plHeadline= "FAX";
   var $plDescription= "This does something";
 
-  /* CLI vars */
-  var $cli_summary= "Manage users fax account";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
-
   /* Department list shown in the divSelectList*/
   var $departments;
 
@@ -244,7 +238,7 @@ class gofaxAccount extends plugin
     /* Add number to blocklist (dialog) */
     if (isset($_POST['add_blocklist_number']) && $_POST['block_number'] != ""){
       if (!tests::is_phone_nr($_POST['block_number'])){
-        print_red (_("You're trying to add an invalid phone number."));
+        msg_dialog::display(_("Error"), _("Phone number is not valid!"), ERROR_DIALOG);
       } else {
         array_push($this->current_blocklist, $_POST['block_number']);
         $this->current_blocklist= array_unique($this->current_blocklist);
@@ -660,7 +654,9 @@ class gofaxAccount extends plugin
 
     new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
-    show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/fax account with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+    }
 
     /* Optionally execute a command after we're done */
     $this->handle_post_events('remove',array("uid"=> $this->uid));
@@ -675,11 +671,11 @@ class gofaxAccount extends plugin
 
     /* must: facsimileTelephoneNumber */
     if ($this->facsimileTelephoneNumber == ""){
-      $message[]= _("The required field 'Fax' is not set.");
+      $message[]= _("Fax is empty!");
     }
 
     if (!tests::is_phone_nr($this->facsimileTelephoneNumber)){
-      $message[]= _("Please enter a valid telephone number in the 'Fax' field.");
+      $message[]= _("Fax number is not valid!");
     }
 
     /* IF mail is specified (which is only the case if there's no mail account
@@ -687,15 +683,15 @@ class gofaxAccount extends plugin
     if (@isset($this->parent->by_object['mailAccount']) &&
         $this->goFaxDeliveryMode & 32){
       if ($this->mail == ""){
-        $message[]= _("Mail delivery is checked, but no address has been specified.");
+        $message[]= _("Mail delivery is requested without target address!");
       } elseif (!tests::is_email($this->mail)){
-        $message[]= _("The mail address you've entered is invalid.");
+        $message[]= _("Mail address is invalid!");
       }
     }
 
     // IE Fix, IE lets you choose disabled option, stupid browser ... 
     if((empty($this->goFaxPrinter))&&($this->goFaxDeliveryMode & 64)){
-      $message[]= _("Deliver fax to printer, is only possible if valid printer is given. Please correct your choice.");
+      $message[]= _("Printing is requested without a target printer!");
     }
 
     return ($message);
@@ -787,7 +783,9 @@ class gofaxAccount extends plugin
       new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
-    show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/fax account with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+    }
 
     /* Optionally execute a command after we're done */
     if ($this->initially_was_account == $this->is_account){