* Finish task #6484.
This commit is contained in:
@@ -1369,9 +1369,9 @@ class task extends control
|
||||
}
|
||||
|
||||
/* Get related objects title or names. */
|
||||
$this->loadModel('tree');
|
||||
$relatedStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($relatedStoryIdList)->fetchPairs();
|
||||
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('task')->andWhere('objectID')->in(@array_keys($tasks))->andWhere('extra')->ne('editor')->fetchGroup('objectID');
|
||||
$relatedModules = $this->loadModel('tree')->getTaskOptionMenu($projectID);
|
||||
|
||||
if($tasks)
|
||||
{
|
||||
@@ -1465,7 +1465,7 @@ class task extends control
|
||||
if(isset($taskLang->priList[$task->pri])) $task->pri = $taskLang->priList[$task->pri];
|
||||
if(isset($taskLang->statusList[$task->status])) $task->status = $this->processStatus('task', $task);
|
||||
if(isset($taskLang->reasonList[$task->closedReason])) $task->closedReason = $taskLang->reasonList[$task->closedReason];
|
||||
if(isset($relatedModules[$task->module])) $task->module = $relatedModules[$task->module] . "(#$task->module)";
|
||||
$task->module = $task->module ? $this->tree->getModulePathByID($task->module) : '';
|
||||
|
||||
if(isset($users[$task->openedBy])) $task->openedBy = $users[$task->openedBy];
|
||||
if(isset($users[$task->assignedTo])) $task->assignedTo = $users[$task->assignedTo];
|
||||
|
||||
@@ -25,6 +25,30 @@ class treeModel extends model
|
||||
return $this->dao->findById((int)$moduleID)->from(TABLE_MODULE)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get module path by ID.
|
||||
*
|
||||
* @param int $moduleID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getModulePathByID($moduleID)
|
||||
{
|
||||
$module = $this->dao->findById((int)$moduleID)->from(TABLE_MODULE)->fetch();
|
||||
if($module->parent == '0') return '/' . $module->name;
|
||||
|
||||
$path = substr($module->path, 1, -1);
|
||||
$modules = $this->dao->select('id,name')->from(TABLE_MODULE)->where('id')->in($path)->orderBy('grade')->fetchPairs();
|
||||
|
||||
$modulePath = '';
|
||||
foreach($modules as $moduleName)
|
||||
{
|
||||
$modulePath .= '/' . $moduleName;
|
||||
}
|
||||
|
||||
return $modulePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the sql query.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user