From bacc10ccc0a408f8c336939eb32ad6d5bd4b3e89 Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 18 Aug 2022 06:41:41 +0000 Subject: [PATCH 1/3] * Finish task #64969. --- framework/base/helper.class.php | 4 ++-- lib/dao/dao.class.php | 12 ++++++------ module/action/control.php | 12 +++++++++++- module/action/view/trash.html.php | 9 +++++++++ module/project/model.php | 9 +++++++++ 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index c787cc08fe..8c98c97628 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -885,8 +885,8 @@ function getWebRoot($full = false) * * @param array|object $var * @param string|int $key - * @param mixed $valueWhenNone value when the key not exits. - * @param mixed $valueWhenExists value when the key exits. + * @param mixed $valueWhenNone value when the key not exists. + * @param mixed $valueWhenExists value when the key exists. * @access public * @return mixed */ diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index 0695c65d0d..f3d50e89e6 100644 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -29,7 +29,7 @@ class dao extends baseDAO /** * 设置需要更新或插入的数据。 * Set the data to update or insert. - * + * * @param object $data the data object or array * @access public * @return object the dao object self. @@ -182,7 +182,7 @@ class dao extends baseDAO /** * Check workFlow field rule. - * + * * @access public * @return object the dao object self. */ @@ -232,10 +232,10 @@ class dao extends baseDAO } /** - * 检查工作流扩展字段 - * check workflow extend field - * - * @param array $fields + * 检查工作流扩展字段 + * check workflow extend field + * + * @param array $fields * @access public * @return object the dao object self */ diff --git a/module/action/control.php b/module/action/control.php index 6edd4aed0d..b4c280f25d 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -52,6 +52,8 @@ class action extends control public function trash($browseType = 'all', $type = 'all', $byQuery = false, $queryID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->loadModel('backup'); + $this->app->loadLang('execution'); + $this->app->loadLang('project'); /* Save session. */ $uri = $this->app->getURI(true); @@ -115,6 +117,15 @@ class action extends control $preferredType = $preferredType + $toPreferredType; } + /* Get the project name of executions. */ + if($browseType == 'execution') + { + $executionIdList = array(); + foreach($trashes as $trash) $executionIdList[] = $trash->objectID; + $projectPairs = $this->loadModel('project')->getProjectName($executionIdList); + $this->view->projectPairs = $projectPairs; + } + /* Title and position. */ $this->view->title = $this->lang->action->trash; $this->view->position[] = $this->lang->action->trash; @@ -130,7 +141,6 @@ class action extends control $this->view->preferredTypeConfig = $preferredTypeConfig; $this->view->byQuery = $byQuery; $this->view->queryID = $queryID; - $this->display(); } diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index 03352675bb..efeaae5ae7 100755 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -82,6 +82,7 @@ action->objectType);?> idAB);?> action->objectName;?> + lang->execution->project;?> action->actor);?> action->date);?> actions;?> @@ -135,6 +136,14 @@ } ?> + + + project]->name;?> + project]->deleted):?> + lang->project->deleted;?> + + + actor);?> date;?> diff --git a/module/project/model.php b/module/project/model.php index 1bd12fd0cb..aacba0b298 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2613,5 +2613,14 @@ class projectModel extends model } return $menu; + } + public function getProjectName($executionIdList) + { + return $this->dao->select('t1.id, t2.id as projectID, t2.name, t2.deleted')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.id')->in($executionIdList) + ->fetchAll('projectID'); + } + } From a68ba64ad8d549effa29a1b8dbb83d9029d461e7 Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 19 Aug 2022 04:50:57 +0000 Subject: [PATCH 2/3] Revert "* Finish task #64969." This reverts commit bacc10ccc0a408f8c336939eb32ad6d5bd4b3e89. --- framework/base/helper.class.php | 4 ++-- lib/dao/dao.class.php | 12 ++++++------ module/action/control.php | 12 +----------- module/action/view/trash.html.php | 9 --------- module/project/model.php | 9 --------- 5 files changed, 9 insertions(+), 37 deletions(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 8c98c97628..c787cc08fe 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -885,8 +885,8 @@ function getWebRoot($full = false) * * @param array|object $var * @param string|int $key - * @param mixed $valueWhenNone value when the key not exists. - * @param mixed $valueWhenExists value when the key exists. + * @param mixed $valueWhenNone value when the key not exits. + * @param mixed $valueWhenExists value when the key exits. * @access public * @return mixed */ diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index f3d50e89e6..0695c65d0d 100644 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -29,7 +29,7 @@ class dao extends baseDAO /** * 设置需要更新或插入的数据。 * Set the data to update or insert. - * + * * @param object $data the data object or array * @access public * @return object the dao object self. @@ -182,7 +182,7 @@ class dao extends baseDAO /** * Check workFlow field rule. - * + * * @access public * @return object the dao object self. */ @@ -232,10 +232,10 @@ class dao extends baseDAO } /** - * 检查工作流扩展字段 - * check workflow extend field - * - * @param array $fields + * 检查工作流扩展字段 + * check workflow extend field + * + * @param array $fields * @access public * @return object the dao object self */ diff --git a/module/action/control.php b/module/action/control.php index b4c280f25d..6edd4aed0d 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -52,8 +52,6 @@ class action extends control public function trash($browseType = 'all', $type = 'all', $byQuery = false, $queryID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->loadModel('backup'); - $this->app->loadLang('execution'); - $this->app->loadLang('project'); /* Save session. */ $uri = $this->app->getURI(true); @@ -117,15 +115,6 @@ class action extends control $preferredType = $preferredType + $toPreferredType; } - /* Get the project name of executions. */ - if($browseType == 'execution') - { - $executionIdList = array(); - foreach($trashes as $trash) $executionIdList[] = $trash->objectID; - $projectPairs = $this->loadModel('project')->getProjectName($executionIdList); - $this->view->projectPairs = $projectPairs; - } - /* Title and position. */ $this->view->title = $this->lang->action->trash; $this->view->position[] = $this->lang->action->trash; @@ -141,6 +130,7 @@ class action extends control $this->view->preferredTypeConfig = $preferredTypeConfig; $this->view->byQuery = $byQuery; $this->view->queryID = $queryID; + $this->display(); } diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index efeaae5ae7..03352675bb 100755 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -82,7 +82,6 @@ action->objectType);?> idAB);?> action->objectName;?> - lang->execution->project;?> action->actor);?> action->date);?> actions;?> @@ -136,14 +135,6 @@ } ?> - - - project]->name;?> - project]->deleted):?> - lang->project->deleted;?> - - - actor);?> date;?> diff --git a/module/project/model.php b/module/project/model.php index aacba0b298..1bd12fd0cb 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2613,14 +2613,5 @@ class projectModel extends model } return $menu; - } - public function getProjectName($executionIdList) - { - return $this->dao->select('t1.id, t2.id as projectID, t2.name, t2.deleted')->from(TABLE_EXECUTION)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') - ->where('t1.id')->in($executionIdList) - ->fetchAll('projectID'); - } - } From 730c63859893f773f598f4b484b2c349bebd23cd Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 19 Aug 2022 04:57:54 +0000 Subject: [PATCH 3/3] * Finish task #64969. --- module/action/control.php | 13 +++++++++++++ module/action/css/trash.css | 3 +++ module/action/view/trash.html.php | 17 +++++++++++++++++ module/project/model.php | 7 ++++--- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/module/action/control.php b/module/action/control.php index 6edd4aed0d..dcfa277933 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -115,6 +115,19 @@ class action extends control $preferredType = $preferredType + $toPreferredType; } +<<<<<<< Updated upstream +======= + /* Get the project name of executions. */ + if($browseType == 'execution') + { + $this->app->loadLang('execution'); + $projectIdList = array(); + foreach($trashes as $trash) $projectIdList[] = $trash->project; + $projectList = $this->loadModel('project')->getByIdList($projectIdList, 'all'); + $this->view->projectList = $projectList; + } + +>>>>>>> Stashed changes /* Title and position. */ $this->view->title = $this->lang->action->trash; $this->view->position[] = $this->lang->action->trash; diff --git a/module/action/css/trash.css b/module/action/css/trash.css index e5b7a61042..94cf000e62 100755 --- a/module/action/css/trash.css +++ b/module/action/css/trash.css @@ -6,3 +6,6 @@ .dropdown-menu .btn-active-text:hover .text:after {border-bottom: 0px;} #querybox #searchform{border-bottom: 1px solid #ddd; margin-bottom: 20px;} +td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center; margin-bottom: 0px;} +.flex span.label-danger {margin-left: 5px; min-width: 50px;} +.c-name > .text-ellipsis {text-overflow: clip;} diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index 03352675bb..e2c235b94d 100755 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -82,6 +82,12 @@ action->objectType);?> idAB);?> action->objectName;?> +<<<<<<< Updated upstream +======= + systemMode == 'new' and $currentObjectType == 'execution'):?> + lang->execution->project;?> + +>>>>>>> Stashed changes action->actor);?> action->date);?> actions;?> @@ -135,6 +141,17 @@ } ?> +<<<<<<< Updated upstream +======= + systemMode == 'new' and $currentObjectType == 'execution'):?> + + project]->name;?> + project]->deleted):?> + lang->project->deleted;?> + + + +>>>>>>> Stashed changes actor);?> date;?> diff --git a/module/project/model.php b/module/project/model.php index 1bd12fd0cb..b85b11c5de 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -797,16 +797,17 @@ class projectModel extends model /** * Get project by id list. * - * @param array $projectIdList + * @param array $projectIdList + * @param string $mode all * @access public * @return object */ - public function getByIdList($projectIdList = array()) + public function getByIdList($projectIdList = array(), $mode = '') { return $this->dao->select('*')->from(TABLE_PROJECT) ->where('type')->eq('project') ->andWhere('id')->in($projectIdList) - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() + ->beginIF(!$this->app->user->admin and $mode != 'all')->andWhere('id')->in($this->app->user->view->projects)->fi() ->fetchAll('id'); }