* finish task#1556.

This commit is contained in:
chencongzhi520@gmail.com
2013-07-12 00:44:27 +00:00
parent 5dc8a427ff
commit 82dc204a37
6 changed files with 75 additions and 30 deletions
+26 -17
View File
@@ -305,37 +305,46 @@ class task extends control
/* Initialize vars. */
$orderBy = str_replace('status', 'statusCustom', $this->cookie->projectTaskOrder);
if(!$orderBy) $orderBy = 'statusCustom,id_desc';
$project = $this->project->getById($projectID);
$tasks = array();
$columns = 13;
$showSuhosinInfo = false;
/* Set project menu. */
$this->project->setMenu($this->project->getPairs(), $project->id);
/* The tasks of project. */
if($projectID)
{
$project = $this->project->getById($projectID);
$this->project->setMenu($this->project->getPairs(), $project->id);
$members = $this->project->getTeamMemberPairs($projectID, 'nodeleted');
$members = $members + array('closed' => 'Closed');
$this->view->title = $project->name . $this->lang->colon . $this->lang->task->batchEdit;
$this->view->project = $project;
$this->view->modules = $this->tree->getOptionMenu($projectID, $viewType = 'task');
$this->view->members = $members;
}
/* The tasks of my. */
else
{
$this->lang->task->menu = $this->lang->my->menu;
$this->lang->set('menugroup.task', 'my.task');
$this->lang->task->menuOrder = $this->lang->my->menuOrder;
$this->loadModel('my')->setMenu();
$this->view->title = $this->lang->task->batchEdit;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
}
/* Get all tasks. */
/* Get edited tasks. */
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($taskIDList)->fetchAll('id');
/* Judge whether the editedTasks is too large. */
/* Judge whether the editedTasks is too large and set session. */
$showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($tasks), $columns);
/* Set the sessions. */
$this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
/* Assign. */
$this->view->title = $project->name . $this->lang->colon . $this->lang->task->batchEdit;
$this->view->position[] = $this->lang->task->common;
$this->view->position[] = $this->lang->task->batchEdit;
$members = $this->project->getTeamMemberPairs($projectID, 'nodeleted');
$members = $members + array('closed' => 'Closed');
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
$this->view->project = $project;
$this->view->modules = $this->tree->getOptionMenu($projectID, $viewType = 'task');
$this->view->projectID = $projectID;
$this->view->taskIDList = $taskIDList;
$this->view->tasks = $tasks;
$this->view->members = $members;
$this->display();
}
+20 -3
View File
@@ -11,13 +11,18 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<form method='post' target='hiddenwin' action="<?php echo $this->inLink('batchEdit', "projectID={$project->id}")?>">
<form method='post' target='hiddenwin' action="<?php echo $this->inLink('batchEdit', "projectID={$projectID}")?>">
<table class='table-1 fixed'>
<caption><?php echo $lang->task->common . $lang->colon . $lang->task->batchEdit;?></caption>
<tr>
<th class='w-30px'><?php echo $lang->idAB;?></th>
<th class='red'> <?php echo $lang->task->name?></th>
<?php if($project->type != 'sprint') echo "<th class='w-80px'>" . $lang->task->module . "</th>";?>
<?php
if(!isset($project) or (isset($project) and $project->type != 'sprint'))
{
echo "<th class='w-80px'>" . $lang->task->module . "</th>";
}
?>
<th class='w-80px'><?php echo $lang->task->assignedTo;?></th>
<th class='w-60px red'><?php echo $lang->typeAB;?></th>
<th class='w-70px'><?php echo $lang->task->status;?></th>
@@ -31,10 +36,22 @@
<th class='w-80px'><?php echo $lang->task->closedReason;?></th>
</tr>
<?php foreach($taskIDList as $taskID):?>
<?php
if(!isset($project))
{
$modules = $this->tree->getOptionMenu($tasks[$taskID]->project, $viewType = 'task');
$members = $this->project->getTeamMemberPairs($tasks[$taskID]->project, 'nodeleted');
}
?>
<tr class='a-center'>
<td><?php echo $taskID . html::hidden("taskIDList[$taskID]", $taskID);?></td>
<td><?php echo html::input("names[$taskID]", $tasks[$taskID]->name, 'class=text-1');?></td>
<?php if($project->type != 'sprint') echo "<td>" . html::select("modules[$taskID]", $modules, $tasks[$taskID]->module, 'class=select-1') . "</td>";?>
<?php
if(!isset($project) or (isset($project) and $project->type != 'sprint'))
{
echo "<td>" . html::select("modules[$taskID]", $modules, $tasks[$taskID]->module, 'class=select-1') . "</td>";
}
?>
<td><?php echo html::select("assignedTos[$taskID]", $members, $tasks[$taskID]->assignedTo, 'class=select-1');?></td>
<td><?php echo html::select("types[$taskID]", $lang->task->typeList, $tasks[$taskID]->type, 'class=select-1');?></td>
<td><?php echo html::select("statuses[$taskID]", $lang->task->statusList, $tasks[$taskID]->status, 'class=select-1');?></td>