This commit is contained in:
tianshujie
2022-04-01 14:32:00 +08:00
parent b9dc9b118e
commit 7407aabc00
5 changed files with 19 additions and 7 deletions
+4 -1
View File
@@ -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');
}
+8 -3
View File
@@ -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);
+2
View File
@@ -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;}
+2 -3
View File
@@ -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;}
+3
View File
@@ -120,6 +120,9 @@
</div>
</div>
<?php endforeach;?>
<div class='col-xs-12' id='cardsFooter'>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</div>
</div>