소스 검색

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

Andrej Studen 1 년 전
부모
커밋
1e5ee12e07
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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');