From cf5d382ebcfc557138bd52cdd84b511e83fbc5d2 Mon Sep 17 00:00:00 2001 From: "shiyangyangwork@yahoo.cn" Date: Tue, 25 Oct 2011 02:23:22 +0000 Subject: [PATCH] * adjust code for task #538. --- module/story/lang/en.php | 2 +- module/task/control.php | 3 ++- module/task/lang/en.php | 1 + module/task/lang/zh-cn.php | 1 + module/task/model.php | 4 ++-- module/task/view/batchcreate.html.php | 9 +++++---- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 1182fb8125..275729e9bd 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -70,7 +70,7 @@ $lang->story->reviewResult = 'Reviewed result'; $lang->story->preVersion = 'Pre version'; $lang->story->keywords = 'Keyword'; -$lang->story->same = 'The same up'; +$lang->story->same = 'The same as above'; $lang->story->useList[0] = 'No use'; $lang->story->useList[1] = 'Use'; diff --git a/module/task/control.php b/module/task/control.php index 681d73de79..65a6d38355 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -119,6 +119,7 @@ class task extends control } $stories = $this->story->getProjectStoryPairs($projectID); + $stories['same'] = $this->lang->task->same; $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); $header['title'] = $project->name . $this->lang->colon . $this->lang->task->create; $position[] = html::a($taskLink, $project->name); @@ -489,7 +490,7 @@ class task extends control } /* Get action info. */ - $action = $this->action->getById($actionID); + $action = $this->loadModel('action')->getById($actionID); $history = $this->action->getHistory($actionID); $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); diff --git a/module/task/lang/en.php b/module/task/lang/en.php index f310d231d7..245eaeeeab 100644 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -68,6 +68,7 @@ $lang->task->lastEditedBy = 'Last Edited By'; $lang->task->lastEditedDate = 'Last Edited Date'; $lang->task->lastEdited = 'Last Edited'; +$lang->task->same = 'The same as above'; $lang->task->notes = '(Notes: the name, type, pri and estimate must be written, otherwise it is no use)'; $lang->task->statusList[''] = ''; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 0472beba1f..427879f8d9 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -68,6 +68,7 @@ $lang->task->lastEditedBy = '最后修改'; $lang->task->lastEditedDate = '最后修改日期'; $lang->task->lastEdited = '最后编辑'; +$lang->task->same = '同上'; $lang->task->notes = '(注:“任务类型”、“任务名称”、“优先级”和“预计工时”必需填写,否则此行无效)'; $lang->task->statusList[''] = ''; diff --git a/module/task/model.php b/module/task/model.php index a627d06fed..6d95f04a24 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -92,8 +92,8 @@ class taskModel extends model { if($tasks->type[$i] != '' and $tasks->name[$i] != '' and $tasks->pri[$i] != 0 and $tasks->estimate[$i] != '') { - $data[$i]->story = $tasks->story[$i]; - $data[$i]->type = $tasks->type[$i]; + $data[$i]->story = $tasks->story[$i] != 'same' ? $tasks->story[$i] : ($i == 0 ? 0 : $data[$i-1]->story); + $data[$i]->type = $tasks->type[$i] == 'same' ? ($i == 0 ? '' : $data[$i-1]->type) : $tasks->type[$i]; $data[$i]->name = $tasks->name[$i]; $data[$i]->desc = $tasks->desc[$i]; $data[$i]->assignedTo = $tasks->assignedTo[$i]; diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 2fcabfe401..cc675620d8 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -25,13 +25,14 @@ task->estimateBatch;?> task->batchCreate; $i++):?> - - + + task->typeList['same'] = $lang->task->same; $type = $i == 0 ? '' : 'same';?> + - - task->typeList, '', "class=select-2"); echo "*";?> + + task->typeList, $type, "class=select-2"); echo "*";?> *";?>