Bug 21722: Use Koha::Account->add_debit in chargelostitem
[koha.git] / C4 / ItemCirculationAlertPreference.pm
index 9659cf6..4eb263c 100644 (file)
@@ -1,27 +1,30 @@
 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 <http://www.gnu.org/licenses>.
 
 use strict;
 use warnings;
 use C4::Context;
-use C4::Category;
-use C4::ItemType;
 use Carp qw(carp croak);
 
+use Koha::ItemTypes;
+use Koha::Patron::Categories;
+
 our $AUTOLOAD;
 
 # helper function for validating \%opts
@@ -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_limited;
+    my @it = Koha::ItemTypes->search;
     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 <john.beppu@liblime.com>
 =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