* Add epic.

This commit is contained in:
sunguangming
2024-03-04 13:01:59 +08:00
parent 88d68e5756
commit 5cb9787c6a
12 changed files with 440 additions and 44 deletions
+1 -1
View File
@@ -180,7 +180,7 @@ $lang->product->homeMenu->kanban = array('link' => "{$lang->product->kanban}|pro
$lang->product->menu = new stdclass();
$lang->product->menu->dashboard = array('link' => "{$lang->dashboard}|product|dashboard|productID=%s");
$lang->product->menu->epic = array('link' => "{$lang->epic->common}|epic|browse|productID=%s");
$lang->product->menu->epic = array('link' => "{$lang->epic->common}|product|browse|productID=%s&branch=&browseType=unclosed&param=0&storyType=epic");
$lang->product->menu->requirement = array('link' => "{$lang->URCommon}|product|browse|productID=%s&branch=&browseType=unclosed&param=0&storyType=requirement", 'alias' => 'batchedit', 'subModule' => 'story');
$lang->product->menu->story = array('link' => "$lang->SRCommon|product|browse|productID=%s", 'alias' => 'batchedit', 'subModule' => 'story', 'exclude' => (isset($_GET['storyType']) ? ($_GET['storyType'] == 'requirement' ? 'browse,story-report,story-create,story-batchcreate' : '') : '') . ',batchtotask');
$lang->product->menu->plan = array('link' => "{$lang->productplan->shortCommon}|productplan|browse|productID=%s", 'subModule' => 'productplan,bug');
+15
View File
@@ -0,0 +1,15 @@
<?php
$config->epic = new stdclass();
$config->epic->create = new stdclass();
$config->epic->edit = new stdclass();
$config->epic->change = new stdclass();
$config->epic->close = new stdclass();
$config->epic->review = new stdclass();
$config->epic->create->requiredFields = 'title';
$config->epic->edit->requiredFields = 'title';
$config->epic->change->requiredFields = 'title';
$config->epic->close->requiredFields = 'closedReason';
$config->epic->review->requiredFields = '';
$config->epic->needReview = 1;
+330
View File
@@ -0,0 +1,330 @@
<?php
class epic extends control
{
/**
* Create a epic.
*
* @param int $productID
* @param int $branch
* @param int $moduleID
* @param int $storyID
* @param int $objectID projectID|executionID
* @param int $bugID
* @param int $planID
* @param int $todoID
* @param string $extra for example feedbackID=0
* @access public
* @return void
*/
public function create(int $productID = 0, string $branch = '', int $moduleID = 0, int $storyID = 0, int $objectID = 0, int $bugID = 0, int $planID = 0, int $todoID = 0, string $extra = '')
{
echo $this->fetch('story', 'create', "productID=$productID&branch=$branch&moduleID=$moduleID&storyID=$storyID&objectID=$objectID&bugID=$bugID&planID=$planID&todoID=$todoID&extra=$extra&storyType=epic");
}
/**
* Create a batch stories.
*
* @param int $productID
* @param string $branch
* @param int $moduleID
* @param int $storyID
* @param int $executionID projectID|executionID
* @param int $plan
* @param string $storyType
* @param string $extra for example feedbackID=0
* @access public
* @return void
*/
public function batchCreate(int $productID = 0, string $branch = '', int $moduleID = 0, int $storyID = 0, int $executionID = 0, int $plan = 0, string $storyType = 'epic', string $extra = '')
{
echo $this->fetch('story', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$moduleID&storyID=$storyID&executionID=$executionID&plan=$plan&storyType=epic&extra=$extra");
}
/**
* View a epic.
*
* @param int $storyID
* @param int $version
* @param int $param executionID|projectID
* @param string $storyType
* @access public
* @return void
*/
public function view(int $storyID, int $version = 0, int $param = 0)
{
echo $this->fetch('story', 'view', "storyID=$storyID&version=$version&param=$param&storyType=epic");
}
/**
* Edit a epic.
*
* @param int $storyID
* @param string $kanbanGroup
* @access public
* @return void
*/
public function edit(int $storyID, string $kanbanGroup = 'default')
{
echo $this->fetch('story', 'edit', "storyID=$storyID&kanbanGroup=$kanbanGroup&storyType=epic");
}
/**
* Batch edit epic.
*
* @param int $productID
* @param int $executionID
* @param int $branch
* @param string $storyType
* @param string $from
* @access public
* @return void
*/
public function batchEdit(int $productID = 0, int $executionID = 0, string $branch = '', string $storyType = 'epic', string $from = '')
{
echo $this->fetch('story', 'batchEdit', "productID=$productID&executionID=$executionID&branch=$branch&storyType=epic&from=$from");
}
/**
* 用户需求详情页,关联软件需求,将用户需求关联到软件需求。
* Link story and epic.
*
* @param int $storyID
* @param string $type linkStories|linkRelateUR|linkRelateSR
* @param int $linkedStoryID
* @param string $browseType ''|bySearch
* @param int $queryID
* @access public
* @return void
*/
public function linkStory(int $storyID, string $type = 'linkStories', int $linkedStoryID = 0, string $browseType = '', int $queryID = 0)
{
echo $this->fetch('story', 'linkStory', "storyID=$storyID&type=$type&linkedStoryID=$linkedStoryID&browseType=$browseType&queryID=$queryID&storyType=epic");
}
/**
* 导出需求数据。
* Get the data of the requiremens to export.
*
* @param int $productID
* @param string $orderBy
* @param int $executionID
* @param string $browseType
* @access public
* @return void
*/
public function export(int $productID, string $orderBy, int $executionID = 0, string $browseType = '')
{
echo $this->fetch('story', 'export', "productID=$productID&orderBy=$orderBy&executionID=$executionID&browseType=$browseType&storyType=epic");
}
/**
* Delete a epic.
*
* @param int $storyID
* @param string $confirm yes|no
* @param string $from taskkanban
* @access public
* @return void
*/
public function delete(int $storyID, string $confirm = 'no', string $from = '')
{
echo $this->fetch('story', 'delete', "storyID=$storyID&confirm=$confirm&from=$from&storyType=epic");
}
/**
* Change a epic.
*
* @param int $storyID
* @param string $from
* @access public
* @return void
*/
public function change(int $storyID, string $from = '')
{
echo $this->fetch('story', 'change', "storyID=$storyID&from=$from&storyType=epic");
}
/**
* Review a epic.
*
* @param int $storyID
* @param string $from product|project
* @access public
* @return void
*/
public function review(int $storyID, string $from = 'product')
{
echo $this->fetch('story', 'review', "storyID=$storyID&from=$from&storyType=epic");
}
/**
* Submit review.
*
* @param int $storyID
* @access public
* @return void
*/
public function submitReview(int $storyID)
{
echo $this->fetch('story', 'submitReview', "storyID=$storyID&storyType=epic");
}
/**
* Batch review epics.
*
* @param string $result
* @param string $reason
* @access public
* @return void
*/
public function batchReview(string $result, string $reason = '')
{
echo $this->fetch('story', 'batchReview', "result=$result&reason=$reason&storyType=epic");
}
/**
* Recall the epic review or epic change.
*
* @param int $storyID
* @param string $from list
* @param string $confirm no|yes
* @access public
* @return void
*/
public function recall(int $storyID, string $from = 'list', string $confirm = 'no')
{
echo $this->fetch('story', 'recall', "storyID=$storyID&from=$from&confirm=$confirm&storyType=epic");
}
/**
* 需求的指派给页面。
* Assign the epic to a user.
*
* @param int $storyID
* @access public
* @return void
*/
public function assignTo(int $storyID)
{
echo $this->fetch('story', 'assignTo', "storyID=$storyID");
}
/**
* 关闭需求。
* Close the epic.
*
* @param int $storyID
* @param string $from taskkanban
* @access public
* @return void
*/
public function close(int $storyID, string $from = '')
{
echo $this->fetch('story', 'close', "storyID=$storyID&from=$from&storyType=epic");
}
/**
* 批量关闭需求。
* Batch close the requiremens.
*
* @param int $productID
* @param int $executionID
* @param string $storyType
* @param string $from contribute|work
* @access public
* @return void
*/
public function batchClose(int $productID = 0, int $executionID = 0, string $storyType = 'epic', string $from = '')
{
echo $this->fetch('story', 'batchClose', "productID=$productID&executionID=$executionID&storyType=epic&from=$from");
}
/**
* 激活需求。
* Activate a epic.
*
* @param int $storyID
* @access public
* @return void
*/
public function activate(int $storyID)
{
echo $this->fetch('story', 'activate', "storyID=$storyID&storyType=epic");
}
/**
* 查看需求的报告。
* The report page.
*
* @param int $productID
* @param int $branchID
* @param string $storyType
* @param string $browseType
* @param int $moduleID
* @param string $chartType
* @param int $projectID
* @access public
* @return void
*/
public function report(int $productID, int $branchID, string $storyType = 'epic', string $browseType = 'unclosed', int $moduleID = 0, string $chartType = 'pie', int $projectID = 0)
{
echo $this->fetch('story', 'report', "productID=$productID&branchID=$branchID&storyType=epic&browseType=$browseType&moduleID=$moduleID&chartType=$chartType&projectID=$projectID");
}
/**
* Batch change branch.
*
* @param int $branchID
* @param string $confirm yes|no
* @param string $storyIdList
* @access public
* @return void
*/
public function batchChangeBranch(int $branchID, string $confirm = '', string $storyIdList = '')
{
echo $this->fetch('story', 'batchChangeBranch', "branchID=$branchID&confirm=$confirm&storyIdList=$storyIdList&storyType=epic");
}
/**
* Batch assign to.
*
* @param string $storyType story|epic
* @access public
* @return void
*/
public function batchAssignTo(string $storyType = 'epic', string $assignedTo = '')
{
echo $this->fetch('story', 'batchAssignTo', "storyType=epic&assignedTo=$assignedTo");
}
/**
* Batch change the module of story.
*
* @param int $moduleID
* @access public
* @return void
*/
public function batchChangeModule(int $moduleID)
{
echo $this->fetch('story', 'batchChangeModule', "moduleID=$moduleID&storyType=epic");
}
/**
* 关联用户需求。
* Link related epics.
*
* @param int $storyID
* @param string $browseType
* @param string $excludeStories
* @param int $param
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function linkepics(int $storyID, string $browseType = '', string $excludeStories = '', int $param = 0, int $recTotal = 0, int $recPerPage = 20, int $pageID = 1)
{
echo $this->fetch('story', 'linkepics', "storyID=$storyID&browseType=$browseType&excludeStories=$excludeStories&param=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
}
}
+11
View File
@@ -0,0 +1,11 @@
<?php
global $app;
$app->loadLang('story');
$lang->requirement = clone $lang->story;
$lang->requirement->common = $lang->URCommon;
foreach($lang->requirement as $key => $value)
{
if(!is_string($value)) continue;
if(strpos($value, $lang->SRCommon) !== false) $lang->requirement->$key = str_replace($lang->SRCommon, $lang->URCommon, $value);
}
+11
View File
@@ -0,0 +1,11 @@
<?php
global $app;
$app->loadLang('story');
$lang->requirement = clone $lang->story;
$lang->requirement->common = $lang->URCommon;
foreach($lang->requirement as $key => $value)
{
if(!is_string($value)) continue;
if(strpos($value, $lang->SRCommon) !== false) $lang->requirement->$key = str_replace($lang->SRCommon, $lang->URCommon, $value);
}
+11
View File
@@ -0,0 +1,11 @@
<?php
global $app;
$app->loadLang('story');
$lang->requirement = clone $lang->story;
$lang->requirement->common = $lang->URCommon;
foreach($lang->requirement as $key => $value)
{
if(!is_string($value)) continue;
if(strpos($value, $lang->SRCommon) !== false) $lang->requirement->$key = str_replace($lang->SRCommon, $lang->URCommon, $value);
}
+11
View File
@@ -0,0 +1,11 @@
<?php
global $app;
$app->loadLang('story');
$lang->epic = clone $lang->story;
$lang->epic->common = '业务需求';
foreach($lang->epic as $key => $value)
{
if(!is_string($value)) continue;
if(strpos($value, $lang->SRCommon) !== false) $lang->epic->$key = str_replace($lang->SRCommon, $lang->URCommon, $value);
}
+5
View File
@@ -0,0 +1,5 @@
<?php
class epicModel extends model
{
}
+1
View File
@@ -130,6 +130,7 @@ class product extends control
/* Pre process. */
$this->loadModel('requirement');
$this->loadModel('epic');
$this->loadModel('tree');
$isProjectStory = $this->app->rawModule == 'projectstory';
$cookieOrderBy = $this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc';
+3 -2
View File
@@ -722,11 +722,12 @@ class productModel extends model
$projectID = ($this->app->tab == 'project' && empty($projectID)) ? $this->session->project : $projectID;
$searchConfig['params']['module']['values'] = $this->productTao->getModulesForSearchForm($productID, $products, $branch, $projectID);
$replacement = $storyType == 'requirement' ? $this->lang->URCommon : $this->lang->epic->common;
$this->lang->story->title = str_replace($this->lang->SRCommon, $replacement, $this->lang->story->title);
$this->lang->story->create = str_replace($this->lang->SRCommon, $replacement, $this->lang->story->create);
if($storyType == 'requirement')
{
/* Change for requirement story title. */
$this->lang->story->title = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->title);
$this->lang->story->create = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->create);
$searchConfig['fields']['title'] = $this->lang->story->title;
unset($searchConfig['fields']['plan']);
unset($searchConfig['params']['plan']);
+2
View File
@@ -11,3 +11,5 @@ $config->requirement->edit->requiredFields = 'title';
$config->requirement->change->requiredFields = 'title';
$config->requirement->close->requiredFields = 'closedReason';
$config->requirement->review->requiredFields = '';
$config->requirement->needReview = 1;
+39 -41
View File
@@ -3753,50 +3753,48 @@ class storyModel extends model
*/
public function replaceURLang(string $type): void
{
if($type != 'requirement') return;
$storyLang = $this->lang->story;
$SRCommon = $this->lang->SRCommon;
$replacement = $type == 'requirement' ? $this->lang->URCommon : $this->lang->epic->common;
$storyLang = $this->lang->story;
$SRCommon = $this->lang->SRCommon;
$URCommon = $this->lang->URCommon;
$storyLang->create = str_replace($SRCommon, $replacement, $storyLang->create);
$storyLang->changeAction = str_replace($SRCommon, $replacement, $storyLang->changeAction);
$storyLang->changed = str_replace($SRCommon, $replacement, $storyLang->changed);
$storyLang->assignAction = str_replace($SRCommon, $replacement, $storyLang->assignAction);
$storyLang->reviewAction = str_replace($SRCommon, $replacement, $storyLang->reviewAction);
$storyLang->subdivideAction = str_replace($SRCommon, $replacement, $storyLang->subdivideAction);
$storyLang->closeAction = str_replace($SRCommon, $replacement, $storyLang->closeAction);
$storyLang->activateAction = str_replace($SRCommon, $replacement, $storyLang->activateAction);
$storyLang->deleteAction = str_replace($SRCommon, $replacement, $storyLang->deleteAction);
$storyLang->view = str_replace($SRCommon, $replacement, $storyLang->view);
$storyLang->linkStory = str_replace($SRCommon, $replacement, $storyLang->linkStory);
$storyLang->exportAction = str_replace($SRCommon, $replacement, $storyLang->exportAction);
$storyLang->zeroCase = str_replace($SRCommon, $replacement, $storyLang->zeroCase);
$storyLang->zeroTask = str_replace($SRCommon, $replacement, $storyLang->zeroTask);
$storyLang->copyTitle = str_replace($SRCommon, $replacement, $storyLang->copyTitle);
$storyLang->common = str_replace($SRCommon, $replacement, $storyLang->common);
$storyLang->title = str_replace($SRCommon, $replacement, $storyLang->title);
$storyLang->spec = str_replace($SRCommon, $replacement, $storyLang->spec);
$storyLang->children = str_replace($SRCommon, $replacement, $storyLang->children);
$storyLang->linkStories = str_replace($SRCommon, $replacement, $storyLang->linkStories);
$storyLang->childStories = str_replace($SRCommon, $replacement, $storyLang->childStories);
$storyLang->duplicateStory = str_replace($SRCommon, $replacement, $storyLang->duplicateStory);
$storyLang->newStory = str_replace($SRCommon, $replacement, $storyLang->newStory);
$storyLang->copy = str_replace($SRCommon, $replacement, $storyLang->copy);
$storyLang->total = str_replace($SRCommon, $replacement, $storyLang->total);
$storyLang->released = str_replace($SRCommon, $replacement, $storyLang->released);
$storyLang->legendLifeTime = str_replace($SRCommon, $replacement, $storyLang->legendLifeTime);
$storyLang->legendLinkStories = str_replace($SRCommon, $replacement, $storyLang->legendLinkStories);
$storyLang->legendChildStories = str_replace($SRCommon, $replacement, $storyLang->legendChildStories);
$storyLang->legendSpec = str_replace($SRCommon, $replacement, $storyLang->legendSpec);
$storyLang->unlinkStory = str_replace($SRCommon, $replacement, $storyLang->unlinkStory);
$storyLang->create = str_replace($SRCommon, $URCommon, $storyLang->create);
$storyLang->changeAction = str_replace($SRCommon, $URCommon, $storyLang->changeAction);
$storyLang->changed = str_replace($SRCommon, $URCommon, $storyLang->changed);
$storyLang->assignAction = str_replace($SRCommon, $URCommon, $storyLang->assignAction);
$storyLang->reviewAction = str_replace($SRCommon, $URCommon, $storyLang->reviewAction);
$storyLang->subdivideAction = str_replace($SRCommon, $URCommon, $storyLang->subdivideAction);
$storyLang->closeAction = str_replace($SRCommon, $URCommon, $storyLang->closeAction);
$storyLang->activateAction = str_replace($SRCommon, $URCommon, $storyLang->activateAction);
$storyLang->deleteAction = str_replace($SRCommon, $URCommon, $storyLang->deleteAction);
$storyLang->view = str_replace($SRCommon, $URCommon, $storyLang->view);
$storyLang->linkStory = str_replace($SRCommon, $URCommon, $storyLang->linkStory);
$storyLang->exportAction = str_replace($SRCommon, $URCommon, $storyLang->exportAction);
$storyLang->zeroCase = str_replace($SRCommon, $URCommon, $storyLang->zeroCase);
$storyLang->zeroTask = str_replace($SRCommon, $URCommon, $storyLang->zeroTask);
$storyLang->copyTitle = str_replace($SRCommon, $URCommon, $storyLang->copyTitle);
$storyLang->common = str_replace($SRCommon, $URCommon, $storyLang->common);
$storyLang->title = str_replace($SRCommon, $URCommon, $storyLang->title);
$storyLang->spec = str_replace($SRCommon, $URCommon, $storyLang->spec);
$storyLang->children = str_replace($SRCommon, $URCommon, $storyLang->children);
$storyLang->linkStories = str_replace($SRCommon, $URCommon, $storyLang->linkStories);
$storyLang->childStories = str_replace($SRCommon, $URCommon, $storyLang->childStories);
$storyLang->duplicateStory = str_replace($SRCommon, $URCommon, $storyLang->duplicateStory);
$storyLang->newStory = str_replace($SRCommon, $URCommon, $storyLang->newStory);
$storyLang->copy = str_replace($SRCommon, $URCommon, $storyLang->copy);
$storyLang->total = str_replace($SRCommon, $URCommon, $storyLang->total);
$storyLang->released = str_replace($SRCommon, $URCommon, $storyLang->released);
$storyLang->legendLifeTime = str_replace($SRCommon, $URCommon, $storyLang->legendLifeTime);
$storyLang->legendLinkStories = str_replace($SRCommon, $URCommon, $storyLang->legendLinkStories);
$storyLang->legendChildStories = str_replace($SRCommon, $URCommon, $storyLang->legendChildStories);
$storyLang->legendSpec = str_replace($SRCommon, $URCommon, $storyLang->legendSpec);
$storyLang->unlinkStory = str_replace($SRCommon, $URCommon, $storyLang->unlinkStory);
$storyLang->notice->closed = str_replace($SRCommon, $replacement, $storyLang->notice->closed);
$storyLang->notice->reviewerNotEmpty = str_replace($SRCommon, $replacement, $storyLang->notice->reviewerNotEmpty);
$storyLang->notice->closed = str_replace($SRCommon, $URCommon, $storyLang->notice->closed);
$storyLang->notice->reviewerNotEmpty = str_replace($SRCommon, $URCommon, $storyLang->notice->reviewerNotEmpty);
$storyLang->report->charts['storiesPerProduct'] = str_replace($SRCommon, $URCommon, $storyLang->report->charts['storiesPerProduct']);
$storyLang->report->charts['storiesPerModule'] = str_replace($SRCommon, $URCommon, $storyLang->report->charts['storiesPerModule']);
$storyLang->report->charts['storiesPerSource'] = str_replace($SRCommon, $URCommon, $storyLang->report->charts['storiesPerSource']);
$storyLang->report->charts['storiesPerProduct'] = str_replace($SRCommon, $replacement, $storyLang->report->charts['storiesPerProduct']);
$storyLang->report->charts['storiesPerModule'] = str_replace($SRCommon, $replacement, $storyLang->report->charts['storiesPerModule']);
$storyLang->report->charts['storiesPerSource'] = str_replace($SRCommon, $replacement, $storyLang->report->charts['storiesPerSource']);
}
/**