|
@@ -41,7 +41,7 @@ div.d1 {text-align:center; width=400px; background-color:#e0e0e0;
|
|
|
<div id="startDiv"></div>
|
|
|
|
|
|
<div id="debugAreaHead"></div>
|
|
|
-<div id="debugAreaDiv" style="display:block">
|
|
|
+<div id="debugAreaDiv" style="display:none">
|
|
|
<textarea cols="95" rows="5" name="formStatus" id="formStatus">Entering data</textarea>
|
|
|
</div>
|
|
|
|
|
@@ -61,7 +61,127 @@ function init() {
|
|
|
config.debugId='formStatus';
|
|
|
|
|
|
generateHead(config,"debugAreaHead","debugAreaDiv","Debug info");
|
|
|
+ generateHead(config,"generalDataHead","generalDataDiv","General data");
|
|
|
+ generateHead(config,"pickFormHead","pickFormDiv","Select CRF");
|
|
|
return;
|
|
|
+
|
|
|
+ //parameters should include
|
|
|
+ //divName - place to render select entry table
|
|
|
+ //masterQuery - the master query that will collect al the data
|
|
|
+ //masterSelectVarName - variable that is going to fill the content of select.
|
|
|
+ // Typically, the variable is a lookup in the master query
|
|
|
+ //masterUserVarName - variable that stores the user id in the master query
|
|
|
+ // only entries matching current user in the master query will be selected
|
|
|
+ //authorization - additional data to check:
|
|
|
+ // * if the current user is authorized to perform action and/or
|
|
|
+ // * limit number of different queryVariable values user is entitled to use
|
|
|
+ //authorization should contain:
|
|
|
+ // * queryName - query of user/queryVariable pairs to check for authorized access
|
|
|
+ // * authUserVarName - name of the variable in authorization.queryName that contain usesId
|
|
|
+ // * authSelectVarName - name of the selectVar in authorization query
|
|
|
+ //callback - function that executes when value of the select changes (onchange).
|
|
|
+ // argument to callback are the parameters
|
|
|
+ //selectId - id of the DOM element where select is rendered - to check for value in callback
|
|
|
+ //dataDiv - div element to render potential output of the callback
|
|
|
+
|
|
|
+ //rework to enable addNew
|
|
|
+ let par=new Object();
|
|
|
+ par.masterQuery="crfEntry";
|
|
|
+ par.dataDiv="listDiv";
|
|
|
+ par.masterUserVarName="UserId";
|
|
|
+ par.formStatusName="FormStatus";
|
|
|
+ par.formStatus=1;
|
|
|
+ par.addDiv="selectFormDiv";
|
|
|
+
|
|
|
+ par.source=new Object();
|
|
|
+ par.source.queryName="StudyProperties";
|
|
|
+ par.source.schemaName="study";
|
|
|
+ par.source.vars=["eudraCTNumber","studyCoordinator","regulatoryNumber","studySponsor"];
|
|
|
+
|
|
|
+ par.vars=new Object();
|
|
|
+
|
|
|
+ //User
|
|
|
+ let parUser=new Object();
|
|
|
+ parUser.masterSelectVarName="UserId";
|
|
|
+ parUser.callback=function(){};
|
|
|
+ parUser.selectId="UserSelect";
|
|
|
+ parUser.inputType="select";
|
|
|
+
|
|
|
+ //only display users in crfEditors list
|
|
|
+ parUser.filter=new Object();
|
|
|
+ parUser.filter.queryName="crfEditors";
|
|
|
+ parUser.filter.filterVarName="User";
|
|
|
+ parUser.filter.filters=new Object();
|
|
|
+ parUser.filter.filters["User"]=LABKEY.Security.currentUser.id;
|
|
|
+ par.vars["User"]=parUser;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //Crf
|
|
|
+ let parCrf=new Object();
|
|
|
+ parCrf.masterSelectVarName="entryId";
|
|
|
+ //parCrf.callback=generateList;
|
|
|
+ parCrf.selectId="crfSelect";
|
|
|
+ parCrf.addSelect=true;
|
|
|
+ parCrf.addNewFlag=-1;
|
|
|
+ parCrf.inputType="select";
|
|
|
+ par.vars["Crf"]=parCrf;
|
|
|
+
|
|
|
+ //Site
|
|
|
+ let parSite=new Object();
|
|
|
+ parSite.masterSelectVarName="Site";
|
|
|
+
|
|
|
+ //parSite.callback=generateListAndPopulateDaughterSelect;
|
|
|
+ parSite.selectId="SiteSelect";
|
|
|
+ parSite.daughterSelect="Crf";
|
|
|
+ parSite.inputType="select";
|
|
|
+
|
|
|
+ //apply additional filter to variable - specify
|
|
|
+ //- queryName,
|
|
|
+ //- name of variable in queryName
|
|
|
+ // - list of filters with name of the variable associated targeted value
|
|
|
+
|
|
|
+ parSite.filter=new Object();
|
|
|
+ parSite.filter.queryName="crfEditors";
|
|
|
+ parSite.filter.filterVarName="Site";
|
|
|
+ parSite.filter.filters=new Object();
|
|
|
+ parSite.filter.filters["User"]=LABKEY.Security.currentUser.id;
|
|
|
+ par.vars["Site"]=parSite;
|
|
|
+
|
|
|
+ //Form
|
|
|
+ par.vars["Form"]=new Object();
|
|
|
+ let parForm=par.vars["Form"];
|
|
|
+ parForm.masterSelectVarName="Form";
|
|
|
+ parForm.callback=function(){};
|
|
|
+ parForm.selectId="FormSelect";
|
|
|
+ parForm.selectAll=true;
|
|
|
+ parForm.inputType="select";
|
|
|
+ parForm.urlName="formUrl";
|
|
|
+
|
|
|
+ //FormStatus;
|
|
|
+ par.vars["FormStatus"]=new Object();
|
|
|
+ let parFormStatus=par.vars["FormStatus"];
|
|
|
+ parFormStatus.masterSelectVarName="FormStatus";
|
|
|
+ //parFormStatus.callback=generateListAndPopulateDaughterSelect;
|
|
|
+ parFormStatus.selectId="FormStatusSelect";
|
|
|
+ parFormStatus.daughterSelect="Crf";
|
|
|
+ parFormStatus.inputType="select";
|
|
|
+
|
|
|
+ parFormStatus.filter=new Object();
|
|
|
+ parFormStatus.filter.queryName="formStatusVisibility";
|
|
|
+ parFormStatus.filter.filterVarName="formStatus";
|
|
|
+ parFormStatus.filter.filters=new Object();
|
|
|
+ parFormStatus.filter.filters["visibilityLevel"]="crfEditor";
|
|
|
+
|
|
|
+
|
|
|
+ //par.vars["eudraCTNumber"]=sourceVar("EudraCTNumber","eudraCTNumber","EudraCTNumber");
|
|
|
+ //par.vars["studyCoordinator"]=sourceVar("StudyCoordinator","studyCoordinator","StudyCoordinator");
|
|
|
+ //par.vars["studySponsor"]=sourceVar("StudySponsor","studySponsor","StudySponsor");
|
|
|
+
|
|
|
+ par.filters=["User","Site","FormStatus"];
|
|
|
+ //par.filters=["User","Site"];
|
|
|
+ //drawForm(par);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|