* Modify file source type name for requirement.

This commit is contained in:
qiyu-xie
2021-07-30 10:59:06 +08:00
parent a099da0f04
commit 3c09c80ffa
11 changed files with 18 additions and 10 deletions
+1
View File
@@ -226,6 +226,7 @@ if(!defined('TABLE_SEARCHDICT')) define('TABLE_SEARCHDICT', $config->db->prefi
$config->objectTables['product'] = TABLE_PRODUCT;
$config->objectTables['productplan'] = TABLE_PRODUCTPLAN;
$config->objectTables['story'] = TABLE_STORY;
$config->objectTables['requirement'] = TABLE_STORY;
$config->objectTables['release'] = TABLE_RELEASE;
$config->objectTables['program'] = TABLE_PROJECT;
$config->objectTables['project'] = TABLE_PROJECT;
+2 -2
View File
@@ -1300,7 +1300,7 @@ class docModel extends model
->where('size')->gt('0')
->andWhere("(objectType = 'product' and objectID = $objectID)", true)
->orWhere("(objectType = 'doc' and objectID in ($docIdList))")
->orWhere("(objectType = 'story' and objectID in ($storyIdList))")
->orWhere("(objectType in ('story','requirement') and objectID in ($storyIdList))")
->orWhere("(objectType = 'bug' and objectID in ($bugIdList))")
->orWhere("(objectType = 'release' and objectID in ($releaseIdList))")
->orWhere("(objectType = 'testreport' and objectID in ($testReportIdList))")
@@ -1424,7 +1424,7 @@ class docModel extends model
foreach($sourceList as $type => $idList)
{
$table = $this->config->objectTables[$type];
$title = in_array($type, array('story', 'bug', 'issue', 'case', 'testcase', 'testreport', 'doc')) ? 'title' : 'name';
$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');
$sourcePairs[$type] = $name;
}
+1 -1
View File
@@ -44,7 +44,7 @@
<?php endif;?>
<?php echo str_replace('.' . $file->extension, '', $file->title);?>
</td>
<td class='c-name'><?php echo $lang->{$file->objectType}->common . ' : ';?><a title='<?php echo $sourcePairs[$file->objectType][$file->objectID];?>' href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>'><?php echo $sourcePairs[$file->objectType][$file->objectID];?></a></td>
<td class='c-name'><?php echo ($file->objectType == 'requirement' ? $lang->file->requirement : $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");?>'><?php echo $sourcePairs[$file->objectType][$file->objectID];?></a></td>
<td><?php echo $file->extension;?></td>
<td><?php echo number_format($file->size / 1024, 1) . 'K';?></td>
<td><?php echo isset($file->addedBy) ? zget($users, $file->addedBy) : '';?></td>
+1
View File
@@ -31,6 +31,7 @@ $lang->file->preview = "Vorschau";
$lang->file->addFile = 'Hinzufügen';
$lang->file->beginUpload = 'Upload';
$lang->file->uploadSuccess = 'Hochgeladen!';
$lang->file->requirement = $lang->URCommon;
$lang->file->pathname = 'Pfadname';
$lang->file->title = 'Titel';
+1
View File
@@ -31,6 +31,7 @@ $lang->file->preview = "Preview";
$lang->file->addFile = 'Add';
$lang->file->beginUpload = 'Click to Upload';
$lang->file->uploadSuccess = 'Uploaded!';
$lang->file->requirement = $lang->URCommon;
$lang->file->pathname = 'Path Name';
$lang->file->title = 'Title';
+1
View File
@@ -31,6 +31,7 @@ $lang->file->preview = "Apperçu";
$lang->file->addFile = 'Ajouter';
$lang->file->beginUpload = 'Clic pour Charger';
$lang->file->uploadSuccess = 'Chargé !';
$lang->file->requirement = $lang->URCommon;
$lang->file->pathname = 'Nom Chemin';
$lang->file->title = 'Titre';
+1
View File
@@ -31,6 +31,7 @@ $lang->file->preview = "Preview";
$lang->file->addFile = 'Thêm';
$lang->file->beginUpload = 'Click to Upload';
$lang->file->uploadSuccess = 'Uploaded!';
$lang->file->requirement = $lang->URCommon;
$lang->file->pathname = 'Path tên';
$lang->file->title = 'Tiêu đề';
+1
View File
@@ -31,6 +31,7 @@ $lang->file->preview = "预览";
$lang->file->addFile = '添加文件';
$lang->file->beginUpload = '开始上传';
$lang->file->uploadSuccess = '上传成功';
$lang->file->requirement = $lang->URCommon;
$lang->file->pathname = '路径';
$lang->file->title = '标题';
+1
View File
@@ -31,6 +31,7 @@ $lang->file->preview = "預覽";
$lang->file->addFile = '添加檔案';
$lang->file->beginUpload = '開始上傳';
$lang->file->uploadSuccess = '上傳成功';
$lang->file->requirement = $lang->URCommon;
$lang->file->pathname = '路徑';
$lang->file->title = '標題';
+3 -2
View File
@@ -808,8 +808,9 @@ class story extends control
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => dao::getError()));
die(js::error(dao::getError()));
}
$story = $this->story->getByID($storyID);
$version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version');
$files = $this->loadModel('file')->saveUpload('story', $storyID, $version);
$files = $this->loadModel('file')->saveUpload($story->type, $storyID, $version);
if($this->post->comment != '' or !empty($changes) or !empty($files))
{
@@ -902,7 +903,7 @@ class story extends control
$this->story->replaceURLang($story->type);
$story->files = $this->loadModel('file')->getByObject('story', $storyID);
$story->files = $this->loadModel('file')->getByObject($story->type, $storyID);
$product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch();
$plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title');
$bugs = $this->dao->select('id,title')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll();
+5 -5
View File
@@ -238,8 +238,8 @@ class storyModel extends model
if(!dao::isError())
{
$storyID = $this->dao->lastInsertID();
$this->file->updateObjectID($this->post->uid, $storyID, 'story');
$this->file->saveUpload('story', $storyID, $extra = 1);
$this->file->updateObjectID($this->post->uid, $storyID, $story->type);
$this->file->saveUpload($story->type, $storyID, $extra = 1);
if(!empty($story->plan)) $this->updateStoryOrderOfPlan($storyID, $story->plan); // Set story order in this plan.
@@ -347,9 +347,9 @@ class storyModel extends model
/**
* Create story from gitlab issue.
*
*
* @param object $story
* @param int $executionID
* @param int $executionID
* @access public
* @return int
*/
@@ -3444,7 +3444,7 @@ class storyModel extends model
$storyIdList = array();
if(isset($stories['id']))
{
$storyIdList = array($stories['id'] => $stories['id']);
$storyIdList = array($stories['id'] => $stories['id']);
}
else
{