* Fix details.

This commit is contained in:
孙广明
2022-02-17 08:15:40 +08:00
parent a46c17c8d0
commit 27f4d92a50
4 changed files with 14 additions and 6 deletions
+1 -2
View File
@@ -454,8 +454,7 @@ class convert extends control
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(isset($result['finished']) and $result['finished'])
{
$message = $method == 'db' ? $this->lang->convert->jira->importSuccessfully : $this->lang->convert->jira->importSuccessfully . sprintf($this->lang->convert->jira->removeFile, $this->app->getTmpRoot() . 'jirafile/');
return print $this->send(array('result' => 'finished', 'message' => $message));
return print $this->send(array('result' => 'finished', 'message' => $this->lang->convert->jira->importSuccessfully));
}
else
{
-1
View File
@@ -156,7 +156,6 @@ $lang->convert->jira->importResult = "Import <strong class='text-red'>%s</
$lang->convert->jira->importing = 'Data is being imported, please do not switch to other pages.';
$lang->convert->jira->importingAB = 'Data Import';
$lang->convert->jira->imported = 'Data Import Complete';
$lang->convert->jira->removeFile = "Please remove <strong class='text-red'>%s</strong>";
$lang->convert->jira->zentaoObjectList[''] = '';
$lang->convert->jira->zentaoObjectList['task'] = 'Task';
-1
View File
@@ -156,7 +156,6 @@ $lang->convert->jira->importResult = "导入 <strong class='text-red'>%s</
$lang->convert->jira->importing = '数据导入中,请不要切换其它页面';
$lang->convert->jira->importingAB = '数据导入中';
$lang->convert->jira->imported = '数据导入完成';
$lang->convert->jira->removeFile = "请手动清空 <strong class='text-red'>%s</strong> 下的文件";
$lang->convert->jira->zentaoObjectList[''] = '';
$lang->convert->jira->zentaoObjectList['task'] = '任务';
+13 -2
View File
@@ -478,7 +478,7 @@ class convertModel extends model
}
}
$this->afterExec();
$this->afterExec('file');
return array('finished' => true);
}
@@ -1446,10 +1446,11 @@ EOT;
/**
* After exec.
*
* @param string $method
* @access public
* @return void
*/
public function afterExec()
public function afterExec($method = 'db')
{
/* Set project min start date. */
$minDate = date('Y-m-d', time() - 30 * 24 * 3600);
@@ -1463,6 +1464,16 @@ EOT;
$minOpenedDate = helper::isZeroDate($minOpenedDate) ? $minDate : $minOpenedDate;
$this->dao->update(TABLE_PROJECT)->set('begin')->eq($minOpenedDate)->where('id')->eq($projectID)->orWhere('id')->eq($executionID)->exec();
}
if($method == 'file')
{
$fileList = array('action', 'project', 'status', 'resolution', 'user', 'issue', 'changegroup', 'changeitem', 'issuelink', 'issuelinktype', 'fileattachment', 'version', 'issuetype', 'nodeassociation', 'applicationuser');
foreach($fileList as $fileName)
{
$filePath = $this->app->getTmpRoot() . 'jirafile/' . $fileName . '.xml';
if(file_exists($filePath)) @unlink($filePath);
}
}
$this->dbh->exec("DROP TABLE" . JIRA_TMPRELATION);
}