This commit is contained in:
wangyidong
2022-08-03 10:35:41 +08:00
parent c73dbfbcd0
commit ebe6dd630f
2 changed files with 38 additions and 11 deletions
+10 -5
View File
@@ -1649,7 +1649,7 @@ class docModel extends model
if(!$this->checkPrivDoc($doc)) unset($docs[$id]);
}
$bugIdList = $testReportIdList = $caseIdList = $storyIdList = $planIdList = $releaseIdList = $executionIdList = $taskIdList = $buildIdList = $issueIdList = $meetingIdList = $designIdList = 0;
$bugIdList = $testReportIdList = $caseIdList = $storyIdList = $planIdList = $releaseIdList = $executionIdList = $taskIdList = $buildIdList = $issueIdList = $meetingIdList = $designIdList = $reviewIdList = 0;
$userView = $this->app->user->view->products;
if($type == 'project') $userView = $this->app->user->view->projects;
@@ -1685,9 +1685,10 @@ class docModel extends model
{
$issueIdList = $this->dao->select('id')->from(TABLE_ISSUE)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->andWhere('project')->in($this->app->user->view->projects)->get();
$meetingIdList = $this->dao->select('id')->from(TABLE_MEETING)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->andWhere('project')->in($this->app->user->view->projects)->get();
$reviewIdList = $this->dao->select('id')->from(TABLE_REVIEW)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->andWhere('project')->in($this->app->user->view->projects)->get();
}
$designIdList = $this->dao->select('id')->from(TABLE_DESIGN)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->andWhere('project')->in($this->app->user->view->projects)->get();
$designIdList = $this->dao->select('id')->from(TABLE_DESIGN)->where('project')->eq($objectID)->andWhere('deleted')->eq('0')->andWhere('project')->in($this->app->user->view->projects)->get();
$executionIdList = $this->loadModel('execution')->getIdList($objectID);
$taskPairs = $this->dao->select('id')->from(TABLE_TASK)->where('execution')->in($executionIdList)->andWhere('deleted')->eq('0')->andWhere('execution')->in($this->app->user->view->sprints)->fetchPairs('id');
if(!empty($taskPairs)) $taskIdList = implode(',', $taskPairs);
@@ -1720,6 +1721,7 @@ class docModel extends model
->beginIF($type == 'project')
->orWhere("(objectType = 'execution' and objectID in ('$executionIdList'))")
->orWhere("(objectType = 'issue' and objectID in ($issueIdList))")
->orWhere("(objectType = 'review' and objectID in ($reviewIdList))")
->orWhere("(objectType = 'meeting' and objectID in ($meetingIdList))")
->orWhere("(objectType = 'design' and objectID in ($designIdList))")
->fi()
@@ -1761,11 +1763,14 @@ class docModel extends model
$sourceList[$file->objectType][$file->objectID] = $file->objectID;
}
$this->app->loadConfig('action');
foreach($sourceList as $type => $idList)
{
$table = $this->config->objectTables[$type];
$title = in_array($type, array('story', 'bug', 'issue', 'case', 'testcase', 'testreport', 'doc', 'requirement')) ? 'title' : 'name';
$name = $this->dao->select('id,' . $title)->from($table)->where('id')->in($idList)->fetchPairs('id');
$table = zget($this->config->objectTables, $type, '');
$field = zget($this->config->action->objectNameFields, $type, '');
if(empty($table) or empty($field)) continue;
$name = $this->dao->select('id,' . $field)->from($table)->where('id')->in($idList)->fetchPairs('id', $field);
$sourcePairs[$type] = $name;
}
+28 -6
View File
@@ -45,9 +45,20 @@
<?php echo str_replace('.' . $file->extension, '', $file->title);?>
</td>
<td class='c-name'>
<?php echo ($file->objectType == 'requirement' ? $lang->URCommon : $lang->{$file->objectType}->common) . ' : ';?>
<a title='<?php echo $sourcePairs[$file->objectType][$file->objectID];?>' href='<?php echo $this->createLink(($file->objectType == 'requirement' ? 'story' : $file->objectType), 'view', "objectID=$file->objectID", '', true);?>' class='iframe' data-width='90%'>
<?php echo $sourcePairs[$file->objectType][$file->objectID];?>
<?php
if($file->objectType == 'requirement')
{
$commonTitle = $lang->URCommon . ' : ';
}
else
{
if(!isset($lang->{$file->objectType}->common)) $app->loadLang($file->objectType);
$commonTitle = $lang->{$file->objectType}->common . ' : ';
}
echo $commonTitle;
?>
<a title='<?php if(isset($sourcePairs[$file->objectType][$file->objectID])) echo $sourcePairs[$file->objectType][$file->objectID];?>' href='<?php echo $this->createLink(($file->objectType == 'requirement' ? 'story' : $file->objectType), 'view', "objectID=$file->objectID", '', true);?>' class='iframe' data-width='90%'>
<?php if(isset($sourcePairs[$file->objectType][$file->objectID])) echo $sourcePairs[$file->objectType][$file->objectID];?>
</a>
</td>
<td><?php echo $file->extension;?></td>
@@ -101,9 +112,20 @@
</a>
<div class='file-name' title='<?php echo $file->title;?>'><?php echo $file->title;?></a></div>
<div class='file-name text-muted'>
<?php echo ($file->objectType == 'requirement' ? $lang->URCommon : $lang->{$file->objectType}->common) . ' : ';?>
<a href='<?php echo $this->createLink(($file->objectType == 'requirement' ? 'story' : $file->objectType), 'view', "objectID=$file->objectID", '', true);?>' title='<?php echo $sourcePairs[$file->objectType][$file->objectID];?>' class='iframe' data-width='90%'>
<?php echo $sourcePairs[$file->objectType][$file->objectID];?>
<?php
if($file->objectType == 'requirement')
{
$commonTitle = $lang->URCommon . ' : ';
}
else
{
if(!isset($lang->{$file->objectType}->common)) $app->loadLang($file->objectType);
$commonTitle = $lang->{$file->objectType}->common . ' : ';
}
echo $commonTitle;
?>
<a href='<?php echo $this->createLink(($file->objectType == 'requirement' ? 'story' : $file->objectType), 'view', "objectID=$file->objectID", '', true);?>' title='<?php if(isset($sourcePairs[$file->objectType][$file->objectID])) echo $sourcePairs[$file->objectType][$file->objectID];?>' class='iframe' data-width='90%'>
<?php if(isset($sourcePairs[$file->objectType][$file->objectID])) echo $sourcePairs[$file->objectType][$file->objectID];?>
</a>
</div>
</div>