diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 68533a4616..5d4c1e7f91 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -55,11 +55,11 @@ js::set('browseType', $browseType);
openedDate, 5, 6);?> - >assignedTo == 'closed' ? 'Closed' : $users[$task->assignedTo];?> + >assignedTo == 'closed' ? 'Closed' : zget($users, $task->assignedTo, $task->assignedTo);?> finishedBy, $task->finishedBy);?> cookie->windowWidth > $this->config->wideSize):?> diff --git a/module/story/control.php b/module/story/control.php index 9bf05c02f1..bf38cb84be 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1272,6 +1272,7 @@ class story extends control $storyInfo['estimate'] = $story->estimate; $storyInfo['pri'] = $story->pri; $storyInfo['spec'] = $story->spec; + echo json_encode($storyInfo); } diff --git a/module/task/control.php b/module/task/control.php index d30168efcf..b5d0e63ba2 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -34,10 +34,10 @@ class task extends control /** * Create a task. - * - * @param int $projectID - * @param int $storyID - * @param int $moduleID + * + * @param int $projectID + * @param int $storyID + * @param int $moduleID * @param int $taskID * @access public * @return void @@ -855,7 +855,7 @@ class task extends control $this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->finish; $this->view->position[] = $this->lang->task->finish; $this->view->users = $this->loadModel('user')->getPairs('noletter'); - + $this->display(); } diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 08f5aaa5ab..97e0603d71 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -41,7 +41,7 @@ function copyStoryTitle(num) $('#name\\[' + num + '\\]').val(storyTitle); $('#estimate\\[' + num + '\\]').val($('#storyEstimate' + num).val()); - $('#desc\\[' + num + '\\]').val($('#storyDesc' + num).val()); + $('#desc\\[' + num + '\\]').val(($('#storyDesc' + num).val()).replace(/<[^>]+>/g,'')); var storyPri = $('#storyPri' + num).val(); if(storyPri == 0) $('#pri' + num ).val('3'); @@ -150,4 +150,6 @@ $(function() $('#module0_chosen').width($('#module1_chosen').width()); $('#story0_chosen').width($('#story1_chosen').width()); if($.cookie('zeroTask') == 'true') toggleZeroTaskStory(); + + if(storyID != 0) setStoryRelated(0); }) diff --git a/module/task/js/create.js b/module/task/js/create.js index 4057a21e75..e50bb46e83 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -5,7 +5,16 @@ function copyStoryTitle() startPosition = storyTitle.indexOf(':') + 1; endPosition = storyTitle.lastIndexOf('('); storyTitle = storyTitle.substr(startPosition, endPosition - startPosition); + $('#name').attr('value', storyTitle); + $('#estimate').val($('#storyEstimate').val()); + $('#desc').val($('#storyDesc').val()); + + $('.pri-text span:first').removeClass().addClass('pri' + $('#storyPri').val()).text($('#storyPri').val()); + $('select#pri').val($('#storyPri').val()); + + $(window.editor.desc.edit.doc).find('span.kindeditor-ph').remove(); + window.editor.desc.html($('#storyDesc').val()); } /* Set the assignedTos field. */ @@ -31,7 +40,7 @@ function setOwners(result) function setStoryRelated() { setPreview(); - if($('#module').val() == 0) setStoryModule(); + setStoryModule(); } /* Set the story module. */ @@ -45,6 +54,10 @@ function setStoryModule() { $('#module').val(storyInfo.moduleID); $("#module").trigger("chosen:updated"); + + $('#storyEstimate').val(storyInfo.estimate); + $('#storyPri' ).val(storyInfo.pri); + $('#storyDesc' ).val(storyInfo.spec); }); } } @@ -137,7 +150,7 @@ function setStories(moduleID, projectID) $(document).ready(function() { - setPreview(); + setStoryRelated(); $('#selectAllUser').on('click', function() { diff --git a/module/task/model.php b/module/task/model.php index d61af2cf2c..d874af8edf 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -37,7 +37,7 @@ class taskModel extends model ->setDefault('openedDate', helper::now()) ->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') - ->remove('after,files,labels,assignedTo,uid') + ->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri') ->get(); foreach($this->post->assignedTo as $assignedTo) @@ -1583,9 +1583,9 @@ class taskModel extends model /** * Judge an action is clickable or not. - * - * @param object $task - * @param string $action + * + * @param object $task + * @param string $action * @access public * @return bool */ diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 778732a8ce..f58f2670f5 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -133,7 +133,8 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; -task->ditto);?> +task->ditto);?> + createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields')?> diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 29e3ac66b8..b36c445810 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -68,6 +68,7 @@ name, "class='form-control' autocomplete='off'");?> config->global->flow != 'onlyTask'):?> task->copyStoryTitle;?> +