diff --git a/module/bug/control.php b/module/bug/control.php index 3844061cd9..ac65cb9af9 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1835,10 +1835,11 @@ class bug extends control * * @param int $bugID * @param string $confirm yes|no + * @param string $extra * @access public * @return void */ - public function delete($bugID, $confirm = 'no') + public function delete($bugID, $confirm = 'no', $extra = '') { $bug = $this->bug->getById($bugID); if($confirm == 'no') @@ -1864,6 +1865,12 @@ class bug extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); + if($this->app->tab == 'execution') + { + $execution = $this->loadModel('execution')->getByID($bug->execution); + if($execution->type == 'kanban') js::console.log(isonlybody() ? '1' : '2');//return print(js::reload(isonlybody() ? 'parent.parent' : 'parent')); + } + $locateLink = $this->session->bugList ? $this->session->bugList : inlink('browse', "productID={$bug->product}"); return print(js::locate($locateLink, 'parent')); } diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 62f68d60af..45efbbbd1f 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -117,7 +117,7 @@ { common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy'); } - common::printIcon('bug', 'delete', $params, $bug, 'button', 'trash', 'hiddenwin'); + common::printIcon('bug', 'delete', $params, $bug, 'button', 'trash', 'hiddenwin', 'showinonlybody'); ?> diff --git a/module/execution/control.php b/module/execution/control.php index ec7ffd8eab..6a3f0e2e42 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2502,6 +2502,13 @@ class execution extends control return print(js::reload('parent')); } } + //public function deleteBug($bugID, $confirm = 'no') + //{ + // if($confirm == 'no') + // { + // return print(); + // } + //} /** * Manage products. diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 9e59198ef2..b255aeb619 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -548,7 +548,7 @@ function renderBugItem(item, $item, col) if(scaleSize <= 1) { var $actions = $item.find('.actions'); - if(!$actions.length && (priv.canEditBug || priv.canResolveBug || priv.canConfirmBug || priv.canCopyBug || priv.canToStoryBug)) + if(!$actions.length && (priv.canEditBug || priv.canResolveBug || priv.canConfirmBug || priv.canCopyBug || priv.canToStoryBug || priv.canDeleteBug)) { $actions = $([ '
', @@ -1089,6 +1089,7 @@ function createTaskMenu(options) if(priv.canActivateTask && (task.$col.type == 'developed' || task.$col.type == 'canceled' || task.$col.type == 'closed')) items.push({label: executionLang.activate, icon: 'magic', url: createLink('task', 'activate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canCreateTask) items.push({label: taskLang.copy, icon: 'copy', url: createLink('task', 'create', 'executionID=' + executionID + '&storyID=' + '0' + '&moduleID=' + '0' + '&taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canCancelTask && (task.$col.type == 'wait' || task.$col.type == 'developing' || task.$col.type == 'pause')) items.push({label: taskLang.cancel, icon: 'cancel', url: createLink('task', 'cancel', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canDeleteTask) items.push({label: taskLang.delete, icon: 'trash', url: createLink('task', 'delete', 'bugID=' + bug.id, '', 'true'), attrs: {'target': 'hiddenwin'}}); return items; } @@ -1108,6 +1109,7 @@ function createBugMenu(options) if(priv.canCopyBug) items.push({label: bugLang.copy, icon: 'copy', url: createLink('bug', 'create', 'productID=' + productID + '&branch=' + '' + '&extras=bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canToStoryBug && (bug.$col.type != 'closed')) items.push({label: bugLang.toStory, icon: 'lightbulb', url: createLink('story', 'create', 'product=' + productID + '&branch=' + '0' + '&module=' + '0' + '&story=' + '0' + '&execution=' + '0' + '&bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canActivateBug && (bug.$col.type == 'fixed') || bug.$col.type == 'testing' || bug.$col.type == 'tested' || bug.$col.type == 'closed') items.push({label: bugLang.activate, icon: 'magic', url: createLink('bug', 'activate', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canDeleteBug) items.push({label: bugLang.delete, icon: 'trash', url: createLink('bug', 'delete', 'bugID=' + bug.id, '', 'true'), attrs: {'target': 'hiddenwin'}}); return items; } diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 1c5e9b50ed..5c84c3267d 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -85,6 +85,7 @@ js::set('priv', 'canResolveBug' => common::hasPriv('bug', 'resolve'), 'canCopyBug' => common::hasPriv('bug', 'create'), 'canEditBug' => common::hasPriv('bug', 'edit'), + 'canDeleteBug' => common::hasPriv('bug', 'delete'), 'canActivateBug' => common::hasPriv('bug', 'activate'), 'canAssignTask' => common::hasPriv('task', 'assignto'), 'canFinishTask' => common::hasPriv('task', 'finish'), @@ -96,10 +97,12 @@ js::set('priv', 'canStartTask' => common::hasPriv('task', 'start'), 'canRestartTask' => common::hasPriv('task', 'restart'), 'canEditTask' => common::hasPriv('task', 'edit'), + 'canDeleteTask' => common::hasPriv('task', 'delete'), 'canRecordEstimateTask' => common::hasPriv('task', 'recordEstimate'), 'canToStoryBug' => common::hasPriv('story', 'create'), 'canAssignStory' => common::hasPriv('story', 'assignto'), 'canEditStory' => common::hasPriv('story', 'edit'), + 'canDeleteStory' => common::hasPriv('story', 'delete'), 'canChangeStory' => common::hasPriv('story', 'change'), 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), )