From 305c6ee54344bff802830ef45fbf21db1f2cab59 Mon Sep 17 00:00:00 2001 From: sunjun Date: Wed, 8 Jun 2022 08:59:25 +0000 Subject: [PATCH] sprint_201_56459 --- module/my/control.php | 53 +++++++++++++++++++++------------------ module/my/model.php | 2 +- module/testcase/model.php | 2 +- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 42b29e1a58..c27455b3dc 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -75,18 +75,19 @@ class my extends control /** * My work view. * - * @param string $mode - * @param string $type - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * @param string $mode + * @param string $type + * @param string|int $param + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ - public function work($mode = 'task', $type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function work($mode = 'task', $type = 'assignedTo', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - echo $this->fetch('my', $mode, "type=$type&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); + echo $this->fetch('my', $mode, "type=$type¶m=$param&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); $this->showWorkCount($recTotal, $recPerPage, $pageID); } @@ -210,20 +211,21 @@ EOF; /** * My contribute view. * - * @param string $mode - * @param string $type - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * @param string $mode + * @param string $type + * @param string|int $param + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ - public function contribute($mode = 'task', $type = 'openedBy', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $param = 0) + public function contribute($mode = 'task', $type = 'openedBy', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { if(($mode == 'issue' or $mode == 'risk') and $type == 'openedBy') $type = 'createdBy'; - echo $this->fetch('my', $mode, "type=$type&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID¶m=$param"); + echo $this->fetch('my', $mode, "type=$type¶m=$param&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); } /** @@ -596,15 +598,16 @@ EOF; /** * My test case. * - * @param string $type assigntome|openedbyme - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * @param string $type assigntome|openedbyme + * @param string|int $param + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ - public function testcase($type = 'assigntome', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $param = 0) + public function testcase($type = 'assigntome', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->loadModel('testcase'); $this->loadModel('testtask'); @@ -633,10 +636,10 @@ EOF; $cases = $this->testcase->appendData($cases, $type == 'assigntome' ? 'run' : 'case'); /* Build the search form. */ - $method = $this->app->rawMethod; - $actionURL = $this->createLink('my', $method, "mode=testcase&type=bysearch&orderBy={$orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}¶m=myQueryID"); + $currentMethod = $this->app->rawMethod; + $actionURL = $this->createLink('my', $currentMethod, "mode=testcase&type=bysearch¶m=myQueryID&orderBy={$orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}"); $this->config->testcase->search['onMenuBar'] = 'yes'; - $this->my->buildTestcaseSearchForm($queryID, $actionURL, $method); + $this->my->buildTestcaseSearchForm($queryID, $actionURL, $currentMethod); /* Assign. */ $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->myTestCase; diff --git a/module/my/model.php b/module/my/model.php index e3aaec1027..b2982a275a 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -417,7 +417,7 @@ class myModel extends model */ public function getTestcasesBySearch($queryID, $type, $orderBy, $pager) { - $queryName = $type == 'contribute' ? 'contributeTestcaseQuery' : 'workTestcaseQuery'; + $queryName = $type == 'openedbyme' ? 'contributeTestcaseQuery' : 'workTestcaseQuery'; if($queryID) { $query = $this->loadModel('search')->getQuery($queryID); diff --git a/module/testcase/model.php b/module/testcase/model.php index ba07b6894d..bca32dc7d4 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -607,7 +607,7 @@ class testcaseModel extends model */ public function getByAssignedTo($account, $orderBy = 'id_desc', $pager = null, $auto = 'no') { - return $this->dao->select('t1.*,t2.project,t2.pri,t2.title,t2.type,t2.openedBy,t2.color,t2.product,t2.branch,t2.module,t2.status,t3.name as taskName')->from(TABLE_TESTRUN)->alias('t1') + return $this->dao->select('t1.task,t1.case,t1.version,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status,t2.id as id,t2.project,t2.pri,t2.title,t2.type,t2.openedBy,t2.color,t2.product,t2.branch,t2.module,t2.status,t3.name as taskName')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') ->leftJoin(TABLE_TESTTASK)->alias('t3')->on('t1.task = t3.id') ->where('t1.assignedTo')->eq($account)