diff --git a/module/user/control.php b/module/user/control.php index 0060792244..03d2fef768 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -43,15 +43,16 @@ class user extends control * Todos of a user. * * @param string $account - * @param string $type the tod type, today|lastweek|thisweek|all|undone, or a date. + * @param string $type the todo type, today|lastweek|thisweek|all|undone, or a date. * @param string $status + * @param string $orderBy * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public * @return void */ - public function todo($account, $type = 'today', $status = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function todo($account, $type = 'today', $status = 'all', $orderBy='date,status,begin', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Set thie url to session. */ $uri = $this->app->getURI(true); @@ -70,7 +71,7 @@ class user extends control /* Get user, totos. */ $user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch(); - $todos = $this->todo->getList($type, $account, $status, 0, $pager); + $todos = $this->todo->getList($type, $account, $status, 0, $pager, $orderBy); $date = (int)$type == 0 ? helper::today() : $type; $title = $this->lang->company->orgView . $this->lang->colon . $this->lang->user->todo; @@ -84,6 +85,8 @@ class user extends control $this->view->user = $user; $this->view->account = $account; $this->view->type = $type; + $this->view->status = $status; + $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->display(); diff --git a/module/user/view/todo.html.php b/module/user/view/todo.html.php index c7304dee1d..ea4dbb7252 100644 --- a/module/user/view/todo.html.php +++ b/module/user/view/todo.html.php @@ -11,7 +11,6 @@ */ ?> - requestType == 'GET' ? '&onlybody=yes' : '?onlybody=yes';?> @@ -22,13 +21,12 @@