Fixed order of tasks in selections with ajax loaded data
This commit is contained in:
parent
0ea7ec6acf
commit
b2fdbde020
3 changed files with 3 additions and 4 deletions
|
@ -41,4 +41,3 @@ function stormtask_organization_project_tasks(_organization_select, _project_sel
|
||||||
var _organization_select_id = $(_organization_select).attr('id');
|
var _organization_select_id = $(_organization_select).attr('id');
|
||||||
stormtask_project_tasks(_organization_select_id, project_select, _task_select_id, _assign_select_id, _with_all_option, _all_text);
|
stormtask_project_tasks(_organization_select_id, project_select, _task_select_id, _assign_select_id, _with_all_option, _all_text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1063,7 +1063,8 @@ function _stormtask_get_tree($project_nid, $parent_nid = 0, $depth = -1, $max_de
|
||||||
function _stormtask_plain_tree($tree) {
|
function _stormtask_plain_tree($tree) {
|
||||||
$rows = array();
|
$rows = array();
|
||||||
foreach ($tree as $item) {
|
foreach ($tree as $item) {
|
||||||
$nid = $item->nid;
|
// Using the space character to preserve the order of tree elements:
|
||||||
|
$nid = " $item->nid";
|
||||||
$title = htmlspecialchars_decode(check_plain($item->title));
|
$title = htmlspecialchars_decode(check_plain($item->title));
|
||||||
if ($item->stepno) $title = check_plain($item->stepno) .' '. $title;
|
if ($item->stepno) $title = check_plain($item->stepno) .' '. $title;
|
||||||
if ($nid) $rows[$nid] = str_repeat('--', $item->depth) .' '. $title;
|
if ($nid) $rows[$nid] = str_repeat('--', $item->depth) .' '. $title;
|
||||||
|
|
|
@ -17,7 +17,7 @@ function stormticket_task_tickets(_task_select, _organization_select_id, _projec
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
async: true,
|
async: true,
|
||||||
url: Drupal.settings.storm.task_tickets_url + Drupal.encodeURIComponent(organization_nid) +
|
url: Drupal.settings.storm.task_tickets_url + Drupal.encodeURIComponent(organization_nid) +
|
||||||
'/' + Drupal.encodeURIComponent(project_nid) +
|
'/' + Drupal.encodeURIComponent(project_nid) +
|
||||||
'/' + Drupal.encodeURIComponent(task_nid),
|
'/' + Drupal.encodeURIComponent(task_nid),
|
||||||
dataType: "string",
|
dataType: "string",
|
||||||
|
@ -39,4 +39,3 @@ function stormticket_organization_project_task_tickets(_organization_select, _pr
|
||||||
var project_select = $("#" + _project_select_id).get(0);
|
var project_select = $("#" + _project_select_id).get(0);
|
||||||
stormticket_project_task_tickets(project_select, _organization_select.id, _task_select_id, _ticket_select_id, _with_all_option, _all_text);
|
stormticket_project_task_tickets(project_select, _organization_select.id, _task_select_id, _ticket_select_id, _with_all_option, _all_text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Reference in a new issue