* code for task#790.

* add pager for user-todo page.
This commit is contained in:
chencongzhi520@gmail.com
2012-05-14 06:59:24 +00:00
parent 385d0d0c32
commit 73e4bc2407
2 changed files with 12 additions and 3 deletions
+11 -3
View File
@@ -39,15 +39,18 @@ class user extends control
}
/**
* Todos of a user.
* Todos of a user.
*
* @param string $account
* @param string $type the tod type, today|lastweek|thisweek|all|undone, or a date.
* @param string $status
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function todo($account, $type = 'today', $status = 'all')
public function todo($account, $type = 'today', $status = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Set thie url to session. */
$uri = $this->app->getURI(true);
@@ -55,13 +58,17 @@ class user extends control
$this->session->set('bugList', $uri);
$this->session->set('taskList', $uri);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* set menus. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account);
/* Get user, totos. */
$user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch();
$todos = $this->loadModel('todo')->getList($type, $account, $status);
$todos = $this->loadModel('todo')->getList($type, $account, $status, 0, $pager);
$date = (int)$type == 0 ? $this->todo->today() : $type;
$header['title'] = $this->lang->company->orgView . $this->lang->colon . $this->lang->user->todo;
@@ -76,6 +83,7 @@ class user extends control
$this->view->user = $user;
$this->view->account = $account;
$this->view->type = $type;
$this->view->pager = $pager;
$this->display();
}
+1
View File
@@ -56,6 +56,7 @@
</tr>
<?php endforeach;?>
</tbody>
<?php if($type == 'all'):?><tfoot><tr><td colspan='8'><?php $pager->show();?></td></tr></tfoot><?php endif;?>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>