* code for task#1800.

This commit is contained in:
xia0ta0
2014-03-05 10:05:08 +08:00
parent 8d53f48c68
commit 25262593fc
2 changed files with 18 additions and 5 deletions
+17 -4
View File
@@ -1071,10 +1071,11 @@ class storyModel extends model
* @param int $projectID
* @param int $productID
* @param array|string $moduleIds
* @param string $type
* @access public
* @return array
*/
public function getProjectStoryPairs($projectID = 0, $productID = 0, $moduleIds = 0)
public function getProjectStoryPairs($projectID = 0, $productID = 0, $moduleIds = 0, $type = 'full')
{
$stories = $this->dao->select('t2.id, t2.title, t2.module, t2.pri, t2.estimate, t3.name AS product')
->from(TABLE_PROJECTSTORY)->alias('t1')
@@ -1088,7 +1089,7 @@ class storyModel extends model
->beginIF($moduleIds)->andWhere('t2.module')->in($moduleIds)->fi()
->fetchAll();
if(!$stories) return array();
return $this->formatStories($stories);
return $this->formatStories($stories, $type);
}
/**
@@ -1228,10 +1229,11 @@ class storyModel extends model
* Format stories
*
* @param array $stories
* @param string $type
* @access public
* @return void
*/
public function formatStories($stories)
public function formatStories($stories, $type = 'full')
{
/* Get module names of stories. */
/*$modules = array();
@@ -1240,7 +1242,18 @@ class storyModel extends model
/* Format these stories. */
$storyPairs = array('' => ' ');
foreach($stories as $story) $storyPairs[$story->id] = $story->id . ':' . $story->title . "({$this->lang->story->pri}:$story->pri, {$this->lang->story->estimate}: $story->estimate)";
foreach($stories as $story)
{
if($type == 'short')
{
$property = '[p' . $story->pri . ', ' . $story->estimate . 'h]';
}
else
{
$property = '(' . $this->lang->story->pri . ':' . $story->pri . ',' . $this->lang->story->estimate . ':' . $story->estimate . ')';
}
$storyPairs[$story->id] = $story->id . ':' . $story->title . $property;
}
return $storyPairs;
}
+1 -1
View File
@@ -161,7 +161,7 @@ class task extends control
die(js::locate($storyLink, 'parent'));
}
$stories = $this->story->getProjectStoryPairs($projectID);
$stories = $this->story->getProjectStoryPairs($projectID, 0, 0, 'short');
$members = $this->project->getTeamMemberPairs($projectID, 'nodeleted');
$modules = $this->loadModel('tree')->getTaskOptionMenu($projectID);
$title = $project->name . $this->lang->colon . $this->lang->task->batchCreate;