[evolvis-commits] r18267: [#2498] further fix displaying related commits; add them to Tracker

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Apr 10 16:37:31 CEST 2012


Author: mirabilos
Date: 2012-04-10 16:37:31 +0200 (Tue, 10 Apr 2012)
New Revision: 18267

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/include/descriptive.php
   trunk/gforge_base/evolvisforge-5.1/src/common/pm/ProjectModel.class.php
   trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/src/www/pm/templates/detail_template.php
   trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php
Log:
[#2498] further fix displaying related commits; add them to Tracker

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/descriptive.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/descriptive.php	2012-04-10 14:37:27 UTC (rev 18266)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/descriptive.php	2012-04-10 14:37:31 UTC (rev 18267)
@@ -2,7 +2,7 @@
 /*-
  * Factored-out code for handling descriptive item elements
  *
- * Copyright © 2011
+ * Copyright © 2011, 2012
  *	Thorsten “mirabilos” Glaser <t.glaser at tarent.de>
  * All rights reserved.
  *
@@ -618,3 +618,25 @@
 		    ),
 	    ), "\n" . $s);
 }
+
+/**
+ * showmess_getcommits() - get array of linked commits
+ *
+ * @param	int	$id
+ *			ID of the task/tracker item
+ * @return	array
+ *		of tasktracker_scm table rows
+ * @deprecated Do not use, will be replaced.
+ */
+function showmess_getcommits($id) {
+	$rv = array();
+	$res = db_query_params('
+		SELECT * FROM tasktracker_scm
+		WHERE id=$1
+		ORDER BY group_name, revision
+	    ', array($id));
+	if ($res) while (($row = db_fetch_array($res))) {
+		$rv[] = $row;
+	}
+	return ($rv);
+}

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/pm/ProjectModel.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/pm/ProjectModel.class.php	2012-04-10 14:37:27 UTC (rev 18266)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/pm/ProjectModel.class.php	2012-04-10 14:37:31 UTC (rev 18267)
@@ -50,21 +50,6 @@
 	}
 
 	public function getRelatedCommits() {
-
-		$result = db_query_params('SELECT group_name, revision, href FROM tasktracker_scm
-			WHERE id=$1 ORDER BY group_name, revision',
-		    array(
-			$this->getProjectTask()->getID(),
-		    ));
-
-		$arrInfo = array();
-		if ($result && db_numrows($result) > 0) {
-			for ($i = 0; $i < db_numrows($result); $i++) {
-				$info = db_fetch_array($result, $i);
-				$arrInfo[$i] = $info;
-			}
-		}
-
-		return $arrInfo;
+		return showmess_getcommits($this->getProjectTask()->getID());
 	}
 }

Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-04-10 14:37:27 UTC (rev 18266)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-04-10 14:37:31 UTC (rev 18267)
@@ -1,3 +1,10 @@
+fusionforge (5.1.1+evolvis53) xunstable; urgency=low
+
+  * [#2498] Show relationships between Commits and Task/Tracker Items
+    (Evolvis 4.8 implementation, SVN only, hardcoded URIs)
+
+ -- Thorsten Glaser <t.glaser at tarent.de>  Tue, 10 Apr 2012 16:34:19 +0200
+
 fusionforge (5.1.1+evolvis52) unstable; urgency=high
 
   * [#2964] [#2965] [#2966] [#2968] Make template groups actually

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/templates/detail_template.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/templates/detail_template.php	2012-04-10 14:37:27 UTC (rev 18266)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/templates/detail_template.php	2012-04-10 14:37:31 UTC (rev 18267)
@@ -136,7 +136,7 @@
 						<?php foreach($this->_['commits'] as $commit) { ?>
 							<tr>
 								<td><?php echo $commit['group_name']; ?></td>
-								<td><a href="<?php echo util_html_encode($commit['href'];) ?>" target="_blank" title="<?php _('Link to version control repository')?>" /><?php echo $commit['revision']; ?></a></td>
+								<td><a href="<?php echo util_html_encode($commit['href']); ?>" target="_blank" title="<?php echo _('Link to version control repository'); ?>"><?php echo $commit['revision']; ?></a></td>
 							</tr>
 						<?php } ?>
 					</table>

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php	2012-04-10 14:37:27 UTC (rev 18266)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php	2012-04-10 14:37:31 UTC (rev 18267)
@@ -438,11 +438,33 @@
 ?>
 </td>
 <td <?php echo $HTML->boxGetAltRowStyle(0); ?> width="50%">
-<?php $ah->showRelations(); ?>
+<?php
+	$ah->showRelations();
+
+	/* old-style svn-only extra detail */
+	$linked_commits = showmess_getcommits($aid);
+	if ($linked_commits) {
+		echo '<h3>' . _('Related Commits') . ":</h3>\n";
+	}
+?>
 	<table border="0" width="100%">
 		<tr><td colspan="2"><!--
 			dummy in case the hook is empty
 		--></td></tr>
+<?php
+	/* old-style svn-only extra detail */
+	if ($linked_commits) {
+		echo html_e('tr', array(), html_e('th', array(),
+		    _('Group name')) . html_e('th', array(),
+		    _('Revision')));
+	}
+	foreach ($linked_commits as $i) {
+		echo html_e('tr', array(), html_e('td', array(),
+		    $i['group_name']) . html_e('td', array(), html_e('a', array(
+			'href' => $i['href'],
+		    ), $i['revision'])));
+	}
+?>
 <?php plugin_hook("artifact_extra_detail", array('artifact_id' => $aid)); ?>
 	</table>
 </td>



More information about the evolvis-commits mailing list