version: Properly handle missing test results
This commit is contained in:
committed by
Chris Morgan
parent
2aad57fbec
commit
5c6b3bb45e
@@ -63,6 +63,12 @@ div.info_contents { padding:10px; background-color: #eee; }
|
|||||||
div.title_class { font-weight: bold; border-bottom: 1px solid; padding: 4px;
|
div.title_class { font-weight: bold; border-bottom: 1px solid; padding: 4px;
|
||||||
font-size: 140%; background-color: #ddd; }
|
font-size: 140%; background-color: #ddd; }
|
||||||
|
|
||||||
|
/* Classes for a note box */
|
||||||
|
div.note_container { margin:6px; border: 1px solid; }
|
||||||
|
div.note_body { padding: 10px; background-color: #ffe732; }
|
||||||
|
div.note_title { font-weight: bold; border-bottom: 1px solid; padding: 4px;
|
||||||
|
font-size: 140%; background-color: #ffc004; }
|
||||||
|
|
||||||
/* classes for the main page */
|
/* classes for the main page */
|
||||||
div.rating_header { padding: 8px; }
|
div.rating_header { padding: 8px; }
|
||||||
div.rating_title { padding-bottom: 4px; font-weight: bold; font-size: 160%; }
|
div.rating_title { padding-bottom: 4px; font-weight: bold; font-size: 160%; }
|
||||||
|
|||||||
@@ -286,4 +286,18 @@ function make_inx_option_list($varname, $inx = null)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Displays a note box */
|
||||||
|
function html_note($shTitle, $shBody)
|
||||||
|
{
|
||||||
|
$shRet = '<div class="note_container">';
|
||||||
|
$shRet .= '<div class="note_title">';
|
||||||
|
$shRet .= $shTitle;
|
||||||
|
$shRet .= '</div>';
|
||||||
|
$shRet .= '<div class="note_body">';
|
||||||
|
$shRet .= $shBody;
|
||||||
|
$shRet .= '</div></div>';
|
||||||
|
|
||||||
|
return $shRet;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -987,11 +987,7 @@ class version {
|
|||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
// Show test data
|
// Show test data
|
||||||
echo "<div class='info_container'>\n";
|
|
||||||
|
|
||||||
echo "\t<div class='title_class'>\n";
|
|
||||||
echo "\t\tSelected test results <small><small>(selected in 'Test Results' table below)</small></small>\n";
|
|
||||||
echo "\t</div>\n";
|
|
||||||
|
|
||||||
/* Set if the use chose to display a particular test report */
|
/* Set if the use chose to display a particular test report */
|
||||||
if($iTestingId)
|
if($iTestingId)
|
||||||
@@ -999,18 +995,45 @@ class version {
|
|||||||
else if($this->iVersionId) /* Let's query for the latest rest report */
|
else if($this->iVersionId) /* Let's query for the latest rest report */
|
||||||
{
|
{
|
||||||
$iTestingId = testData::getNewestTestIdFromVersionId($this->iVersionId);
|
$iTestingId = testData::getNewestTestIdFromVersionId($this->iVersionId);
|
||||||
|
|
||||||
|
if($iTestingId) /* We want all entries to have test data, but old versions might lack
|
||||||
|
it, or data may have been deleted */
|
||||||
$oTest = new testData($iTestingId);
|
$oTest = new testData($iTestingId);
|
||||||
} else /* Perhaps we have a cached entry? There should be */
|
} else /* Perhaps we have a cached entry? There should be */
|
||||||
{
|
{
|
||||||
$aTests = $this->getTestResults();
|
$aTests = $this->getTestResults();
|
||||||
|
|
||||||
|
if(sizeof($aTests)) /* ... but we cannot be certain */
|
||||||
$oTest = $aTests[0];
|
$oTest = $aTests[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($oTest)
|
||||||
|
{
|
||||||
|
echo "<div class='info_container'>\n";
|
||||||
|
|
||||||
|
echo "\t<div class='title_class'>\n";
|
||||||
|
echo "\t\tSelected test results <small><small>(selected in 'Test Results' table below)</small></small>\n";
|
||||||
|
echo "\t</div>\n";
|
||||||
|
|
||||||
echo "<div class='info_contents'>\n";
|
echo "<div class='info_contents'>\n";
|
||||||
|
|
||||||
$oTest->ShowTestResult();
|
$oTest->ShowTestResult();
|
||||||
|
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
|
||||||
echo "</div>\n"; // end the 'info_container' div
|
echo "</div>\n";
|
||||||
|
} else /* Show a note saying that no test results are present,
|
||||||
|
and encourage the user to take action */
|
||||||
|
{
|
||||||
|
echo html_note('No Test Results',
|
||||||
|
'This version has no test results, please consider submitting some.<br />'.
|
||||||
|
'They may be part of the '.
|
||||||
|
'version or application description. If they are, please '.
|
||||||
|
'consider becoming a maintainer and remove them, submitting '.
|
||||||
|
'a proper test report instead.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// end the 'info_container' div
|
||||||
// end show test data
|
// end show test data
|
||||||
/////////////////////
|
/////////////////////
|
||||||
|
|
||||||
@@ -1020,7 +1043,7 @@ class version {
|
|||||||
if($oTest->iTestingId)
|
if($oTest->iTestingId)
|
||||||
{
|
{
|
||||||
$oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5);
|
$oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5);
|
||||||
} else /* We are previewing the version */
|
} else if($oTest) /* We are previewing the version */
|
||||||
{
|
{
|
||||||
$oTable = $oTest->CreateTestTable();
|
$oTable = $oTest->CreateTestTable();
|
||||||
$oTable->AddRow($oTest->CreateTestTableRow(0, ""));
|
$oTable->AddRow($oTest->CreateTestTableRow(0, ""));
|
||||||
|
|||||||
Reference in New Issue
Block a user