* Fix todo bug.
This commit is contained in:
@@ -417,4 +417,19 @@ class epic extends control
|
||||
{
|
||||
echo $this->fetch('story', 'batchChangePlan', "planID=$planID&oldPlanID=$oldPlanID&storyType=epic");
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get the stories of a user.
|
||||
*
|
||||
* @param int $userID
|
||||
* @param string $id
|
||||
* @param int $appendID
|
||||
* @param string $storyType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetUserStories(int $userID = 0, string $id = '', int $appendID = 0, $storyType = 'epic')
|
||||
{
|
||||
echo $this->fetch('story', 'ajaxGetUserStories', "userID=$userID&id=$id&appendID=$appendID&storyType=epic");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,4 +415,19 @@ class requirement extends control
|
||||
{
|
||||
echo $this->fetch('story', 'linkRequirements', "storyID=$storyID&browseType=$browseType&excludeStories=$excludeStories¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get the stories of a user.
|
||||
*
|
||||
* @param int $userID
|
||||
* @param string $id
|
||||
* @param int $appendID
|
||||
* @param string $storyType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetUserStories(int $userID = 0, string $id = '', int $appendID = 0, $storyType = 'requirement')
|
||||
{
|
||||
echo $this->fetch('story', 'ajaxGetUserStories', "userID=$userID&id=$id&appendID=$appendID&storyType=requirement");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1910,19 +1910,20 @@ class story extends control
|
||||
* @param int $userID
|
||||
* @param string $id the id of the select control.
|
||||
* @param int $appendID
|
||||
* @param string $storyType
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function ajaxGetUserStories(int $userID = 0, string $id = '', int $appendID = 0)
|
||||
public function ajaxGetUserStories(int $userID = 0, string $id = '', int $appendID = 0, $storyType = 'story')
|
||||
{
|
||||
if(empty($userID)) $userID = $this->app->user->id;
|
||||
$user = $this->loadModel('user')->getById($userID, 'id');
|
||||
$stories = $this->story->getUserStoryPairs($user->account, 10, 'story', '', $appendID);
|
||||
$stories = $this->story->getUserStoryPairs($user->account, 10, $storyType, '', $appendID);
|
||||
|
||||
$items = array();
|
||||
foreach($stories as $storyID => $storyTitle) $items[] = array('text' => $storyTitle, 'value' => $storyID);
|
||||
|
||||
$fieldName = $id ? "stories[$id]" : 'story';
|
||||
$fieldName = $id ? "stories[$id]" : $storyType;
|
||||
return print(json_encode(array('name' => $fieldName, 'items' => $items)));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,10 +33,12 @@ $config->todo->custom->batchEditFields = 'pri,beginAndEnd,status';
|
||||
$config->todo->moduleList = array('bug', 'task', 'epic', 'requirement', 'story', 'testtask');
|
||||
|
||||
$config->todo->getUserObjectsMethod = array();
|
||||
$config->todo->getUserObjectsMethod['bug'] = 'ajaxGetUserBugs';
|
||||
$config->todo->getUserObjectsMethod['task'] = 'ajaxGetUserTasks';
|
||||
$config->todo->getUserObjectsMethod['story'] = 'ajaxGetUserStories';
|
||||
$config->todo->getUserObjectsMethod['testtask'] = 'ajaxGetUserTestTasks';
|
||||
$config->todo->getUserObjectsMethod['bug'] = 'ajaxGetUserBugs';
|
||||
$config->todo->getUserObjectsMethod['task'] = 'ajaxGetUserTasks';
|
||||
$config->todo->getUserObjectsMethod['story'] = 'ajaxGetUserStories';
|
||||
$config->todo->getUserObjectsMethod['epic'] = 'ajaxGetUserStories';
|
||||
$config->todo->getUserObjectsMethod['requirement'] = 'ajaxGetUserStories';
|
||||
$config->todo->getUserObjectsMethod['testtask'] = 'ajaxGetUserTestTasks';
|
||||
|
||||
$config->todo->objectList = array();
|
||||
$config->todo->objectList['bug'] = 'bugs';
|
||||
|
||||
Reference in New Issue
Block a user