Code

Fixed replacing of dateOfBirth in vacation templates
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 5 Feb 2007 04:50:52 +0000 (04:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 5 Feb 2007 04:50:52 +0000 (04:50 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5687 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/mail/class_mailAccount.inc

index 96c09aa185b6593e0755a31a457abf3007e93219..93662308dd0c3ae65a175ad428ef9706c9c0012a 100644 (file)
@@ -406,8 +406,15 @@ class mailAccount extends plugin
       /* Replace attributes */
       $attrs= $this->parent->by_object['user']->attributes;
       foreach ($attrs as $val){
-        $contents= preg_replace("/%$val/",
-            $this->parent->by_object['user']->$val, $contents);
+        
+        if(preg_match("/dateOfBirth/",$val)){
+          if($this->parent->by_object['user']->use_dob){
+            $contents= preg_replace("/%$val/",date("Y-d-m",$this->parent->by_object['user']->dateOfBirth),$contents);
+          }
+        }else {
+          $contents= preg_replace("/%$val/",
+              $this->parent->by_object['user']->$val, $contents);
+        }
       }
 
       /* Save message */