Allow previewing versions
This commit is contained in:
committed by
Chris Morgan
parent
1753ff9757
commit
cdee3a77e9
@@ -746,7 +746,13 @@ class version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display($aVars)
|
public function objectShowPreview()
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* $oTest can be passed by version_queue to allow previewing a version, in which case the test id may not be defined */
|
||||||
|
public function display($aVars, $oTest = null)
|
||||||
{
|
{
|
||||||
/* is this user supposed to view this version? */
|
/* is this user supposed to view this version? */
|
||||||
if(!$_SESSION['current']->canViewVersion($this))
|
if(!$_SESSION['current']->canViewVersion($this))
|
||||||
@@ -760,10 +766,6 @@ class version {
|
|||||||
if(!$oApp->iAppId)
|
if(!$oApp->iAppId)
|
||||||
util_show_error_page_and_exit('Internal Database Access Error. No App found.');
|
util_show_error_page_and_exit('Internal Database Access Error. No App found.');
|
||||||
|
|
||||||
// Oops! Version not found or other error. do something
|
|
||||||
if(!$this->iVersionId)
|
|
||||||
util_show_error_page_and_exit('Internal Database Access Error. No Version Found.');
|
|
||||||
|
|
||||||
// show Vote Menu
|
// show Vote Menu
|
||||||
if($_SESSION['current']->isLoggedIn())
|
if($_SESSION['current']->isLoggedIn())
|
||||||
apidb_sidebar_add("vote_menu");
|
apidb_sidebar_add("vote_menu");
|
||||||
@@ -976,10 +978,13 @@ class version {
|
|||||||
echo "\t<div class='title_class'>\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\tSelected test results <small><small>(selected in 'Test Results' table below)</small></small>\n";
|
||||||
echo "\t</div>\n";
|
echo "\t</div>\n";
|
||||||
|
|
||||||
|
/* oTest may be passed by version_queue to allow previewing a version which does not exist in the database */
|
||||||
|
if(!$oTest && $iTestingId)
|
||||||
$oTest = new testData($iTestingId);
|
$oTest = new testData($iTestingId);
|
||||||
|
|
||||||
/* if $iTestingId wasn't valid then it won't be valid in $oTest */
|
/* if $iTestingId wasn't valid then it won't be valid in $oTest */
|
||||||
if(!$oTest->iTestingId)
|
if(!$oTest)
|
||||||
{
|
{
|
||||||
/* fetch a new test id for this version */
|
/* fetch a new test id for this version */
|
||||||
$iTestingId = testData::getNewestTestIdFromVersionId($this->iVersionId);
|
$iTestingId = testData::getNewestTestIdFromVersionId($this->iVersionId);
|
||||||
@@ -999,9 +1004,14 @@ class version {
|
|||||||
// show the test results table
|
// show the test results table
|
||||||
if($oTest->iTestingId)
|
if($oTest->iTestingId)
|
||||||
{
|
{
|
||||||
$oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=",
|
$oTest->ShowVersionsTestingTable($this->objectMakeUrl()."&iTestingId=", 5);
|
||||||
5);
|
} else /* We are previewing the version */
|
||||||
|
{
|
||||||
|
$oTable = $oTest->CreateTestTable();
|
||||||
|
$oTable->AddRow($oTest->CreateTestTableRow(0, ""));
|
||||||
|
echo $oTable->GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SESSION['current']->isLoggedIn())
|
if($_SESSION['current']->isLoggedIn())
|
||||||
{
|
{
|
||||||
echo '<form method=post name=sMessage action=objectManager.php?'.
|
echo '<form method=post name=sMessage action=objectManager.php?'.
|
||||||
@@ -1040,6 +1050,7 @@ class version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Comments Section
|
// Comments Section
|
||||||
|
if($this->iVersionId)
|
||||||
Comment::view_app_comments($this->iVersionId);
|
Comment::view_app_comments($this->iVersionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ class version_queue
|
|||||||
|
|
||||||
function getOutputEditorValues($aClean)
|
function getOutputEditorValues($aClean)
|
||||||
{
|
{
|
||||||
|
$this->oVersion->iAppId = $aClean['iAppId'];
|
||||||
$this->oVersion->getOutputEditorValues($aClean);
|
$this->oVersion->getOutputEditorValues($aClean);
|
||||||
$this->oTestDataQueue->getOutputEditorValues($aClean);
|
$this->oTestDataQueue->getOutputEditorValues($aClean);
|
||||||
}
|
}
|
||||||
@@ -214,9 +215,17 @@ class version_queue
|
|||||||
return $this->oVersion->objectGetTableRow();
|
return $this->oVersion->objectGetTableRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function objectShowPreview()
|
||||||
|
{
|
||||||
|
return $this->oVersion->objectShowPreview();
|
||||||
|
}
|
||||||
|
|
||||||
function display()
|
function display()
|
||||||
{
|
{
|
||||||
$this->oVersion->display();
|
$aVars = array();
|
||||||
|
$aVars['iTestingId'] = 0;
|
||||||
|
|
||||||
|
$this->oVersion->display($aVars, $this->oTestDataQueue->oTestData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectMakeUrl()
|
function objectMakeUrl()
|
||||||
|
|||||||
Reference in New Issue
Block a user