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 typeSelectorLabel = "organization type" />
|
||||
<#assign buttonText = "Leadership Role" />
|
||||
<#assign roleActivityVClass = "organizations" />
|
||||
|
||||
<#--Each of the two stage forms will include the form below-->
|
||||
<#include "addRoleToPersonTwoStage.ftl">
|
|
@ -20,7 +20,7 @@ roleExamples-->
|
|||
<#--Variable assignments for Add Clinical Role To Person-->
|
||||
<#assign roleDescriptor = "membership" />
|
||||
<#assign typeSelectorLabel = "membership in" />
|
||||
|
||||
<#assign roleActivityVClass = "organizations" />
|
||||
|
||||
<#--Each of the two stage forms will include the form below-->
|
||||
<#include "addRoleToPersonTwoStage.ftl">
|
|
@ -20,6 +20,7 @@ roleExamples-->
|
|||
<#--Variable assignments for Add Clinical Role To Person-->
|
||||
<#assign roleDescriptor = "outreach & community service" />
|
||||
<#assign typeSelectorLabel = "outreach & community service in" />
|
||||
<#assign roleActivityVClass = "organizations" />
|
||||
|
||||
|
||||
<#--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">
|
||||
<label for="presentationType">Presentation Type<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
|
||||
<#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">
|
||||
<option value="" selected="selected">Select one</option>
|
||||
<#list presentationTypeOpts?keys as key>
|
||||
<option value="${key}" <#if presentationTypeValue = key>selected</#if>> <#if presentationTypeOpts[key] == "Other">Presentation<#else>${presentationTypeOpts[key]}</#if></option>
|
||||
</#list>
|
||||
</select>
|
||||
</#if>
|
||||
<option value="" selected="selected">Select one</option>
|
||||
<#list presentationTypeOpts?keys as key>
|
||||
<option value="${key}" <#if presentationTypeValue = key>selected</#if>> <#if presentationTypeOpts[key] == "Other">Presentation<#else>${presentationTypeOpts[key]}</#if></option>
|
||||
</#list>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<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="changeSelection" id="changeSelection">change selection)</a>
|
||||
</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 id="fieldsForNewPub">
|
||||
<#-- Published In: collection -->
|
||||
|
|
|
@ -13,8 +13,17 @@
|
|||
</#if>
|
||||
<#--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>
|
||||
<#assign typeSelectorLabel = roleDescriptor />
|
||||
|
@ -27,6 +36,10 @@
|
|||
<#assign roleExamples = "" />
|
||||
</#if>
|
||||
|
||||
<#if !roleActivityVClass?has_content>
|
||||
<#assign roleActivityVClass = "" />
|
||||
</#if>
|
||||
|
||||
<#--Setting values for titleVerb, submitButonText, and disabled Value-->
|
||||
<#if editConfiguration.objectUri?has_content>
|
||||
<#assign titleVerb = "Edit"/>
|
||||
|
@ -51,13 +64,14 @@
|
|||
|
||||
<#--Get activity label value-->
|
||||
<#assign activityLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "activityLabel") />
|
||||
<#assign activityLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "activityLabelDisplay") />
|
||||
|
||||
|
||||
<#--Get role label-->
|
||||
<#assign roleLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleLabel") />
|
||||
|
||||
<#--For role activity uri-->
|
||||
<#assign existingRoleActivityValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleActivity") />
|
||||
<#assign existingRoleActivityValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingRoleActivity") />
|
||||
|
||||
|
||||
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
|
||||
|
@ -118,19 +132,20 @@
|
|||
</#if>
|
||||
<#assign roleActivityTypeSelect = editConfiguration.pageData.roleActivityType />
|
||||
<#assign roleActivityTypeKeys = roleActivityTypeSelect?keys />
|
||||
<#if editMode == "edit">
|
||||
<#list roleActivityTypeKeys as key>
|
||||
<#if selectedActivityType = key >
|
||||
<span class="readOnly" id="typeSelectorSpan">${roleActivityTypeSelect[key]}</span>
|
||||
<input type="hidden" id="typeSelectorInput" name="roleActivityType" acGroupName="activity" value="${activityTypeValue}" >
|
||||
</#if>
|
||||
</#list>
|
||||
<#else>
|
||||
<select id="typeSelector" name="roleActivityType" acGroupName="activity">
|
||||
|
||||
<#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>
|
||||
</select>
|
||||
<#else>
|
||||
<#list roleActivityTypeKeys as key>
|
||||
<#if selectedActivityType = key >
|
||||
<span class="readOnly" id="typeSelectorSpan">${roleActivityTypeSelect[key]}</span>
|
||||
<input type="hidden" id="typeSelectorInput" name="roleActivityType" acGroupName="activity" value="${activityTypeValue}" >
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</p>
|
||||
|
||||
|
@ -139,17 +154,23 @@
|
|||
<p>
|
||||
<label for="activity">### Name ${requiredHint}</label>
|
||||
<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>
|
||||
|
||||
<input type="hidden" id="roleToActivityPredicate" name="roleToActivityPredicate" value="" />
|
||||
<!--Populated or modified by JavaScript based on type of activity, type returned from AJAX request-->
|
||||
<#--
|
||||
<#if editMode = "edit">
|
||||
<input type="hidden" id="roleActivityType" name="roleActivityType" value="${activityTypeValue}"/>
|
||||
<input type="hidden" id="activityLabel" name="activityLabel" value="${activityLabelValue}"/>
|
||||
</#if>
|
||||
-->
|
||||
<@lvf.acSelection urls.base "roleActivity" "roleActivityUri" "activity" existingRoleActivityValue />
|
||||
|
||||
<div class="acSelection" acGroupName="activity">
|
||||
<p class="inline">
|
||||
<label></label>
|
||||
<span class="acSelectionInfo"></span>
|
||||
<a href="/vivo/individual?uri=" class="verifyMatch" title="verify match">(Verify this match</a> or
|
||||
<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>
|
||||
<p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label>
|
||||
|
@ -191,7 +212,9 @@
|
|||
acUrl: '${urls.base}/autocomplete?tokenize=true',
|
||||
editMode: '${editMode}',
|
||||
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>
|
||||
|
||||
|
|
|
@ -17,10 +17,11 @@ showRoleLAbelField
|
|||
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 typeSelectorLabel = "service to the profession in" />
|
||||
<#assign buttonText = "Service Provider Role" />
|
||||
<#assign roleActivityVClass = "organizations" />
|
||||
|
||||
|
||||
<#--Each of the two stage forms will include the form below-->
|
||||
|
|
|
@ -26,6 +26,7 @@ var awardReceiptUtils = {
|
|||
this.form = $('#personHasAwardOrHonor');
|
||||
this.recLabel = $('#awardReceiptLabel');
|
||||
this.award = $('#award');
|
||||
this.awardDisplay = $('#awardDisplay');
|
||||
this.org = $('#org');
|
||||
this.yearAwarded = $('#yearAwarded-year');
|
||||
this.displayedYear = $('#yearAwardedDisplay');
|
||||
|
@ -87,7 +88,13 @@ var awardReceiptUtils = {
|
|||
},
|
||||
|
||||
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 ) {
|
||||
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
|
||||
// THE SPECIAL "acGroupName" ATTRIBUTE WHICH IS SHARED AMONG THE SELECT AND
|
||||
// THE INPUT AND THE AC SELECTION DIV.
|
||||
customForm.undoAutocompleteSelection($(this));
|
||||
|
||||
if (customForm.editMode != "edit") {
|
||||
customForm.undoAutocompleteSelection($(this));
|
||||
}
|
||||
// Reinitialize view. If no type selection in a two-step form, go back to type view;
|
||||
// otherwise, reinitialize full view.
|
||||
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">
|
||||
<label for="orgType">Organization Type ${requiredHint}</label>
|
||||
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
||||
<#--
|
||||
<#if editMode == "edit">
|
||||
<#list orgTypeOpts?keys as key>
|
||||
<#if orgTypeValue = key >
|
||||
|
@ -130,6 +131,17 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
|||
</#list>
|
||||
</select>
|
||||
</#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>
|
||||
|
||||
<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">
|
||||
<label for="orgType">Organization Type<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
|
||||
<#assign orgTypeOpts = editConfiguration.pageData.orgType />
|
||||
<#--
|
||||
<#if editMode == "edit">
|
||||
<#list orgTypeOpts?keys as key>
|
||||
<#if orgTypeValue = key >
|
||||
|
@ -106,13 +107,14 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
|
|||
</#if>
|
||||
</#list>
|
||||
<#else>
|
||||
<select id="typeSelector" name="orgType" ${disabledVal} acGroupName="org">
|
||||
<option value="" selected="selected">Select one</option>
|
||||
<#list orgTypeOpts?keys as key>
|
||||
<option value="${key}" <#if orgTypeValue = key>selected</#if>>${orgTypeOpts[key]}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</#if>
|
||||
-->
|
||||
<select id="typeSelector" name="orgType" acGroupName="org">
|
||||
<option value="" selected="selected">Select one</option>
|
||||
<#list orgTypeOpts?keys as key>
|
||||
<option value="${key}" <#if orgTypeValue = key>selected</#if>>${orgTypeOpts[key]}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<div class="fullViewOnly">
|
||||
|
|
Loading…
Add table
Reference in a new issue