* code for task#1043.

This commit is contained in:
zhujinyong
2013-01-06 02:03:30 +00:00
parent 0a7bad1def
commit 3d0dffd995
2 changed files with 20 additions and 17 deletions

View File

@@ -68,7 +68,7 @@ class my extends control
* @access public
* @return void
*/
public function todo($type = 'today', $account = '', $status = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function todo($type = 'today', $account = '', $status = 'all', $orderBy="date, status, begin", $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$uri = $this->app->getURI(true);
@@ -85,13 +85,16 @@ class my extends control
$this->view->position[] = $this->lang->my->todo;
/* Assign. */
$this->view->dates = $this->loadModel('todo')->buildDateList();
$this->view->todos = $this->todo->getList($type, $account, $status, 0, $pager);
$this->view->date = (int)$type == 0 ? date(DT_DATE1) : date(DT_DATE1, strtotime($type));
$this->view->type = is_numeric($type) ? 'bydate' : $type;
$this->view->status = $status;
$this->view->account = $this->app->user->account;
$this->view->pager = $pager;
$this->view->dates = $this->loadModel('todo')->buildDateList();
$this->view->todos = $this->todo->getList($type, $account, $status, 0, $pager, $orderBy);
$this->view->date = (int)$type == 0 ? date(DT_DATE1) : date(DT_DATE1, strtotime($type));
$this->view->type = is_numeric($type) ? 'bydate' : $type;
$this->view->recTotal = $recTotal;
$this->view->recPerPage = $recPerPage;
$this->view->status = $status;
$this->view->account = $this->app->user->account;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->importFuture = ($type != 'today');
$this->display();

View File

@@ -12,7 +12,6 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<form method='post' id='todoform'>
<div id='featurebar'>
<div class='f-left'>
@@ -53,16 +52,17 @@
</div>
</div>
<table class='table-1 tablesorter'>
<?php $vars = "type=$type&account=$account&status=$status&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; ?>
<thead>
<tr class='colhead'>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-date'><?php echo $lang->todo->date;?></th>
<th class='w-type'><?php echo $lang->todo->type;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->todo->name;?></th>
<th class='w-hour'><?php echo $lang->todo->beginAB;?></th>
<th class='w-hour'><?php echo $lang->todo->endAB;?></th>
<th class='w-status'><?php echo $lang->todo->status;?></th>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='w-date'><?php common::printOrderLink('date', $orderBy, $vars, $lang->todo->date);?></th>
<th class='w-type'><?php common::printOrderLink('type', $orderBy, $vars, $lang->todo->type);?></th>
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th> <?php common::printOrderLink('name', $orderBy, $vars, $lang->todo->name);?></th>
<th class='w-hour'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->todo->beginAB);?></th>
<th class='w-hour'><?php common::printOrderLink('end', $orderBy, $vars, $lang->todo->endAB);?></th>
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->todo->status);?></th>
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>