Bug 16011: $VERSION - Remove the $VERSION init
[koha.git] / C4 / ClassSortRoutine / LCC.pm
1 package C4::ClassSortRoutine::LCC;
2
3 # Copyright (C) 2007 LibLime
4 # Copyright (C) 2012 Equinox Software, Inc.
5
6 # This file is part of Koha.
7 #
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.
12 #
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.
17 #
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>.
20
21 use strict;
22 use warnings;
23 use Library::CallNumber::LC;
24
25 use vars qw();
26
27 # set the version for version checking
28
29 =head1 NAME 
30
31 C4::ClassSortRoutine::LCC - generic call number sorting key routine
32
33 =head1 SYNOPSIS
34
35 use C4::ClassSortRoutine;
36
37 my $cn_sort = GetClassSortKey('LCC', $cn_class, $cn_item);
38
39 =head1 FUNCTIONS
40
41 =head2 get_class_sort_key
42
43   my $cn_sort = C4::ClassSortRoutine::LCC::LCC($cn_class, $cn_item);
44
45 Generates sorting key for LC call numbers.
46
47 =cut
48
49 sub get_class_sort_key {
50     my ($cn_class, $cn_item) = @_;
51
52     $cn_class = '' unless defined $cn_class;
53     $cn_item  = '' unless defined $cn_item;
54     my $call_number = Library::CallNumber::LC->new(uc "$cn_class $cn_item");
55     return '' unless defined $call_number;
56     my $key = $call_number->normalize();
57     $key = '' unless defined $key;
58     return $key;
59
60 }
61
62 1;
63
64 =head1 AUTHOR
65
66 Koha Development Team <http://koha-community.org/>
67
68 =cut
69