* Finish task#8487. Modify dynamic links and notes.

This commit is contained in:
qiyu-xie
2020-11-26 15:16:18 +08:00
parent 04bfca5242
commit cd431a0d78
6 changed files with 38 additions and 31 deletions
+8 -7
View File
@@ -801,12 +801,13 @@ class actionModel extends model
{
if(!isset($this->config->objectTables[$objectType])) continue; // If no defination for this type, omit it.
$objectIds = array_unique($objectIds);
$table = $this->config->objectTables[$objectType];
$field = $this->config->action->objectNameFields[$objectType];
$objectIds = array_unique($objectIds);
$table = $this->config->objectTables[$objectType];
$field = $this->config->action->objectNameFields[$objectType];
if($table != TABLE_TODO)
{
if(strpos($table, 'task') !== false or strpos($table, 'bug') !== false or strpos($table, 'build') !== false or strpos($table, 'issue') !== false)
$needGetPRJType = 'task,bug,build,issue';
if(strpos($needGetPRJType, $objectType) !== false)
{
$objectInfo = $this->dao->select("id, PRJ, $field AS name")->from($table)->where('id')->in($objectIds)->fetchAll();
foreach($objectInfo as $object)
@@ -815,13 +816,13 @@ class actionModel extends model
$objectPRJ[$object->id] = $object->PRJ;
}
}
elseif(strpos($table, 'project') !== false)
elseif($objectType == 'program' or $objectType == 'project' or $objectType == 'execution')
{
$objectInfo = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchAll();
$objectInfo = $this->dao->select("id, project, $field AS name")->from($table)->where('id')->in($objectIds)->fetchAll();
foreach($objectInfo as $object)
{
$objectName[$object->id] = $object->name;
$objectPRJ[$object->id] = $object->id;
$objectPRJ[$object->id] = $object->project > 0 ? $object->project : $object->id;
}
}
else