瀏覽代碼

With allowFormReassignment, forms can be reassigned. Typicall scenario is in Screening form where first part could be done by PI and the rest by other people reclaiming the form

Andrej Studen 2 年之前
父節點
當前提交
d45a72ebda
共有 1 個文件被更改,包括 15 次插入4 次删除
  1. 15 4
      web/crfTecant/crfVisit.js

+ 15 - 4
web/crfTecant/crfVisit.js

@@ -2124,10 +2124,21 @@ function(){
 	if (operator=='crfEditor'){
 		//editor can only edit its own forms
 		if (currentUser.UserId!=formCreatorId){
-			let msg='User '+currentUser.DisplayName;
-			msg+=' has no permission on this form';
-			this.generateErrorMsg(msg);
-			return;
+         if ("allowFormReassignment" in config.formConfig.settings){
+           let that=this;
+           let action=new Object();
+           action.name="formReassignement";
+           action.cb=function(){that.doNothing();}
+           config.formConfig.crfEntry['UserId']=currentUser.UserId;
+           let status=config.formConfig.crfEntry['FormStatus'];
+           this.updateFlag(status,action);
+         }
+         else{
+			   let msg='User '+currentUser.DisplayName;
+			   msg+=' has no permission on this form';
+			   this.generateErrorMsg(msg);
+			   return;
+         }
 		}
 	}
 	if (operator=='crfMonitor' || operator=='crfSponsor'){