From 7407aabc00975880c4fba528e899f52af38765d4 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 1 Apr 2022 14:32:00 +0800 Subject: [PATCH] * Fix bug #19104. --- module/execution/model.php | 5 ++++- module/project/control.php | 11 ++++++++--- module/project/css/index.css | 2 ++ module/project/view/browsebycard.html.php | 5 ++--- module/project/view/index.html.php | 3 +++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index bfac6c4405..b3eb5a31d3 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1136,10 +1136,11 @@ class executionModel extends model * @param int $limit * @param int $productID * @param int $branch + * @param object $pager * @access public * @return array */ - public function getList($projectID = 0, $type = 'all', $status = 'all', $limit = 0, $productID = 0, $branch = 0) + public function getList($projectID = 0, $type = 'all', $status = 'all', $limit = 0, $productID = 0, $branch = 0, $pager = null) { if($status == 'involved') return $this->getInvolvedExecutionList($projectID, $status, $limit, $productID, $branch); @@ -1157,6 +1158,7 @@ class executionModel extends model ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() ->orderBy('order_desc') + ->page($pager) ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); } @@ -1172,6 +1174,7 @@ class executionModel extends model ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->orderBy('order_desc') + ->page($pager) ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); } diff --git a/module/project/control.php b/module/project/control.php index a7636221fc..7d88be3a51 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -228,7 +228,7 @@ class project extends control * @access public * @return void */ - public function index($projectID = 0, $browseType = 'all') + public function index($projectID = 0, $browseType = 'all', $recTotal = 0, $recPerPage = 15, $pageID = 1) { $projectID = $this->project->saveState($projectID, $this->project->getPairsByProgram()); @@ -245,7 +245,11 @@ class project extends control if($project->model == 'kanban' and $this->config->vision != 'lite') { - $kanbanList = $this->loadModel('execution')->getList($projectID, 'all', $browseType); + /* Load pager and get kanban list. */ + $this->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); + + $kanbanList = $this->loadModel('execution')->getList($projectID, 'all', $browseType, 0, 0, 0, $pager); $executionActions = array(); foreach($kanbanList as $kanbanID => $kanban) @@ -262,6 +266,7 @@ class project extends control $this->view->memberGroup = $this->execution->getMembersByIdList(array_keys($kanbanList)); $this->view->usersAvatar = $this->loadModel('user')->getAvatarPairs('all'); $this->view->executionActions = $executionActions; + $this->view->pager = $pager; } $this->view->title = $this->lang->project->common . $this->lang->colon . $this->lang->project->index; @@ -293,7 +298,7 @@ class project extends control $projectType = $this->cookie->projectType ? $this->cookie->projectType : 'bylist'; - /* Load pager and get tasks. */ + /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); diff --git a/module/project/css/index.css b/module/project/css/index.css index 151516a0ab..9a6fcb9d22 100644 --- a/module/project/css/index.css +++ b/module/project/css/index.css @@ -28,3 +28,5 @@ .kanbans .kanban-actions .dropdown-menu.pull-left {top:31px; right:-1px; left: auto;} .label-doing {background: #ff5d5d} +#cardsFooter .pager {margin: 0; float: right;} +#cardsFooter .pager .btn {padding-top: 4px; border: none;} diff --git a/module/project/view/browsebycard.html.php b/module/project/view/browsebycard.html.php index 83103ac5ce..5de6a42787 100644 --- a/module/project/view/browsebycard.html.php +++ b/module/project/view/browsebycard.html.php @@ -15,7 +15,6 @@ #cards > .col {width: 25%;} @media screen and (max-width: 1500px) {#cards > .col {width: 33.3333333%;}} #cards .panel {margin: 10px 0; border: 1px solid #DCDCDC; border-radius: 4px; box-shadow: none; cursor: pointer; height: 190px;} -#cards .pager .btn {padding-top: 4px;} #cards .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);} #cards .panel .projectStatus .label{float: right;} #cards .panel-heading {padding: 12px 24px 10px 16px;} @@ -30,8 +29,8 @@ #cards .project-infos > .budget {max-width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} #cards .project-detail {position: absolute; top: 75px; left: 16px; right: 16px; font-size: 12px;} #cards .project-footer {position: absolute; bottom: 10px; right: 10px; left: 15px;} -#cards .pager {margin: 0; float: right;} -#cards .pager .btn {border: none} +#cardsFooter .pager {margin: 0; float: right;} +#cardsFooter .pager .btn {border: none; padding-top: 4px;} #cards .panel .label-wait {background: #EFEFEF !important; color: #838A9D;} #cards .panel .label-doing {background: #E9F2FB !important; color: #2B80FF;} #cards .panel .label-suspended {background: #AAA !important; color: #FFF;} diff --git a/module/project/view/index.html.php b/module/project/view/index.html.php index f27a1135ed..27e0555b00 100644 --- a/module/project/view/index.html.php +++ b/module/project/view/index.html.php @@ -120,6 +120,9 @@ +
+ show('right', 'pagerjs');?> +