[evolvis-commits] r17234: merge bm:taramir51/patches/use-same-sequence-for-pm-and-tracker

mirabilos at evolvis.org mirabilos at evolvis.org
Fri May 13 18:14:01 CEST 2011


Author: mirabilos
Date: 2011-05-13 18:14:01 +0200 (Fri, 13 May 2011)
New Revision: 17234

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php
Log:
merge bm:taramir51/patches/use-same-sequence-for-pm-and-tracker

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php	2011-05-13 16:13:57 UTC (rev 17233)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php	2011-05-13 16:14:01 UTC (rev 17234)
@@ -1599,6 +1599,32 @@
 	return false;
 }
 
+function util_tasktracker_links($s) {
+	global $gfcommon;
+	require_once $gfcommon.'pm/ProjectTaskSqlQueries.php';
+	$t = preg_replace_callback('|\[#([0-9]+)]|', create_function(
+	    '$matches', '
+		$r = tasktracker_gettype($matches[1]);
+		if (!$r)
+			return $matches[0];
+		if ($r["is_a"] == "aid") {
+			$p = "/tracker";
+			$q = " (" . _("Bug/FR") . ")";
+		} else if ($r["is_a"] == "tid") {
+			$p = "/pm";
+			$q = " (" . _("Task") . ")";
+		} else
+			return $matches[0];
+		return "[<a href=\"" . util_make_url($p .
+		    "/t_follow.php/" . $matches[1]) .
+		    "\" title=\"" . util_html_secure($r["summary"]) . $q .
+		    "\">#" . $matches[1] . "</a>]";
+	    '), $s);
+	if ($t)
+		return $t;
+	return $s;
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"



More information about the evolvis-commits mailing list