For NIHVIVO-3344, The name and ids of the auto complete fields were incorrectly set and the existing value was not being passed back to them either. I updated the macro and the freemarker templates that used the macro.

Also allowing label for "years of participation" to be changed according to value of drop-down in role forms.
This commit is contained in:
hjkhjk54 2011-11-29 18:44:47 +00:00
parent d303104af6
commit 1e8924b236
4 changed files with 12 additions and 7 deletions

View file

@ -47,7 +47,8 @@
<#assign grantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "grantLabel")/> <#assign grantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "grantLabel")/>
<#--Get existing grant label value--> <#--Get existing grant label value-->
<#assign existingGrantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingGrantLabel")/> <#assign existingGrantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingGrantLabel")/>
<#--Get existing grant value-->
<#assign existingGrantValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "grant")/>
<#assign requiredHint = "<span class='requiredHint'> *</span>" /> <#assign requiredHint = "<span class='requiredHint'> *</span>" />
@ -107,7 +108,7 @@
<input type="hidden" id="grantLabel" name="grantLabel" value="${grantLabel}"/> <input type="hidden" id="grantLabel" name="grantLabel" value="${grantLabel}"/>
</#if> </#if>
<@lvf.acSelection urls.base /> <@lvf.acSelection urls.base "grant" "grant" existingGrantValue/>
<h4>Years of Participation in Grant</h4> <h4>Years of Participation in Grant</h4>
<#if htmlForElements?keys?seq_contains("startField")> <#if htmlForElements?keys?seq_contains("startField")>

View file

@ -58,6 +58,9 @@
<#--Get role label--> <#--Get role label-->
<#assign roleLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleLabel") /> <#assign roleLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleLabel") />
<#--For role activity uri-->
<#assign existingRoleActivityValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleActivity") />
<#assign requiredHint = "<span class='requiredHint'> *</span>" /> <#assign requiredHint = "<span class='requiredHint'> *</span>" />
<#assign yearHint = "<span class='hint'>(YYYY)</span>" /> <#assign yearHint = "<span class='hint'>(YYYY)</span>" />
@ -144,7 +147,7 @@
<input type="hidden" id="roleActivityType" name="roleActivityType" value="${activityTypeValue}"/> <input type="hidden" id="roleActivityType" name="roleActivityType" value="${activityTypeValue}"/>
<input type="hidden" id="activityLabel" name="activityLabel" value="${activityLabelValue}"/> <input type="hidden" id="activityLabel" name="activityLabel" value="${activityLabelValue}"/>
</#if> </#if>
<@lvf.acSelection urls.base /> <@lvf.acSelection urls.base "roleActivity" "roleActivityUri" existingRoleActivityValue />
<#if showRoleLabelField = true> <#if showRoleLabelField = true>
<p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label> <p><label for="roleLabel">Role in ### ${requiredHint} ${roleExamples}</label>
@ -159,7 +162,7 @@
${htmlForElements["startField"]} ${yearHint} ${htmlForElements["startField"]} ${yearHint}
</#if> </#if>
<#else> <#else>
<h4>Years of Participation in ${roleDescriptor?capitalize}</h4> <h4 class="label">Years of Participation in ### </h4>
<#if htmlForElements?keys?seq_contains("startField")> <#if htmlForElements?keys?seq_contains("startField")>
<label class="dateTime" for="startField">Start</label> <label class="dateTime" for="startField">Start</label>
${htmlForElements["startField"]} ${yearHint} ${htmlForElements["startField"]} ${yearHint}

View file

@ -21,6 +21,7 @@
<#assign infoValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "info") /> <#assign infoValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "info") />
<#assign majorFieldValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "majorField") /> <#assign majorFieldValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "majorField") />
<#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degree") /> <#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degree") />
<#assign existingOrgValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "org") />
<#--If edit submission exists, then retrieve validation errors if they exist--> <#--If edit submission exists, then retrieve validation errors if they exist-->
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content> <#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
@ -117,7 +118,7 @@
<input type="hidden" name="orgLabel" id="orgLabel" value="${orgLabelValue}"/> <input type="hidden" name="orgLabel" id="orgLabel" value="${orgLabelValue}"/>
</#if> </#if>
<@lvf.acSelection urls.base /> <@lvf.acSelection urls.base "org" "org" existingOrgValue/>
<p> <p>
<label for="dept">Department or School Name within the ###</label> <label for="dept">Department or School Name within the ###</label>

View file

@ -15,14 +15,14 @@
</#macro> </#macro>
<#-- After selecting an individual via autocomplete, display highlighted and with verify link --> <#-- After selecting an individual via autocomplete, display highlighted and with verify link -->
<#macro acSelection urlsBase> <#macro acSelection urlsBase inputName inputId inputValue>
<div class="acSelection"> <div class="acSelection">
<p class="inline"> <p class="inline">
<label></label> <label></label>
<span class="acSelectionInfo"></span> <span class="acSelectionInfo"></span>
<a href="${urlsBase}/individual?uri=" class="verifyMatch">(Verify this match)</a> <a href="${urlsBase}/individual?uri=" class="verifyMatch">(Verify this match)</a>
</p> </p>
<input class="acUriReceiver" type="hidden" id="org" name="org" value="" /> <input class="acUriReceiver" type="hidden" id="${inputId}" name="${inputName}" value="${inputValue}" />
<!-- Field value populated by JavaScript --> <!-- Field value populated by JavaScript -->
</div> </div>
</#macro> </#macro>