* finish task #2281.
This commit is contained in:
@@ -129,6 +129,7 @@ class company extends control
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
$this->company->setMenu();
|
||||
$title = $this->lang->company->common . $this->lang->colon . $this->lang->company->edit;
|
||||
$position[] = $this->lang->company->edit;
|
||||
$this->view->title = $title;
|
||||
|
||||
@@ -529,7 +529,7 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function story($projectID = 0, $orderBy = '', $type = 'byModule', $param = 0)
|
||||
public function story($projectID = 0, $orderBy = '', $type = 'byModule', $param = 0, $recTotal = 0, $recPerPage = 50, $pageID = 1)
|
||||
{
|
||||
/* Load these models. */
|
||||
$this->loadModel('story');
|
||||
@@ -554,8 +554,12 @@ class project extends control
|
||||
$position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
|
||||
$position[] = $this->lang->project->story;
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* The pager. */
|
||||
$stories = $this->story->getProjectStories($projectID, $sort, $type, $param);
|
||||
$stories = $this->story->getProjectStories($projectID, $sort, $type, $param, $pager);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false);
|
||||
$storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $projectID);
|
||||
$users = $this->user->getPairs('noletter');
|
||||
@@ -583,6 +587,7 @@ class project extends control
|
||||
$this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink'));
|
||||
$this->view->tabID = 'story';
|
||||
$this->view->users = $users;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<table class='table tablesorter table-condensed table-fixed' id='storyList'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "projectID={$project->id}&orderBy=%s&type=$type¶m=$param"; ?>
|
||||
<?php $vars = "projectID={$project->id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<th class='w-id {sorter:false}'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri {sorter:false}'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='{sorter:false}'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
@@ -147,6 +147,7 @@
|
||||
echo "<div class='text'>" . $summary . '</div>';
|
||||
?>
|
||||
</div>
|
||||
<?php echo $pager->show();?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@@ -1181,7 +1181,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectStories($projectID = 0, $orderBy = 'pri_asc,id_desc', $type = 'byModule', $param = 0)
|
||||
public function getProjectStories($projectID = 0, $orderBy = 'pri_asc,id_desc', $type = 'byModule', $param = 0, $pager = null)
|
||||
{
|
||||
$modules = ($type == 'byModule' and $param) ? $this->dao->select('*')->from(TABLE_MODULE)->where('path')->like("%,$param,%")->andWhere('type')->eq('story')->fetchPairs('id', 'id') : array();
|
||||
$stories = $this->dao->select('t1.*, t2.*')->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
@@ -1191,6 +1191,7 @@ class storyModel extends model
|
||||
->beginIF($type == 'byModule' and $param)->andWhere('t2.module')->in($modules)->fi()
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
return $stories;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user