diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 35ba15e23e..9332709f9a 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1347,7 +1347,7 @@ function createTaskMenu(options) if(priv.canPauseTask && task.$col.type == 'developing') items.push({label: taskLang.pause, icon: 'pause', url: createLink('task', 'pause', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canRecordEstimateTask) items.push({label: executionLang.effort, icon: 'time', url: createLink('task', 'recordEstimate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); 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 && !task.mode) 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.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', onClick: function(){deleteCard('task', task.id, task.$lane.region)}}); return items; diff --git a/module/task/control.php b/module/task/control.php index b88d22b8f1..5cff2fbfd9 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -62,6 +62,7 @@ class task extends control $task = new stdClass(); $task->module = $moduleID; + $task->mode = ''; $task->assignedTo = ''; $task->name = ''; $task->story = $storyID; diff --git a/module/task/js/create.js b/module/task/js/create.js index 538b94c5de..36e63a45ff 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -27,6 +27,32 @@ $(function() loadStories(executionID); }) +/** + * Show team menu. + * + * @access public + * @return void + */ +function showTeamMenu() +{ + if($('[name^=multiple]').prop('checked')) + { + $('#assignedTo, #assignedTo_chosen').addClass('hidden'); + $('#assignedTo').next('.picker').addClass('hidden'); + $('.team-group').removeClass('hidden'); + $('.modeBox').removeClass('hidden'); + $('#estimate').attr('readonly', true); + } + else + { + $('#assignedTo, #assignedTo_chosen').removeClass('hidden'); + $('#assignedTo').next('.picker').removeClass('hidden'); + $('.team-group').addClass('hidden'); + $('.modeBox').addClass('hidden'); + $('#estimate').attr('readonly', false); + } + $('#dataPlanGroup').fixInputGroup(); +} /** * Load module, stories and members. * @@ -518,23 +544,7 @@ $(document).ready(function() /* Show team menu. */ $('[name^=multiple]').change(function() { - if($(this).prop('checked')) - { - $('#assignedTo, #assignedTo_chosen').addClass('hidden'); - $('#assignedTo').next('.picker').addClass('hidden'); - $('.team-group').removeClass('hidden'); - $('.modeBox').removeClass('hidden'); - $('#estimate').attr('readonly', true); - } - else - { - $('#assignedTo, #assignedTo_chosen').removeClass('hidden'); - $('#assignedTo').next('.picker').removeClass('hidden'); - $('.team-group').addClass('hidden'); - $('.modeBox').addClass('hidden'); - $('#estimate').attr('readonly', false); - } - $('#dataPlanGroup').fixInputGroup(); + showTeamMenu(); }); $('#showAllModule').change(function() diff --git a/module/task/model.php b/module/task/model.php index c7b154499f..708a8a7791 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -4132,7 +4132,7 @@ class taskModel extends model $menu .= "
"; $menu .= $this->buildMenu('task', 'edit', $params, $task, 'view', '', '', 'showinonlybody'); - if(empty($task->team)) $menu .= $this->buildMenu('task', 'create', "projctID={$task->execution}&storyID=0&moduleID=0&taskID=$task->id", $task, 'view', 'copy'); + $menu .= $this->buildMenu('task', 'create', "projctID={$task->execution}&storyID=0&moduleID=0&taskID=$task->id", $task, 'view', 'copy'); $menu .= $this->buildMenu('task', 'delete', "executionID=$task->execution&taskID=$task->id", $task, 'view', 'trash', 'hiddenwin', 'showinonlybody', true); if($task->parent > 0) $menu .= $this->buildMenu('task', 'view', "taskID=$task->parent", $task, 'view', 'chevron-double-up', '', '', '', '', $this->lang->task->parent); diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 84e5c96f69..f66321ccb0 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -86,7 +86,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)