From 64d8d581d27db12e3151c7900403c07e409d21ba Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 2 Oct 2012 10:01:11 -0400 Subject: [PATCH] Bug 8845 - Add ability search patrons by date of birth - Add tooltip --- Koha/Template/Plugin/Koha.pm | 49 ++++++++++++++++++++ .../prog/en/includes/doc-head-close.inc | 1 + .../prog/en/includes/patron-search.inc | 24 ++++++++++ 3 files changed, 74 insertions(+), 0 deletions(-) create mode 100644 Koha/Template/Plugin/Koha.pm diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm new file mode 100644 index 0000000..09bd97b --- /dev/null +++ b/Koha/Template/Plugin/Koha.pm @@ -0,0 +1,49 @@ +package Koha::Template::Plugin::Koha; + +# Copyright ByWater Solutions 2013 + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; + +use Template::Plugin; +use base qw( Template::Plugin ); + +use C4::Koha; +use C4::Context; + +=pod + +This plugin contains various Koha replated Template Toolkit functions +to help streamline Koha and to move logic from the Perl code into the +Templates when it makes sense to do so. + +To use, first, include the line '[% USE Koha %]' at the top +of the template to enable the plugin. + +For example: [% IF Koha.Preference( 'MyPreference ) == 'SettingA' %] +removes the necessity of setting a template variable in Perl code for +each and every system preference, even if no evaluation of the setting +is necessary. + +=cut + +sub Preference { + my ( $self, $pref ) = @_; + return C4::Context->preference( $pref ); +} + +1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc index 32eae21..ff2ba0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -13,6 +13,7 @@ + [% IF ( login ) %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 1881d57..95c3a79 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -1,3 +1,4 @@ +[% USE Koha %]

[% LibraryName %]