diff --git a/module/bug/control.php b/module/bug/control.php index b9027f4e94..dc60c07f57 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1530,7 +1530,12 @@ class bug extends control */ public function batchResolve($resolution, $resolvedBuild = '') { +<<<<<<< Updated upstream if(!$this->post->bugIDList) return print(js::locate($this->session->bugList, 'parent')); +======= + $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : print(js::locate($this->session->bugList, 'parent')); + $bugIDList = array_unique($bugIDList); +>>>>>>> Stashed changes $bugIDList = array_unique($this->post->bugIDList); $changes = $this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild); @@ -1766,9 +1771,14 @@ class bug extends control return print(js::locate($this->session->bugList, 'parent')); } +<<<<<<< Updated upstream if(!$this->post->bugIDList) return print(js::locate($this->session->bugList, 'parent')); $bugIDList = array_unique($$this->post->bugIDList); +======= + $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : print(js::locate($this->session->bugList, 'parent')); + $bugIDList = array_unique($bugIDList); +>>>>>>> Stashed changes $bugs = $this->dao->select('id, title, status, resolvedBy, openedBuild')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); $this->qa->setMenu($this->products, $productID, $branch); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index c746512166..ae1a1ec051 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -469,7 +469,7 @@ function renderStoryItem(item, $item, col) if(scaleSize <= 1) { var $actions = $item.find('.actions'); - if(!$actions.length && item.menus && item.menus.length) + if(!$actions.length && (priv.canEditStory || priv.canChangeStory || priv.canCreateTask || priv.canBatchCreate || priv.canUnlinkStory)) { $actions = $([ '
', @@ -1037,6 +1037,24 @@ function processMinusBtn() } } + /** + * Create story menu + * @returns {Object[]} + */ +function createStoryMenu(options) +{ + var $card = options.$trigger.closest('.kanban-item'); + var story = $card.data('item'); + + var items = []; + if(priv.canEditStory) items.push({label: storyLang.edit, icon: 'edit', url: createLink('story', 'edit', 'storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canChangeStory) items.push({label: storyLang.change, icon: 'change', url: createLink('story', 'change', 'storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canCreateTask) items.push({label: taskLang.create, icon: 'plus', url: createLink('task', 'create', 'executionID=' + execution.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, icon: 'pluses', url: createLink('task', 'batchCreate', 'executionID=' + execution.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canUnlinkStory) items.push({label: executionLang.unlinkStory, icon: 'unlink', url: createLink('execution', 'unlinkStory', 'executionID=' + execution.id + '&storyID=' + story.id, '', 'false'), attrs: {target: 'hiddenwin'}}); + return items; +} + /** * Create task menu * @returns {Object[]} @@ -1065,6 +1083,7 @@ window.menuCreators = column: createColumnMenu, columnCreate: createColumnCreateMenu, task: createTaskMenu, + story: createStoryMenu, }; /** diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 56342f8a00..4ad84cd2e5 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -83,7 +83,12 @@ js::set('priv', 'canStartTask' => common::hasPriv('task', 'start'), 'canAssignBug' => common::hasPriv('bug', 'assignto'), 'canConfirmBug' => common::hasPriv('bug', 'confirmBug'), - 'canActivateBug' => common::hasPriv('bug', 'activate') + 'canActivateBug' => common::hasPriv('bug', 'activate'), + 'canEditStory' => common::hasPriv('story', 'edit'), + 'canChangeStory' => common::hasPriv('story', 'change'), + 'canCreateTask' => common::hasPriv('task', 'create'), + 'canBatchCreateTask' => common::hasPriv('task', 'batchCreate'), + 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), ) ); js::set('hasStoryButton', $hasStoryButton);