* Modify create task error of set the module is requried.
This commit is contained in:
@@ -68,7 +68,7 @@ class task extends control
|
||||
if($duplicateTaskID) return $this->send(array('result' => 'success', 'message' => sprintf($this->lang->duplicate, $this->lang->task->common), 'load' => $this->createLink('task', 'view', "taskID={$duplicateTaskID}")));
|
||||
|
||||
$this->dao->begin();
|
||||
if($this->post->type == 'test' && $this->post->selectTestStory)
|
||||
if($this->post->type == 'test' && $this->post->selectTestStory == 'on')
|
||||
{
|
||||
/* Prepare to create the data for the test subtask and to check the data format. */
|
||||
$testTasks = $this->taskZen->buildTestTasksForCreate($taskData->execution);
|
||||
|
||||
@@ -1018,10 +1018,7 @@ class taskModel extends model
|
||||
*/
|
||||
public function createTaskOfTest(object $task, array $testTasks): false|int
|
||||
{
|
||||
if(!empty($testTasks))
|
||||
{
|
||||
$this->config->task->create->requiredFields = str_replace(array(',estimate,', ',story,', ',estStarted,', ',deadline,', ',module,'), ',', ",{$this->config->task->create->requiredFields},");
|
||||
}
|
||||
$this->config->task->create->requiredFields = str_replace(array(',estimate,', ',story,', ',estStarted,', ',deadline,', ',module,'), ',', ",{$this->config->task->create->requiredFields},");
|
||||
|
||||
$taskID = $this->create($task);
|
||||
if(!$taskID) return false;
|
||||
|
||||
@@ -5,7 +5,7 @@ global $lang,$config;
|
||||
$fields = defineFieldList('task.create', 'task');
|
||||
|
||||
/* Set foldable attribute. */
|
||||
$fields->field('module')->foldable();
|
||||
$fields->field('module')->foldable(strpos($config->task->create->requiredFields, 'module') === false);
|
||||
$fields->field('file')->foldable();
|
||||
$fields->field('mailto')->foldable();
|
||||
$fields->field('keywords')->foldable();
|
||||
|
||||
+5
-1
@@ -551,7 +551,11 @@ class taskZen extends task
|
||||
{
|
||||
$formConfig = $this->config->task->form->create;
|
||||
if($this->post->type == 'affair') $formConfig['assignedTo']['type'] = 'array';
|
||||
if($this->post->type == 'test') $formConfig['story']['skipRequired'] = true;
|
||||
if($this->post->type == 'test')
|
||||
{
|
||||
$formConfig['story']['skipRequired'] = true;
|
||||
$formConfig['module']['skipRequired'] = true;
|
||||
}
|
||||
|
||||
$execution = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch();
|
||||
$team = $this->post->team ? array_filter($this->post->team) : array();
|
||||
|
||||
Reference in New Issue
Block a user