* Finish task#8076.
This commit is contained in:
@@ -1236,9 +1236,9 @@ EOD;
|
||||
$preAndNextObject->pre = '';
|
||||
$preAndNextObject->next = '';
|
||||
|
||||
if($type == 'story' and !empty($_SESSION['planStoryOrder']))
|
||||
if($type == 'story' and !empty($_SESSION['sortedIdList']))
|
||||
{
|
||||
$objects = explode(',', $_SESSION['planStoryOrder']);
|
||||
$objects = explode(',', $_SESSION['sortedIdList']);
|
||||
$key = array_search($objectID, $objects);
|
||||
|
||||
if($key > 0)
|
||||
|
||||
@@ -112,7 +112,7 @@ class product extends control
|
||||
/* Save session. */
|
||||
$this->session->set('storyList', $this->app->getURI(true));
|
||||
$this->session->set('productList', $this->app->getURI(true));
|
||||
$this->session->set('planStoryOrder', '');
|
||||
$this->session->set('sortedIdList', '');
|
||||
|
||||
/* Set product, module and query. */
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
class productplan extends control
|
||||
{
|
||||
/**
|
||||
* Common actions
|
||||
* Common actions.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
@@ -261,7 +261,7 @@ class productplan extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('planStoryOrder', '');
|
||||
$this->session->set('sortedIdList', '');
|
||||
}
|
||||
|
||||
/* Append id for secend sort. */
|
||||
@@ -284,7 +284,7 @@ class productplan extends control
|
||||
$planStories = $this->story->sortPlanStory($planStories, $plan->order, $orderBy);
|
||||
|
||||
$storyIDList = implode(',', array_keys($planStories));
|
||||
$this->session->set('planStoryOrder', $storyIDList);
|
||||
$this->session->set('sortedIdList', $storyIDList);
|
||||
|
||||
$storyPager->recTotal = count($planStories);
|
||||
|
||||
@@ -352,10 +352,10 @@ class productplan extends control
|
||||
if(empty($planID)) return true;
|
||||
|
||||
$plan = $this->productplan->getByID($planID, true);
|
||||
$order = $this->loadModel('story')->getAllStorySort($planID, $plan->order);
|
||||
$order = $this->loadModel('story')->sortStoriesOfPlan($planID, $plan->order);
|
||||
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)->set('`order`')->eq($order)->where('id')->eq((int)$planID)->exec();
|
||||
$this->session->set('planStoryOrder', $order);
|
||||
$this->session->set('sortedIdList', $order);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -689,7 +689,7 @@ class project extends control
|
||||
|
||||
/* Save session. */
|
||||
$this->app->session->set('storyList', $this->app->getURI(true));
|
||||
$this->session->set('planStoryOrder', '');
|
||||
$this->session->set('sortedIdList', '');
|
||||
|
||||
/* Process the order by field. */
|
||||
if(!$orderBy) $orderBy = $this->cookie->projectStoryOrder ? $this->cookie->projectStoryOrder : 'pri';
|
||||
|
||||
@@ -2366,7 +2366,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getAllStorySort($planID, $planOrder)
|
||||
public function sortStoriesOfPlan($planID, $planOrder)
|
||||
{
|
||||
$orderBy = $this->post->orderBy;
|
||||
if(strpos($orderBy, 'order') !== false) $orderBy = str_replace('order', 'id', $orderBy);
|
||||
|
||||
Reference in New Issue
Block a user