* Finish task #58288.

This commit is contained in:
liumengyi
2022-06-22 16:15:06 +08:00
parent 8f0073050f
commit b7a32b354b
8 changed files with 96 additions and 10 deletions
+26 -2
View File
@@ -333,15 +333,27 @@ class executionModel extends model
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', helper::now())
->setDefault('team', substr($this->post->name, 0, 30))
->setDefault('displayCards', 0)
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
->setIF($this->config->systemMode == 'new', 'parent', $this->post->project)
->setIF($this->post->acl == 'open', 'whitelist', '')
->join('whitelist', ',')
->setDefault('type', $type)
->stripTags($this->config->execution->editor->create['id'], $this->config->allowedTags)
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu')
->remove('products, workDays, delta, branch, uid, plans, teams, teamMembers, contactListMenu, heightType')
->get();
if(isset($_POST['heightType']) and $this->post->heightType == 'custom')
{
if(!preg_match("/^-?\d+$/", $sprint->displayCards) or $sprint->displayCards < 3)
{
$this->app->loadLang('kanban');
dao::$errors['displayCards'] = $this->lang->kanbanlane->error->mustBeInt;
return false;
}
}
/* Check the workload format and total. */
if(!empty($sprint->percent)) $this->checkWorkload('create', $sprint->percent);
@@ -475,6 +487,8 @@ class executionModel extends model
->add('id', $executionID)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', helper::now())
->setDefault('displayCards', 0)
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
->setIF(helper::isZeroDate($this->post->begin), 'begin', '')
->setIF(helper::isZeroDate($this->post->end), 'end', '')
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
@@ -483,9 +497,19 @@ class executionModel extends model
->setDefault('team', $this->post->name)
->join('whitelist', ',')
->stripTags($this->config->execution->editor->edit['id'], $this->config->allowedTags)
->remove('products, branch, uid, plans, syncStories, contactListMenu, teamMembers')
->remove('products, branch, uid, plans, syncStories, contactListMenu, teamMembers, heightType')
->get();
if(isset($_POST['heightType']) and $this->post->heightType == 'custom')
{
if(!preg_match("/^-?\d+$/", $sprint->displayCards) or $sprint->displayCards < 3)
{
$this->app->loadLang('kanban');
dao::$errors['displayCards'] = $this->lang->kanbanlane->error->mustBeInt;
return false;
}
}
if(in_array($execution->status, array('closed', 'suspended'))) $this->computeBurn($executionID);
if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end);