This commit is contained in:
holan20180123
2021-04-26 09:07:28 +08:00
parent 07245d54af
commit 9a5d8d50b9
+15
View File
@@ -868,6 +868,7 @@ class actionModel extends model
public function transformActions($actions)
{
$this->app->loadLang('todo');
$requirements = array();
/* Get commiters. */
$commiters = $this->loadModel('user')->getCommiters();
@@ -901,6 +902,16 @@ class actionModel extends model
$objectProject[$object->id] = $object->project > 0 ? $object->project : $object->id;
}
}
elseif($objectType == 'story')
{
$objectInfo = $this->dao->select('id,title,type')->from($table)->where('id')->in($objectIds)->fetchAll();
foreach($objectInfo as $object)
{
$objectName[$object->id] = $object->title;
if($object->type == 'requirement') $requirements[$object->id] = $object->id;
}
$objectProject = array();
}
else
{
$objectName = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs();
@@ -946,6 +957,10 @@ class actionModel extends model
if(isset($this->lang->action->label->$objectType))
{
$objectLabel = $this->lang->action->label->$objectType;
/* Replace story to requirement. */
if(in_array($action->objectID, $requirements)) $objectLabel = str_replace($this->lang->SRCommon, $this->lang->URCommon, $objectLabel);
if(!is_array($objectLabel)) $action->objectLabel = $objectLabel;
if(is_array($objectLabel) and isset($objectLabel[$actionType])) $action->objectLabel = $objectLabel[$actionType];
}