diff --git a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl
index dd34288d..e6deaee4 100644
--- a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl
+++ b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl
@@ -17,6 +17,19 @@
<#assign disabledVal = "disabled=\"disabled\"" />
#if>
+
+<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected.
+If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship
+if nothing is selected for that object-->
+<#assign blankSentinel = "" />
+<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
+ <#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
+#if>
+
+<#--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" />
+
<#--the heading and submit button label depend on the predicate uri-->
<#assign formHeading = "investigator entry for "/>
@@ -43,11 +56,10 @@
<#--Get selected activity type value if it exists, this is alternative to below-->
-<#assign grantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "grantLabel")/>
-<#--Get existing grant label value-->
-<#assign existingGrantLabel = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingGrantLabel")/>
+<#assign grantLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "grantLabel")/>
+<#assign grantLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "grantLabelDisplay")/>
<#--Get existing grant value-->
-<#assign existingGrantValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "grant")/>
+<#assign existingGrantValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingGrant")/>
<#assign requiredHint = " *" />
@@ -62,6 +74,10 @@
<#--Display error messages if any-->
<#if submissionErrors?has_content>
+ <#if grantLabelDisplayValue?has_content >
+ <#assign grantLabelValue = grantLabelDisplayValue />
+ #if>
+
<#if htmlForElements?keys?seq_contains("startField")>
@@ -137,8 +162,10 @@ var customFormData = {
acTypes: {grant: 'http://vivoweb.org/ontology/core#Grant'},
editMode: '${editMode}',
typeName: 'Grant',
- baseHref: '${urls.base}/individual?uri='
-};
+ baseHref: '${urls.base}/individual?uri=',
+ blankSentinel: '${blankSentinel}',
+ flagClearLabelForExisting: '${flagClearLabelForExisting}'
+ };
${stylesheets.add('')}
${stylesheets.add('')}
diff --git a/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl
index 6bbb2a08..fa11c84c 100644
--- a/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl
+++ b/productMods/templates/freemarker/edit/forms/addPresenterRoleToPerson.ftl
@@ -26,7 +26,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
-<#assign presentationValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingPresentation") />
+<#assign existingPresentationValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingPresentation") />
<#assign presentationLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "presentationLabel") />
<#assign presentationLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "presentationLabelDisplay") />
<#assign presentationTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "presentationType") />
@@ -132,7 +132,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
(Verify this match or
change selection)
-
+
diff --git a/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl b/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl
index 5a7c267d..ea3ded65 100644
--- a/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl
+++ b/productMods/templates/freemarker/edit/forms/addPublicationToPerson.ftl
@@ -104,10 +104,13 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#--below shows examples of both printing out all error messages and checking the error message for a specific field-->
- <#list submissionErrors?keys as errorFieldName>
- ${submissionErrors[errorFieldName]}
- #list>
-
+ <#if lvf.submissionErrorExists(editSubmission, "title")>
+ Please select an existing publication in the Title field or enter a new one.
+ <#else>
+ <#list submissionErrors?keys as errorFieldName>
+ ${submissionErrors[errorFieldName]}
+ #list>
+ #if>
#if>
@@ -222,7 +225,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#-- Editor -->
-
+
diff --git a/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js b/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js
index f96ba126..b5481af9 100644
--- a/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js
+++ b/productMods/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js
@@ -492,7 +492,8 @@ var customForm = {
$acSelector.parent('p').show();
this.resetAcSelection($acSelectionObj);
if ( clearAcSelectorVal == true ) {
- $acSelector.val('');
+ $acSelector.val('');
+ $("input.display[acGroupName='" + $acSelectionObj.attr('acGroupName') + "']").val("");
}
customForm.addAcHelpText($acSelector);
diff --git a/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js b/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js
index f28d94f3..fd1aebb8 100644
--- a/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js
+++ b/productMods/templates/freemarker/edit/forms/js/publicationToPersonUtils.js
@@ -381,23 +381,35 @@ var publicationToPersonUtils = {
// If editorUri contains the sentinel value, we need to process the name fields
// otherwise, disable them so they are not submitted
- if ( this.editorUri.val() == this.sentinel ) {
- firstName = this.firstName.val();
- lastName = this.editor.val();
- name = lastName;
- if (firstName) {
- name += ', ' + firstName;
- }
- this.editor.val(name);
- this.lastName.val(lastName);
- }
- else {
- this.firstName.attr('disabled', 'disabled');
- this.lastName.attr('disabled', 'disabled');
- }
-
+ if (this.editor.parent('p').is(':visible') ) {
+ if ( this.editor.val().indexOf('Select an existing') != -1 ) {
+ this.editor.val('');
+ }
+ if ( this.editorUri.val() == '' || this.editorUri.val() == this.sentinel ) {
+ firstName = this.firstName.val();
+ lastName = this.editor.val();
+ name = lastName;
+ if (firstName) {
+ name += ', ' + firstName;
+ }
+ this.editor.val(name);
+ this.lastName.val(lastName);
+ }
+ else {
+ this.disableNameFields();
+ }
+ }
+ else {
+ this.disableNameFields();
+ }
+
},
+ disableNameFields: function() {
+ this.firstName.attr('disabled', 'disabled');
+ this.lastName.attr('disabled', 'disabled');
+ },
+
resetLastNameLabel: function() {
var indx = this.editor.val().indexOf(", ");
if ( indx != -1 ) {
diff --git a/productMods/templates/freemarker/edit/forms/organizationHasPositionHistory.ftl b/productMods/templates/freemarker/edit/forms/organizationHasPositionHistory.ftl
index 5245f0f3..41d69e48 100644
--- a/productMods/templates/freemarker/edit/forms/organizationHasPositionHistory.ftl
+++ b/productMods/templates/freemarker/edit/forms/organizationHasPositionHistory.ftl
@@ -23,10 +23,22 @@
<#assign requiredHint = " *" />
<#assign yearHint = "(YYYY)" />
+<#assign blankSentinel = "" />
+<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
+ <#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
+#if>
+
+<#--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" />
+
<#assign positionTitleValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "positionTitle") />
<#assign positionTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "positionType") />
-<#assign personValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "person") />
+<#assign existingPersonValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingPerson") />
<#assign personLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "personLabel") />
+<#assign personLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "personLabelDisplay") />
+<#assign firstNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "firstName") />
+<#assign lastNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "lastName") />
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
<#assign submissionErrors = editSubmission.validationErrors/>
@@ -35,6 +47,9 @@
${titleVerb} position history entry for ${editConfiguration.subjectName}
@@ -139,11 +159,19 @@
acTypes: {person: 'http://xmlns.com/foaf/0.1/Person'},
editMode: '${editMode}',
defaultTypeName: 'person',
- baseHref: '${urls.base}/individual?uri='
+ baseHref: '${urls.base}/individual?uri=',
+ blankSentinel: '${blankSentinel}',
+ flagClearLabelForExisting: '${flagClearLabelForExisting}'
+
};
+
${stylesheets.add('')}
${stylesheets.add('')}
@@ -153,6 +181,7 @@ ${stylesheets.add('',
'',
'',
+ '',
'',
'',
'')}
diff --git a/productMods/templates/freemarker/edit/forms/personHasAwardOrHonor.ftl b/productMods/templates/freemarker/edit/forms/personHasAwardOrHonor.ftl
index e0bb2679..187d4ed8 100644
--- a/productMods/templates/freemarker/edit/forms/personHasAwardOrHonor.ftl
+++ b/productMods/templates/freemarker/edit/forms/personHasAwardOrHonor.ftl
@@ -25,7 +25,6 @@ if nothing is selected for that object-->
Set this flag on the input acUriReceiver where you would like this behavior to occur. -->
<#assign flagClearLabelForExisting = "flagClearLabelForExisting" />
-
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
diff --git a/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl b/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl
index 63ea38f1..4a4b5c1e 100644
--- a/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl
+++ b/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl
@@ -14,14 +14,27 @@
<#assign editMode = editConfiguration.pageData.editMode />
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
+<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected.
+If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship
+if nothing is selected for that object-->
+<#assign blankSentinel = "" />
+<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
+ <#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
+#if>
+
+<#--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" />
+
<#--Retrieve variables needed-->
<#assign orgTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgType")/>
<#assign orgLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabel") />
+<#assign orgLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabelDisplay") />
<#assign deptValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "dept") />
<#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") />
+<#assign existingOrgValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingOrg") />
<#assign trainingTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "trainingType")/>
<#--If edit submission exists, then retrieve validation errors if they exist-->
@@ -47,6 +60,9 @@
<#--Display error messages if any-->
<#if submissionErrors?has_content>
+ <#if orgLabelDisplayValue?has_content >
+ <#assign orgLabelValue = orgLabelDisplayValue />
+ #if>