Explorar el Código

Drive availability of empty squares that allow creation of new forms based on unique property of Forms list

Andrej Studen hace 1 año
padre
commit
1e5ee12e07
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      web/crf/formPortalNew.js

+ 5 - 2
web/crf/formPortalNew.js

@@ -218,10 +218,13 @@ function(el,formList,roleAndSite,formId=null,idLabel=null){
          crfHTML.createParagraph(text[j],null,fbox);
       }
    }
-   if (n>0) return table;
    if (!formId) return table;
+   let formEntry=crfSetup.getEntryMap('dataForms')[formId];
+   this.print(fName+' unique '+formEntry['unique']);
 
-   //always add empty form
+   if (n>0 && formEntry['unique']=='TRUE') return table;
+
+   //add empty forms for absent records and non-unique records
 
    //should not be allowed to create new forms
    let regFormId=crfSetup.getSettings('registrationFormId');