Ver código fonte

Allowing multiple comma separated states to be visible to roles for Forms

Andrej Studen 1 ano atrás
pai
commit
3ba5fb1c71
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      web/crfTecant/formPortal.js

+ 6 - 2
web/crfTecant/formPortal.js

@@ -215,9 +215,13 @@ function(entry,filter,settings){
    if (entry.FormStatus!=filter.formStatus){
       //check for additionalStates
       let addStates=filter.additionalVisibilityStates[filter.role];
-      this.print(fName+' addState['+filter.role+'] '+addStates);
+      this.print(fName+' addState['+filter.role+'/'+entry.FormStatus+'] '+addStates);
       if (!addStates) return false;
-      if (entry.FormStatus!=addStates) return false;
+      let ar=addStates.split(',');
+      this.print(fName+" ar "+ar.length);
+      let v=String(entry.FormStatus);
+      if (!(ar.includes(v))) return false;
+      this.print(fName+" allowed for state "+entry.FormStatus);
 
    }