From 5474fe2bb7e6ea2f3c0eab13f8da8512722d9f18 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 6 Jan 2011 21:19:44 +0000 Subject: [PATCH] NIHVIVO-1610 Extracted datetime code in propStatement templates into a macro. --- .../propStatement-educationalTraining.ftl | 26 ++----------------- .../individual/propStatement-hasRole.ftl | 26 ++----------------- .../propStatement-organizationForPosition.ftl | 26 ++----------------- .../propStatement-personInPosition.ftl | 24 +---------------- .../individual/propStatement-relatedRole.ftl | 26 ++----------------- 5 files changed, 9 insertions(+), 119 deletions(-) diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl index d8dabead..64026c4a 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl @@ -25,29 +25,7 @@ ${statement.edTrainingName} (no linked organization) - - <#local dateTimeInterval> - <#if statement.dateTimeStart??> - <#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)> - - <#if statement.dateTimeEnd??> - <#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)> - - <#if startYear?? && endYear??> - ${startYear} - ${endYear} - <#elseif startYear??> - ${startYear} - - <#elseif endYear ??> - ${endYear} <#-- no hyphen, so doesn't display as a range with missing start date --> - - - - <#local date> - <#if dateTimeInterval?has_content> - ${dateTimeInterval} - - - - <@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info! ] /> ${date} + + <@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info! ] /> <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" false/> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl index 9fadc30f..57789be3 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -19,29 +19,7 @@ ${statement.roleName} (no linked activity) - - <#local dateTimeInterval> - <#if statement.dateTimeStart??> - <#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)> - - <#if statement.dateTimeEnd??> - <#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)> - - <#if startYear?? && endYear??> - ${startYear} - ${endYear} - <#elseif startYear??> - ${startYear} - - <#elseif endYear ??> - - ${endYear} - - - - <#local dateInRole> - <#if dateTimeInterval?has_content> - ${dateTimeInterval} - - - - ${linkedIndividual} ${statement.specificRole} ${dateInRole!} + + ${linkedIndividual} ${statement.specificRole} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl index e199acc9..fcac5b55 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl @@ -19,29 +19,7 @@ ${statement.positionName} (no linked person) - - <#local dateTimeInterval> - <#if statement.dateTimeStart??> - <#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)> - - <#if statement.dateTimeEnd??> - <#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)> - - <#if startYear?? && endYear??> - ${startYear} - ${endYear} - <#elseif startYear??> - ${startYear} - - <#elseif endYear ??> - - ${endYear} - - - - <#local dateInPosition> - <#if dateTimeInterval?has_content> - ${dateTimeInterval} - - - - <@s.join [ linkedIndividual, statement.positionTitle! ] /> ${dateInPosition!} + + <@s.join [ linkedIndividual, statement.positionTitle! ] /> <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl index 2ecba302..b46c8414 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl @@ -20,28 +20,6 @@ - <#local dateTimeInterval> - <#if statement.dateTimeStart??> - <#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)> - - <#if statement.dateTimeEnd??> - <#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)> - - <#if startYear?? && endYear??> - ${startYear} - ${endYear} - <#elseif startYear??> - ${startYear} - - <#elseif endYear ??> - - ${endYear} - - - - <#local dateInPosition> - <#if dateTimeInterval?has_content> - ${dateTimeInterval} - - - - <@s.join [ linkedIndividual, statement.positionTitle! ] /> ${dateInPosition!} + <@s.join [ linkedIndividual, statement.positionTitle! ] /> <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl index c89497dd..53c53005 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl @@ -19,29 +19,7 @@ ${statement.roleName} (no linked individual in this role) - - <#local dateTimeInterval> - <#if statement.dateTimeStart??> - <#local startYear = dt.xsdDateTimeToYear(statement.dateTimeStart)> - - <#if statement.dateTimeEnd??> - <#local endYear = dt.xsdDateTimeToYear(statement.dateTimeEnd)> - - <#if startYear?? && endYear??> - ${startYear} - ${endYear} - <#elseif startYear??> - ${startYear} - - <#elseif endYear ??> - - ${endYear} - - - - <#local dateInRole> - <#if dateTimeInterval?has_content> - ${dateTimeInterval} - - - - ${linkedIndividual} ${statement.specificRole} ${dateInRole!} + + ${linkedIndividual} ${statement.specificRole} <@dt.yearInterval "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> \ No newline at end of file