* save the order by of stories, tasks list page to cookie.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user