diff --git a/Adaptation/FileHandlers/json/StaticSite/js/122508.js b/Adaptation/FileHandlers/json/StaticSite/js/122508.js index 50db9b7..b1ca524 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/122508.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/122508.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,26 +115,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/122514.js b/Adaptation/FileHandlers/json/StaticSite/js/122514.js index 50db9b7..b1ca524 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/122514.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/122514.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,26 +115,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/122517.js b/Adaptation/FileHandlers/json/StaticSite/js/122517.js index 50db9b7..b1ca524 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/122517.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/122517.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,26 +115,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/123066.js b/Adaptation/FileHandlers/json/StaticSite/js/123066.js index 50db9b7..b1ca524 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/123066.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/123066.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,26 +115,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/123067.js b/Adaptation/FileHandlers/json/StaticSite/js/123067.js index 50db9b7..b1ca524 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/123067.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/123067.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,26 +115,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/126169.js b/Adaptation/FileHandlers/json/StaticSite/js/126169.js index 50db9b7..b1ca524 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/126169.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/126169.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,26 +115,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/business.js b/Adaptation/FileHandlers/json/StaticSite/js/business.js index 657bbd3..185040f 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/business.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/business.js @@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) { 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 workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (parent === null) { - 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"]); - var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]); - workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]); - workItem["Priority"] = priority; - workItems.push(workItem); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordParent(parent, workItem); + updateRecordOther(workItem, dataB, description); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } 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 html = "Parent IdParent TitleIdRequesterTitleAssigned ToSystem(s)StateValueUpDownPoll Value" + th + ""; const element = document.getElementById("HeaderGrid"); @@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) { updateSite(); $.getJSON(urlB, { _: new Date().getTime() }, function (dataB) { $.getJSON(url, { _: new Date().getTime() }, function (data) { - var workItems = getWorkItems(data, dataB, description); + var records = getRecords(data, dataB, description); console.log(data.length); if (data.length > 0) console.log(data[0]); - setWorkItems(workItems, page, description, th); + setRecords(records, page, description, th); $(".up,.down").click(function () { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/effort.js b/Adaptation/FileHandlers/json/StaticSite/js/effort.js index 224523e..d161829 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/effort.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/effort.js @@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) { 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 workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (parent === null) { - 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"]); - var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]); - workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]); - workItem["Priority"] = priority; - workItems.push(workItem); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordParent(parent, workItem); + updateRecordOther(workItem, dataB, description); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } 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 html = "Parent IdParent TitleIdRequesterTitleAssigned ToSystem(s)StateValueUpDownPoll Value" + th + ""; const element = document.getElementById("HeaderGrid"); @@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) { updateSite(); $.getJSON(urlB, { _: new Date().getTime() }, function (dataB) { $.getJSON(url, { _: new Date().getTime() }, function (data) { - var workItems = getWorkItems(data, dataB, description); + var records = getRecords(data, dataB, description); console.log(data.length); if (data.length > 0) console.log(data[0]); - setWorkItems(workItems, page, description, th); + setRecords(records, page, description, th); $(".up,.down").click(function () { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/leo.js b/Adaptation/FileHandlers/json/StaticSite/js/leo.js index 1eb46be..866e401 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/leo.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/leo.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -90,26 +117,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/mes.js b/Adaptation/FileHandlers/json/StaticSite/js/mes.js index 1eb46be..866e401 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/mes.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/mes.js @@ -77,10 +77,37 @@ function getPriority(workItemType, priority) { 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) { var parent; var workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -90,26 +117,14 @@ function getRecords(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["RiskReductionMinusOpportunityEnablement"] === null || workItem["TimeCriticality"] === null || workItem["BusinessValue"] === null) - workItem["CoD"] === 0; - else - workItem["CoD"] === workItem["RiskReductionMinusOpportunityEnablement"] + workItem["TimeCriticality"] + workItem["BusinessValue"]; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/risk.js b/Adaptation/FileHandlers/json/StaticSite/js/risk.js index 9484df9..9a2b7f1 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/risk.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/risk.js @@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) { 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 workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (parent === null) { - 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"]); - var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]); - workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]); - workItem["Priority"] = priority; - workItems.push(workItem); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordParent(parent, workItem); + updateRecordOther(workItem, dataB, description); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } 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 html = "Parent IdParent TitleIdRequesterTitleAssigned ToSystem(s)StateValueUpDownPoll Value" + th + ""; const element = document.getElementById("HeaderGrid"); @@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) { updateSite(); $.getJSON(urlB, { _: new Date().getTime() }, function (dataB) { $.getJSON(url, { _: new Date().getTime() }, function (data) { - var workItems = getWorkItems(data, dataB, description); + var records = getRecords(data, dataB, description); console.log(data.length); if (data.length > 0) console.log(data[0]); - setWorkItems(workItems, page, description, th); + setRecords(records, page, description, th); $(".up,.down").click(function () { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/time.js b/Adaptation/FileHandlers/json/StaticSite/js/time.js index 3c78bc5..76a195f 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/time.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/time.js @@ -111,10 +111,39 @@ function getPollValue(description, priority, priorityDisplay, pollValue) { 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 workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -126,24 +155,14 @@ function getWorkItems(data, dataB, description) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (parent === null) { - 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"]); - var priority = getPriority(workItem["WorkItemType"], workItem["Priority"]); - workItem["PollValue"] = getPollValue(description, workItem["Priority"], priority, dataB[workItem.Id]); - workItem["Priority"] = priority; - workItems.push(workItem); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordParent(parent, workItem); + updateRecordOther(workItem, dataB, description); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } 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 html = "Parent IdParent TitleIdRequesterTitleAssigned ToSystem(s)StateValueUpDownPoll Value" + th + ""; const element = document.getElementById("HeaderGrid"); @@ -208,11 +227,11 @@ function initIndex(url, apiUrl, page, description, th, urlB) { updateSite(); $.getJSON(urlB, { _: new Date().getTime() }, function (dataB) { $.getJSON(url, { _: new Date().getTime() }, function (data) { - var workItems = getWorkItems(data, dataB, description); + var records = getRecords(data, dataB, description); console.log(data.length); if (data.length > 0) console.log(data[0]); - setWorkItems(workItems, page, description, th); + setRecords(records, page, description, th); $(".up,.down").click(function () { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { diff --git a/Adaptation/FileHandlers/json/StaticSite/js/with-parents.js b/Adaptation/FileHandlers/json/StaticSite/js/with-parents.js index e44922e..77bc395 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/with-parents.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/with-parents.js @@ -1,5 +1,9 @@ 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) { @@ -73,10 +77,37 @@ function getPriority(workItemType, priority) { 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 workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -86,22 +117,14 @@ function getWorkItems(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (parent === null) { - workItem["ParentId"] = null; - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } function updateSite() { @@ -122,13 +145,13 @@ function updateSite() { function initIndex(url) { updateSite(); $.getJSON(url, { _: new Date().getTime() }, function (data) { - var workItems = getWorkItems(data); + var records = getRecords(data); console.log(data.length); if (data.length > 0) console.log(data[0]); $("#HeaderGrid").igGrid({ autoGenerateColumns: false, - dataSource: workItems, + dataSource: records, height: "100%", primaryKey: "Id", width: "100%", diff --git a/Adaptation/FileHandlers/json/StaticSite/js/wsjf.js b/Adaptation/FileHandlers/json/StaticSite/js/wsjf.js index 38a91ff..3edb7a9 100644 --- a/Adaptation/FileHandlers/json/StaticSite/js/wsjf.js +++ b/Adaptation/FileHandlers/json/StaticSite/js/wsjf.js @@ -75,10 +75,42 @@ function getPriority(workItemType, priority) { 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 workItem; - var workItems = []; + var records = []; for (var i = 0; i < data.length; i++) { parent = data[i].Parent; workItem = data[i].WorkItem; @@ -88,27 +120,18 @@ function getWorkItems(data) { continue; if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES')) continue; - if (workItem["WeightedShortestJobFirst"] === null) - workItem["WeightedShortestJobFirst"] = 9999999; - if (parent === null) { - 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); + updateRecordCoD(parent); + updateRecordCoD(workItem); + updateRecordWSJF(workItem); + updateRecordOther(workItem); + updateRecordParent(parent, workItem); + records.push(workItem); } - workItems.sort(compareFunction); - return workItems; + records.sort(compareFunction); + return records; } -function setWorkItems(workItems) { +function setRecords(workItems) { var record; var html = "Parent IdParent TitleIdRequesterTitleAssigned ToSystem(s)WSJFValueUpDown"; const element = document.getElementById("HeaderGrid"); @@ -147,11 +170,11 @@ function initIndex(url, apiUrl) { _apiUrl = apiUrl; updateSite(); $.getJSON(url, { _: new Date().getTime() }, function (data) { - var workItems = getWorkItems(data); + var records = getRecords(data); console.log(data.length); if (data.length > 0) console.log(data[0]); - setWorkItems(workItems); + setRecords(records); $(".up,.down").click(function () { var row = $(this).parents("tr:first"); if ($(this).is(".up")) {