From 970f3e11a532c8eebbc8306ef9b4929435214e63 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 1 Jan 2021 14:37:16 +0800 Subject: [PATCH] * Adjust the batchedit method icons. --- module/task/control.php | 53 +++++++++++++++-------------- module/task/view/batchedit.html.php | 10 +++--- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index aeff71b43c..08d6726e6b 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -400,11 +400,11 @@ class task extends control /** * Batch edit task. * - * @param int $projectID + * @param int $executionID * @access public * @return void */ - public function batchEdit($projectID = 0) + public function batchEdit($executionID = 0) { if($this->post->names) { @@ -442,20 +442,20 @@ class task extends control $taskIDList = $this->post->taskIDList ? $this->post->taskIDList : die(js::locate($this->session->taskList, 'parent')); $taskIDList = array_unique($taskIDList); - /* The tasks of project. */ - if($projectID) + /* The tasks of execution. */ + if($executionID) { - $project = $this->project->getById($projectID); - $this->project->setMenu($this->project->getExecutionPairs($this->session->PRJ), $project->id); + $execution = $this->project->getById($executionID); + $this->project->setMenu($this->project->getExecutionPairs($this->session->PRJ), $execution->id); /* Set modules and members. */ $showAllModule = isset($this->config->project->task->allModule) ? $this->config->project->task->allModule : ''; - $modules = $this->tree->getTaskOptionMenu($projectID, 0, 0, $showAllModule ? 'allModule' : ''); + $modules = $this->tree->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : ''); $modules = array('ditto' => $this->lang->task->ditto) + $modules; - $this->view->title = $project->name . $this->lang->colon . $this->lang->task->batchEdit; - $this->view->position[] = html::a($this->createLink('project', 'browse', "project=$project->id"), $project->name); - $this->view->project = $project; + $this->view->title = $execution->name . $this->lang->colon . $this->lang->task->batchEdit; + $this->view->position[] = html::a($this->createLink('project', 'browse', "executionID=$execution->id"), $execution->name); + $this->view->execution = $execution; $this->view->modules = $modules; } /* The tasks of my. */ @@ -474,10 +474,10 @@ class task extends control $tasks = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($taskIDList)->fetchAll('id'); $teams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($taskIDList)->andWhere('type')->eq('task')->fetchGroup('root', 'account'); - /* Get project teams. */ - $projectIDList = array(); - foreach($tasks as $task) if(!in_array($task->project, $projectIDList)) $projectIDList[] = $task->project; - $projectTeams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($projectIDList)->andWhere('type')->in('sprint,stage')->fetchGroup('root', 'account'); + /* Get execution teams. */ + $executionIDList = array(); + foreach($tasks as $task) if(!in_array($task->project, $executionIDList)) $executionIDList[] = $task->project; + $executionTeams = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->in($executionIDList)->andWhere('type')->in('sprint,stage')->fetchGroup('root', 'account'); /* Judge whether the editedTasks is too large and set session. */ $countInputVars = count($tasks) * (count(explode(',', $this->config->task->custom->batchEditFields)) + 3); @@ -490,18 +490,19 @@ class task extends control $this->view->showFields = $this->config->task->custom->batchEditFields; /* Assign. */ - $this->view->position[] = $this->lang->task->common; - $this->view->position[] = $this->lang->task->batchEdit; - $this->view->projectID = $projectID; - $this->view->priList = array('0' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->priList; - $this->view->statusList = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->statusList; - $this->view->typeList = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->typeList; - $this->view->taskIDList = $taskIDList; - $this->view->tasks = $tasks; - $this->view->teams = $teams; - $this->view->projectTeams = $projectTeams; - $this->view->projectName = isset($project) ? $project->name : ''; - $this->view->users = $this->loadModel('user')->getPairs('nodeleted'); + $this->view->position[] = $this->lang->task->common; + $this->view->position[] = $this->lang->task->batchEdit; + $this->view->executionID = $executionID; + $this->view->priList = array('0' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->priList; + $this->view->statusList = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->statusList; + $this->view->typeList = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->typeList; + $this->view->taskIDList = $taskIDList; + $this->view->tasks = $tasks; + $this->view->teams = $teams; + $this->view->executionTeams = $executionTeams; + $this->view->executionName = isset($execution) ? $execution->name : ''; + $this->view->executionType = isset($execution) ? $execution->type : ''; + $this->view->users = $this->loadModel('user')->getPairs('nodeleted'); $this->display(); } diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 0bab4f314c..add72714c8 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -20,8 +20,8 @@ js::set('dittoNotice', $dittoNotice);

task->common . $lang->colon . $lang->task->batchEdit;?> - - icons['project']) . ' ' . $lang->task->execution . $lang->colon . ' ' . $projectName;?> + + icons[$executionType]) . ' ' . $lang->task->execution . $lang->colon . ' ' . $executionName;?>

@@ -48,7 +48,7 @@ js::set('dittoNotice', $dittoNotice); } } ?> -
"> + ">
@@ -78,7 +78,7 @@ js::set('dittoNotice', $dittoNotice); project->getById($tasks[$taskID]->project); $modules = $this->tree->getOptionMenu($tasks[$taskID]->project, $viewType = 'task'); @@ -91,7 +91,7 @@ js::set('dittoNotice', $dittoNotice); parent < 0) ? "disabled='disabled'" : '';?> '', 'ditto' => $this->lang->task->ditto); - $teamAccounts = array_keys($projectTeams[$tasks[$taskID]->project]); + $teamAccounts = array_keys($executionTeams[$tasks[$taskID]->project]); foreach($teamAccounts as $teamAccount) $members[$teamAccount] = $users[$teamAccount]; $members['closed'] = 'Closed';