* Adjust the batchedit method icons.

This commit is contained in:
leiyong
2021-01-01 14:37:16 +08:00
parent 5cc89dc76b
commit 970f3e11a5
2 changed files with 32 additions and 31 deletions
+27 -26
View File
@@ -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();
}
+5 -5
View File
@@ -20,8 +20,8 @@ js::set('dittoNotice', $dittoNotice);
<div class='main-header'>
<h2>
<?php echo $lang->task->common . $lang->colon . $lang->task->batchEdit;?>
<?php if($projectName):?>
<small class='text-muted'><?php echo html::icon($lang->icons['project']) . ' ' . $lang->task->execution . $lang->colon . ' ' . $projectName;?></small>
<?php if($executionName):?>
<small class='text-muted'><?php echo html::icon($lang->icons[$executionType]) . ' ' . $lang->task->execution . $lang->colon . ' ' . $executionName;?></small>
<?php endif;?>
</h2>
<div class='pull-right btn-toolbar'>
@@ -48,7 +48,7 @@ js::set('dittoNotice', $dittoNotice);
}
}
?>
<form id='batchEditForm' class='main-form' method='post' target='hiddenwin' action="<?php echo inLink('batchEdit', "projectID={$projectID}")?>">
<form id='batchEditForm' class='main-form' method='post' target='hiddenwin' action="<?php echo inLink('batchEdit', "executionID={$executionID}")?>">
<div class="table-responsive">
<table class='table table-form table-fixed with-border'>
<thead>
@@ -78,7 +78,7 @@ js::set('dittoNotice', $dittoNotice);
<tbody>
<?php foreach($taskIDList as $taskID):?>
<?php
if(!isset($project))
if(!isset($execution))
{
$prjInfo = $this->project->getById($tasks[$taskID]->project);
$modules = $this->tree->getOptionMenu($tasks[$taskID]->project, $viewType = 'task');
@@ -91,7 +91,7 @@ js::set('dittoNotice', $dittoNotice);
<?php $disableHour = (isset($teams[$taskID]) or $tasks[$taskID]->parent < 0) ? "disabled='disabled'" : '';?>
<?php
$members = array('' => '', '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';