From cf6d5098b48283e4c08e5c986b3e564c531d0675 Mon Sep 17 00:00:00 2001 From: bdc34 Date: Wed, 5 Jan 2011 20:45:58 +0000 Subject: [PATCH] Adding some changes to DateTimeWidget. NIHVIVO-631 --- .../vitro/webapp/edit/elements/DateTimeWithPrecision.java | 4 ++-- .../web/templates/freemarker/edit/dateTimeWithPrecision.ftl | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/elements/DateTimeWithPrecision.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/elements/DateTimeWithPrecision.java index 9cc51efd0..c0fb0d179 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/elements/DateTimeWithPrecision.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/elements/DateTimeWithPrecision.java @@ -84,7 +84,7 @@ public class DateTimeWithPrecision extends BaseEditElement { //it would be nice to have only the version of the constructor that takes the enum //but this is to quickly get the JSP configuration working. public DateTimeWithPrecision(Field field, String minimumPrecisionURI, String displayRequiredLevelUri){ - super(field); + this(field); this.minimumPrecision = toPrecision( minimumPrecisionURI); if( this.minimumPrecision == null ) @@ -116,7 +116,7 @@ public class DateTimeWithPrecision extends BaseEditElement { /** * This produces a map for use in the template. */ - private Map getMapForTemplate(EditConfiguration editConfig, EditSubmission editSub) { + protected Map getMapForTemplate(EditConfiguration editConfig, EditSubmission editSub) { Mapmap = new HashMap(); //always need the fieldName, required precision, and constants diff --git a/webapp/web/templates/freemarker/edit/dateTimeWithPrecision.ftl b/webapp/web/templates/freemarker/edit/dateTimeWithPrecision.ftl index 35c1f0ee3..b7da42827 100644 --- a/webapp/web/templates/freemarker/edit/dateTimeWithPrecision.ftl +++ b/webapp/web/templates/freemarker/edit/dateTimeWithPrecision.ftl @@ -30,10 +30,12 @@ precisionConstants.minute -- URI for precision precisionConstants.second -- URI for precision --> + ${fieldName} <@dateTime specificity="${minimumPrecision}" required="${requiredLevel}" /> <#macro dateTime specificity="full" required=specificity> - + + <#assign specLevel = 10 /> <#assign reqLevel = 10 /> <#if specificity == "${precisionConstants.year}">