[evolvis-commits] r18368: FR by rfisch: render the platform notes in the test report

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Apr 24 11:41:51 CEST 2012


Author: mirabilos
Date: 2012-04-24 11:41:51 +0200 (Tue, 24 Apr 2012)
New Revision: 18368

Modified:
   trunk/testlink/lib/functions/print.inc.php
   trunk/testlink/lib/results/printDocument.php
Log:
FR by rfisch: render the platform notes in the test report

Modified: trunk/testlink/lib/functions/print.inc.php
===================================================================
--- trunk/testlink/lib/functions/print.inc.php	2012-04-23 10:39:33 UTC (rev 18367)
+++ trunk/testlink/lib/functions/print.inc.php	2012-04-24 09:41:51 UTC (rev 18368)
@@ -1517,15 +1517,23 @@
 
 /**
  * Render HTML header for a given platform. 
+ * Also renders notes if $platform_mgr is not false but a tlPlatform instance.
  * Also adds code to $options['tocCode']
  */
-function renderPlatformHeading($tocPrefix, $platform_id, $platform_name, &$options)
+function renderPlatformHeading($tocPrefix, $platform_id, $platform_name, &$options, &$platform_mgr=false)
 {
 	$platformLabel = lang_get('platform');
 	$platform_name = htmlspecialchars($platform_name);
 	$options['tocCode'] .= '<p><a href="#' . prefixToHTMLID($tocPrefix) . '">' .
 	                               $platformLabel . ':' . $platform_name . '</a></p>';
-	return '<h1 class="doclevel" id="' . prefixToHTMLID($tocPrefix) . "\">$tocPrefix $platformLabel: $platform_name</h1>";
+	$rv = '<h1 class="doclevel" id="' . prefixToHTMLID($tocPrefix) . "\">$tocPrefix $platformLabel: $platform_name</h1>";
+	if ($platform_mgr !== false) {
+		$platformInfo = $platform_mgr->getByID($platform_id);
+		if ($platformInfo['notes']) {
+			$rv .= '<p>' . $platformInfo['notes'] . "</p>\n";
+		}
+	}
+	return $rv;
 }
 
 

Modified: trunk/testlink/lib/results/printDocument.php
===================================================================
--- trunk/testlink/lib/results/printDocument.php	2012-04-23 10:39:33 UTC (rev 18367)
+++ trunk/testlink/lib/results/printDocument.php	2012-04-24 09:41:51 UTC (rev 18368)
@@ -47,6 +47,7 @@
 testlinkInitPage($db);
 $tproject = new testproject($db);
 $tree_manager = &$tproject->tree_manager;
+$platform_mgr = new tlPlatform($db);
 
 $args = init_args();
 $decode = getDecode($tree_manager);
@@ -278,7 +279,7 @@
 			    	if ($showPlatforms)
 					{
 						$docText .= renderPlatformHeading($tocPrefix, $platform_id, $platforms[$platform_id], 
-						                                  $printingOptions);
+						                                  $printingOptions, $platform_mgr);
 					}
 					// BUGID 3459 - added platform ID
 					$docText .= renderTestPlanForPrinting($db, $tree2work, $doc_info->content_range, 



More information about the evolvis-commits mailing list