Merge branch release/21.7.5 of zentao/zentaopms (#11298)

This commit is contained in:
刘刚
2025-09-05 10:38:45 +08:00
committed by Gitfox
4 changed files with 30 additions and 6 deletions
+4 -2
View File
@@ -430,11 +430,13 @@ class caselib extends control
{
$this->loadModel('testcase');
if($_FILES)
if($_POST)
{
$file = $this->loadModel('file')->getUpload('file');
$file = $file[0];
if(empty($_FILES)) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
if(empty($file[0])) return $this->send(array('result' => 'fail', 'message' => $this->lang->testcase->errorFileNotEmpty));
$file = $file[0];
if(!$file || (isset($file['extension']) && $file['extension'] != 'csv')) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
$fileName = $this->file->savePath . $this->file->getSaveName($file['pathname']);
+11 -4
View File
@@ -981,7 +981,7 @@ class testcase extends control
/* bug 分页。*/
/* Pager. */
$this->app->loadClass('pager', true);
$recTotal = count($bugs2Link);
if(empty($recTotal)) $recTotal = count($bugs2Link);
$pager = new pager($recTotal, $recPerPage, $pageID);
$bugs2Link = array_chunk($bugs2Link, $pager->recPerPage);
@@ -1236,14 +1236,16 @@ class testcase extends control
{
$this->testcaseZen->checkProducts(); // 如果不存在产品,则跳转到产品创建页面。
if($_FILES)
if($_POST)
{
/* 获取上传的文件。 */
/* Get file. */
$file = $this->loadModel('file')->getUpload('file');
if(empty($_FILES)) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
if(empty($file[0])) return $this->send(array('result' => 'fail', 'message' => $this->lang->testcase->errorFileNotEmpty));
$file = $file[0];
if(!$file || (isset($file['extension']) && $file['extension'] != 'csv')) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
/* 移动上传的文件。 */
/* Move file. */
@@ -1957,9 +1959,14 @@ class testcase extends control
*/
public function importXmind(int $productID, string $branch)
{
if($_FILES)
if($_POST)
{
if($_FILES['file']['size'][0] == 0) return $this->send(array('result' => 'fail', 'message' => $this->lang->testcase->errorFileNotEmpty));
$file = $this->loadModel('file')->getUpload('file');
if(empty($_FILES)) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
if(empty($file[0])) return $this->send(array('result' => 'fail', 'message' => $this->lang->testcase->errorFileNotEmpty));
$file = $file[0];
if(!$file || (isset($file['extension']) && $file['extension'] != 'xmind')) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->errorFileFormat));
/* 保存xmind配置。*/
/* Sav xmind config. */
+4
View File
@@ -11,3 +11,7 @@
#caseStepForm .step-item-id {color: var(--color-gray-500);}
.modal[id^='fileModal'] .modal-dialog {max-height: 100%;}
.files-list>li>a {display: inline; word-wrap: break-word; color: #313c52; line-height: 24px}
.files-list .icon.icon-file-text {padding-left: 7px}
.files-list .right-icon .btn {padding: 0 6px; height: 20px}
+11
View File
@@ -23,6 +23,17 @@ function loadResult()
{
loadCurrentPage({url: resultsLink, selector: '#casesResults', partial: true});
window.waitDom('#casesResults .result-item', function(){ $('#casesResults .result-item').first().trigger('click');})
$(document).off('mouseover', 'li.file').on('mouseover', 'li.file', function()
{
$(this).children('span.right-icon').removeClass("hidden");
$(this).addClass('backgroundColor');
});
$(document).off('mouseout', 'li.file').on('mouseout', 'li.file', function()
{
$(this).children('span.right-icon').addClass("hidden");
$(this).removeClass('backgroundColor');
});
}
/**