From 285400f3df4c7ea7231633356a18ca4fcf856419 Mon Sep 17 00:00:00 2001 From: nac26 Date: Mon, 31 Jan 2011 16:51:10 +0000 Subject: [PATCH] NIHVIVO-1959 Added default value for property parameter in hasStatement(). Tried to put the onus of determining whether a property is available in the function. Work in progress. --- .../body/partials/individual/lib-properties.ftl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl index 5c01a094c..957deeed0 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -1,7 +1,13 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- Function to test whether any statements exist with property as predicate --> -<#function hasStatements property> +<#function hasStatements property=false> + <#-- First ensure that the property is defined + (an unpopulated property while logged out is undefined) --> + <#if property?is_boolean> + <#return false> + + <#if property.collatedBySubclass!false> <#-- collated --> <#if (property.subclasses?size > 0)> <#return true>