* 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
+1 -1
View File
@@ -137,7 +137,7 @@ $lang->my->menu = new stdclass();
$lang->my->menu->account = '<span id="mybg">&nbsp;</span>%s' . $lang->arrow;
$lang->my->menu->index = 'Index|my|index';
$lang->my->menu->todo = array('link' => 'Todo|my|todo|', 'subModule' => 'todo');
$lang->my->menu->task = 'Task|my|task|';
$lang->my->menu->task = array('link' => 'Task|my|task|', 'subModule' => 'task');
$lang->my->menu->bug = 'Bug|my|bug|';
$lang->my->menu->testtask = array('link' => 'Test|my|testtask|', 'alias' => 'testcase');
$lang->my->menu->story = 'Story|my|story|';
+1 -1
View File
@@ -137,7 +137,7 @@ $lang->my->menu = new stdclass();
$lang->my->menu->account = '<span id="mybg">&nbsp;</span>%s' . $lang->arrow;
$lang->my->menu->index = '首页|my|index';
$lang->my->menu->todo = array('link' => '待办|my|todo|', 'subModule' => 'todo');
$lang->my->menu->task = '任务|my|task|';
$lang->my->menu->task = array('link' => '任务|my|task|', 'subModule' => 'task');
$lang->my->menu->bug = 'Bug|my|bug|';
$lang->my->menu->testtask = array('link' => '测试|my|testtask|', 'alias' => 'testcase');
$lang->my->menu->story = '需求|my|story|';
+6
View File
@@ -3,3 +3,9 @@ $(function()
//$("#submenuchangePassword").colorbox({width:600, height:400, iframe:true, transition:'none', scrolling:false});
$(function(){$('.iframe').colorbox({width:900, height:500, iframe:true, transition:'none', onCleanup:function(){parent.location.href=parent.location.href;}});})
});
function changeAction(formName, actionName, actionLink)
{
if(actionName == 'batchClose') $('#' + formName).attr('target', 'hiddenwin');
$('#' + formName).attr('action', actionLink).submit();
}
+21 -8
View File
@@ -24,10 +24,7 @@
?>
</div>
</div>
<?php $canBatchClose = (common::hasPriv('task', 'batchClose') and $type != 'closedBy');?>
<?php if($canBatchClose):?>
<form method='post' target='hiddenwin' action='<?php echo $this->createLink('task', 'batchClose');?>'>
<?php endif;?>
<form method='post' id='myTaskForm'>
<table class='table-1 tablesorter fixed colored' id='tasktable'>
<?php $vars = "type=$type&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"; ?>
<thead>
@@ -46,10 +43,12 @@
</tr>
</thead>
<tbody>
<?php $canBatchEdit = common::hasPriv('task', 'batchEdit');?>
<?php $canBatchClose = (common::hasPriv('task', 'batchClose') and $type != 'closedBy');?>
<?php foreach($tasks as $task):?>
<tr class='a-center'>
<td class='a-left'>
<?php if($canBatchClose):?><input type='checkbox' name='taskIDList[]' value='<?php echo $task->id;?>' /><?php endif;?>
<?php if($canBatchEdit or $canBatchClose):?><input type='checkbox' name='taskIDList[]' value='<?php echo $task->id;?>' /><?php endif;?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), sprintf('%03d', $task->id));?>
</td>
<td><span class='<?php echo 'pri' . $lang->task->priList[$task->pri];?>'><?php echo isset($lang->task->priList[$task->pri]) ? $lang->task->priList[$task->pri] : $task->pri;?></span></td>
@@ -77,13 +76,27 @@
<tfoot>
<tr>
<td colspan='11'>
<?php if($canBatchClose and count($tasks)):?>
<div class='f-left'><?php echo html::selectAll() . html::selectReverse() . html::submitButton($lang->close)?></div>
<?php if(count($tasks)):?>
<div class='f-left'>
<?php
if($canBatchEdit or $canBatchClose) echo html::selectAll() . html::selectReverse();
if($canBatchEdit)
{
$actionLink = $this->createLink('task', 'batchEdit', "projectID=0&orderBy=$orderBy");
echo html::commonButton($lang->edit, "onclick=\"changeAction('myTaskForm', 'batchEdit', '$actionLink')\"");
}
if($canBatchClose)
{
$actionLink = $this->createLink('task', 'batchClose');
echo html::commonButton($lang->close, "onclick=\"changeAction('myTaskForm', 'batchClose', '$actionLink')\"");
}
?>
</div>
<?php endif;?>
<?php $pager->show();?>
</td>
</tr>
</tfoot>
</table>
<?php if($canBatchClose) echo '</form>';?>
</form>
<?php include '../../common/view/footer.html.php';?>
+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>