diff --git a/module/common/tao.php b/module/common/tao.php index 5b1cdc9400..ba7d38bc0f 100644 --- a/module/common/tao.php +++ b/module/common/tao.php @@ -37,8 +37,9 @@ class commonTao extends commonModel $select = ''; if($this->session->$typeOnlyCondition) { - if($orderBy and str_contains($orderBy, 'priOrder')) $select .= ", IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder"; - if($orderBy and str_contains($orderBy, 'severityOrder')) $select .= ", IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder"; + if($orderBy and str_contains($orderBy, 'priOrder')) $select .= ", IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder"; + if($orderBy and str_contains($orderBy, 'severityOrder')) $select .= ", IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder"; + if($type == 'task' && str_contains($orderBy, 'statusOrder')) $select .= ", INSTR('wait,doing,done,pause,cancel,closed,', status) as statusOrder"; $queryCondition = str_replace('t4.status', 'status', $queryCondition); $sql = $this->dao->select("*$select")->from($table) diff --git a/module/design/ui/view.html.php b/module/design/ui/view.html.php index 11b662c166..be9a8aee49 100644 --- a/module/design/ui/view.html.php +++ b/module/design/ui/view.html.php @@ -46,7 +46,7 @@ foreach($config->design->view->operateList['common'] as $operate) $moduleName = empty($project->hasProduct) ? 'projectstory' : (isset($design->storyInfo) ? $design->storyInfo->type : 'story'); $storyName = zget($stories, $design->story, ''); $storyItem = array(); -if($common::hasPriv($moduleName, 'view')) +if(common::hasPriv($moduleName, 'view')) { $storyItem[] = a( set::href(helper::createLink($moduleName, 'view', "id={$design->story}")), diff --git a/module/execution/model.php b/module/execution/model.php index c4fdb5bc3a..87de3745b0 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1508,6 +1508,7 @@ class executionModel extends model */ public function fetchExecutionList(int $projectID = 0, string $browseType = 'undone', int $productID = 0, int $param = 0, string $orderBy = 'id_asc', ?object $pager = null): array { + if(strpos($orderBy, 'nameCol') !== false) $orderBy = str_replace('nameCol', 'name', $orderBy); /* Construct the query SQL at search executions. */ $executionQuery = $browseType == 'bySearch' ? $this->getExecutionQuery($param) : ''; $projectModel = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('model'); diff --git a/module/productplan/ui/linkstory.html.php b/module/productplan/ui/linkstory.html.php index 60e80bd84d..f721ddbabc 100644 --- a/module/productplan/ui/linkstory.html.php +++ b/module/productplan/ui/linkstory.html.php @@ -24,7 +24,7 @@ $cols['assignedTo']['type'] = 'user'; $cols['module']['type'] = 'text'; $cols['module']['map'] = $modules; -foreach($allStories as $story) $story->estimate = $story->estimate . $config->hourUnit; +foreach($allStories as $story) $story->estimate = helper::formatHours($story->estimate) . $config->hourUnit; $config->product->search['fields']['title'] = $lang->productplan->storyTitle; searchForm diff --git a/module/productplan/ui/story.html.php b/module/productplan/ui/story.html.php index 4db28d4ea0..8b0446b3a1 100644 --- a/module/productplan/ui/story.html.php +++ b/module/productplan/ui/story.html.php @@ -104,7 +104,7 @@ formPanel ) ); -foreach($planStories as $story) $story->estimate = $story->estimate . $config->hourUnit; +foreach($planStories as $story) $story->estimate = helper::formatHours($story->estimate) . $config->hourUnit; dtable ( setID('planStories'), diff --git a/module/productplan/ui/view.html.php b/module/productplan/ui/view.html.php index d7b1de078b..0e38bc7f3a 100644 --- a/module/productplan/ui/view.html.php +++ b/module/productplan/ui/view.html.php @@ -154,7 +154,7 @@ if($canBatchActionBug) $planStories = initTableData($planStories, $storyCols, $this->productplan); $planBugs = initTableData($planBugs, $bugCols, $this->productplan); -foreach($planStories as $story) $story->estimate = $story->estimate . $config->hourUnit; +foreach($planStories as $story) $story->estimate = helper::formatHours($story->estimate) . $config->hourUnit; $createStoryLink = common::hasPriv('story', 'create') ? $this->createLink('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=$projectID&bugID=0&planID=$plan->id") : null; $batchCreateStoryLink = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$plan->product&branch=$plan->branch&moduleID=0&story=0&project=$projectID&plan={$plan->id}") : null; diff --git a/module/testcase/ui/header.html.php b/module/testcase/ui/header.html.php index b5f123b02c..7a0c711810 100644 --- a/module/testcase/ui/header.html.php +++ b/module/testcase/ui/header.html.php @@ -158,7 +158,7 @@ if($isFromDoc || $isFromAI) } $linkParams = $rawMethod == 'groupcase' ? "productID=$productID&branch=$branch&groupBy=$groupBy&objectID=0&caseType=$caseType&browseType={key}" : "productID=$productID&branch=$branch&browseType={key}¶m=0" . $suffixParam; -if($app->tab == 'project' && $from != 'doc' && $from != 'ai') $linkParams = "projectID={$projectID}&$linkParams"; +if($app->tab == 'project' && $from != 'doc' && $from != 'ai' && $rawMethod != 'groupcase') $linkParams = "projectID={$projectID}&$linkParams"; $browseLink = createLink('testcase', 'browse', $linkParams); if($app->tab == 'project') $browseLink = createLink('project', 'testcase', $linkParams); if($app->tab == 'execution' && $from != 'doc' && $from != 'ai') $browseLink = createLink('execution', 'testcase', "executionID={$executionID}&productID=$productID&branch=$branch&browseType={key}"); diff --git a/module/transfer/model.php b/module/transfer/model.php index 62335c38a2..67f789e540 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -699,6 +699,7 @@ class transferModel extends model $selectedFields = '*'; if($orderBy && strpos($orderBy, 'priOrder') !== false) $selectedFields .= ",IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) AS priOrder"; if($orderBy && strpos($orderBy, 'severityOrder') !== false) $selectedFields .= ",IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) AS severityOrder"; + if($module == 'task' && $orderBy && strpos($orderBy, 'statusOrder') !== false) $selectedFields .= ",INSTR('wait,doing,done,pause,cancel,closed,', status) AS statusOrder"; $table = zget($this->config->objectTables, $module); //获取对应的表 $moduleDatas = $this->dao->select($selectedFields)->from($table) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index c6d23e3dcd..3d1bce4625 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4045,6 +4045,7 @@ class upgradeModel extends model $project->lastEditedBy = $account; $project->lastEditedDate = $now; $project->acl = isset($data->projectAcl) ? $data->projectAcl : 'open'; + $project->storyType = 'story,requirement'; $this->dao->insert(TABLE_PROJECT)->data($project) ->batchcheck('name', 'notempty') ->check('name', 'unique', "type='project' AND parent='{$programID}' AND deleted='0'")