custom form changes for NIHVIVO-2594 and NIHVIVO-3761
This commit is contained in:
parent
9400e200de
commit
ccb2ff3be5
11 changed files with 85 additions and 46 deletions
|
@ -21,6 +21,7 @@ roleExamples-->
|
||||||
<#assign roleDescriptor = "leadership" />
|
<#assign roleDescriptor = "leadership" />
|
||||||
<#assign typeSelectorLabel = "organization type" />
|
<#assign typeSelectorLabel = "organization type" />
|
||||||
<#assign buttonText = "Leadership Role" />
|
<#assign buttonText = "Leadership Role" />
|
||||||
|
<#assign roleActivityVClass = "organizations" />
|
||||||
|
|
||||||
<#--Each of the two stage forms will include the form below-->
|
<#--Each of the two stage forms will include the form below-->
|
||||||
<#include "addRoleToPersonTwoStage.ftl">
|
<#include "addRoleToPersonTwoStage.ftl">
|
|
@ -20,7 +20,7 @@ roleExamples-->
|
||||||
<#--Variable assignments for Add Clinical Role To Person-->
|
<#--Variable assignments for Add Clinical Role To Person-->
|
||||||
<#assign roleDescriptor = "membership" />
|
<#assign roleDescriptor = "membership" />
|
||||||
<#assign typeSelectorLabel = "membership in" />
|
<#assign typeSelectorLabel = "membership in" />
|
||||||
|
<#assign roleActivityVClass = "organizations" />
|
||||||
|
|
||||||
<#--Each of the two stage forms will include the form below-->
|
<#--Each of the two stage forms will include the form below-->
|
||||||
<#include "addRoleToPersonTwoStage.ftl">
|
<#include "addRoleToPersonTwoStage.ftl">
|
|
@ -20,6 +20,7 @@ roleExamples-->
|
||||||
<#--Variable assignments for Add Clinical Role To Person-->
|
<#--Variable assignments for Add Clinical Role To Person-->
|
||||||
<#assign roleDescriptor = "outreach & community service" />
|
<#assign roleDescriptor = "outreach & community service" />
|
||||||
<#assign typeSelectorLabel = "outreach & community service in" />
|
<#assign typeSelectorLabel = "outreach & community service in" />
|
||||||
|
<#assign roleActivityVClass = "organizations" />
|
||||||
|
|
||||||
|
|
||||||
<#--Each of the two stage forms will include the form below-->
|
<#--Each of the two stage forms will include the form below-->
|
||||||
|
|
|
@ -101,21 +101,12 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
||||||
<p class="inline">
|
<p class="inline">
|
||||||
<label for="presentationType">Presentation Type<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
|
<label for="presentationType">Presentation Type<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
|
||||||
<#assign presentationTypeOpts = editConfiguration.pageData.presentationType />
|
<#assign presentationTypeOpts = editConfiguration.pageData.presentationType />
|
||||||
<#if editMode == "edit">
|
|
||||||
<#list presentationTypeOpts?keys as key>
|
|
||||||
<#if presentationTypeValue = key >
|
|
||||||
<span class="readOnly" id="typeSelectorSpan"><#if presentationTypeOpts[key] == "Other">Presentation<#else>${presentationTypeOpts[key]}</#if></span>
|
|
||||||
<input type="hidden" id="typeSelectorInput" name="presentationType" acGroupName="presentation" value="${presentationTypeValue}">
|
|
||||||
</#if>
|
|
||||||
</#list>
|
|
||||||
<#else>
|
|
||||||
<select id="typeSelector" name="presentationType" acGroupName="presentation">
|
<select id="typeSelector" name="presentationType" acGroupName="presentation">
|
||||||
<option value="" selected="selected">Select one</option>
|
<option value="" selected="selected">Select one</option>
|
||||||
<#list presentationTypeOpts?keys as key>
|
<#list presentationTypeOpts?keys as key>
|
||||||
<option value="${key}" <#if presentationTypeValue = key>selected</#if>> <#if presentationTypeOpts[key] == "Other">Presentation<#else>${presentationTypeOpts[key]}</#if></option>
|
<option value="${key}" <#if presentationTypeValue = key>selected</#if>> <#if presentationTypeOpts[key] == "Other">Presentation<#else>${presentationTypeOpts[key]}</#if></option>
|
||||||
</#list>
|
</#list>
|
||||||
</select>
|
</select>
|
||||||
</#if>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="fullViewOnly">
|
<div class="fullViewOnly">
|
||||||
|
|
|
@ -151,7 +151,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
||||||
<a href="" class="verifyMatch" title="verify match">(Verify this match</a> or
|
<a href="" class="verifyMatch" title="verify match">(Verify this match</a> or
|
||||||
<a href="#" class="changeSelection" id="changeSelection">change selection)</a>
|
<a href="#" class="changeSelection" id="changeSelection">change selection)</a>
|
||||||
</p>
|
</p>
|
||||||
<input class="acUriReceiver" type="hidden" id="pubUri" name="pubUri" value="${pubUriValue}" />
|
<input class="acUriReceiver" type="hidden" id="pubUri" name="pubUri" value="${pubUriValue}" ${flagClearLabelForExisting}="true" />
|
||||||
</div>
|
</div>
|
||||||
<div id="fieldsForNewPub">
|
<div id="fieldsForNewPub">
|
||||||
<#-- Published In: collection -->
|
<#-- Published In: collection -->
|
||||||
|
|
|
@ -13,8 +13,17 @@
|
||||||
</#if>
|
</#if>
|
||||||
<#--Freemarker variables with default values that can be overridden by specific forms-->
|
<#--Freemarker variables with default values that can be overridden by specific forms-->
|
||||||
|
|
||||||
|
<#assign blankSentinel = "" />
|
||||||
|
<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
|
||||||
|
<#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
|
||||||
|
</#if>
|
||||||
|
|
||||||
<#-- typeSelectorLabel, numDateFields, roleExamples-->
|
<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete.
|
||||||
|
Set this flag on the input acUriReceiver where you would like this behavior to occur. -->
|
||||||
|
<#assign flagClearLabelForExisting = "flagClearLabelForExisting" />
|
||||||
|
|
||||||
|
|
||||||
|
<#-- typeSelectorLabel, numDateFields, roleExamples, roleActivityVClass -->
|
||||||
|
|
||||||
<#if !typeSelectorLabel?has_content>
|
<#if !typeSelectorLabel?has_content>
|
||||||
<#assign typeSelectorLabel = roleDescriptor />
|
<#assign typeSelectorLabel = roleDescriptor />
|
||||||
|
@ -27,6 +36,10 @@
|
||||||
<#assign roleExamples = "" />
|
<#assign roleExamples = "" />
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
<#if !roleActivityVClass?has_content>
|
||||||
|
<#assign roleActivityVClass = "" />
|
||||||
|
</#if>
|
||||||
|
|
||||||
<#--Setting values for titleVerb, submitButonText, and disabled Value-->
|
<#--Setting values for titleVerb, submitButonText, and disabled Value-->
|
||||||
<#if editConfiguration.objectUri?has_content>
|
<#if editConfiguration.objectUri?has_content>
|
||||||
<#assign titleVerb = "Edit"/>
|
<#assign titleVerb = "Edit"/>
|
||||||
|
@ -51,13 +64,14 @@
|
||||||
|
|
||||||
<#--Get activity label value-->
|
<#--Get activity label value-->
|
||||||
<#assign activityLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "activityLabel") />
|
<#assign activityLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "activityLabel") />
|
||||||
|
<#assign activityLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "activityLabelDisplay") />
|
||||||
|
|
||||||
|
|
||||||
<#--Get role label-->
|
<#--Get role label-->
|
||||||
<#assign roleLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleLabel") />
|
<#assign roleLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleLabel") />
|
||||||
|
|
||||||
<#--For role activity uri-->
|
<#--For role activity uri-->
|
||||||
<#assign existingRoleActivityValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleActivity") />
|
<#assign existingRoleActivityValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingRoleActivity") />
|
||||||
|
|
||||||
|
|
||||||
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
|
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
|
||||||
|
@ -118,19 +132,20 @@
|
||||||
</#if>
|
</#if>
|
||||||
<#assign roleActivityTypeSelect = editConfiguration.pageData.roleActivityType />
|
<#assign roleActivityTypeSelect = editConfiguration.pageData.roleActivityType />
|
||||||
<#assign roleActivityTypeKeys = roleActivityTypeSelect?keys />
|
<#assign roleActivityTypeKeys = roleActivityTypeSelect?keys />
|
||||||
<#if editMode == "edit">
|
|
||||||
|
<#if editMode != "edit" || ( editMode == "edit" && roleActivityVClass == "organizations") >
|
||||||
|
<select id="typeSelector" name="roleActivityType" acGroupName="activity">
|
||||||
|
<#list roleActivityTypeKeys as key>
|
||||||
|
<option value="${key}"<#if selectedActivityType = key>selected</#if>>${roleActivityTypeSelect[key]}</option>
|
||||||
|
</#list>
|
||||||
|
</select>
|
||||||
|
<#else>
|
||||||
<#list roleActivityTypeKeys as key>
|
<#list roleActivityTypeKeys as key>
|
||||||
<#if selectedActivityType = key >
|
<#if selectedActivityType = key >
|
||||||
<span class="readOnly" id="typeSelectorSpan">${roleActivityTypeSelect[key]}</span>
|
<span class="readOnly" id="typeSelectorSpan">${roleActivityTypeSelect[key]}</span>
|
||||||
<input type="hidden" id="typeSelectorInput" name="roleActivityType" acGroupName="activity" value="${activityTypeValue}" >
|
<input type="hidden" id="typeSelectorInput" name="roleActivityType" acGroupName="activity" value="${activityTypeValue}" >
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
<#else>
|
|
||||||
<select id="typeSelector" name="roleActivityType" acGroupName="activity">
|
|
||||||
<#list roleActivityTypeKeys as key>
|
|
||||||
<option value="${key}"<#if selectedActivityType = key>selected</#if>>${roleActivityTypeSelect[key]}</option>
|
|
||||||
</#list>
|
|
||||||
</select>
|
|
||||||
</#if>
|
</#if>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -139,17 +154,23 @@
|
||||||
<p>
|
<p>
|
||||||
<label for="activity">### Name ${requiredHint}</label>
|
<label for="activity">### Name ${requiredHint}</label>
|
||||||
<input class="acSelector" size="50" type="text" id="activity" name="activityLabel" acGroupName="activity" value="${activityLabelValue}" />
|
<input class="acSelector" size="50" type="text" id="activity" name="activityLabel" acGroupName="activity" value="${activityLabelValue}" />
|
||||||
|
<input class="display" type="hidden" id="activityDisplay" acGroupName="activity" name="activityLabelDisplay" value="$activityLabelDisplayValue}">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<input type="hidden" id="roleToActivityPredicate" name="roleToActivityPredicate" value="" />
|
<input type="hidden" id="roleToActivityPredicate" name="roleToActivityPredicate" value="" />
|
||||||
<!--Populated or modified by JavaScript based on type of activity, type returned from AJAX request-->
|
<!--Populated or modified by JavaScript based on type of activity, type returned from AJAX request-->
|
||||||
<#--
|
|
||||||
<#if editMode = "edit">
|
<div class="acSelection" acGroupName="activity">
|
||||||
<input type="hidden" id="roleActivityType" name="roleActivityType" value="${activityTypeValue}"/>
|
<p class="inline">
|
||||||
<input type="hidden" id="activityLabel" name="activityLabel" value="${activityLabelValue}"/>
|
<label></label>
|
||||||
</#if>
|
<span class="acSelectionInfo"></span>
|
||||||
-->
|
<a href="/vivo/individual?uri=" class="verifyMatch" title="verify match">(Verify this match</a> or
|
||||||
<@lvf.acSelection urls.base "roleActivity" "roleActivityUri" "activity" existingRoleActivityValue />
|
<a href="#" class="changeSelection" id="changeSelection">change selection)</a>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
<input class="acUriReceiver" type="hidden" id="roleActivityUri" name="existingRoleActivity" value="${existingRoleActivityValue}" ${flagClearLabelForExisting}="true" />
|
||||||
|
<!-- Field value populated by JavaScript -->
|
||||||
|
</div>
|
||||||
|
|
||||||
<#if showRoleLabelField = true>
|
<#if showRoleLabelField = true>
|
||||||
<p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label>
|
<p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label>
|
||||||
|
@ -191,7 +212,9 @@
|
||||||
acUrl: '${urls.base}/autocomplete?tokenize=true',
|
acUrl: '${urls.base}/autocomplete?tokenize=true',
|
||||||
editMode: '${editMode}',
|
editMode: '${editMode}',
|
||||||
defaultTypeName: 'activity', // used in repair mode, to generate button text and org name field label
|
defaultTypeName: 'activity', // used in repair mode, to generate button text and org name field label
|
||||||
baseHref: '${urls.base}/individual?uri='
|
baseHref: '${urls.base}/individual?uri=',
|
||||||
|
blankSentinel: '${blankSentinel}',
|
||||||
|
flagClearLabelForExisting: '${flagClearLabelForExisting}'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,11 @@ showRoleLAbelField
|
||||||
roleExamples-->
|
roleExamples-->
|
||||||
|
|
||||||
|
|
||||||
<#--Variable assignments for Add Clinical Role To Person-->
|
<#--Variable assignments for Add Service Provider Role To Person-->
|
||||||
<#assign roleDescriptor = "service to the profession" />
|
<#assign roleDescriptor = "service to the profession" />
|
||||||
<#assign typeSelectorLabel = "service to the profession in" />
|
<#assign typeSelectorLabel = "service to the profession in" />
|
||||||
<#assign buttonText = "Service Provider Role" />
|
<#assign buttonText = "Service Provider Role" />
|
||||||
|
<#assign roleActivityVClass = "organizations" />
|
||||||
|
|
||||||
|
|
||||||
<#--Each of the two stage forms will include the form below-->
|
<#--Each of the two stage forms will include the form below-->
|
||||||
|
|
|
@ -26,6 +26,7 @@ var awardReceiptUtils = {
|
||||||
this.form = $('#personHasAwardOrHonor');
|
this.form = $('#personHasAwardOrHonor');
|
||||||
this.recLabel = $('#awardReceiptLabel');
|
this.recLabel = $('#awardReceiptLabel');
|
||||||
this.award = $('#award');
|
this.award = $('#award');
|
||||||
|
this.awardDisplay = $('#awardDisplay');
|
||||||
this.org = $('#org');
|
this.org = $('#org');
|
||||||
this.yearAwarded = $('#yearAwarded-year');
|
this.yearAwarded = $('#yearAwarded-year');
|
||||||
this.displayedYear = $('#yearAwardedDisplay');
|
this.displayedYear = $('#yearAwardedDisplay');
|
||||||
|
@ -87,7 +88,13 @@ var awardReceiptUtils = {
|
||||||
},
|
},
|
||||||
|
|
||||||
buildAwardReceiptLabel: function() {
|
buildAwardReceiptLabel: function() {
|
||||||
var rdfsLabel = this.award.val();
|
var rdfsLabel = "";
|
||||||
|
if ( this.editMode == "edit" ) {
|
||||||
|
rdfsLabel = this.awardDisplay.val();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rdfsLabel = this.award.val();
|
||||||
|
}
|
||||||
if ( this.yearAwarded.val().length ) {
|
if ( this.yearAwarded.val().length ) {
|
||||||
rdfsLabel += " (" + this.subjectName + ' - ' + this.yearAwarded.val() + ")";
|
rdfsLabel += " (" + this.subjectName + ' - ' + this.yearAwarded.val() + ")";
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,8 +227,9 @@ var customForm = {
|
||||||
// BECAUSE THERE COULD BE MORE THAN ONE AC FIELD. ASSOCIATION IS MADE VIA
|
// BECAUSE THERE COULD BE MORE THAN ONE AC FIELD. ASSOCIATION IS MADE VIA
|
||||||
// THE SPECIAL "acGroupName" ATTRIBUTE WHICH IS SHARED AMONG THE SELECT AND
|
// THE SPECIAL "acGroupName" ATTRIBUTE WHICH IS SHARED AMONG THE SELECT AND
|
||||||
// THE INPUT AND THE AC SELECTION DIV.
|
// THE INPUT AND THE AC SELECTION DIV.
|
||||||
|
if (customForm.editMode != "edit") {
|
||||||
customForm.undoAutocompleteSelection($(this));
|
customForm.undoAutocompleteSelection($(this));
|
||||||
|
}
|
||||||
// Reinitialize view. If no type selection in a two-step form, go back to type view;
|
// Reinitialize view. If no type selection in a two-step form, go back to type view;
|
||||||
// otherwise, reinitialize full view.
|
// otherwise, reinitialize full view.
|
||||||
if (!typeVal.length && customForm.formSteps > 1) {
|
if (!typeVal.length && customForm.formSteps > 1) {
|
||||||
|
|
|
@ -111,6 +111,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
||||||
<p class="inline">
|
<p class="inline">
|
||||||
<label for="orgType">Organization Type ${requiredHint}</label>
|
<label for="orgType">Organization Type ${requiredHint}</label>
|
||||||
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
||||||
|
<#--
|
||||||
<#if editMode == "edit">
|
<#if editMode == "edit">
|
||||||
<#list orgTypeOpts?keys as key>
|
<#list orgTypeOpts?keys as key>
|
||||||
<#if orgTypeValue = key >
|
<#if orgTypeValue = key >
|
||||||
|
@ -130,6 +131,17 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
||||||
</#list>
|
</#list>
|
||||||
</select>
|
</select>
|
||||||
</#if>
|
</#if>
|
||||||
|
-->
|
||||||
|
<select id="typeSelector" name="orgType" acGroupName="org">
|
||||||
|
<option value="" selected="selected">Select one</option>
|
||||||
|
<#list orgTypeOpts?keys as key>
|
||||||
|
<#if orgTypeValue = key>
|
||||||
|
<option value="${key}" selected >${orgTypeOpts[key]}</option>
|
||||||
|
<#else>
|
||||||
|
<option value="${key}">${orgTypeOpts[key]}</option>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</select>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="fullViewOnly">
|
<div class="fullViewOnly">
|
||||||
|
|
|
@ -98,6 +98,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
||||||
<p class="inline">
|
<p class="inline">
|
||||||
<label for="orgType">Organization Type<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
|
<label for="orgType">Organization Type<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
|
||||||
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
||||||
|
<#--
|
||||||
<#if editMode == "edit">
|
<#if editMode == "edit">
|
||||||
<#list orgTypeOpts?keys as key>
|
<#list orgTypeOpts?keys as key>
|
||||||
<#if orgTypeValue = key >
|
<#if orgTypeValue = key >
|
||||||
|
@ -106,13 +107,14 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
<#else>
|
<#else>
|
||||||
<select id="typeSelector" name="orgType" ${disabledVal} acGroupName="org">
|
</#if>
|
||||||
|
-->
|
||||||
|
<select id="typeSelector" name="orgType" acGroupName="org">
|
||||||
<option value="" selected="selected">Select one</option>
|
<option value="" selected="selected">Select one</option>
|
||||||
<#list orgTypeOpts?keys as key>
|
<#list orgTypeOpts?keys as key>
|
||||||
<option value="${key}" <#if orgTypeValue = key>selected</#if>>${orgTypeOpts[key]}</option>
|
<option value="${key}" <#if orgTypeValue = key>selected</#if>>${orgTypeOpts[key]}</option>
|
||||||
</#list>
|
</#list>
|
||||||
</select>
|
</select>
|
||||||
</#if>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="fullViewOnly">
|
<div class="fullViewOnly">
|
||||||
|
|
Loading…
Add table
Reference in a new issue