window.getItem = function(info)
{
const col = info.col;
const color = info.item.color ? " style='color:" + info.item.color + "'" : '';
const title = info.item.title;
let titleHtml = `${title}`;
info.item.content = [];
if(col.indexOf('demand') != -1 || col.indexOf('epic') != -1 || col.indexOf('requirement') != -1 || col.indexOf('story') != -1)
{
let storyPriList = langStoryPriList[info.item.storyType];
let storyPri = storyPriList[info.item.pri] === undefined ? '' : storyPriList[info.item.pri];;
let storyStatusList = langStoryStatusList[info.item.storyType];
let storyStageList = langStoryStageList[info.item.storyType];
if(privs[info.item.storyType]) titleHtml = "" + title + "";
info.item.title = {html: `
${storyPri} ${titleHtml}
`}
info.item.titleAttrs = {'title' : title};
if(storyStatusList[info.item.status]) info.item.content.push({html: `${storyStatusList[info.item.status]}
`});
info.item.content.push({html: `${storyStageList[info.item.stage]}
`})
}
else if(col == 'project' || col == 'execution')
{
let delayHtml = '';
if(info.item.delay > 0) delayHtml = `${langProjectStatusList['delay']}`;
titleHtml = `${title}`;
if(col == 'project' && privs['project']) titleHtml = "" + title + "";
if(col == 'execution' && privs['execution']) titleHtml = "" + title + "";
info.item.title = [];
info.item.title.push({html: `${titleHtml}
`});
info.item.title.push({html: `${delayHtml}
`, 'class': 'delayBox gap-x-2'});
info.item.titleAttrs = {'title' : title, 'class': 'card-title flex'};
info.item.content.push({html: `${langProjectStatusList[info.item.status]}
`});
info.item.content.push({component: 'ProgressCircle', props: {percent: info.item.progress, size: 24}});
}
else if(col == 'task')
{
if(privs['task']) titleHtml = "" + title + "";
info.item.title = {html: `${langTaskPriList[info.item.pri]} ${titleHtml}
`}
info.item.titleAttrs = {'title' : title};
if(info.item.parent == '-1') info.item.content.push({html: `${langChildren} `});
info.item.content.push({html: `${langTaskStatusList[info.item.status]}
`});
if(info.item.assignedTo) info.item.content.push({html: " " + (users[info.item.assignedTo] ? users[info.item.assignedTo] : info.item.assignedTo)});
info.item.content.push({component: 'ProgressCircle', props: {percent: info.item.progress, size: 24}});
}
else if(col == 'bug')
{
if(privs['bug']) titleHtml = "" + title + "";
info.item.title = {html: `${langBugPriList[info.item.pri]} ${titleHtml}
`}
info.item.titleAttrs = {'title' : title};
severity = info.item.severity;
severityHtml = ``;
if(!langBugSeverityList[severity] || langBugSeverityList[severity] != severity) severityHtml = `${langBugSeverityList[severity]}
`;
info.item.content.push({html: severityHtml});
if(info.item.assignedTo) info.item.content.push({html: " " + (users[info.item.assignedTo] ? users[info.item.assignedTo] : info.item.assignedTo)});
}
else if(col == 'case')
{
if(privs['case']) titleHtml = "" + title + "";
info.item.title = {html: `${langCasePriList[info.item.pri]} ${titleHtml}
`}
info.item.titleAttrs = {'title' : title};
info.item.content.push({html: "" + (langCaseResultList[info.item.lastRunResult] ? langCaseResultList[info.item.lastRunResult] : langUnexecuted) + "
"});
info.item.content.push({html: (users[info.item.lastRunner] ? users[info.item.lastRunner] : info.item.lastRunner)});
}
else if(col == 'design')
{
info.item.titleAttrs = {'class': 'line-clamp-3', 'title' : title};
if(privs['design'])
{
info.item.titleUrl = $.createLink('design', 'view', `id=${info.item.id}`);
info.item.titleAttrs = {'class': 'line-clamp-3', 'title' : title, 'data-toggle': 'modal', 'data-size': 'lg'};
}
}
else if(col == 'commit')
{
if(privs['commit']) info.item.titleUrl = $.createLink('repo', 'revision', `repoID=${info.item.repo}&objectID=0&revision=${info.item.revision}`);
info.item.titleAttrs = {'class': 'line-clamp-3', 'title' : title};
}
}
window.getLaneCol = function(lane, col)
{
if(mergeCells[lane.name])
{
if(mergeCells[lane.name][col.name]) return {laneColClass: 'lane-col-join-with-above'};
return {laneColClass: 'lane-col-shrink-with-above'};
}
}
window.itemRender = function(info)
{
const col = info.col;
if(col == 'task')
{
if(info.item.parent > '0') info.item.className.push('hidden childTask parent-' + info.item.parent);
if(info.item.parent == '-1') info.item.className.push('parentTask');
}
}
window.toggleChildren = function(obj, parentID)
{
if($(obj).hasClass('is-expanded'))
{
$(obj).removeClass('is-expanded').addClass('is-collapsed');
$('.parent-' + parentID).addClass('hidden')
}
else
{
$(obj).removeClass('is-collapsed').addClass('is-expanded');
$('.parent-' + parentID).removeClass('hidden')
}
}