Allow administrators to submit app, version and testresults in one step instead of three. Fix minor vendor logic bug.
This commit is contained in:
@@ -132,37 +132,29 @@ if ($_REQUEST['sub'])
|
|||||||
|
|
||||||
if($_REQUEST['sub'] == 'add')
|
if($_REQUEST['sub'] == 'add')
|
||||||
{
|
{
|
||||||
if (($_REQUEST['apptype'] == "application") && is_numeric($_REQUEST['appId'])) // application
|
$oVersion = new Version($_REQUEST['versionId']);
|
||||||
|
$oTest = new testData($_REQUEST['iTestingId']);
|
||||||
|
$oVersion->GetOutputEditorValues();
|
||||||
|
$oTest->GetOutputEditorValues();
|
||||||
|
if ($_REQUEST['apptype'] == "application") // application
|
||||||
{
|
{
|
||||||
|
$oApp = new Application($_REQUEST['appId']);
|
||||||
|
$oApp->GetOutputEditorValues(); // load the values from $_REQUEST
|
||||||
// add new vendor
|
// add new vendor
|
||||||
if($_REQUEST['appVendorName'])
|
if($_REQUEST['appVendorName'] and !$_REQUEST['appVendorId'])
|
||||||
{
|
{
|
||||||
$oVendor = new Vendor();
|
$oVendor = new Vendor();
|
||||||
$oVendor->create($_REQUEST['appVendorName'],$_REQUEST['appWebpage']);
|
$oVendor->create($_REQUEST['appVendorName'],$_REQUEST['appWebpage']);
|
||||||
|
$oApp->iVendorId = $oVendor->iVendorId;
|
||||||
}
|
}
|
||||||
|
$oApp->update(true);
|
||||||
$oApp = new Application($_REQUEST['appId']);
|
|
||||||
$oApp->GetOutputEditorValues();
|
|
||||||
$oApp->update();
|
|
||||||
$oApp->unQueue();
|
$oApp->unQueue();
|
||||||
} else if(($_REQUEST['apptype'] == "version") && is_numeric($_REQUEST['versionId'])) // version
|
|
||||||
{
|
|
||||||
$oVersion = new Version($_REQUEST['versionId']);
|
|
||||||
$oVersion->GetOutputEditorValues();
|
|
||||||
$oVersion->update();
|
|
||||||
$oVersion->unQueue();
|
|
||||||
foreach($oVersion->aVersionIds as $iTestingId)
|
|
||||||
{
|
|
||||||
$oTest = new Version($iTestingId);
|
|
||||||
$oTest->GetOutputEditorValues();
|
|
||||||
$oTest->iVersionId = $oVersion->iVersionId;
|
|
||||||
$oTest->iVersionId = $oVersion->iVersionId;
|
|
||||||
$oTest->Update();
|
|
||||||
$oTest->unQueue();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
$oVersion->update(true);
|
||||||
redirect(apidb_fullurl("admin/adminAppQueue.php"));
|
$oVersion->unQueue();
|
||||||
|
$oTest->update(true);
|
||||||
|
$oTest->unQueue();
|
||||||
|
redirect($_SERVER['PHP_SELF']);
|
||||||
}
|
}
|
||||||
else if ($_REQUEST['sub'] == 'duplicate')
|
else if ($_REQUEST['sub'] == 'duplicate')
|
||||||
{
|
{
|
||||||
@@ -347,7 +339,10 @@ if ($_REQUEST['sub'])
|
|||||||
|
|
||||||
//vendor field
|
//vendor field
|
||||||
if($iVendorId)
|
if($iVendorId)
|
||||||
|
{
|
||||||
$sVendor = "";
|
$sVendor = "";
|
||||||
|
$oApp->iVendorId = $iVendorId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* output the appropriate editors depending on whether we are processing an application */
|
/* output the appropriate editors depending on whether we are processing an application */
|
||||||
|
|||||||
Reference in New Issue
Block a user