* finish the rewrite of other bug's pages.

This commit is contained in:
wangchunsheng
2010-01-19 09:14:44 +00:00
parent 25ad0cad8c
commit d0d05ee359
8 changed files with 54 additions and 35 deletions

View File

@@ -235,7 +235,7 @@ class bug extends control
$this->view->projects = $this->product->getProjectPairs($bug->product);
$this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product);
$this->view->tasks = $this->task->getProjectTaskPairs($bug->project);
$this->view->users = $this->user->getPairs();
$this->view->users = $this->user->getPairs();
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->actions = $this->action->getList('bug', $bugID);
@@ -255,20 +255,23 @@ class bug extends control
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
/* 生成表单。*/
/* 查找bug和产品信息。*/
$bug = $this->bug->getById($bugID);
$productID = $bug->product;
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve;
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$position[] = $this->lang->bug->resolve;
/* 设置菜单。*/
$this->bug->setMenu($this->products, $productID);
$users = $this->user->getPairs();
$this->assign('header', $header);
$this->assign('position', $position);
$this->assign('bug', $bug);
/* 位置。*/
$this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->resolve;
/* 赋值。*/
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs();
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
}
@@ -280,28 +283,30 @@ class bug extends control
{
$this->bug->activate($bugID);
if(dao::isError()) die(js::error(dao::getError()));
$files = $this->loadModel('file')->saveUpload('files', 'bug', $bugID);
$files = $this->loadModel('file')->saveUpload('bug', $bugID);
$actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment);
$this->sendmail($bugID, $actionID);
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
/* 生成表单。*/
/* 获得bug和产品信息。*/
$bug = $this->bug->getById($bugID);
$productID = $bug->product;
$users = $this->user->getPairs();
/* 设置菜单。*/
$this->bug->setMenu($this->products, $productID);
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate;
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$position[] = $this->lang->bug->activate;
/* 当前位置。*/
$this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->activate;
/* 赋值。*/
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs();
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->assign('header', $header);
$this->assign('position', $position);
$this->assign('bug', $bug);
$this->assign('users', $users);
$this->display();
}
@@ -318,20 +323,20 @@ class bug extends control
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
/* 生成表单。*/
/* bug和产品信息。*/
$bug = $this->bug->getById($bugID);
$productID = $bug->product;
/* 设置菜单。*/
$this->bug->setMenu($this->products, $productID);
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate;
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$position[] = $this->lang->bug->activate;
$this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->activate;
$this->assign('header', $header);
$this->assign('position', $position);
$this->assign('bug', $bug);
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs();
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
}

View File

@@ -145,7 +145,7 @@ $lang->bug->status = 'Bug状态';
$lang->bug->mailto = '抄送给';
$lang->bug->openedBy = '由谁创建';
$lang->bug->openedDate = '创建日期';
$lang->bug->openedBuild = '创建版本';
$lang->bug->openedBuild = '影响版本';
$lang->bug->assignedTo = '指派给';
$lang->bug->assignedDate = '指派日期';
$lang->bug->resolvedBy = '解决者';

View File

@@ -133,11 +133,11 @@ class bugModel extends model
->add('resolvedBy', $this->app->user->account)
->add('resolvedDate', $now)
->add('status', 'resolved')
->add('assignedTo', $oldBug->openedBy)
->add('assignedDate', $now)
->add('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)
->setDefault('duplicateBug', 0)
->setDefault('assignedTo', $oldBug->openedBy)
->remove('comment')
->get();

View File

@@ -31,6 +31,10 @@
<td class='rowhead'><?php echo $lang->bug->assignedTo;?></td>
<td><?php echo html::select('assignedTo', $users, $bug->resolvedBy, 'class=select-3');?></td>
</tr>
<tr>
<td class='rowhead'><?php echo $lang->bug->openedBuild;?></td>
<td><?php echo html::select('openedBuild', $builds, $bug->resolvedBuild, 'class=select-3');?></td>
</tr>
<tr>
<td class='rowhead'><?php echo $lang->comment;?></td>
<td><textarea name='comment' rows='6' class='area-1'></textarea></td>
@@ -47,5 +51,6 @@
</td>
</tr>
</table>
<?php include '../../common/action.html.php';?>
</div>
<?php include '../../common/footer.html.php';?>

View File

@@ -39,5 +39,6 @@
</td>
</tr>
</table>
<?php include '../../common/action.html.php';?>
</div>
<?php include '../../common/footer.html.php';?>

View File

@@ -44,15 +44,18 @@ function setDuplicate(resolution)
<td class='rowhead'><?php echo $lang->bug->resolution;?></td>
<td><?php echo html::select('resolution', $lang->bug->resolutionList, '', 'class=select-3 onchange=setDuplicate(this.value)');?></td>
</tr>
<!--
<tr>
<td class='rowhead'><?php echo $lang->bug->resolvedBuild;?></td>
<td><?php echo html::input('resolvedBuild', '', 'class=text-3');?></td>
</tr>-->
<tr id='duplicateBugBox' style='display:none'>
<td class='rowhead'><?php echo $lang->bug->duplicateBug;?></td>
<td><?php echo html::input('duplicateBug', '', 'class=text-3');?></td>
</tr>
<tr>
<td class='rowhead'><?php echo $lang->bug->resolvedBuild;?></td>
<td><?php echo html::select('resolvedBuild', $builds, '', 'class=select-3');?></td>
</tr>
<tr>
<td class='rowhead'><?php echo $lang->bug->assignedTo;?></td>
<td><?php echo html::select('assignedTo', $users, $bug->openedBy, 'class=select-3');?></td>
</tr>
<tr>
<td class='rowhead'><?php echo $lang->comment;?></td>
<td><textarea name='comment' rows='6' class='area-1'></textarea></td>
@@ -65,5 +68,6 @@ function setDuplicate(resolution)
</td>
</tr>
</table>
<?php include '../../common/action.html.php';?>
</div>
<?php include '../../common/footer.html.php';?>

View File

@@ -33,7 +33,7 @@
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' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
common::printLink('bug', 'browse', '', $lang->bug->buttonToList);
?>
</div>
@@ -57,7 +57,7 @@
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' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
if(!(($bug->status == 'closed' or $bug->status == 'resolved') and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' ';
common::printLink('bug', 'browse', '', $lang->bug->buttonToList);
?>
</div>

View File

@@ -3,6 +3,10 @@
<ol>
<?php foreach($actions as $action):?>
<li>
<?php
if(isset($users[$action->actor])) $action->actor = $users[$action->actor];
if($pos = strpos($action->actor, ':') !== false) $action->actor = substr($action->actor, $pos + 1);
?>
<span><?php echo "$action->date, <strong>$action->action</strong> by <strong>$action->actor</strong>"; ?></span>
<?php if(!empty($action->comment) or !empty($action->history)):?>
<div class='history'>