From 31dcfb2325418a0578ee9ba2a3e75583c86da9a6 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Thu, 18 Apr 2013 02:01:39 +0000 Subject: [PATCH] * finish task#1189. --- module/task/control.php | 25 ++++++++++++++++++++++--- module/task/view/create.html.php | 22 +++++++++++----------- module/task/view/view.html.php | 3 ++- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 6bbe4edf85..45c2ea97ae 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -30,11 +30,31 @@ class task extends control * * @param int $projectID * @param int $storyID + * @param int $moduleID + * @param int $taskID * @access public * @return void */ - public function create($projectID = 0, $storyID = 0, $moduleID = 0) + public function create($projectID = 0, $storyID = 0, $moduleID = 0, $taskID = 0) { + $task = new stdClass(); + $task->module = $moduleID; + $task->assignedTo = ''; + $task->name = ''; + $task->story = $storyID; + $task->type = ''; + $task->pri = ''; + $task->estimate = ''; + $task->desc = ''; + $task->estStarted = ''; + $task->deadline = ''; + $task->mailto = ''; + if($taskID > 0) + { + $task = $this->task->getByID($taskID); + $projectID = $task->project; + } + $project = $this->project->getById($projectID); $taskLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task"); $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID"); @@ -84,11 +104,10 @@ class task extends control $this->view->title = $title; $this->view->position = $position; $this->view->project = $project; + $this->view->task = $task; $this->view->stories = $stories; - $this->view->storyID = $storyID; $this->view->members = $members; $this->view->contactLists = $contactLists; - $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; $this->display(); } diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index d58ea005b2..c8c3c10796 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -35,17 +35,17 @@ type != 'sprint'):?> task->module;?> - + module, "class='select-3'");?> task->assignedTo;?> - + assignedTo, 'class=select-3');?> task->story;?> - + story, 'class=select-1 onchange=setPreview();');?> preview;?> @@ -53,39 +53,39 @@ task->name;?> name, "class='text-1'"); echo html::commonButton($lang->task->copyStoryTitle, 'onclick=copyStoryTitle()');?> task->desc;?> - + desc, "rows='7' class='area-1'");?> task->pri;?> - task->priList, '', 'class=select-3');?> + task->priList, $task->pri, 'class=select-3');?> task->estimate;?> - task->hour;?> + estimate, "class='text-3'") . $lang->task->hour;?> task->estStarted;?> - + estStarted, "class='text-3 date'");?> task->deadline;?> - + deadline, "class='text-3 date'");?> task->type;?> - task->typeList, '', 'class=select-3 onchange="setOwners(this.value)"');?> + task->typeList, $task->type, 'class=select-3 onchange="setOwners(this.value)"');?> task->mailto;?> mailto, 'class="text-1"'); if($contactLists) echo html::select('', $contactLists, '', "onchange=\"setMailto('mailto', this.value)\""); ?> diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index a00719ad04..b018c42d70 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -36,7 +36,8 @@ common::printDivider(); common::printIcon('task', 'edit', "taskID=$task->id"); common::printCommentIcon('task'); - common::printIcon('task', 'delete',"projectID=$task->project&taskID=$task->id", '', 'button', '', 'hiddenwin'); + common::printIcon('task', 'create', "productID=0&storyID=0&moduleID=0&taskID=$task->id", '', 'button', 'copy'); + common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", '', 'button', '', 'hiddenwin'); common::printDivider(); common::printRPN($browseLink, $preAndNext);