Wednesday 16 November 2011

Test Link : 1.8.5 How to Print Images/ attach images in requirement document or in Microsoft word

We are using TestLink Test Management tool, version 1.8.5  for over a year now and we saw the problem that when we print the document in MSWORD the images are lost. It will not show the images but a blank space will be left in the document.

Again I searched the forum and found one link , i asked the the question and got the answer. these Guys are really good :-)

So i modified as per the suggestion and it worked fine below is the modification code:

Go to

/TestLink_1.8.5.1/lib/results/printDocument.php , insert it on line 249 Before 250 $generatedText .= renderEof();

####################################################################################
# change relative image paths to absolute image paths
# src="/  => src="http(s)://example.com/
####################################################################################

# fetch protocol and domainname
if($_SERVER["SERVER_PORT"]=='443'){
   $url_host = "https://".$_SERVER["HTTP_HOST"];
}elseif($_SERVER["SERVER_PORT"]=='8001'){
   $url_host = "http://".$_SERVER["HTTP_HOST"];
}else{
   $url_host = $_SERVER["HTTP_HOST"].":".$_SERVER["SERVER_PORT"];
}
if(substr($url_host, -1)!='/'){
   $url_host.= '/';
}

$xPattern = "/src=\"\//si";
$xValue = "src=\"".$url_host;
$generatedText = preg_replace($xPattern, $xValue, $generatedText);
####################################################################################
save it .

It should work fine. May be in newer version this bug should be fixed.

Below are links:

Forum Link:



http://www.teamst.org/forum/viewtopic.php?f=11&t=3583&p=11354&hilit=sss&sid=380ad4c03e77d6864e1388fc0cd806c0#p11354