Bug 8435: DBRev 3.13.00.038
[koha.git] / C4 / ItemCirculationAlertPreference.pm
index 7ade3df..4d88fec 100644 (file)
@@ -1,5 +1,7 @@
 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
@@ -11,9 +13,9 @@ package C4::ItemCirculationAlertPreference;
 # 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, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -165,7 +167,7 @@ sub create {
             return $class->new($self);
         } else {
             carp $dbh->errstr;
-            return undef;
+            return;
         }
     }
 }
@@ -349,13 +351,20 @@ sub grid {
             my $key = $c->categorycode . "-" . $i->itemtype . "-" . $notification;
             $key =~ s/\*/_/g;
             my @classes;
+            my $text = " ";
             if ($disabled{$key}) {
                 push @classes, 'disabled';
+                $text = "Disabled for $where->{branchcode}";
             }
             if ($default{$key}) {
                 push @classes, 'default';
+                $text = "Disabled for all";
             }
-            push @{$row->{items}}, { class => join(' ', @classes),  id => $key };
+            push @{$row->{items}}, {
+                class => join(' ', @classes),
+                id    => $key,
+                text  => $text,
+            };
         }
     }
     return \@grid;
@@ -370,12 +379,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
@@ -387,7 +404,7 @@ sub AUTOLOAD {
     if (exists $self->{$attr}) {
         return $self->{$attr};
     } else {
-        return undef;
+        return;
     }
 }
 
@@ -406,14 +423,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