ParentCoD
This commit is contained in:
parent
326bd1ea73
commit
1131479245
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,26 +115,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,26 +115,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,26 +115,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,26 +115,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,26 +115,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,26 +115,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkItems(data, dataB, description) {
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem, dataB, description) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
||||||
|
workItem["Priority"] = priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecords(data, dataB, description) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (parent === null) {
|
updateRecordCoD(parent);
|
||||||
workItem["ParentId"] = 9999999;
|
updateRecordCoD(workItem);
|
||||||
workItem["ParentTitle"] = null;
|
updateRecordParent(parent, workItem);
|
||||||
workItem["ParentState"] = null;
|
updateRecordOther(workItem, dataB, description);
|
||||||
}
|
records.push(workItem);
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"]);
|
|
||||||
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
|
||||||
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
|
||||||
workItem["Priority"] = priority;
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendValue(element, page, id) {
|
function sendValue(element, page, id) {
|
||||||
@ -157,7 +176,7 @@ function sendValue(element, page, id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWorkItems(workItems, page, description, th) {
|
function setRecords(workItems, page, description, th) {
|
||||||
var record;
|
var record;
|
||||||
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
||||||
const element = document.getElementById("HeaderGrid");
|
const element = document.getElementById("HeaderGrid");
|
||||||
@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) {
|
|||||||
updateSite();
|
updateSite();
|
||||||
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
||||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||||
var workItems = getWorkItems(data, dataB, description);
|
var records = getRecords(data, dataB, description);
|
||||||
console.log(data.length);
|
console.log(data.length);
|
||||||
if (data.length > 0)
|
if (data.length > 0)
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
setWorkItems(workItems, page, description, th);
|
setRecords(records, page, description, th);
|
||||||
$(".up,.down").click(function () {
|
$(".up,.down").click(function () {
|
||||||
var row = $(this).parents("tr:first");
|
var row = $(this).parents("tr:first");
|
||||||
if ($(this).is(".up")) {
|
if ($(this).is(".up")) {
|
||||||
|
@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkItems(data, dataB, description) {
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem, dataB, description) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
||||||
|
workItem["Priority"] = priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecords(data, dataB, description) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (parent === null) {
|
updateRecordCoD(parent);
|
||||||
workItem["ParentId"] = 9999999;
|
updateRecordCoD(workItem);
|
||||||
workItem["ParentTitle"] = null;
|
updateRecordParent(parent, workItem);
|
||||||
workItem["ParentState"] = null;
|
updateRecordOther(workItem, dataB, description);
|
||||||
}
|
records.push(workItem);
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"]);
|
|
||||||
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
|
||||||
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
|
||||||
workItem["Priority"] = priority;
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendValue(element, page, id) {
|
function sendValue(element, page, id) {
|
||||||
@ -157,7 +176,7 @@ function sendValue(element, page, id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWorkItems(workItems, page, description, th) {
|
function setRecords(workItems, page, description, th) {
|
||||||
var record;
|
var record;
|
||||||
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
||||||
const element = document.getElementById("HeaderGrid");
|
const element = document.getElementById("HeaderGrid");
|
||||||
@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) {
|
|||||||
updateSite();
|
updateSite();
|
||||||
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
||||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||||
var workItems = getWorkItems(data, dataB, description);
|
var records = getRecords(data, dataB, description);
|
||||||
console.log(data.length);
|
console.log(data.length);
|
||||||
if (data.length > 0)
|
if (data.length > 0)
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
setWorkItems(workItems, page, description, th);
|
setRecords(records, page, description, th);
|
||||||
$(".up,.down").click(function () {
|
$(".up,.down").click(function () {
|
||||||
var row = $(this).parents("tr:first");
|
var row = $(this).parents("tr:first");
|
||||||
if ($(this).is(".up")) {
|
if ($(this).is(".up")) {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -90,26 +117,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -77,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getRecords(data) {
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -90,26 +117,14 @@ function getRecords(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["CoD"] === 0;
|
updateRecordCoD(workItem);
|
||||||
else
|
updateRecordOther(workItem);
|
||||||
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
updateRecordParent(parent, workItem);
|
||||||
if (parent === null) {
|
records.push(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
|
||||||
workItem["ParentTitle"] = null;
|
|
||||||
workItem["ParentState"] = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
|
@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkItems(data, dataB, description) {
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem, dataB, description) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
||||||
|
workItem["Priority"] = priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecords(data, dataB, description) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (parent === null) {
|
updateRecordCoD(parent);
|
||||||
workItem["ParentId"] = 9999999;
|
updateRecordCoD(workItem);
|
||||||
workItem["ParentTitle"] = null;
|
updateRecordParent(parent, workItem);
|
||||||
workItem["ParentState"] = null;
|
updateRecordOther(workItem, dataB, description);
|
||||||
}
|
records.push(workItem);
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"]);
|
|
||||||
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
|
||||||
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
|
||||||
workItem["Priority"] = priority;
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendValue(element, page, id) {
|
function sendValue(element, page, id) {
|
||||||
@ -157,7 +176,7 @@ function sendValue(element, page, id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWorkItems(workItems, page, description, th) {
|
function setRecords(workItems, page, description, th) {
|
||||||
var record;
|
var record;
|
||||||
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
||||||
const element = document.getElementById("HeaderGrid");
|
const element = document.getElementById("HeaderGrid");
|
||||||
@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) {
|
|||||||
updateSite();
|
updateSite();
|
||||||
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
||||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||||
var workItems = getWorkItems(data, dataB, description);
|
var records = getRecords(data, dataB, description);
|
||||||
console.log(data.length);
|
console.log(data.length);
|
||||||
if (data.length > 0)
|
if (data.length > 0)
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
setWorkItems(workItems, page, description, th);
|
setRecords(records, page, description, th);
|
||||||
$(".up,.down").click(function () {
|
$(".up,.down").click(function () {
|
||||||
var row = $(this).parents("tr:first");
|
var row = $(this).parents("tr:first");
|
||||||
if ($(this).is(".up")) {
|
if ($(this).is(".up")) {
|
||||||
|
@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkItems(data, dataB, description) {
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem, dataB, description) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
||||||
|
workItem["Priority"] = priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecords(data, dataB, description) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (parent === null) {
|
updateRecordCoD(parent);
|
||||||
workItem["ParentId"] = 9999999;
|
updateRecordCoD(workItem);
|
||||||
workItem["ParentTitle"] = null;
|
updateRecordParent(parent, workItem);
|
||||||
workItem["ParentState"] = null;
|
updateRecordOther(workItem, dataB, description);
|
||||||
}
|
records.push(workItem);
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"]);
|
|
||||||
var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
|
||||||
workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]);
|
|
||||||
workItem["Priority"] = priority;
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendValue(element, page, id) {
|
function sendValue(element, page, id) {
|
||||||
@ -157,7 +176,7 @@ function sendValue(element, page, id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWorkItems(workItems, page, description, th) {
|
function setRecords(workItems, page, description, th) {
|
||||||
var record;
|
var record;
|
||||||
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>State</th><th>Value</th><th>Up</th><th>Down</th><th>Poll Value</th><th>" + th + "</th></tr>";
|
||||||
const element = document.getElementById("HeaderGrid");
|
const element = document.getElementById("HeaderGrid");
|
||||||
@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) {
|
|||||||
updateSite();
|
updateSite();
|
||||||
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
$.getJSON(urlB, { _: new Date().getTime() }, function (dataB) {
|
||||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||||
var workItems = getWorkItems(data, dataB, description);
|
var records = getRecords(data, dataB, description);
|
||||||
console.log(data.length);
|
console.log(data.length);
|
||||||
if (data.length > 0)
|
if (data.length > 0)
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
setWorkItems(workItems, page, description, th);
|
setRecords(records, page, description, th);
|
||||||
$(".up,.down").click(function () {
|
$(".up,.down").click(function () {
|
||||||
var row = $(this).parents("tr:first");
|
var row = $(this).parents("tr:first");
|
||||||
if ($(this).is(".up")) {
|
if ($(this).is(".up")) {
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
function compareFunction(a, b) {
|
function compareFunction(a, b) {
|
||||||
return b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
|
if (a.ParentCoD === null || b.ParentCoD === null) {
|
||||||
|
return b.ParentCoD - a.ParentCoD || b.Id - a.Id;
|
||||||
|
} else {
|
||||||
|
return b.State[0] - a.State[0] || b.ParentId - a.ParentId || a.Id - b.Id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showOne(rowData) {
|
function showOne(rowData) {
|
||||||
@ -73,10 +77,37 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkItems(data) {
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -86,22 +117,14 @@ function getWorkItems(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (parent === null) {
|
updateRecordCoD(parent);
|
||||||
workItem["ParentId"] = null;
|
updateRecordCoD(workItem);
|
||||||
workItem["ParentTitle"] = null;
|
updateRecordOther(workItem);
|
||||||
workItem["ParentState"] = null;
|
updateRecordParent(parent, workItem);
|
||||||
}
|
records.push(workItem);
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSite() {
|
function updateSite() {
|
||||||
@ -122,13 +145,13 @@ function updateSite() {
|
|||||||
function initIndex(url) {
|
function initIndex(url) {
|
||||||
updateSite();
|
updateSite();
|
||||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||||
var workItems = getWorkItems(data);
|
var records = getRecords(data);
|
||||||
console.log(data.length);
|
console.log(data.length);
|
||||||
if (data.length > 0)
|
if (data.length > 0)
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
$("#HeaderGrid").igGrid({
|
$("#HeaderGrid").igGrid({
|
||||||
autoGenerateColumns: false,
|
autoGenerateColumns: false,
|
||||||
dataSource: workItems,
|
dataSource: records,
|
||||||
height: "100%",
|
height: "100%",
|
||||||
primaryKey: "Id",
|
primaryKey: "Id",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
@ -75,10 +75,42 @@ function getPriority(workItemType, priority) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkItems(data) {
|
function updateRecordCoD(workItem) {
|
||||||
|
if (workItem === null || workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null)
|
||||||
|
workItem["CoD"] === 0;
|
||||||
|
else
|
||||||
|
workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"];
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordWSJF(workItem) {
|
||||||
|
if (workItem["WeightedShortestJobFirst"] === null)
|
||||||
|
workItem["WeightedShortestJobFirst"] = 9999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordOther(workItem) {
|
||||||
|
workItem["State"] = getState(workItem["State"]);
|
||||||
|
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRecordParent(parent, workItem) {
|
||||||
|
if (parent === null) {
|
||||||
|
workItem["ParentId"] = 9999999;
|
||||||
|
workItem["ParentTitle"] = null;
|
||||||
|
workItem["ParentState"] = null;
|
||||||
|
workItem["ParentCoD"] = 9999999;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
workItem["ParentId"] = parent["Id"];
|
||||||
|
workItem["ParentCoD"] = parent["CoD"];
|
||||||
|
workItem["ParentTitle"] = parent["Title"];
|
||||||
|
workItem["ParentState"] = getState(parent["State"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecords(data) {
|
||||||
var parent;
|
var parent;
|
||||||
var workItem;
|
var workItem;
|
||||||
var workItems = [];
|
var records = [];
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
parent = data[i].Parent;
|
parent = data[i].Parent;
|
||||||
workItem = data[i].WorkItem;
|
workItem = data[i].WorkItem;
|
||||||
@ -88,27 +120,18 @@ function getWorkItems(data) {
|
|||||||
continue;
|
continue;
|
||||||
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
|
||||||
continue;
|
continue;
|
||||||
if (workItem["WeightedShortestJobFirst"] === null)
|
updateRecordCoD(parent);
|
||||||
workItem["WeightedShortestJobFirst"] = 9999999;
|
updateRecordCoD(workItem);
|
||||||
if (parent === null) {
|
updateRecordWSJF(workItem);
|
||||||
workItem["ParentId"] = 9999999;
|
updateRecordOther(workItem);
|
||||||
workItem["ParentTitle"] = null;
|
updateRecordParent(parent, workItem);
|
||||||
workItem["ParentState"] = null;
|
records.push(workItem);
|
||||||
}
|
|
||||||
else {
|
|
||||||
workItem["ParentId"] = parent["Id"];
|
|
||||||
workItem["ParentTitle"] = parent["Title"];
|
|
||||||
workItem["ParentState"] = getState(parent["State"]);
|
|
||||||
}
|
|
||||||
workItem["State"] = getState(workItem["State"])
|
|
||||||
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
|
|
||||||
workItems.push(workItem);
|
|
||||||
}
|
}
|
||||||
workItems.sort(compareFunction);
|
records.sort(compareFunction);
|
||||||
return workItems;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWorkItems(workItems) {
|
function setRecords(workItems) {
|
||||||
var record;
|
var record;
|
||||||
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>WSJF</th><th>Value</th><th>Up</th><th>Down</th></tr>";
|
var html = "<tr><th>Parent Id</th><th>Parent Title</th><th>Id</th><th>Requester</th><th>Title</th><th>Assigned To</th><th>System(s)</th><th>WSJF</th><th>Value</th><th>Up</th><th>Down</th></tr>";
|
||||||
const element = document.getElementById("HeaderGrid");
|
const element = document.getElementById("HeaderGrid");
|
||||||
@ -147,11 +170,11 @@ function initIndex(url, apiUrl) {
|
|||||||
_apiUrl = apiUrl;
|
_apiUrl = apiUrl;
|
||||||
updateSite();
|
updateSite();
|
||||||
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
$.getJSON(url, { _: new Date().getTime() }, function (data) {
|
||||||
var workItems = getWorkItems(data);
|
var records = getRecords(data);
|
||||||
console.log(data.length);
|
console.log(data.length);
|
||||||
if (data.length > 0)
|
if (data.length > 0)
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
setWorkItems(workItems);
|
setRecords(records);
|
||||||
$(".up,.down").click(function () {
|
$(".up,.down").click(function () {
|
||||||
var row = $(this).parents("tr:first");
|
var row = $(this).parents("tr:first");
|
||||||
if ($(this).is(".up")) {
|
if ($(this).is(".up")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user