* Fix bug of RD kanban creation and associating story.
This commit is contained in:
@@ -2626,10 +2626,11 @@ class execution extends control
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkStory($objectID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 50, $pageID = 1)
|
||||
public function linkStory($objectID = 0, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 50, $pageID = 1, $extra = '')
|
||||
{
|
||||
$this->loadModel('story');
|
||||
$this->loadModel('product');
|
||||
@@ -2650,7 +2651,7 @@ class execution extends control
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->execution->linkStory($objectID);
|
||||
$this->execution->linkStory($objectID, array(), array(), $extra);
|
||||
if($object->type != 'project' and $object->project != 0) $this->execution->linkStory($object->project);
|
||||
|
||||
if(isonlybody()) die(js::reload('parent'));
|
||||
@@ -3382,10 +3383,11 @@ class execution extends control
|
||||
* @param int $planID
|
||||
* @param int $productID
|
||||
* @param string $fromMethod
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story')
|
||||
public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story', $extra = '')
|
||||
{
|
||||
$planStories = $planProducts = array();
|
||||
$planStory = $this->loadModel('story')->getPlanStories($planID);
|
||||
@@ -3408,7 +3410,7 @@ class execution extends control
|
||||
$projectID = $this->dao->findByID($executionID)->from(TABLE_EXECUTION)->fetch('project');
|
||||
$planStories = array_keys($planStory);
|
||||
|
||||
$this->execution->linkStory($executionID, $planStories, $planProducts);
|
||||
$this->execution->linkStory($executionID, $planStories, $planProducts, $extra);
|
||||
if($this->config->systemMode == 'new' and $executionID != $projectID) $this->execution->linkStory($projectID, $planStories, $planProducts);
|
||||
}
|
||||
|
||||
@@ -3419,7 +3421,14 @@ class execution extends control
|
||||
$moduleName = 'projectstory';
|
||||
$param = "projectID=$executionID";
|
||||
}
|
||||
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, 'story', $param));
|
||||
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
global $lang;
|
||||
$lang->executionCommon = $lang->execution->kanban;
|
||||
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
|
||||
}
|
||||
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, $execution->type == 'sprint' ? 'story' : 'kanban', $param));
|
||||
die(js::locate(helper::createLink($moduleName, $fromMethod, $param)));
|
||||
}
|
||||
|
||||
|
||||
@@ -179,10 +179,10 @@ function createColumnCreateMenu(options)
|
||||
|
||||
if(col.type == 'backlog')
|
||||
{
|
||||
if(priv.canCreateStory) items.push({label: storyLang.create, url: $.createLink('story', 'create', 'productID=' + productID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
|
||||
if(priv.canBatchCreateStory) items.push({label: executionLang.batchCreateStroy, url: $.createLink('story', 'batchcreate', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
|
||||
if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
|
||||
if(priv.canLinkStoryByPlane) items.push({label: executionLang.linkStoryByPlan, url: '#linkStoryByPlan', 'attrs' : {'data-toggle': 'modal'}});
|
||||
if(priv.canCreateStory) items.push({label: storyLang.create, url: $.createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&objectID=0&bugID=0&planID=0&todoID=0&extra=executionID=' + executionID + ',laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
|
||||
if(priv.canBatchCreateStory) items.push({label: executionLang.batchCreateStroy, url: $.createLink('story', 'batchcreate', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&executionID=' + executionID + '&plan=0&type=story&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
|
||||
if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID + '&browseType=¶m=0&recTotal=0&recPerPage=50,&pageID=1&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
|
||||
if(priv.canLinkStoryByPlane) items.push({label: executionLang.linkStoryByPlan, url: '#linkStoryByPlan', 'attrs' : {'data-toggle': 'modal', 'data-target': '#linkStoryByPlan','data-col' : col.id, 'data-lane' : laneID, 'class' : 'linkStoryByPlanButton'}});
|
||||
}
|
||||
else if(col.type == 'unconfirmed')
|
||||
{
|
||||
@@ -1015,12 +1015,12 @@ $(function()
|
||||
$.zui.ContextMenu.hide();
|
||||
});
|
||||
|
||||
$('#toStoryButton').on('click', function()
|
||||
$('#toStoryButton').on('click', function(e)
|
||||
{
|
||||
var planID = $('#plan').val();
|
||||
if(planID)
|
||||
{
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban');
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col'));
|
||||
$.closeModal();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2268,14 +2268,15 @@ class executionModel extends model
|
||||
/**
|
||||
* Link story.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param array $stories
|
||||
* @param array $products
|
||||
* @param int $executionID
|
||||
* @param array $stories
|
||||
* @param array $products
|
||||
* @param string $extra
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function linkStory($executionID, $stories = array(), $products = array())
|
||||
public function linkStory($executionID, $stories = array(), $products = array(), $extra = '')
|
||||
{
|
||||
if(empty($executionID)) return false;
|
||||
if(empty($stories)) $stories = $this->post->stories;
|
||||
@@ -2293,6 +2294,10 @@ class executionModel extends model
|
||||
if(strpos($notAllowedStatus, $storyList[$storyID]->status) !== false) continue;
|
||||
if(isset($linkedStories[$storyID])) continue;
|
||||
|
||||
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
|
||||
parse_str($extra, $output);
|
||||
if(isset($output['laneID']) and isset($output['columnID'])) $this->loadModel('kanban')->addKanbanCell($executionID, $output['laneID'], $output['columnID'], 'story', $storyID);
|
||||
|
||||
$data = new stdclass();
|
||||
$data->project = $executionID;
|
||||
$data->product = (int)$products[$storyID];
|
||||
|
||||
@@ -803,8 +803,8 @@ function initKanban($kanban)
|
||||
maxColHeight: 510,
|
||||
calcColHeight: calcColHeight,
|
||||
fluidBoardWidth: false,
|
||||
minColWidth: 287,
|
||||
maxColWidth: 287,
|
||||
minColWidth: 285,
|
||||
maxColWidth: 285,
|
||||
cardHeight: 60,
|
||||
displayCards: displayCards,
|
||||
createColumnText: kanbanLang.createColumn,
|
||||
|
||||
@@ -105,6 +105,9 @@ class story extends control
|
||||
|
||||
$storyID = $storyResult['id'];
|
||||
$productID = $this->post->product ? $this->post->product : $productID;
|
||||
|
||||
if(isset($output['executionID']) and isset($output['laneID']) and isset($output['columnID'])) $this->loadModel('kanban')->addKanbanCell($output['executionID'], $output['laneID'], $output['columnID'], 'story', $storyID);
|
||||
|
||||
if($storyResult['status'] == 'exists')
|
||||
{
|
||||
$response['message'] = sprintf($this->lang->duplicate, $this->lang->story->common);
|
||||
@@ -355,10 +358,11 @@ class story extends control
|
||||
* @param int $executionID
|
||||
* @param int $plan
|
||||
* @param string $type requirement|story
|
||||
* @param string $extra for example feedbackID=0
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $executionID = 0, $plan = 0, $type = 'story')
|
||||
public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $executionID = 0, $plan = 0, $type = 'story', $extra = '')
|
||||
{
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID);
|
||||
|
||||
@@ -412,7 +416,7 @@ class story extends control
|
||||
{
|
||||
$products = array();
|
||||
foreach($mails as $story) $products[$story->storyID] = $productID;
|
||||
$this->execution->linkStory($executionID, $stories, $products);
|
||||
$this->execution->linkStory($executionID, $stories, $products, $extra);
|
||||
if($executionID != $this->session->project) $this->execution->linkStory($this->session->project, $stories, $products);
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@ class storyModel extends model
|
||||
foreach($stories->title as $i => $title)
|
||||
{
|
||||
$module = $stories->module[$i] == 'ditto' ? $module : $stories->module[$i];
|
||||
$plan = $stories->plan[$i] == 'ditto' ? $plan : $stories->plan[$i];
|
||||
$plan = isset($stories->plan[$i]) ? ($stories->plan[$i] == 'ditto' ? $plan : $stories->plan[$i]) : 0;
|
||||
$pri = $stories->pri[$i] == 'ditto' ? $pri : $stories->pri[$i];
|
||||
$source = $stories->source[$i] == 'ditto' ? $source : $stories->source[$i];
|
||||
$stories->module[$i] = (int)$module;
|
||||
|
||||
Reference in New Issue
Block a user