Add 'use warnings' and correct uninitialized value warnings.
authorStan Brinkerhoff <koha@brinkerhoff.org>
Wed, 24 Dec 2008 12:41:56 +0000 (07:41 -0500)
committerGalen Charlton <galen.charlton@liblime.com>
Tue, 30 Dec 2008 01:52:45 +0000 (19:52 -0600)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
admin/branches.pl

index fecc030..6ce54a3 100755 (executable)
@@ -44,6 +44,7 @@ FIXME: looped html (e.g., list of checkboxes) need to be properly
 =cut
 
 use strict;
+use warnings;
 use CGI;
 use C4::Auth;
 use C4::Context;
@@ -63,6 +64,10 @@ my $branchname   = $input->param('branchname');
 my $categorycode = $input->param('categorycode');
 my $op           = $input->param('op');
 
+if(!defined($op)){
+  $op = '';
+}
+
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     {
         template_name   => "admin/branches.tmpl",
@@ -338,7 +343,7 @@ sub branchinfotable {
         $branchinfo = GetBranchInfo(undef,'properties');
     }
     my $toggle;
-    my $i;
+    my $i = 0;
     my @loop_data = ();
     foreach my $branch (@$branchinfo) {
         ( $i % 2 ) ? ( $toggle = 1 ) : ( $toggle = 0 );