* save the order by of stories, tasks list page to cookie.

This commit is contained in:
wangchunsheng
2011-09-20 03:00:10 +00:00
parent b8ffc2d742
commit f08a588b38
3 changed files with 20 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ class bug extends control
* @access public
* @return void
*/
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Set browseType, productID, moduleID and queryID. */
$browseType = strtolower($browseType);
@@ -73,6 +73,10 @@ class bug extends control
$this->bug->setMenu($this->products, $productID);
$this->session->set('bugList', $this->app->getURI(true));
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc';
setcookie('qaBugOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);

View File

@@ -59,7 +59,7 @@ class product extends control
* @access public
* @return void
*/
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Lower browse type. */
$browseType = strtolower($browseType);
@@ -76,6 +76,10 @@ class product extends control
/* Set menu. */
$this->product->setMenu($this->products, $productID);
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc';
setcookie('productStoryOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
/* Set header and position. */
$this->view->header->title = $this->lang->product->index . $this->lang->colon . $this->products[$productID];
$this->view->position[] = $this->products[$productID];

View File

@@ -95,7 +95,7 @@ class project extends control
* @access public
* @return void
*/
public function task($projectID = 0, $status = 'all', $param=0, $orderBy = 'status_asc,id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
public function task($projectID = 0, $status = 'all', $param=0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
/* Set browseType, productID, moduleID and queryID. */
$browseType = strtolower($status);
@@ -109,6 +109,10 @@ class project extends control
$this->app->session->set('storyList', $uri);
$this->app->session->set('projectList', $uri);
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->projectTaskOrder ? $this->cookie->projectTaskOrder : 'status,id_desc';
setcookie('projectTaskOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
/* Header and position. */
$this->view->header->title = $project->name . $this->lang->colon . $this->lang->project->task;
$this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
@@ -292,7 +296,7 @@ class project extends control
* @access public
* @return void
*/
public function story($projectID = 0, $orderBy = 'pri_asc')
public function story($projectID = 0, $orderBy = '')
{
/* Load these models. */
$this->loadModel('story');
@@ -302,6 +306,10 @@ class project extends control
/* Save session. */
$this->app->session->set('storyList', $this->app->getURI(true));
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->projectStoryOrder ? $this->cookie->projectStoryOrder : 'pri';
setcookie('projectStoryOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
$project = $this->commonAction($projectID);
/* Header and position. */