From 82dc204a37c41dbefc35d062e99f5c2aab4b94a4 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Fri, 12 Jul 2013 00:44:27 +0000 Subject: [PATCH] * finish task#1556. --- module/common/lang/en.php | 2 +- module/common/lang/zh-cn.php | 2 +- module/my/js/common.js | 6 ++++ module/my/view/task.html.php | 29 +++++++++++++------ module/task/control.php | 43 +++++++++++++++++------------ module/task/view/batchedit.html.php | 23 +++++++++++++-- 6 files changed, 75 insertions(+), 30 deletions(-) diff --git a/module/common/lang/en.php b/module/common/lang/en.php index d02c550136..46651c9ff5 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -137,7 +137,7 @@ $lang->my->menu = new stdclass(); $lang->my->menu->account = ' %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|'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index aeebab6ff2..94fe41e584 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -137,7 +137,7 @@ $lang->my->menu = new stdclass(); $lang->my->menu->account = ' %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|'; diff --git a/module/my/js/common.js b/module/my/js/common.js index 5b1e2f6e44..3ef321529c 100644 --- a/module/my/js/common.js +++ b/module/my/js/common.js @@ -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(); +} diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 81fae86f90..e8e12f3b19 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -24,10 +24,7 @@ ?> - - -
'> - + @@ -46,10 +43,12 @@ + + @@ -77,13 +76,27 @@
- + createLink('task', 'view', "taskID=$task->id"), sprintf('%03d', $task->id));?> task->priList[$task->pri];?>'>task->priList[$task->pri]) ? $lang->task->priList[$task->pri] : $task->pri;?>
- -
close)?>
+ +
+ 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')\""); + } + ?> +
show();?>
-';?> +
diff --git a/module/task/control.php b/module/task/control.php index 658880cf75..9b92f586a5 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -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(); } diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 73e52124be..13eec9af32 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -11,13 +11,18 @@ */ ?> -
id}")?>"> +"> - type != 'sprint') echo "";?> + type != 'sprint')) + { + echo ""; + } + ?> @@ -31,10 +36,22 @@ + tree->getOptionMenu($tasks[$taskID]->project, $viewType = 'task'); + $members = $this->project->getTeamMemberPairs($tasks[$taskID]->project, 'nodeleted'); + } + ?> - type != 'sprint') echo "";?> + type != 'sprint')) + { + echo ""; + } + ?>
task->common . $lang->colon . $lang->task->batchEdit;?>
idAB;?> task->name?>" . $lang->task->module . "" . $lang->task->module . "task->assignedTo;?> typeAB;?> task->status;?>task->closedReason;?>
name, 'class=text-1');?>" . html::select("modules[$taskID]", $modules, $tasks[$taskID]->module, 'class=select-1') . "" . html::select("modules[$taskID]", $modules, $tasks[$taskID]->module, 'class=select-1') . "assignedTo, 'class=select-1');?> task->typeList, $tasks[$taskID]->type, 'class=select-1');?> task->statusList, $tasks[$taskID]->status, 'class=select-1');?>