* code for task#1665.

This commit is contained in:
xia0ta0
2013-08-02 08:57:23 +08:00
parent 7ed9556bda
commit c97dd391ac
4 changed files with 47 additions and 5 deletions
+16 -3
View File
@@ -69,10 +69,23 @@ function setAfter()
}
}
/* Get select of stories.*/
function setStories(moduleID, projectID, productID)
/**
* load stories of module.
*
* @access public
* @return void
*/
function loadModuleRelated()
{
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + productID + '&moduleID=' + moduleID);
moduleID = $('#module').val();
projectID = $('#project').val();
setStories(moduleID, projectID);
}
/* Get select of stories.*/
function setStories(moduleID, projectID)
{
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=0&moduleID=' + moduleID);
$.get(link, function(stories)
{
if(!stories) stories = '<select id="story" name="story"></select>';
+29
View File
@@ -66,3 +66,32 @@ function loadProjectMembers(projectID)
link = createLink('project', 'ajaxGetMembers', 'projectID=' + projectID);
$('#assignedToIdBox').load(link);
}
/**
* load stories of module.
*
* @access public
* @return void
*/
function loadModuleRelated()
{
moduleID = $('#module').val();
projectID = $('#project').val();
setStories(moduleID, projectID);
}
/* Get select of stories.*/
function setStories(moduleID, projectID)
{
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=0&moduleID=' + moduleID);
$.get(link, function(stories)
{
if(!stories) stories = '<select id="story" name="story"></select>';
$('#story').replaceWith(stories);
$('#story_chzn').remove();
$("#story").chosen({no_results_text: ''});
});
}
/* empty function. */
function setPreview(){}
+1 -1
View File
@@ -33,7 +33,7 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->task->module;?></th>
<td><span id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $task->module, "class='select-3' onchange='setStories(this.value,$project->id,0)'");?></span></td>
<td><span id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $task->module, "class='select-3' onchange='setStories(this.value,$project->id)'");?></span></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->task->assignedTo;?></th>
+1 -1
View File
@@ -57,7 +57,7 @@
</tr>
<tr>
<th class='rowhead w-p20'><?php echo $lang->task->module;?></th>
<td><span id="moduleIdBox"><?php echo html::select('module', $modules, $task->module, 'class="select-1"');?></span></td>
<td><span id="moduleIdBox"><?php echo html::select('module', $modules, $task->module, 'class="select-1" onchange="loadModuleRelated()"');?></span></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->task->story;?></th>