Code

Applied gofax patch
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Apr 2010 06:39:51 +0000 (06:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Apr 2010 06:39:51 +0000 (06:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@17804 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc
gosa-plugins/mail/personal/mail/class_mailAccount.inc

index f7d814e474842d338ef959b327a4e20e34e841e6..35121299af835ee1dc84e9eedfe3c75418942050 100644 (file)
@@ -633,10 +633,9 @@ class gofaxAccount extends plugin
       $message[]= msgPool::invalid(_("Fax number"),$this->facsimileTelephoneNumber,"/[0-9]/");
     }
 
-    /* IF mail is specified (which is only the case if there's no mail account
-       present), check if it's valid..  */
-    if (@isset($this->parent->by_object['mailAccount']) &&
-        $this->goFaxDeliveryMode & 32){
+    // check for a valid Mail-Address in case of 'delivery to mailbox'
+    $mailAccount = (isset($this->parent->by_object['mailAccount']) && $this->parent->by_object['mailAccount']->is_account);
+    if(!$mailAccount && $this->goFaxDeliveryMode & 32){
       if ($this->mail == ""){
         $message[]= _("Mail delivery is requested without target address!");
       } elseif (!tests::is_email($this->mail)){
index 12755e1c2e9699177d84edb52d9af6a7132bd64f..79428a6f43f70831bdc8c0ca89bd76f448a03788 100644 (file)
@@ -799,6 +799,16 @@ class mailAccount extends plugin
       } 
     }
 
+    // Do NOT remove the mail attribute while it is used in the Fax Account.
+    if(isset($this->parent->by_object['gofaxAccount'])){
+        $fax = $this->parent->by_object['gofaxAccount'];
+
+        // Fax delivery to the mail account is activated, keep the mail attribute.
+        if($fax->goFaxDeliveryMode & 32){
+           $this->attributes = array_remove_entries(array('mail'), $this->attributes)  ;
+        }
+    }
+
     /* Remove GOsa attributes */
     plugin::remove_from_parent();