* [refac bug #58590] Set story picker box.
This commit is contained in:
@@ -25,7 +25,7 @@ window.renderRowData = function($row, index, row)
|
||||
|
||||
const taskUsers = [];
|
||||
let disabled = false;
|
||||
let $assignedTo = $row.find('.form-batch-input[data-name="assignedTo"]').empty();
|
||||
$row.find('.form-batch-input[data-name="assignedTo"]').empty();
|
||||
if(teams[row.id] != undefined && ((row.assignedTo != currentUser && row.mode == 'linear') || taskMembers[currentUser] == undefined))
|
||||
{
|
||||
disabled = true;
|
||||
@@ -45,9 +45,7 @@ window.renderRowData = function($row, index, row)
|
||||
{
|
||||
$row.find('[data-name="status"]').find('.picker-box').on('inited', function(e, info)
|
||||
{
|
||||
let $options = info[0].options;
|
||||
$options.items.splice(4, 1);
|
||||
info[0].render({items: $options});
|
||||
info[0].render({items: noPauseStatusList});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,10 +69,22 @@ window.renderRowData = function($row, index, row)
|
||||
|
||||
$row.find('[data-name="story"]').find('.picker-box').on('inited', function(e, info)
|
||||
{
|
||||
const storyItems = stories[row.module] != undefined ? stories[row.module] : [];
|
||||
const $storyPicker = info[0];
|
||||
$storyPicker.render({items: storyItems});
|
||||
$storyPicker.$.setValue(row.story);
|
||||
if(stories.length > 0)
|
||||
{
|
||||
const storyItems = stories[row.module] != undefined ? stories[row.module] : [];
|
||||
$storyPicker.render({items: storyItems});
|
||||
$storyPicker.$.setValue(row.story);
|
||||
}
|
||||
else
|
||||
{
|
||||
const getStoryLink = $.createLink('task', 'ajaxGetStories', 'executionID=' + row.execution + '&moduleID=' + row.module);
|
||||
$.getJSON(getStoryLink, function(executionStories)
|
||||
{
|
||||
$storyPicker.render({items: executionStories});
|
||||
$storyPicker.$.setValue(row.story);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,13 @@ declare(strict_types=1);
|
||||
namespace zin;
|
||||
/* ====== Preparing and processing page data ====== */
|
||||
|
||||
$noPauseStatusList = array();
|
||||
foreach($lang->task->statusList as $status => $label)
|
||||
{
|
||||
if ($status == 'pause') continue;
|
||||
$noPauseStatusList[] = array('text' => $label, 'value' => $status, 'key' => $label);
|
||||
}
|
||||
|
||||
/* zin: Set variables to define picker options for form. */
|
||||
jsVar('executionTeams', $executionTeams);
|
||||
jsVar('users', $users);
|
||||
@@ -21,6 +28,7 @@ jsVar('executionID', $executionID);
|
||||
jsVar('childTasks', $childTasks);
|
||||
jsVar('nonStoryChildTasks', $nonStoryChildTasks);
|
||||
jsVar('tasks', $tasks);
|
||||
jsVar('noPauseStatusList', $noPauseStatusList);
|
||||
jsVar('stories', $stories);
|
||||
jsVar('syncStoryToChildrenTip', $lang->task->syncStoryToChildrenTip);
|
||||
jsVar('parentTasks', $parentTasks);
|
||||
|
||||
Reference in New Issue
Block a user