* code for task #44331.

This commit is contained in:
王怡栋
2021-11-18 13:45:32 +08:00
parent 15c1ec6c42
commit 26b110b73a
4 changed files with 61 additions and 5 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
/**
* The execution bugs 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 executionBugsEntry extends entry
{
/**
* GET method.
*
* @param int $executionID
* @access public
* @return void
*/
public function get($executionID = 0)
{
if(!$executionID) $executionID = $this->param('execution', 0);
if(empty($executionID)) return $this->sendError(400, 'Need execution id.');
$control = $this->loadController('execution', 'bug');
$control->bug($executionID, $this->param('product', 0), $this->param('order', 'status,id_desc'), $this->param('build', 0), $this->param('status', 'all'), 0, 0, $this->param('limit', 20), $this->param('page', 1));
$data = $this->getData();
if(isset($data->status) and $data->status == 'success')
{
$bugs = $data->data->bugs;
$pager = $data->data->pager;
$result = array();
foreach($bugs as $bug)
{
$status = array('code' => $bug->status, 'name' => $this->lang->bug->statusList[$bug->status]);
if($bug->status == 'active' and $bug->confirmed) $status = array('code' => 'confirmed', 'name' => $this->lang->bug->labelConfirmed);
if($bug->resolution == 'postponed') $status = array('code' => 'postponed', 'name' => $this->lang->bug->labelPostponed);
if(!empty($bug->delay)) $status = array('code' => 'delay', 'name' => $this->lang->bug->overdueBugs);
$bug->status = $status;
$result[] = $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time,deadline:date,deleted:bool');
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => $result));
}
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
return $this->sendError(400, 'error');
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
* @version 1
* @link http://www.zentao.net
*/
class projectbugsEntry extends entry
class projectBugsEntry extends entry
{
/**
* GET method.
+5 -4
View File
@@ -39,10 +39,11 @@ $routes['/executions/:id/stories'] = 'executionStories';
$routes['/stories/:id'] = 'story';
$routes['/stories/:id/change'] = 'storyChange';
$routes['/products/:id/bugs'] = 'bugs';
$routes['/projects/:id/bugs'] = 'projectBugs';
$routes['/bugs'] = 'bugs';
$routes['/bugs/:id'] = 'bug';
$routes['/products/:id/bugs'] = 'bugs';
$routes['/projects/:id/bugs'] = 'projectBugs';
$routes['/executions/:id/bugs'] = 'executionBugs';
$routes['/bugs'] = 'bugs';
$routes['/bugs/:id'] = 'bug';
$routes['/programs/:id/projects'] = 'projects';
$routes['/projects'] = 'projects';
+1
View File
@@ -1647,6 +1647,7 @@ class docModel extends model
$docItem->type = 'doc';
$docItem->id = $doc->id;
$docItem->title = $doc->title;
$docItem->acl = $doc->acl;
$docItem->url = helper::createLink('doc', 'view', "doc=$doc->id");
$buttons = '';