*Close a story.

This commit is contained in:
songchenxuan
2022-03-17 10:11:35 +08:00
parent 7ca9c8aa36
commit ed6e82f02f
6 changed files with 44 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
/**
* The story close 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 storyCloseEntry extends Entry
{
/**
* POST method.
*
* @param int $storyID
* @access public
* @return void
*/
public function post($storyID)
{
$story = $this->loadModel('story')->getByID($storyID);
$fields = 'closedReason,duplicateStory,childStories,comment';
$this->batchSetPost($fields);
$control = $this->loadController('story', 'close');
$control->close($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'));
}
}
+1
View File
@@ -28,6 +28,7 @@ class tabsEntry extends baseEntry
foreach($tabs as $menuKey)
{
if(!isset($this->lang->my->$menuKey)) continue;
if(!common::hasPriv('my', $menuKey)) continue;
$label = $this->lang->my->$menuKey;
if($menuKey == 'calendar') $label = $this->lang->my->calendarAction;
+1 -1
View File
@@ -23,7 +23,7 @@ $config->cookieLife = time() + 2592000; // Cookie的生存时间。The co
$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php.
$config->webRoot = ''; // URL根目录。 The root path of the url.
$config->customSession = false; // 是否开启自定义session的存储路径。Whether custom the session save path.
$config->edition = 'max'; // 设置系统的edition,可选值:open|biz|max。Set edition, optional: open|biz|max.
$config->edition = 'open'; // 设置系统的edition,可选值:open|biz|max。Set edition, optional: open|biz|max.
/* 框架路由相关设置。Routing settings. */
$config->requestType = 'PATH_INFO'; // 请求类型:PATH_INFO|PATHINFO2|GET。 The request type: PATH_INFO|PATH_INFO2|GET.
+1
View File
@@ -45,6 +45,7 @@ $routes['/projects/:id/stories'] = 'projectStories';
$routes['/executions/:id/stories'] = 'executionStories';
$routes['/stories/:id'] = 'story';
$routes['/stories/:id/change'] = 'storyChange';
$routes['/stories/:id/close'] = 'storyClose';
$routes['/module/:id/stories'] = 'moduleStories';
+1
View File
@@ -149,6 +149,7 @@ class myModel extends model
}
/* Sort by storyCount, get 5 records */
$products = json_decode(json_encode($products), true);
array_multisort(array_column($products, 'storyEstimateCount'), SORT_DESC, $products);
$products = array_slice($products, 0, 5);
+1 -1
View File
@@ -1343,7 +1343,7 @@ class story extends control
if(defined('RUN_MODE') && RUN_MODE == 'api')
{
return print(array('status' => 'success', 'data' => $storyID));
return $this->send(array('status' => 'success', 'data' => $storyID));
}
else
{