Bug 10480: Use the framework plugin object in cataloguing
[koha.git] / C4 / ClassSortRoutine / LCC.pm
blobf5f4a1c85c24fcdf92a29e213b96a1aef3543774
1 package C4::ClassSortRoutine::LCC;
3 # Copyright (C) 2007 LibLime
4 # Copyright (C) 2012 Equinox Software, Inc.
5 #
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
11 # version.
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with Koha; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 use strict;
22 use warnings;
23 use Library::CallNumber::LC;
25 use vars qw($VERSION);
27 # set the version for version checking
28 $VERSION = 3.07.00.049;
30 =head1 NAME
32 C4::ClassSortRoutine::LCC - generic call number sorting key routine
34 =head1 SYNOPSIS
36 use C4::ClassSortRoutine;
38 my $cn_sort = GetClassSortKey('LCC', $cn_class, $cn_item);
40 =head1 FUNCTIONS
42 =head2 get_class_sort_key
44 my $cn_sort = C4::ClassSortRoutine::LCC::LCC($cn_class, $cn_item);
46 Generates sorting key for LC call numbers.
48 =cut
50 sub get_class_sort_key {
51 my ($cn_class, $cn_item) = @_;
53 $cn_class = '' unless defined $cn_class;
54 $cn_item = '' unless defined $cn_item;
55 my $call_number = Library::CallNumber::LC->new(uc "$cn_class $cn_item");
56 return '' unless defined $call_number;
57 my $key = $call_number->normalize();
58 $key = '' unless defined $key;
59 return $key;
65 =head1 AUTHOR
67 Koha Development Team <http://koha-community.org/>
69 =cut