* Finish task #4974.

This commit is contained in:
Yagami
2018-10-09 10:53:19 +08:00
parent f1c761f50d
commit 7cc5d54833
2 changed files with 14 additions and 4 deletions
+13 -3
View File
@@ -1813,7 +1813,7 @@ class project extends control
* @access public
* @return void
*/
public function linkStory($projectID = 0, $browseType = '', $param = 0)
public function linkStory($projectID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
$this->loadModel('story');
$this->loadModel('product');
@@ -1876,6 +1876,16 @@ class project extends control
}
$prjStories = $this->story->getProjectStoryPairs($projectID);
foreach($allStories as $id => $story)
{
if(isset($prjStories[$story->id])) unset($allStories[$id]);
}
/* Pager. */
$recTotal = count($allStories);
$allStories = array_chunk($allStories, $recPerPage);
$this->app->loadClass('pager', $static = true);
/* Assign. */
$title = $project->name . $this->lang->colon . $this->lang->project->linkStory;
$position[] = html::a($browseLink, $project->name);
@@ -1885,8 +1895,8 @@ class project extends control
$this->view->position = $position;
$this->view->project = $project;
$this->view->products = $products;
$this->view->allStories = $allStories;
$this->view->prjStories = $prjStories;
$this->view->allStories = empty($allStories) ? $allStories : $allStories[$pageID - 1];;
$this->view->pager = pager::init($recTotal, $recPerPage, $pageID);
$this->view->browseType = $browseType;
$this->view->productType = $productType;
$this->view->modules = $modules;
+1 -1
View File
@@ -55,7 +55,6 @@
<tbody>
<?php $storyCount = 0;?>
<?php foreach($allStories as $story):?>
<?php if(isset($prjStories[$story->id])) continue;?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id");?>
<tr>
<td class='cell-id'>
@@ -84,6 +83,7 @@
<div class='table-actions btn-toolbar show-always'>
<?php echo html::submitButton('', '', 'btn btn-secondary');?>
</div>
<?php $pager->show('right', 'pagerjs')?>
</div>
<?php else:?>
<div class="table-empty-tip">