From e9abe8c682d0b57eb71dd8b9337a01ea8ab0a4a6 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Sun, 2 Sep 2012 01:25:50 +0000 Subject: [PATCH] * adjust the batchEdit page. + add module field when batch edit tasks. --- module/task/control.php | 7 ++-- module/task/model.php | 54 ++++++++++++++++------------- module/task/view/batchedit.html.php | 38 ++++++++++---------- 3 files changed, 52 insertions(+), 47 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 0fe10c509b..80779e7d5a 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -75,9 +75,9 @@ class task extends control $stories = $this->story->getProjectStoryPairs($projectID); $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); $moduleOptionMenu = $this->tree->getOptionMenu($projectID, $viewType = 'task'); - $header['title'] = $project->name . $this->lang->colon . $this->lang->task->create; - $position[] = html::a($taskLink, $project->name); - $position[] = $this->lang->task->create; + $header['title'] = $project->name . $this->lang->colon . $this->lang->task->create; + $position[] = html::a($taskLink, $project->name); + $position[] = $this->lang->task->create; $this->view->header = $header; $this->view->position = $position; $this->view->project = $project; @@ -260,6 +260,7 @@ class task extends control if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo; $this->view->projectID = $project->id; + $this->view->modules = $this->tree->getOptionMenu($projectID, $viewType = 'task'); $this->view->editedTasks = $editedTasks; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); diff --git a/module/task/model.php b/module/task/model.php index ca7465e497..fef11e98cf 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -230,6 +230,7 @@ class taskModel extends model $oldTask = $this->getById($taskID); $task->name = htmlspecialchars($this->post->names[$taskID]); + $task->module = $this->post->modules[$taskID]; $task->assignedTo = $this->post->assignedTos[$taskID]; $task->type = $this->post->types[$taskID]; $task->status = $this->post->statuses[$taskID]; @@ -248,36 +249,39 @@ class taskModel extends model $task->lastEditedDate = $now; if(isset($this->post->assignedTos[$taskID])) { - $task->assignedDate = $this->post->assignedTos[$taskID] == $oldTask->assignedTo ? $oldTask->assignedDate : $now; + $task->assignedDate = $this->post->assignedTos[$taskID] == $oldTask->assignedTo ? $oldTask->assignedDate : $now; } switch($task->status) { - case 'done': - { - $task->left = 0; - if(!$task->finishedBy) $task->finishedBy = $this->app->user->account; - if(!$task->finishedDate) $task->finishedDate = $now; - }break; - case 'cancel': - { - $task->assignedTo = $oldTask->openedBy; - $task->assignedDate = $now; + case 'done': + { + $task->left = 0; + if(!$task->finishedBy) $task->finishedBy = $this->app->user->account; + if(!$task->finishedDate) $task->finishedDate = $now; + } + break; + case 'cancel': + { + $task->assignedTo = $oldTask->openedBy; + $task->assignedDate = $now; - if(!$task->canceledBy) $task->canceledBy = $this->app->user->account; - if(!$task->canceledDate) $task->canceledDate = $now; - }break; - case 'closed': - { - if(!$task->closedBy) $task->closedBy = $this->app->user->account; - if(!$task->closedDate) $task->closedDate = $now; - }break; - case 'wait': - { - if($task->consumed > 0 and $task->left > 0) $task->status = 'doing'; - if($task->left == $oldTask->left and $task->consumed == 0) $task->left = $task->estimate; - } - default:break; + if(!$task->canceledBy) $task->canceledBy = $this->app->user->account; + if(!$task->canceledDate) $task->canceledDate = $now; + } + break; + case 'closed': + { + if(!$task->closedBy) $task->closedBy = $this->app->user->account; + if(!$task->closedDate) $task->closedDate = $now; + } + break; + case 'wait': + { + if($task->consumed > 0 and $task->left > 0) $task->status = 'doing'; + if($task->left == $oldTask->left and $task->consumed == 0) $task->left = $task->estimate; + } + default:break; } if($task->assignedTo) $task->assignedDate = $now; diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 93ca360a20..8bbce7e7da 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -16,40 +16,40 @@ task->common . $lang->colon . $lang->task->batchEdit;?> idAB;?> - task->name;?> - task->assignedTo;?> - typeAB;?> - task->status;?> - task->pri;?> - task->estimateAB;?> - task->consumedAB;?> - task->leftAB;?> - task->finishedBy;?> - task->canceledBy;?> - task->closedBy;?> - task->closedReason;?> + task->name?> + task->module;?> + task->assignedTo;?> + typeAB;?> + task->status;?> + task->pri;?> + task->estimateAB?> + task->consumedAB?> + task->leftAB?> + task->finishedBy;?> + task->closedBy;?> + task->closedReason;?> id . html::hidden("taskIDList[$task->id]", $task->id);?> - id]", $task->name, 'class=text-1'); echo "*";?> + id]", $task->name, 'class=text-1');?> + id]", $modules, $task->module, 'class=select-1');?> id]", $members, $task->assignedTo, 'class=select-1');?> id]", $lang->task->typeList, $task->type, 'class=select-1');?> id]", $lang->task->statusList, $task->status, 'class=select-1');?> id]", (array)$lang->task->priList, $task->pri, 'class=select-1');?> - id]", $task->estimate, 'class=text-1'); echo "*";?> - id]", $task->consumed, 'class=text-1'); echo "*";?> - id]", $task->left, 'class=text-1'); echo "*";?> + id]", $task->estimate, 'class=text-1');?> + id]", $task->consumed, 'class=text-1');?> + id]", $task->left, 'class=text-1');?> id]", $members, $task->finishedBy, 'class=select-1');?> - id]", $members, $task->canceledBy, 'class=select-1');?> id]", $members, $task->closedBy, 'class=select-1');?> id]", $lang->task->reasonList, $task->closedReason, 'class=select-1');?> -
+
- +