*+ finish the task #798.
This commit is contained in:
@@ -532,6 +532,42 @@ class bug extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update assign of bug.
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function assignTo($bugID)
|
||||
{
|
||||
$bug = $this->bug->getById($bugID);
|
||||
|
||||
/* Set menu. */
|
||||
$this->bug->setMenu($this->products, $bug->product);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->bug->assign($bugID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('bug', $bugID, 'Assigned', $this->post->comment, $this->post->assignedTo);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($bugID, $actionID);
|
||||
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
$this->view->header->title = $this->products[$bug->product] . $this->lang->colon . $this->lang->bug->assignedTo;
|
||||
$this->view->position[] = $this->lang->bug->assignedTo;
|
||||
|
||||
$this->view->users = $this->user->getPairs('nodeleted');
|
||||
$this->view->bug = $bug;
|
||||
$this->view->bugID = $bugID;
|
||||
$this->view->actions = $this->action->getList('bug', $bugID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* confirm a bug.
|
||||
*
|
||||
|
||||
@@ -70,6 +70,7 @@ $lang->bug->create = 'Create Bug';
|
||||
$lang->bug->confirmBug = 'Confirm Bug';
|
||||
$lang->bug->edit = 'Edit Bug';
|
||||
$lang->bug->batchEdit = 'Batch edit';
|
||||
$lang->bug->assignTo = 'Assign';
|
||||
$lang->bug->browse = 'Browse Bug';
|
||||
$lang->bug->view = 'Bug Info';
|
||||
$lang->bug->resolve = 'Resolve Bug';
|
||||
@@ -134,6 +135,7 @@ $lang->bug->legendMisc = 'Misc';
|
||||
/* Action buttons. */
|
||||
$lang->bug->buttonConfirm = 'Confirm';
|
||||
$lang->bug->buttonCopy = 'Copy';
|
||||
$lang->bug->buttonAssign = 'Assgin';
|
||||
$lang->bug->buttonEdit = 'Edit';
|
||||
$lang->bug->buttonActivate = 'Activate';
|
||||
$lang->bug->buttonResolve = 'Resolve';
|
||||
|
||||
@@ -70,6 +70,7 @@ $lang->bug->create = '创建Bug';
|
||||
$lang->bug->confirmBug = '确认';
|
||||
$lang->bug->edit = '编辑Bug';
|
||||
$lang->bug->batchEdit = '批量编辑';
|
||||
$lang->bug->assignTo = '指派';
|
||||
$lang->bug->browse = 'Bug列表';
|
||||
$lang->bug->view = 'Bug详情';
|
||||
$lang->bug->resolve = '解决Bug';
|
||||
@@ -134,6 +135,7 @@ $lang->bug->legendMisc = '其他相关';
|
||||
/* 功能按钮。*/
|
||||
$lang->bug->buttonConfirm = '确认';
|
||||
$lang->bug->buttonCopy = '复制';
|
||||
$lang->bug->buttonAssign = '指派';
|
||||
$lang->bug->buttonEdit = '编辑';
|
||||
$lang->bug->buttonActivate = '激活';
|
||||
$lang->bug->buttonResolve = '解决';
|
||||
|
||||
@@ -273,6 +273,31 @@ class bugModel extends model
|
||||
return $allChanges;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a bug to a user again.
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function assign($bugID)
|
||||
{
|
||||
$now = helper::now();
|
||||
$oldBug = $this->getById($bugID);
|
||||
$bug = fixer::input('post')
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', $now)
|
||||
->remove('comment')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_BUG)
|
||||
->data($bug)
|
||||
->autoCheck()
|
||||
->where('id')->eq($bugID)->exec();
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldBug, $bug);
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm a bug.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* The complete file of task module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package task
|
||||
* @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $bug->title;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->assignedTo;?></th>
|
||||
<td><?php echo html::select('assignedTo', $users, '', "class='text-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->comment;?></td>
|
||||
<td><?php echo html::textarea('comment', '', "rows='6' class='area-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::linkButton($lang->goback, $this->session->taskList);?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -23,6 +23,7 @@
|
||||
{
|
||||
if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' ';
|
||||
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
|
||||
common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign);
|
||||
common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit);
|
||||
if(common::hasPriv('bug', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' ';
|
||||
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
|
||||
@@ -59,6 +60,7 @@
|
||||
{
|
||||
if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' ';
|
||||
if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' ';
|
||||
common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign);
|
||||
common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit);
|
||||
if(common::hasPriv('bug', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' ';
|
||||
if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' ';
|
||||
|
||||
@@ -157,6 +157,7 @@ $lang->resource->bug->confirmBug = 'confirmBug';
|
||||
$lang->resource->bug->view = 'view';
|
||||
$lang->resource->bug->edit = 'edit';
|
||||
$lang->resource->bug->batchEdit = 'batchEdit';
|
||||
$lang->resource->bug->assignTo = 'assignTo';
|
||||
$lang->resource->bug->resolve = 'resolve';
|
||||
$lang->resource->bug->activate = 'activate';
|
||||
$lang->resource->bug->close = 'close';
|
||||
|
||||
Reference in New Issue
Block a user