*Assign a story.

This commit is contained in:
songchenxuan
2022-03-17 13:32:29 +08:00
8 changed files with 55 additions and 19 deletions
+4 -9
View File
@@ -20,7 +20,8 @@ class executionEntry extends Entry
*/
public function get($executionID)
{
$fields = $this->param('fields');
$fields = $this->param('fields');
$productID = $this->param('productID');
$control = $this->loadController('execution', 'view');
$control->view($executionID);
@@ -63,14 +64,8 @@ class executionEntry extends Entry
{
switch($field)
{
case 'modules':
$control = $this->loadController('tree', 'browsetask');
$control->browsetask($executionID);
$data = $this->getData();
if(isset($data->status) and $data->status == 'success')
{
$execution->modules = $data->data->tree;
}
case 'builds':
$execution->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone', $executionID, 'execution');
break;
case 'moduleoptionmenu':
$execution->moduleOptionMenu = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, 0, 'allModule');
+39
View File
@@ -0,0 +1,39 @@
<?php
/**
* The story assignto 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 storyAssignToEntry extends Entry
{
/**
* PUT method.
*
* @param int $storyID
* @access public
* @return void
*/
public function put($storyID)
{
$task = $this->loadModel('story')->getByID($storyID);
$fields = 'assignedTo';
$this->batchSetPost($fields);
$control = $this->loadController('story', 'assignTo');
$control->assignTo($storyID);
$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);
$story = $this->story->getByID($storyID);
$this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList'));
}
}
+2 -2
View File
@@ -12,13 +12,13 @@
class storyCloseEntry extends Entry
{
/**
* POST method.
* PUT method.
*
* @param int $storyID
* @access public
* @return void
*/
public function post($storyID)
public function put($storyID)
{
$story = $this->loadModel('story')->getByID($storyID);
+2 -2
View File
@@ -12,13 +12,13 @@
class taskCloseEntry extends Entry
{
/**
* POST method.
* PUT method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
public function put($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+2 -2
View File
@@ -12,13 +12,13 @@
class taskFinishEntry extends Entry
{
/**
* POST method.
* PUT method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
public function put($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+2 -2
View File
@@ -12,13 +12,13 @@
class taskPauseEntry extends Entry
{
/**
* POST method.
* PUT method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
public function put($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+2 -2
View File
@@ -12,13 +12,13 @@
class taskStartEntry extends Entry
{
/**
* POST method.
* PUT method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
public function put($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+2
View File
@@ -47,6 +47,8 @@ $routes['/stories/:id'] = 'story';
$routes['/stories/:id/change'] = 'storyChange';
$routes['/stories/:id/close'] = 'storyClose';
$routes['/stories/:id/active'] = 'storyActive';
$routes['/module/:id/stories'] = 'moduleStories';
$routes['/products/:id/bugs'] = 'bugs';