This commit is contained in:
Yagami
2022-12-02 14:34:34 +08:00
parent 5498b85ad6
commit dda0446e57
+28
View File
@@ -332,6 +332,20 @@ class executionModel extends model
$this->checkBeginAndEndDate($_POST['project'], $_POST['begin'], $_POST['end']);
if(dao::isError()) return false;
if($_POST['products'])
{
$this->app->loadLang('project');
$multipleProducts = $this->loadModel('product')->getMultiBranchPairs();
foreach($_POST['products'] as $index => $productID)
{
if(isset($multipleProducts[$productID]) and empty($_POST['branch'][$index]))
{
dao::$errors[] = $this->lang->project->emptyBranch;
return false;
}
}
}
/* Determine whether to add a sprint or a stage according to the model of the execution. */
$project = $this->loadModel('project')->getByID($_POST['project']);
$type = 'sprint';
@@ -514,6 +528,20 @@ class executionModel extends model
return false;
}
if($_POST['products'])
{
$this->app->loadLang('project');
$multipleProducts = $this->loadModel('product')->getMultiBranchPairs();
foreach($_POST['products'] as $index => $productID)
{
if(isset($multipleProducts[$productID]) and empty($_POST['branch'][$index]))
{
dao::$errors[] = $this->lang->project->emptyBranch;
return false;
}
}
}
/* Get the data from the post. */
$execution = fixer::input('post')
->add('id', $executionID)