From 54c49e23404b68c8580172453b1f7064ada80a28 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Thu, 11 Dec 2014 17:40:06 +0800 Subject: [PATCH] * code for task#2154. --- module/bug/control.php | 5 ++++- module/bug/model.php | 2 +- module/bug/view/create.html.php | 2 +- module/bug/view/resolve.html.php | 6 +++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 39526d4205..cf923eaf39 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -756,7 +756,10 @@ class bug extends control { $this->bug->resolve($bugID); if(dao::isError()) die(js::error(dao::getError())); - $actionID = $this->action->create('bug', $bugID, 'Resolved', $this->post->comment, $this->post->resolution); + $files = $this->loadModel('file')->saveUpload('task', $taskID); + + $fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : ''; + $actionID = $this->action->create('bug', $bugID, 'Resolved', $fileAction . $this->post->comment, $this->post->resolution); $this->sendmail($bugID, $actionID); $bug = $this->bug->getById($bugID); diff --git a/module/bug/model.php b/module/bug/model.php index 7bb9f89e12..ad645aaab1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -568,7 +568,7 @@ class bugModel extends model ->add('lastEditedDate', $now) ->setDefault('duplicateBug', 0) ->setDefault('assignedTo', $oldBug->openedBy) - ->remove('comment') + ->remove('comment,files,labels') ->get(); if($bug->resolvedBuild != 'trunk') diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 25fc8b95e0..90ba471db5 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -142,7 +142,7 @@ js::set('refresh', $lang->refresh); bug->files;?> fetch('file', 'buildform', 'fileCount=2&percent=0.85');?> - + diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index 1047a12936..afed3b1c6c 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -21,7 +21,7 @@ -
+ @@ -43,6 +43,10 @@ + + + +
bug->resolution;?>bug->assignedTo;?> openedBy, "class='form-control chosen'");?>
bug->files;?>fetch('file', 'buildform', 'fileCount=2&percent=0.85');?>
comment;?>