Skip to content
Snippets Groups Projects
Commit d9d2c1ad authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

fix salesproject phase stepper

parent 44a7a9fe
No related branches found
No related tags found
No related merge requests found
......@@ -6,19 +6,31 @@ import("system.result");
import("system.vars");
var steps = KeywordUtils.getEntryNamesAndIdsByContainer($KeywordRegistry.salesprojectPhase());
var selection = vars.get("$sys.selection");
var ids = vars.get("$local.idvalues");
var selected = vars.exists("$param.CurrentPhase_param") && vars.get("$param.CurrentPhase_param");
// filter only for steps reqested by the system
if (ids)
{
steps = steps.filter(function(pStep)
{
for (let i = 0; i < ids.length; i++)
{
if (ids[i] == pStep[0])
return true
}
return false
})
}
var res = [];
steps.forEach(function ([stepId, title])
{
if (selection.length > 0)
res.push([stepId, selection.indexOf(stepId) > -1 ? "ACTIVE" : "EDITABLE", title, _getIcon(stepId)]);
if (ids)
res.push([stepId, ids.indexOf(stepId) > -1 ? "ACTIVE" : "EDITABLE", title, _getIcon(stepId)]);
else
res.push([stepId, stepId === selected ? "ACTIVE" : "EDITABLE", title, _getIcon(stepId)]);
});
result.object(res);
function _getIcon (pPhase)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment