[Fusionforge-commits] r12286 - trunk/src/common/tracker

Thorsten Glaser mirabilos at fusionforge.org
Tue Feb 15 14:32:45 CET 2011


Author: mirabilos
Date: 2011-02-15 14:32:45 +0100 (Tue, 15 Feb 2011)
New Revision: 12286

Modified:
   trunk/src/common/tracker/Artifact.class.php
Log:
apply fix from Evolvis:
?\226?\128?\162 when sending out tracker mails, the date of the _change_ is only the
  artefact opening date if it?\226?\128?\153s being opened; use the real change date
  (currently, ?\226?\128?\156now?\226?\128?\157, but can be changed for imports) instead if needed
?\226?\128?\162 drop unenglish comma while here (also from Evolvis)


Modified: trunk/src/common/tracker/Artifact.class.php
===================================================================
--- trunk/src/common/tracker/Artifact.class.php	2011-02-13 19:50:11 UTC (rev 12285)
+++ trunk/src/common/tracker/Artifact.class.php	2011-02-15 13:32:45 UTC (rev 12286)
@@ -308,7 +308,7 @@
 			//
 			//	now send an email if appropriate
 			//
-			$this->mailFollowup(1);
+			$this->mailFollowupEx(0, 1);
 			db_commit();
 
 			return $artifact_id;
@@ -764,17 +764,18 @@
 			}
 		}
 
+		$now = time();
 		$res = db_query_params ('INSERT INTO artifact_message (artifact_id,submitted_by,from_email,adddate,body) VALUES ($1,$2,$3,$4,$5)',
 					array ($this->getID(),
 					       $user_id,
 					       $by,
-					       time(),
+					       $now,
 					       htmlspecialchars($body))) ;
 
 		$this->updateLastModifiedDate();
 
 		if ($send_followup) {
-			$this->mailFollowup(2,false);
+			$this->mailFollowupEx($now, 2, false);
 		}
 		return $res;
 	}
@@ -1035,6 +1036,7 @@
 		//
 		//	handle audit trail
 		//
+		$now = time();
 		if ($this->getStatusID() != $status_id) {
 			$this->addHistory('status_id',$this->getStatusID());
 			$qpa = db_construct_qpa($qpa, ' status_id=$1,', array($status_id));
@@ -1042,7 +1044,7 @@
 			$update = true;
 
 			if ($status_id != 1) {
-				$qpa = db_construct_qpa($qpa, ' close_date=$1,', array(time()));
+				$qpa = db_construct_qpa($qpa, ' close_date=$1,', array($now));
 			} else {
 			  $qpa = db_construct_qpa($qpa, ' close_date=$1,', array(0));
 			}
@@ -1140,7 +1142,7 @@
 		if ($update || $send_message){
 			if (!empty($changes)) {
 				// Send the email with changes
-				$this->mailFollowup(2, false, $changes);
+				$this->mailFollowupEx($now, 2, false, $changes);
 			}
 			db_commit();
 			return true;
@@ -1497,15 +1499,16 @@
 	}				
 
 	/**
-	 *	mailFollowup - send out an email update for this artifact.
+	 *	mailFollowupEx - send out an email update for this artifact.
 	 *
+	 *	@param	time_t	Time of the change
 	 *	@param	int		(1) initial/creation (2) update.
 	 *	@param	array	Array of additional addresses to mail to.
 	 *	@param	array	Array of fields changed in this update .
 	 *	@access private
 	 *	@return	boolean	success.
 	 */
-	function mailFollowup($type, $more_addresses=false, $changes='') {
+	function mailFollowupEx($tm,$type,$more_addresses=false,$changes='') {
 
 		$monitor_ids = array();
 
@@ -1522,9 +1525,16 @@
 			}
 		} else {
 			if ($sess) {
-				$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was changed at ". date( _('Y-m-d H:i'), $this->getOpenDate() ) . " by " . $sess->getRealName ();
+				$body = $this->ArtifactType->getName() .
+				    " item #" . $this->getID() .
+				    " was changed at " .
+				    date(_('Y-m-d H:i'), $tm) . " by " .
+				    $sess->getRealName();
 			} else {
-				$body = $this->ArtifactType->getName() ." item #". $this->getID() .", was changed at ". date( _('Y-m-d H:i'), $this->getOpenDate() ) ;
+				$body = $this->ArtifactType->getName() .
+				    " item #" . $this->getID() .
+				    " was changed at " .
+				    date(_('Y-m-d H:i'), $tm);
 			}
 		}
 			      




More information about the Fusionforge-commits mailing list