* Add branch param for project post api.

This commit is contained in:
宋辰轩
2024-04-11 14:14:40 +08:00
parent b4492a72c5
commit d697745692

View File

@@ -75,7 +75,7 @@ class projectsEntry extends entry
*/
public function post()
{
$fields = 'name,begin,end,products,desc,hasProduct';
$fields = 'name,begin,end,products,branch,desc,hasProduct';
$this->batchSetPost($fields);
if(isset($_POST['products']) and !isset($_POST['hasProduct'])) $_POST['hasProduct'] = true;
@@ -89,6 +89,17 @@ class projectsEntry extends entry
$this->setPost('model', $this->request('model', 'scrum'));
$this->setPost('parent', $this->request('parent', 0));
if(isset($_POST['branch']))
{
$branches = $_POST['branch'];
foreach($branches as $key => $branch)
{
if(empty($branch)) unset($branches[$key]);
}
$this->setPost('branch', $branches);
}
$control = $this->loadController('project', 'create');
$requireFields = 'name,begin,end,products';