Bugfixes for Freemarker functions
git-svn-id: https://svn.libreccm.org/ccm/trunk@6084 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ab8ed2e2e4
commit
4115973bf0
|
|
@ -26,7 +26,15 @@
|
|||
</#function>
|
||||
|
||||
<#function getObjectCount listId>
|
||||
<#if (model["/bebop:page/*[@id='${listId}']/nav:noContent"]?size > 0)>
|
||||
<#return 0>
|
||||
<#elseif (model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectCount"]?size > 0)>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/@objectCount"]?number>
|
||||
<#elseif (model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/count"]?size > 0)>
|
||||
<#return model["/bebop:page/*[@id='${listId}']/nav:objectList/nav:paginator/count"]?number>
|
||||
<#else>
|
||||
<#return 0>
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#function getPaginatorBaseUrl listId>
|
||||
|
|
|
|||
|
|
@ -14,11 +14,19 @@
|
|||
</#function>
|
||||
|
||||
<#function getTitleFilterValue list>
|
||||
<#if (list["./filters/title"]?size > 0)>
|
||||
<#return list["./filters/title"]>
|
||||
<#else>
|
||||
<#return "">
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#function getResearchFieldFilterValue list>
|
||||
<#if (list["./filters/researchfield"]?size > 0)>
|
||||
<#return list["./filters/researchfield"]>
|
||||
<#else>
|
||||
<#return "">
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#function getCount list>
|
||||
|
|
@ -65,6 +73,10 @@
|
|||
<#return item["./@object-type"]>
|
||||
</#function>
|
||||
|
||||
<#function getProjectItemBegin item>
|
||||
<#return item["./project-begin"]>
|
||||
</#function>
|
||||
|
||||
<#function getProjectItemBeginDay item>
|
||||
<#return item["./project-begin/@day"]>
|
||||
</#function>
|
||||
|
|
@ -77,6 +89,10 @@
|
|||
<#return item["./project-begin/@year"]>
|
||||
</#function>
|
||||
|
||||
<#function getProjectItemEnd item>
|
||||
<#return item["./project-end"]>
|
||||
</#function>
|
||||
|
||||
<#function getProjectItemEndDay item>
|
||||
<#return item["./project-end/@day"]>
|
||||
</#function>
|
||||
|
|
|
|||
|
|
@ -35,5 +35,11 @@
|
|||
</#function>
|
||||
|
||||
<#function formatDateTime style date>
|
||||
<#return _formatDateTime(style, date["./@year"], date["./@month"], date["./@day"], date["./@hour"], date["./@minute"], date["./@second"])>
|
||||
<#assign year = (date["./@year"]?size > 0)?then(date["./@year"], 0)>
|
||||
<#assign month = (date["./@month"]?size > 0)?then(date["./@month"], 0)>
|
||||
<#assign day = (date["./@day"]?size > 0)?then(date["./@day"], 0)>
|
||||
<#assign hour = (date["./@hour"]?size > 0)?then(date["./@hour"], 0)>
|
||||
<#assign minute = (date["./@minute"]?size > 0)?then(date["./@minute"], 0)>
|
||||
<#assign second = (date["./@second"]?size > 0)?then(date["./@second"], 0)>
|
||||
<#return _formatDateTime(style, year, month, day, hour, minute, second)>
|
||||
</#function>
|
||||
Loading…
Reference in New Issue