Support previewing version when submitting application
This commit is contained in:
committed by
Chris Morgan
parent
69d584ed85
commit
dba90a0924
@@ -160,7 +160,7 @@ class application_queue
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function outputEditor()
|
function outputEditor($aClean = array())
|
||||||
{
|
{
|
||||||
/* We ask the user for the application name first so as to avoid duplicate
|
/* We ask the user for the application name first so as to avoid duplicate
|
||||||
submissons; a list of potential duplicates is displayed on the next page */
|
submissons; a list of potential duplicates is displayed on the next page */
|
||||||
@@ -203,6 +203,23 @@ class application_queue
|
|||||||
$this->oVersionQueue->oVersion->iVersionId, $aClean);
|
$this->oVersionQueue->oVersion->iVersionId, $aClean);
|
||||||
|
|
||||||
$this->oVersionQueue->oTestDataQueue->outputEditor();
|
$this->oVersionQueue->oTestDataQueue->outputEditor();
|
||||||
|
|
||||||
|
/* Allow the user to choose whether to preview the application view
|
||||||
|
or the version view. Application view is default */
|
||||||
|
echo html_frame_start("Select What to Preview");
|
||||||
|
$sPreviewVersion = $aClean['bPreviewVersion'] ? $aClean['bPreviewVersion'] : "";
|
||||||
|
|
||||||
|
$shPreviewApp = '';
|
||||||
|
$shPreviewVersion = '';
|
||||||
|
|
||||||
|
if($sPreviewVersion == "true")
|
||||||
|
$shPreviewVersion = ' checked="checked"';
|
||||||
|
else
|
||||||
|
$shPreviewApp = ' checked="checked"';
|
||||||
|
|
||||||
|
echo "<input type=\"radio\" name=\"bPreviewVersion\"$shPreviewApp value=\"false\" /> Preview application<br />\n";
|
||||||
|
echo "<input type=\"radio\" name=\"bPreviewVersion\"$shPreviewVersion value=\"true\" /> Preview version\n";
|
||||||
|
echo html_frame_end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,14 +314,35 @@ class application_queue
|
|||||||
echo "</table>";
|
echo "</table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function display()
|
function objectGetCustomVars($sAction)
|
||||||
|
{
|
||||||
|
switch($sAction)
|
||||||
|
{
|
||||||
|
case "preview":
|
||||||
|
return array("bPreviewVersion");
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function display($aClean = array())
|
||||||
{
|
{
|
||||||
/* Cache the version object if it is not in the database */
|
/* Cache the version object if it is not in the database */
|
||||||
if(!$this->oVersionQueue->objectGetId())
|
if(!$this->oVersionQueue->objectGetId())
|
||||||
$this->oApp->aVersions = array($this->oVersionQueue->oVersion);
|
$this->oApp->aVersions = array($this->oVersionQueue->oVersion);
|
||||||
|
|
||||||
|
$sPreviewVersion = $aClean['bPreviewVersion'] ? $aClean['bPreviewVersion'] : "";
|
||||||
|
|
||||||
|
if($sPreviewVersion == "true")
|
||||||
|
{
|
||||||
|
$this->oVersionQueue->oVersion->oApp = $this->oApp;
|
||||||
|
$this->oVersionQueue->display();
|
||||||
|
} else
|
||||||
|
{
|
||||||
$this->oApp->display();
|
$this->oApp->display();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function objectMakeUrl()
|
function objectMakeUrl()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ define("LICENSE_RETAIL", "Retail");
|
|||||||
class version {
|
class version {
|
||||||
var $iVersionId;
|
var $iVersionId;
|
||||||
var $iAppId;
|
var $iAppId;
|
||||||
|
var $oApp; /* Parento object */
|
||||||
var $sName;
|
var $sName;
|
||||||
var $sDescription;
|
var $sDescription;
|
||||||
var $sTestedRelease;
|
var $sTestedRelease;
|
||||||
@@ -759,6 +760,16 @@ class version {
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Not standard OM function yet, but will be in the future */
|
||||||
|
public function objectGetParent()
|
||||||
|
{
|
||||||
|
/* No id so we can't query the DB, but perhaps an entry is cached? */
|
||||||
|
if(!$this->iAppId)
|
||||||
|
return $this->oApp;
|
||||||
|
|
||||||
|
return new application($this->iAppId);
|
||||||
|
}
|
||||||
|
|
||||||
public function display($aVars = array())
|
public function display($aVars = array())
|
||||||
{
|
{
|
||||||
/* is this user supposed to view this version? */
|
/* is this user supposed to view this version? */
|
||||||
@@ -767,11 +778,7 @@ class version {
|
|||||||
|
|
||||||
$iTestingId = $aVars['iTestingId'] ? $aVars['iTestingId'] : 0;
|
$iTestingId = $aVars['iTestingId'] ? $aVars['iTestingId'] : 0;
|
||||||
|
|
||||||
$oApp = new Application($this->iAppId);
|
$oApp = $this->objectGetParent();
|
||||||
|
|
||||||
// Oops! application not found or other error. do something
|
|
||||||
if(!$oApp->iAppId)
|
|
||||||
util_show_error_page_and_exit('Internal Database Access Error. No App found.');
|
|
||||||
|
|
||||||
// show Vote Menu
|
// show Vote Menu
|
||||||
if($_SESSION['current']->isLoggedIn())
|
if($_SESSION['current']->isLoggedIn())
|
||||||
|
|||||||
Reference in New Issue
Block a user