* [bug#60654,done,1h,0h] Fix import jira data error.

This commit is contained in:
wangyuting
2025-03-20 17:08:26 +08:00
committed by 谢杞钰
parent d1aa84589d
commit 9133cf61b6
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -252,7 +252,7 @@ class convertModel extends model
if(!empty($desc)) $value['description'] = $desc;
if(!empty($summary)) $value['summary'] = $summary;
if(!empty($body)) $value['body'] = $body;
$dataID = !empty($value['id']) ? $value['id'] : $key;
$dataID = !empty($value['id']) ? $value['id'] : ($key + 1);
$data = array_merge($data, $value);
}
else
@@ -260,7 +260,7 @@ class convertModel extends model
$data = array_merge($data, array($k => $value));
}
}
$dataList[$dataID] = $data;
if(!empty($dataID)) $dataList[$dataID] = $data;
}
else
{
+4 -3
View File
@@ -1055,6 +1055,9 @@ class convertTao extends convertModel
$fileName = $fileAttachment->filename;
list($mime, $extension) = explode('/', $fileAttachment->mimetype);
$jiraFile = $this->app->getTmpRoot() . 'attachments/' . $filePaths[$issueID] . $fileID;
if(!is_file($jiraFile)) continue;
$file = new stdclass();
$file->pathname = $this->file->setPathName((int)$fileID, $extension);
$file->title = str_ireplace(".{$extension}", '', $fileName);
@@ -1067,10 +1070,8 @@ class convertTao extends convertModel
$file->addedDate = !empty($fileAttachment->created) ? substr($fileAttachment->created, 0, 19) : null;
$this->dao->dbh($this->dbh)->insert(TABLE_FILE)->data($file)->exec();
$jiraFile = $this->app->getTmpRoot() . 'attachments/' . $filePaths[$issueID] . $fileID;
if(is_file($jiraFile)) copy($jiraFile, $this->file->savePath . $file->pathname);
$fileID = $this->dao->dbh($this->dbh)->lastInsertID();
copy($jiraFile, $this->file->savePath . $file->pathname);
if(in_array($file->objectType, array('epic', 'requirement', 'story')))
{