[Fusionforge-commits] r6799 - trunk/gforge/common/tracker

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Jan 29 13:50:34 CET 2009


Author: lolando
Date: 2009-01-29 13:50:34 +0100 (Thu, 29 Jan 2009)
New Revision: 6799

Modified:
   trunk/gforge/common/tracker/Artifact.class.php
Log:
Add who opened or modified an artifact in the notification email

Modified: trunk/gforge/common/tracker/Artifact.class.php
===================================================================
--- trunk/gforge/common/tracker/Artifact.class.php	2009-01-29 12:19:23 UTC (rev 6798)
+++ trunk/gforge/common/tracker/Artifact.class.php	2009-01-29 12:50:34 UTC (rev 6799)
@@ -1191,8 +1191,23 @@
 			$changes=array();
 		}
 		
-		$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was opened at ". date( _('Y-m-d H:i'), $this->getOpenDate() ). 
-			"\nYou can respond by visiting: ".
+		$sess = session_get_user() ;
+		if ($type == 1) { // Initial opening
+			if ($sess) {
+				$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was opened at ". date( _('Y-m-d H:i'), $this->getOpenDate() ) . " by " . $sess->getRealName () ;
+			} else {
+				$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was opened at ". date( _('Y-m-d H:i'), $this->getOpenDate() ) ;
+			}
+		} else {
+			if ($sess) {
+				$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was changed at ". date( _('Y-m-d H:i'), $this->getOpenDate() ) . " by " . $sess->getRealName ();
+			} else {
+				$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was changed at ". date( _('Y-m-d H:i'), $this->getOpenDate() ) ;
+			}
+		}
+			      
+
+		$body .= "\nYou can respond by visiting: ".
 			"\n".util_make_url ('/tracker/?func=detail&atid='. $this->ArtifactType->getID() .
 					    "&aid=". $this->getID() .
 					    "&group_id=". $this->ArtifactType->Group->getID()) .




More information about the Fusionforge-commits mailing list