From 1e8924b2361ed58b73160e1240a781c7d738b7a5 Mon Sep 17 00:00:00 2001 From: hjkhjk54 Date: Tue, 29 Nov 2011 18:44:47 +0000 Subject: [PATCH] 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. --- .../freemarker/edit/forms/addGrantRoleToPerson.ftl | 5 +++-- .../freemarker/edit/forms/addRoleToPersonTwoStage.ftl | 7 +++++-- .../freemarker/edit/forms/personHasEducationalTraining.ftl | 3 ++- productMods/templates/freemarker/lib/lib-vivo-form.ftl | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl index 71f6d1cb..d7d3b21d 100644 --- a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl @@ -47,7 +47,8 @@ <#assign grantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "grantLabel")/> <#--Get existing grant label value--> <#assign existingGrantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingGrantLabel")/> - +<#--Get existing grant value--> +<#assign existingGrantValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "grant")/> <#assign requiredHint = " *" /> @@ -107,7 +108,7 @@ - <@lvf.acSelection urls.base /> + <@lvf.acSelection urls.base "grant" "grant" existingGrantValue/>

Years of Participation in Grant

<#if htmlForElements?keys?seq_contains("startField")> diff --git a/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl b/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl index be2dcbb9..f4343573 100644 --- a/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl +++ b/productMods/templates/freemarker/edit/forms/addRoleToPersonTwoStage.ftl @@ -58,6 +58,9 @@ <#--Get role label--> <#assign roleLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleLabel") /> +<#--For role activity uri--> +<#assign existingRoleActivityValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "roleActivity") /> + <#assign requiredHint = " *" /> <#assign yearHint = "(YYYY)" /> @@ -144,7 +147,7 @@ - <@lvf.acSelection urls.base /> + <@lvf.acSelection urls.base "roleActivity" "roleActivityUri" existingRoleActivityValue /> <#if showRoleLabelField = true>

@@ -159,7 +162,7 @@ ${htmlForElements["startField"]} ${yearHint} <#else> -

Years of Participation in ${roleDescriptor?capitalize}

+

Years of Participation in ###

<#if htmlForElements?keys?seq_contains("startField")> ${htmlForElements["startField"]} ${yearHint} diff --git a/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl b/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl index ebde1055..65ab2fa4 100644 --- a/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl +++ b/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl @@ -21,6 +21,7 @@ <#assign infoValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "info") /> <#assign majorFieldValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "majorField") /> <#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 editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content> @@ -117,7 +118,7 @@ - <@lvf.acSelection urls.base /> + <@lvf.acSelection urls.base "org" "org" existingOrgValue/>

diff --git a/productMods/templates/freemarker/lib/lib-vivo-form.ftl b/productMods/templates/freemarker/lib/lib-vivo-form.ftl index 1892f3ba..43f2165a 100644 --- a/productMods/templates/freemarker/lib/lib-vivo-form.ftl +++ b/productMods/templates/freemarker/lib/lib-vivo-form.ftl @@ -15,14 +15,14 @@ <#-- After selecting an individual via autocomplete, display highlighted and with verify link --> -<#macro acSelection urlsBase> +<#macro acSelection urlsBase inputName inputId inputValue>

(Verify this match)

- +