X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FItemCirculationAlertPreference.pm;h=2526e5c61af2df4bcd5c3dd5132709a27b88e3f6;hb=f3dd750a972ecd95c566d413a7d468ecc01df9fe;hp=9659cf64861a23715b28012c0722a677ca2337a7;hpb=9035706950cd2520f7019ceb2f09eebf83723a56;p=koha-ffzg.git diff --git a/C4/ItemCirculationAlertPreference.pm b/C4/ItemCirculationAlertPreference.pm index 9659cf6486..2526e5c61a 100644 --- a/C4/ItemCirculationAlertPreference.pm +++ b/C4/ItemCirculationAlertPreference.pm @@ -1,26 +1,29 @@ package C4::ItemCirculationAlertPreference; +# Copyright Liblime 2009 +# # 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 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 3 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. +# 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., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . use strict; use warnings; use C4::Context; -use C4::Category; -use C4::ItemType; -use Carp qw(carp croak); +use Carp qw( carp croak ); + +use Koha::ItemTypes; +use Koha::Patron::Categories; our $AUTOLOAD; @@ -165,7 +168,7 @@ sub create { return $class->new($self); } else { carp $dbh->errstr; - return undef; + return; } } } @@ -328,8 +331,8 @@ sub grid { my ($class, $where) = @_; my @branch_prefs = $class->find($where); my @default_prefs = $class->find({ branchcode => '*', notification => $where->{notification} }); - my @cc = C4::Category->all; - my @it = C4::ItemType->all; + my @cc = Koha::Patron::Categories->search_with_library_limits->as_list; + my @it = Koha::ItemTypes->search->as_list; my $notification = $where->{notification}; my %disabled = map { my $key = $_->categorycode . "-" . $_->item_type . "-" . $notification; @@ -377,12 +380,20 @@ These are read-only accessors for the various attributes of a preference. =head3 $pref->id +=cut + =head3 $pref->branchcode +=cut + =head3 $pref->categorycode +=cut + =head3 $pref->item_type +=cut + =head3 $pref->notification =cut @@ -394,7 +405,7 @@ sub AUTOLOAD { if (exists $self->{$attr}) { return $self->{$attr}; } else { - return undef; + return; } } @@ -413,14 +424,3 @@ John Beppu =cut 1; - -# Local Variables: *** -# mode: cperl *** -# indent-tabs-mode: nil *** -# cperl-close-paren-offset: -4 *** -# cperl-continued-statement-offset: 4 *** -# cperl-indent-level: 4 *** -# cperl-indent-parens-as-block: t *** -# cperl-tab-always-indent: nil *** -# End: *** -# vim:tabstop=8 softtabstop=4 shiftwidth=4 shiftround expandtab