* When create story can choise parent story.

This commit is contained in:
zhengrunyu
2022-04-24 08:40:45 +08:00
parent 0dd4f63440
commit 24530f75ca
4 changed files with 3 additions and 76 deletions
-31
View File
@@ -1,31 +0,0 @@
<?php
/**
* The module 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 moduleStoriesEntry extends Entry
{
public function get($moduleID)
{
$executionID = $this->param('executionID', 0);
if(empty($executionID)) return $this->sendError(400, 'Need execution id.');
$control = $this->loadController('execution', 'story');
$control->story($executionID, 'order_desc', 'byModule', $moduleID);
$data = $this->getData();
$result = [];
foreach($data->data->stories as $story)
{
$result[] = $this->filterFields($story, 'id,title,module,pri,status,stage,estimate');
}
return $this->send(200, array('stories' => $result));
}
}
+3
View File
@@ -57,6 +57,9 @@ class productEntry extends Entry
case 'moduleoptionmenu':
$product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'story', 0, 'all');
break;
case 'parentstories':
$product->parentstories= $this->loadModel('story')->getParentStoryPairs($productID);
break;
case 'builds':
$product->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone,withbranch', $this->param('object', 0), $this->param('objectType', 'execution'));
break;
-44
View File
@@ -1,44 +0,0 @@
<?php
/**
* The story component 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 storyChildEntry extends Entry
{
/**
* POST method.
*
* @param int $storyID
* @access public
* @return void
**/
public function post($storyID)
{
$fields = 'title,spec,verify,reviewer,type,plan,module,moduleOptionMenu,source,sourceNote,category,pri,estimate,keywords,parent';
$this->batchSetPost($fields);
$fields = explode(',', $fields);
foreach($fields as $field) $this->setArrayPost($field);
$story = $this->loadModel('story')->getById($storyID);
$control = $this->loadController('story', 'batchCreate');
$control->batchCreate($story->product, 0, 0, $storyID);
$data = $this->getData();
$story = $this->story->getById($data->idList[0]);
$this->send(200, $this->format($story, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
}
public function setArrayPost($field)
{
$_POST[$field] = array('0' => $_POST[$field]);
}
}
-1
View File
@@ -737,7 +737,6 @@ class fileModel extends model
if($content) $data->$editorID = $content;
$data->$editorID = preg_replace("/ src=\"$readLinkReg\" /", ' src="' . $imgURL . '" ', $data->$editorID);
$data->$editorID = preg_replace("/ src=\"" . htmlSpecialString($readLinkReg) . "\" /", ' src="' . $imgURL . '" ', $data->$editorID);
preg_match_all('/ src="{([0-9]+)\.\w+}"/', $data->$editorID, $matchs);
if($matchs[1])
{