1 package C4
::ClassSortRoutine
::LCC
;
3 # Copyright (C) 2007 LibLime
4 # Copyright (C) 2012 Equinox Software, Inc.
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
23 use Library
::CallNumber
::LC
;
29 C4::ClassSortRoutine::LCC - generic call number sorting key routine
33 use C4::ClassSortRoutine;
35 my $cn_sort = GetClassSortKey('LCC', $cn_class, $cn_item);
39 =head2 get_class_sort_key
41 my $cn_sort = C4::ClassSortRoutine::LCC::LCC($cn_class, $cn_item);
43 Generates sorting key for LC call numbers.
47 sub get_class_sort_key
{
48 my ($cn_class, $cn_item) = @_;
50 $cn_class = '' unless defined $cn_class;
51 $cn_item = '' unless defined $cn_item;
52 my $call_number = Library
::CallNumber
::LC
->new(uc "$cn_class $cn_item");
53 return '' unless defined $call_number;
54 my $key = $call_number->normalize();
55 $key = '' unless defined $key;
64 Koha Development Team <http://koha-community.org/>