From 05b9275e14122602c9b881e5698f3861b848a3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Fri, 7 Sep 2018 00:41:41 +0800 Subject: [PATCH 1/3] * Finished task#4802. --- module/bug/config.php | 6 +- module/file/control.php | 8 +- module/file/model.php | 126 +++++++++++++-------------- module/file/view/printfiles.html.php | 2 +- 4 files changed, 74 insertions(+), 68 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index 37773028f7..9c7e5ed1ef 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -165,7 +165,7 @@ $config->bug->search['params']['lastEditedDate']= array('operator' => '=', $config->bug->search['params']['deadline'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->bug->datatable = new stdclass(); -$config->bug->datatable->defaultField = array('id', 'pri', 'title', 'severity', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'actions'); +$config->bug->datatable->defaultField = array('id', 'pri', 'title', 'severity', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolution', 'actions'); $config->bug->datatable->fieldList['id']['title'] = 'idAB'; $config->bug->datatable->fieldList['id']['fixed'] = 'left'; @@ -284,12 +284,12 @@ $config->bug->datatable->fieldList['deadline']['required'] = 'no'; $config->bug->datatable->fieldList['resolvedBy']['title'] = 'resolvedByAB'; $config->bug->datatable->fieldList['resolvedBy']['fixed'] = 'no'; -$config->bug->datatable->fieldList['resolvedBy']['width'] = '80'; +$config->bug->datatable->fieldList['resolvedBy']['width'] = '70'; $config->bug->datatable->fieldList['resolvedBy']['required'] = 'no'; $config->bug->datatable->fieldList['resolution']['title'] = 'resolutionAB'; $config->bug->datatable->fieldList['resolution']['fixed'] = 'no'; -$config->bug->datatable->fieldList['resolution']['width'] = '80'; +$config->bug->datatable->fieldList['resolution']['width'] = '70'; $config->bug->datatable->fieldList['resolution']['required'] = 'no'; $config->bug->datatable->fieldList['resolvedDate']['title'] = 'resolvedDateAB'; diff --git a/module/file/control.php b/module/file/control.php index 48477542a3..9571a83a0b 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -138,9 +138,15 @@ class file extends control $file = $this->file->getById($fileID); /* Judge the mode, down or open. */ - $mode = 'down'; + $mode = 'down'; $fileTypes = 'txt|jpg|jpeg|gif|png|bmp|xml|html'; if(stripos($fileTypes, $file->extension) !== false && $mouse == 'left') $mode = 'open'; + if($file->extension == 'txt') + { + $extension = end(explode('.', $file->title)); + if($extension != 'txt') $mode = 'down'; + $file->extension = $extension; + } if(file_exists($file->realPath)) { diff --git a/module/file/model.php b/module/file/model.php index d0d1152d35..3baa7a8089 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -19,7 +19,7 @@ class fileModel extends model /** * Construct function. - * + * * @access public * @return void */ @@ -33,9 +33,9 @@ class fileModel extends model /** * Get files of an object. - * - * @param string $objectType - * @param string $objectID + * + * @param string $objectType + * @param string $objectID * @param string $extra * @access public * @return array @@ -60,8 +60,8 @@ class fileModel extends model /** * Get info of a file. - * - * @param int $fileID + * + * @param int $fileID * @access public * @return object */ @@ -77,10 +77,10 @@ class fileModel extends model /** * Save upload. - * - * @param string $objectType - * @param string $objectID - * @param string $extra + * + * @param string $objectType + * @param string $objectID + * @param string $extra * @param string $filesName * @param string $labelsName * @access public @@ -113,7 +113,7 @@ class fileModel extends model /** * Get counts of uploaded files. - * + * * @access public * @return int */ @@ -124,8 +124,8 @@ class fileModel extends model /** * Get info of uploaded files. - * - * @param string $htmlTagName + * + * @param string $htmlTagName * @param string $labelsName * @access public * @return array @@ -152,7 +152,7 @@ class fileModel extends model $title = isset($_POST[$labelsName][$id]) ? $_POST[$labelsName][$id] : ''; $file['extension'] = $this->getExtension($filename); $file['pathname'] = $this->setPathName($id, $file['extension']); - $file['title'] = (!empty($title) and $title != $filename) ? htmlspecialchars($title) : str_replace('.' . $file['extension'], '', $filename); + $file['title'] = (!empty($title) and $title != $filename) ? htmlspecialchars($title) : $filename; $file['title'] = $purifier->purify($file['title']); $file['size'] = $size[$id]; $file['tmpname'] = $tmp_name[$id]; @@ -167,7 +167,7 @@ class fileModel extends model $title = isset($_POST[$labelsName][0]) ? $_POST[$labelsName][0] : ''; $file['extension'] = $this->getExtension($name); $file['pathname'] = $this->setPathName(0, $file['extension']); - $file['title'] = (!empty($title) and $title != $name) ? htmlspecialchars($title) : substr($name, 0, strpos($name, $file['extension']) - 1); + $file['title'] = (!empty($title) and $title != $name) ? htmlspecialchars($title) : $name; $file['title'] = $purifier->purify($file['title']); $file['size'] = $size; $file['tmpname'] = $tmp_name; @@ -287,8 +287,8 @@ class fileModel extends model /** * Get extension of a file. - * - * @param string $filename + * + * @param string $filename * @access public * @return string */ @@ -303,8 +303,8 @@ class fileModel extends model /** * Get save name. - * - * @param string $pathName + * + * @param string $pathName * @access public * @return string */ @@ -316,8 +316,8 @@ class fileModel extends model /** * Get real path name. - * - * @param string $pathName + * + * @param string $pathName * @access public * @return string */ @@ -331,8 +331,8 @@ class fileModel extends model /** * Get export tpl. - * - * @param string $module + * + * @param string $module * @access public * @return object */ @@ -349,8 +349,8 @@ class fileModel extends model /** * Save export template. - * - * @param string $module + * + * @param string $module * @access public * @return int */ @@ -369,9 +369,9 @@ class fileModel extends model /** * Set path name of the uploaded file to be saved. - * - * @param int $fileID - * @param string $extension + * + * @param int $fileID + * @param string $extension * @access public * @return string */ @@ -384,7 +384,7 @@ class fileModel extends model /** * Set save path. - * + * * @access public * @return void */ @@ -398,10 +398,10 @@ class fileModel extends model } $this->savePath = dirname($savePath) . '/'; } - + /** * Set the web path of upload files. - * + * * @access public * @return void */ @@ -412,9 +412,9 @@ class fileModel extends model /** * Insert the set image size code. - * - * @param string $content - * @param int $maxSize + * + * @param string $content + * @param int $maxSize * @access public * @return string */ @@ -463,9 +463,9 @@ class fileModel extends model } /** - * Paste image in kindeditor at firefox and chrome. - * - * @param string $data + * Paste image in kindeditor at firefox and chrome. + * + * @param string $data * @access public * @return string */ @@ -503,8 +503,8 @@ class fileModel extends model /** * Parse CSV. - * - * @param string $fileName + * + * @param string $fileName * @access public * @return array */ @@ -606,8 +606,8 @@ class fileModel extends model /** * Remove interference for parse csv. - * - * @param array $matchs + * + * @param array $matchs * @access private * @return string */ @@ -619,9 +619,9 @@ class fileModel extends model /** * Process editor. - * - * @param object $data - * @param string $editorList + * + * @param object $data + * @param string $editorList * @access public * @return object */ @@ -662,9 +662,9 @@ class fileModel extends model } /** - * Compress image - * - * @param array $file + * Compress image + * + * @param array $file * @access public * @return array */ @@ -699,15 +699,15 @@ class fileModel extends model * Webpage: de77.com * Version: 07.02.2010 * Source : https://github.com/acustodioo/pic/blob/master/imagecreatefrombmp.function.php - * - * @param string $filename + * + * @param string $filename * @access public * @return resource */ public function imagecreatefrombmp($filename) { $f = fopen($filename, "rb"); - //read header + //read header $header = fread($f, 54); $header = unpack('c2identifier/Vfile_size/Vreserved/Vbitmap_data/Vheader_size/'. 'Vwidth/Vheight/vplanes/vbits_per_pixel/Vcompression/Vdata_size/'. @@ -740,9 +740,9 @@ class fileModel extends model } /** - * Dwordize for imagecreatefrombmp - * - * @param streing $str + * Dwordize for imagecreatefrombmp + * + * @param streing $str * @access private * @return int */ @@ -756,10 +756,10 @@ class fileModel extends model /** * Update objectID. - * - * @param int $uid - * @param int $objectID - * @param string $objectType + * + * @param int $uid + * @param int $objectID + * @param string $objectType * @access public * @return bool */ @@ -779,10 +779,10 @@ class fileModel extends model } /** - * Revert real src. - * - * @param object $data - * @param string $fields + * Revert real src. + * + * @param object $data + * @param string $fields * @access public * @return object */ @@ -800,8 +800,8 @@ class fileModel extends model /** * Auto delete useless image. - * - * @param int $uid + * + * @param int $uid * @access public * @return void */ diff --git a/module/file/view/printfiles.html.php b/module/file/view/printfiles.html.php index 31ad8eef60..f72e2360b1 100644 --- a/module/file/view/printfiles.html.php +++ b/module/file/view/printfiles.html.php @@ -47,7 +47,7 @@ $sessionString .= session_name() . '=' . session_id(); { $uploadDate = $lang->file->uploadDate . substr($file->addedDate, 0, 10); $fileTitle = "
  •  " . $file->title; - if(strpos($file->title, ".{$file->extension}") === false) $fileTitle .= ".{$file->extension}"; + if(strpos($file->title, ".{$file->extension}") === false && $file->extension != 'txt') $fileTitle .= ".{$file->extension}"; $imageWidth = 0; if(stripos('jpg|jpeg|gif|png|bmp', $file->extension) !== false) { From def4a53d04b45c1e843094723fafd45323e4d6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Fri, 7 Sep 2018 01:44:22 +0800 Subject: [PATCH 2/3] * Finished task#4801 --- module/doc/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 7b15723fff..dda419e267 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1224,14 +1224,14 @@ class docModel extends model */ public function statLibCounts($idList) { - $moduleCounts = $this->dao->select("root, count(id) as moduleCount")->from(TABLE_MODULE) + $moduleCounts = $this->dao->select("`root`, count(id) as moduleCount")->from(TABLE_MODULE) ->where('type')->eq('doc') ->andWhere('root')->in($idList) ->andWhere('deleted')->eq(0) ->groupBy('root') ->fetchPairs(); - $docs = $this->dao->select("id,lib,acl,users,groups")->from(TABLE_DOC) + $docs = $this->dao->select("`id`,`lib`,`acl`,`users`,`groups`")->from(TABLE_DOC) ->where('lib')->in($idList) ->andWhere('deleted')->eq(0) ->andWhere('module')->eq(0) From cd3ab969679b256a0cd9acd5eb3c9d01d710528e Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 7 Sep 2018 10:18:56 +0800 Subject: [PATCH 3/3] * Finish task #4767. --- module/testtask/control.php | 12 +++++++++++- module/testtask/view/groupcase.html.php | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 54255159c9..b249b30e3a 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -395,7 +395,6 @@ class testtask extends control $runs = $this->testtask->getRuns($taskID, 0, $groupBy); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false); $runs = $this->testcase->appendData($runs, 'run'); - $groupCases = array(); $groupByList = array(); foreach($runs as $run) @@ -411,6 +410,17 @@ class testtask extends control } } + if($groupBy == 'story' && $task->build) + { + $buildStoryIDs = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories'); + $buildStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($buildStoryIDs)->andWhere('id')->notin(array_keys($groupCases))->fetchAll('id'); + foreach($buildStories as $buildStory) + { + $groupCases[$buildStory->id][] = $buildStory; + $groupByList[$buildStory->id] = $buildStory->title; + } + } + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases; $this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->position[] = $this->lang->testtask->common; diff --git a/module/testtask/view/groupcase.html.php b/module/testtask/view/groupcase.html.php index b9d033dba7..040e1a83ee 100644 --- a/module/testtask/view/groupcase.html.php +++ b/module/testtask/view/groupcase.html.php @@ -55,6 +55,13 @@ $groupName", '', "class='text-primary'");?> + case)) + { + echo ""; + continue; + } + ?> case);?> pri;?>' title='testcase->priList, $run->pri, $run->pri);?>'>testcase->priList, $run->pri, $run->pri);?> case", $run->title)) echo $run->title;?>