* [bug#54956,done,1h] The team for the multi-person task cannot be empty.

This commit is contained in:
hufangzhou
2024-09-06 13:29:56 +08:00
committed by 王于听
parent 3659b019e5
commit ad09cb511d
5 changed files with 20 additions and 2 deletions
+1
View File
@@ -273,6 +273,7 @@ $lang->task->noticeLinkStory = "No story has been linked. You can for
$lang->task->noticeLinkStoryNoProduct = "No story has been linked.";
$lang->task->noticeSaveRecord = 'Ihre Stunden wurden nicht gespeichrt. Bitte erst speichern.';
$lang->task->noticeManageTeam = 'Task status is %s, can not manage team.';
$lang->task->teamNotEmpty = 'Team can not be empty.';
$lang->task->commentActions = '%s. %s, kommentiert von <strong>%s</strong>.';
$lang->task->deniedNotice = 'Nur %s kann die Aufgabe %s.';
$lang->task->deniedStatusNotice = 'The task status is %s, the effort cannot be maintained.';
+1
View File
@@ -273,6 +273,7 @@ $lang->task->noticeLinkStory = "No story has been linked. You can for
$lang->task->noticeLinkStoryNoProduct = "No story has been linked.";
$lang->task->noticeSaveRecord = 'Your Hour is not saved. Please save it first.';
$lang->task->noticeManageTeam = 'Task status is %s, can not manage team.';
$lang->task->teamNotEmpty = 'Team can not be empty.';
$lang->task->commentActions = '%s. %s, commented by <strong>%s</strong>.';
$lang->task->deniedNotice = 'Only the %s can %s the task.';
$lang->task->deniedStatusNotice = 'The task status is %s, the effort cannot be maintained.';
+1
View File
@@ -273,6 +273,7 @@ $lang->task->noticeLinkStory = "No story has been linked. You can for
$lang->task->noticeLinkStoryNoProduct = "No story has been linked.";
$lang->task->noticeSaveRecord = "Votre temps n'a pas été sauvé. Enregistrez-le d'abord.";
$lang->task->noticeManageTeam = 'Task status is %s, can not manage team.';
$lang->task->teamNotEmpty = 'Team can not be empty.';
$lang->task->commentActions = '%s. %s, commenté par <strong>%s</strong>.';
$lang->task->deniedNotice = 'Seulement le %s peut %s la tâche.';
$lang->task->deniedStatusNotice = 'The task status is %s, the effort cannot be maintained.';
+1
View File
@@ -273,6 +273,7 @@ $lang->task->noticeLinkStory = "没有可关联的相关{$lang->SRComm
$lang->task->noticeLinkStoryNoProduct = "没有可关联的相关{$lang->SRCommon}";
$lang->task->noticeSaveRecord = '您有尚未保存的工时记录,请先将其保存。';
$lang->task->noticeManageTeam = '任务状态是%s,不能维护团队';
$lang->task->teamNotEmpty = '多人任务团队不能为空。';
$lang->task->commentActions = '%s. %s, 由 <strong>%s</strong> 添加备注。';
$lang->task->deniedNotice = '当前任务只有%s才可以%s。';
$lang->task->deniedStatusNotice = '当前任务状态是%s,不能维护日志。';
+16 -2
View File
@@ -480,6 +480,13 @@ class taskZen extends task
->stripTags($this->config->task->editor->edit['id'], $this->config->allowedTags)
->get();
$team = $this->post->team ? array_filter($this->post->team) : array();
if($task->mode && empty($team))
{
dao::$errors['assignedTo'] = $this->lang->task->teamNotEmpty;
return false;
}
return $this->loadModel('file')->processImgURL($task, $this->config->task->editor->edit['id'], (string)$this->post->uid);
}
@@ -599,7 +606,7 @@ class taskZen extends task
$task = $this->loadModel('file')->processImgURL($task, $this->config->task->editor->create['id'], (string)$this->post->uid);
/* Check if the input post data meets the requirements. */
$this->checkCreateTask($task);
$this->checkCreateTask($task, $team);
return $task;
}
@@ -913,10 +920,11 @@ class taskZen extends task
* Check if the input post meets the requirements.
*
* @param object $task
* @param array $team
* @access protected
* @return bool
*/
protected function checkCreateTask(object $task): bool
protected function checkCreateTask(object $task, array $team): bool
{
/* Check if the estimate is positive. */
if($task->estimate < 0)
@@ -925,6 +933,12 @@ class taskZen extends task
return false;
}
if($this->post->multiple && empty($team))
{
dao::$errors['assignedTo'] = $this->lang->task->teamNotEmpty;
return false;
}
/* If the task start and end date must be between the execution start and end date, check if the task start and end date accord with the conditions. */
if(!empty($this->config->limitTaskDate))
{