@@ -, +, @@
KohaAuthorisedValues and AuthorisedValues
name is still visible
---
Koha/Template/Plugin/AuthorisedValues.pm | 12 +++++
Koha/Template/Plugin/KohaAuthorisedValues.pm | 50 --------------------
.../prog/en/modules/circ/circulation.tt | 18 +++----
.../prog/en/modules/suggestion/suggestion.tt | 8 ++--
.../opac-tmpl/prog/en/includes/item-status.inc | 6 +--
.../opac-tmpl/prog/en/modules/opac-suggestions.tt | 4 +-
6 files changed, 30 insertions(+), 68 deletions(-)
delete mode 100644 Koha/Template/Plugin/KohaAuthorisedValues.pm
--- a/Koha/Template/Plugin/AuthorisedValues.pm
+++ a/Koha/Template/Plugin/AuthorisedValues.pm
@@ -26,6 +26,18 @@ use Encode qw{encode decode};
use C4::Koha;
+=pod
+
+To use, first, include the line '[% USE AuthorisedValues %]' at the top
+of the template to enable the plugin.
+
+Now, in a template, you can get the description for an authorised value with
+the following TT code: [% AuthorisedValues.GetByCode( 'CATEGORY', 'AUTHORISED_VALUE_CODE', 'IS_OPAC' ) %]
+
+The parameters are identical to those used by the subroutine C4::Koha::GetAuthorisedValueByCode.
+
+=cut
+
sub GetByCode {
my ( $self, $category, $code, $opac ) = @_;
return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
--- a/Koha/Template/Plugin/KohaAuthorisedValues.pm
+++ a/Koha/Template/Plugin/KohaAuthorisedValues.pm
@@ -1,50 +0,0 @@
-package Koha::Template::Plugin::KohaAuthorisedValues;
-
-# Copyright ByWater Solutions 2012
-
-# 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;
-
-=pod
-
-This plugin allows one to get the description for an authorised value
-from within a template.
-
-First, include the line '[% USE KohaAuthorisedValues %]' at the top
-of the template to enable the plugin.
-
-To use, call KohaAuthorisedValues.GetByCode with the category
-of the authorised value, the code to look up, and optionally,
-the OPAC flag ( if set, it will return the OPAC description rather
-than the Intranet description ).
-
-For example: [% KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
-will print the OPAC description for the LOST value stored in item.itemlost.
-
-=cut
-
-sub GetByCode {
- my ( $self, $category, $code, $opac ) = @_;
- return GetAuthorisedValueByCode( $category, $code, $opac );
-}
-
-1;
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -3,7 +3,7 @@
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
[% SET exports_enabled = 1 %]
[% END %]
-[% USE KohaAuthorisedValues %]
+[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
[% SET destination = "circ" %]
Koha › Circulation
@@ -371,7 +371,7 @@ function validate1(date) {
[% IF ( itemtype_notforloan ) %]
Item type is normally not for loan.
[% ELSIF ( item_notforloan ) %]
- [% item_notforloan_lib = KohaAuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
+ [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
Item is normally not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
[% END %]
Check out anyway?
@@ -504,7 +504,7 @@ function validate1(date) {
[% IF ( itemtype_notforloan ) %]
Item type not for loan.
[% ELSIF ( item_notforloan ) %]
- [% item_notforloan_lib = KohaAuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
+ [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
Item not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
[% END %]
@@ -847,10 +847,10 @@ No patron matched [% message %]
[% todayissue.dd %]
[% IF ( todayissue.itemlost ) %]
- [% KohaAuthorisedValues.GetByCode( 'LOST', todayissue.itemlost ) %]
+ [% AuthorisedValues.GetByCode( 'LOST', todayissue.itemlost ) %]
[% END %]
[% IF ( todayissue.damaged ) %]
- [% KohaAuthorisedValues.GetByCode( 'DAMAGED', todayissue.damaged ) %]
+ [% AuthorisedValues.GetByCode( 'DAMAGED', todayissue.damaged ) %]
[% END %]
[% todayissue.title |html %][% FOREACH subtitl IN todayissue.subtitle %] [% subtitl.subfield %][% END %][% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- [% todayissue.itemnotes %][% END %] [% todayissue.barcode %] |
@@ -934,10 +934,10 @@ No patron matched [% message %]
[% previssue.dd %]
[% IF ( previssue.itemlost ) %]
- [% KohaAuthorisedValues.GetByCode( 'LOST', previssue.itemlost ) %]
+ [% AuthorisedValues.GetByCode( 'LOST', previssue.itemlost ) %]
[% END %]
[% IF ( previssue.damaged ) %]
- [% KohaAuthorisedValues.GetByCode( 'DAMAGED', previssue.damaged ) %]
+ [% AuthorisedValues.GetByCode( 'DAMAGED', previssue.damaged ) %]
[% END %]
[% previssue.title |html %][% FOREACH subtitl IN previssue.subtitle %] [% subtitl.subfield %][% END %][% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %] [% previssue.barcode %] |
@@ -1072,10 +1072,10 @@ No patron matched [% message %]
[% relissue.dd %]
[% IF ( relissue.itemlost ) %]
- [% KohaAuthorisedValues.GetByCode( 'LOST', relissue.itemlost ) %]
+ [% AuthorisedValues.GetByCode( 'LOST', relissue.itemlost ) %]
[% END %]
[% IF ( relissue.damaged ) %]
- [% KohaAuthorisedValues.GetByCode( 'DAMAGED', relissue.damaged ) %]
+ [% AuthorisedValues.GetByCode( 'DAMAGED', relissue.damaged ) %]
[% END %]
[% relissue.title |html %][% FOREACH subtitl IN relissue.subtitle %] [% subtitl.subfield %][% END %][% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- [% relissue.itemnotes %][% END %] [% relissue.barcode %] |
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -1,4 +1,4 @@
-[% USE KohaAuthorisedValues %]
+[% USE AuthorisedValues %]
[% USE KohaBranchName %]
[% INCLUDE 'doc-head-open.inc' %]
Koha › Acquisitions ›
@@ -431,7 +431,7 @@ $(document).ready(function() { calcNewsuggTotal(); });
[% ELSE %][% suggestion.suggestiontypelabel %][% END %]
[% ELSE %]
[% IF ( suggestion.suggestiontype ) %]
- [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
+ [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
[% ELSE %]
No name
[% END %]
@@ -498,8 +498,8 @@ $(document).ready(function() { calcNewsuggTotal(); });
Rejected
[% ELSIF ( suggestions_loo.CHECKED ) %]
Checked
- [% ELSIF KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
- [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
+ [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
+ [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
[% END %]
[% IF ( suggestions_loo.reason ) %]
--- a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
+++ a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
@@ -1,4 +1,4 @@
-[% USE KohaAuthorisedValues %]
+[% USE AuthorisedValues %]
[% IF ( item.datedue ) %]
[% IF ( OPACShowCheckoutName ) %]
@@ -14,7 +14,7 @@
[% ELSIF ( item.wthdrawn ) %]
Item withdrawn
[% ELSIF ( item.itemlost ) %]
- [% av_lib_include = KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
+ [% av_lib_include = AuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
[% IF ( av_lib_include ) %]
[% av_lib_include %]
[% ELSE %]
@@ -33,7 +33,7 @@
[% ELSIF ( item.notforloan_per_itemtype ) %]
Not for loan [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %]
[% ELSIF ( item.damaged ) %]
- [% av_lib_include = KohaAuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %]
+ [% av_lib_include = AuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %]
[% IF av_lib_include %]
[% av_lib_include %]
[% ELSE %]
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
+++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
@@ -1,5 +1,5 @@
[% USE Koha %]
-[% USE KohaAuthorisedValues %]
+[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
[% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
[% IF ( op_else ) %]Purchase Suggestions[% END %]
@@ -213,7 +213,7 @@
[% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
[% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
[% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
- [% ELSE %] [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
+ [% ELSE %] [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
[% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason %])[% END %]
--