* Finish task#8076.

This commit is contained in:
leiyong
2020-09-30 14:16:17 +08:00
parent bfca760cfc
commit b60e13adff
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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);
+5 -5
View File
@@ -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);
}
/**
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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);