* adjust code for task #610.

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-12-07 06:19:08 +00:00
parent c4be65d61b
commit 8f7af22077
4 changed files with 43 additions and 18 deletions
+2 -1
View File
@@ -570,7 +570,7 @@ class bug extends control
* @access public
* @return void
*/
public function resolve($bugID)
public function resolve($bugID, $toStory = false)
{
$this->view->users = $this->user->getPairs('nodeleted');
@@ -606,6 +606,7 @@ class bug extends control
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->resolve;
$this->view->toStory = $toStory;
$this->view->bug = $bug;
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->actions = $this->action->getList('bug', $bugID);
+7 -4
View File
@@ -246,10 +246,13 @@ class bugModel extends model
$actionID = $this->loadModel('action')->create('story', $storyID, 'Frombug', '', $bugID);
$file = $this->dao->select('*')->from(TABLE_FILE)->where('objectType')->eq('bug')->andWhere('objectID')->eq($bugID)->fetch();
$file->objectType = 'story';
$file->objectID = $storyID;
unset($file->id);
$this->dao->insert(TABLE_FILE)->data($file)->exec();
if(!empty($file))
{
$file->objectType = 'story';
$file->objectID = $storyID;
unset($file->id);
$this->dao->insert(TABLE_FILE)->data($file)->exec();
}
}
$bug = fixer::input('post')
+4
View File
@@ -16,7 +16,11 @@
<caption><?php echo $bug->title;?></caption>
<tr>
<td class='rowhead'><?php echo $lang->bug->resolution;?></td>
<?php if($toStory == false):?>
<td><?php echo html::select('resolution', $lang->bug->resolutionList, '', 'class=select-3 onchange=setDuplicate(this.value)');?></td>
<?php else:?>
<td><?php echo $lang->bug->resolutionList['tostory'];echo html::input('resolution', 'tostory', 'class=select-3 hidden');?></td>
<?php endif;?>
</tr>
<tr id='duplicateBugBox' style='display:none'>
<td class='rowhead'><?php echo $lang->bug->duplicateBug;?></td>
+30 -13
View File
@@ -25,6 +25,14 @@
common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit);
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
if($bug->status == 'active' and common::hasPriv('bug', 'resolve'))
{
common::printLink('bug', 'resolve', "$params&toStory=true", $lang->bug->resolutionList['tostory']) . ' ';
}
else
{
echo $lang->bug->resolutionList['tostory'] . ' ';
}
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
common::printLink('bug', 'create', $copyParams, $lang->bug->buttonCopy);
common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase);
@@ -45,19 +53,28 @@
<?php echo $this->fetch('file', 'printFiles', array('files' => $bug->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<div class='a-center' style='font-size:16px; font-weight:bold'>
<?php
if(!$bug->deleted)
{
if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' ';
common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit);
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
common::printLink('bug', 'create', $copyParams, $lang->bug->buttonCopy);
common::printLink('bug', 'delete', $params, $lang->delete, 'hiddenwin');
}
echo html::a($browseLink, $lang->goback);
?>
<?php
if(!$bug->deleted)
{
if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' ';
common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit);
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
if($bug->status == 'active' and common::hasPriv('bug', 'resolve'))
{
common::printLink('bug', 'resolve', "$params&toStory=true", $lang->bug->resolutionList['tostory']) . ' ';
}
else
{
echo $lang->bug->resolutionList['tostory'] . ' ';
}
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
common::printLink('bug', 'create', $copyParams, $lang->bug->buttonCopy);
common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase);
common::printLink('bug', 'delete', $params, $lang->delete, 'hiddenwin');
}
echo html::a($browseLink, $lang->goback);
?>
</div>
</td>
<td class='divider'></td>