Files
EasySoft-ZenTaoPMS/module/task/js/batchcreate.js
xia0ta0 a954e09d53 Merge branch 'zui'
Conflicts:
	module/bug/view/activate.html.php
	module/bug/view/assignto.html.php
	module/bug/view/confirmbug.html.php
	module/bug/view/edit.html.php
	module/bug/view/resolve.html.php
	module/build/view/create.html.php
	module/build/view/edit.html.php
	module/common/model.php
	module/common/view/header.lite.html.php
	module/file/view/edit.html.php
	module/my/view/bug.html.php
	module/product/view/browse.html.php
	module/product/view/close.html.php
	module/product/view/edit.html.php
	module/productplan/view/edit.html.php
	module/project/view/activate.html.php
	module/project/view/batchedit.html.php
	module/project/view/burn.html.php
	module/project/view/close.html.php
	module/project/view/edit.html.php
	module/project/view/putoff.html.php
	module/project/view/start.html.php
	module/project/view/story.html.php
	module/project/view/suspend.html.php
	module/project/view/taskheader.html.php
	module/release/view/edit.html.php
	module/search/view/buildform.html.php
	module/story/view/batchclose.html.php
	module/story/view/change.html.php
	module/task/control.php
	module/task/css/batchcreate.css
	module/task/view/activate.html.php
	module/task/view/assignto.html.php
	module/task/view/batchcreate.html.php
	module/task/view/cancel.html.php
	module/task/view/close.html.php
	module/task/view/create.html.php
	module/task/view/edit.html.php
	module/task/view/finish.html.php
	module/task/view/start.html.php
	module/testtask/view/close.html.php
	module/testtask/view/edit.html.php
	module/testtask/view/start.html.php
	www/theme/default/style.css
2014-03-27 16:27:43 +08:00

43 lines
1.4 KiB
JavaScript
Executable File

$(function() {
for(i=0; i<batchCreateNum; i++) $("#story" + i).chosen(defaultChosenOptions);
})
/* Get select of stories.*/
function setStories(moduleID, projectID, num)
{
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=0&moduleID=' + moduleID + '&storyID=0&num=' + num + '&type=short');
$.get(link, function(stories)
{
var storyID = $('#story' + num).val();
if(!stories) stories = '<select id="story' + num + '" name="story' + num + '" class="select-1"></select>';
$('#story' + num).replaceWith(stories);
$('#story' + num).val(storyID);
$('#story' + num + '_chzn').remove();
$("#story" + num).chosen({no_results_text: ''});
});
}
/* Copy story title as task title. */
function copyStoryTitle(num)
{
var storyTitle = $('#story' + num).find('option:selected').text();
startPosition = storyTitle.indexOf(':') + 1;
endPosition = storyTitle.lastIndexOf('[');
storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
$('#story' + num).parent().next().find('input:first').val(storyTitle);
}
/* Set the story module. */
function setStoryRelated(num)
{
var storyID = $('#story' + num).val();
if(storyID)
{
var link = createLink('story', 'ajaxGetModule', 'storyID=' + storyID);
$.get(link, function(moduleID)
{
$('#module' + num).val(moduleID);
});
}
}