* Add api for resolve bug.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* The bug resolve entry point of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package entries
|
||||
* @version 1
|
||||
* @link http://www.zentao.net
|
||||
**/
|
||||
class bugResolveEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($bugID)
|
||||
{
|
||||
$bug = $this->loadModel('bug')->getByID($bugID);
|
||||
|
||||
$fields = 'resolution,resolvedBuild,resolvedDate,assignedTo,uid,comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('bug', 'resolve');
|
||||
$control->resolve($bugID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$bug = $this->bug->getByID($bugID);
|
||||
|
||||
$this->send(200, $this->format($bug, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,resolvedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ $routes['/bugs/:id'] = 'bug';
|
||||
$routes['/bugs/:id/close'] = 'bugClose';
|
||||
$routes['/bugs/:id/assign'] = 'bugAssign';
|
||||
$routes['/bugs/:id/confirm'] = 'bugConfirm';
|
||||
$routes['/bugs/:id/resolve'] = 'bugResolve';
|
||||
|
||||
$routes['/programs/:id/projects'] = 'projects';
|
||||
$routes['/products/:id/projects'] = 'productProjects';
|
||||
|
||||
@@ -1561,7 +1561,7 @@ class bug extends control
|
||||
}
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
return print(array('status' => 'success', 'data' => $bugID));
|
||||
return $this->send(array('status' => 'success', 'data' => $bugID));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user