Only create new distributions if the user didn't pick one from the dropdown menu. Previous behavior would create a new distribution if any text was present in the 'distribution' textbox, even if a distribution is picked from the dropdown menu.
This commit is contained in:
@@ -181,14 +181,16 @@ if ($_REQUEST['sub'])
|
|||||||
{
|
{
|
||||||
$oVersion->create();
|
$oVersion->create();
|
||||||
}
|
}
|
||||||
|
if(!$_REQUEST['iDistributionId'])
|
||||||
$sDistribution = trim($_REQUEST['sDistribution']);
|
|
||||||
if(!empty($sDistribution))
|
|
||||||
{
|
{
|
||||||
$oDistribution = new distribution();
|
$sDistribution = trim($_REQUEST['sDistribution']);
|
||||||
$oDistribution->sName = $sDistribution;
|
if(!empty($sDistribution))
|
||||||
$oDistribution->create();
|
{
|
||||||
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
$oDistribution = new distribution();
|
||||||
|
$oDistribution->sName = $sDistribution;
|
||||||
|
$oDistribution->create();
|
||||||
|
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$oTest->iVersionId = $oVersion->iVersionId;
|
$oTest->iVersionId = $oVersion->iVersionId;
|
||||||
if(is_numeric($oTest->iTestingId))
|
if(is_numeric($oTest->iTestingId))
|
||||||
|
|||||||
@@ -27,22 +27,25 @@ if ($_REQUEST['sub'])
|
|||||||
$oTest->GetOutputEditorValues(); // retrieve the values from the current $_REQUEST
|
$oTest->GetOutputEditorValues(); // retrieve the values from the current $_REQUEST
|
||||||
if(empty($errors))
|
if(empty($errors))
|
||||||
{
|
{
|
||||||
$sDistribution = trim($_REQUEST['sDistribution']);
|
if(!$_REQUEST['iDistributionId'])
|
||||||
if(!empty($sDistribution))
|
|
||||||
{
|
{
|
||||||
$oDistribution = new distribution();
|
$sDistribution = trim($_REQUEST['sDistribution']);
|
||||||
$oDistribution->sName = $sDistribution;
|
if(!empty($sDistribution))
|
||||||
$oDistribution->create();
|
{
|
||||||
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
$oDistribution = new distribution();
|
||||||
|
$oDistribution->sName = $sDistribution;
|
||||||
|
$oDistribution->create();
|
||||||
|
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($_REQUEST['sub'] == 'Submit')
|
||||||
|
{
|
||||||
|
$oTest->create();
|
||||||
|
} else if($_REQUEST['sub'] == 'Resubmit')
|
||||||
|
{
|
||||||
|
$oTest->update(true);
|
||||||
|
$oTest->ReQueue();
|
||||||
}
|
}
|
||||||
if($_REQUEST['sub'] == 'Submit')
|
|
||||||
{
|
|
||||||
$oTest->create();
|
|
||||||
} else if($_REQUEST['sub'] == 'Resubmit')
|
|
||||||
{
|
|
||||||
$oTest->update(true);
|
|
||||||
$oTest->ReQueue();
|
|
||||||
}
|
|
||||||
redirect($_SERVER['PHP_SELF']);
|
redirect($_SERVER['PHP_SELF']);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user