Bug 7673: QA Followup: trailing whitespace and perlcritic issues
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 3 Dec 2013 14:09:01 +0000 (15:09 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 11 Nov 2014 15:27:09 +0000 (12:27 -0300)
This patch fixes the following qa issues:

 FAIL   cataloguing/additem.pl
   FAIL   forbidden patterns
        forbidden pattern: trailing space char (line 833)
   FAIL   critic
        # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).

 FAIL   tools/batchMod.pl
   FAIL   critic
        # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
cataloguing/additem.pl
tools/batchMod.pl

index fe1db82..5f35077 100755 (executable)
@@ -369,8 +369,8 @@ my ($template, $loggedinuser, $cookie)
 
 
 # Does the user have a limited item edition permission?
-my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser) ;
-my $limitededition = haspermission($uid,  {'editcatalogue' => 'limited_item_edition'}) if ($uid);
+my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef;
+my $limitededition = $uid ? haspermission($uid,  {'editcatalogue' => 'limited_item_edition'}) : undef;
 # In case user is a superlibrarian, edition is not limited
 $limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1);
 
@@ -833,7 +833,7 @@ foreach my $tag ( keys %{$tagslib}){
             my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $limitededition);
             push (@loop_data, $subfield_data);
             $i++;
-        } 
+        }
   }
 }
 @loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
index ca10f61..d0648e4 100755 (executable)
@@ -71,8 +71,8 @@ my ($template, $loggedinuser, $cookie)
                  });
 
 # Does the user have a limited item edition permission?
-my $uid = GetMember( borrowernumber => $loggedinuser )->{userid} if ($loggedinuser) ;
-my $limitededition = haspermission($uid,  {'tools' => 'items_limited_batchmod'}) if ($uid);
+my $uid = $loggedinuser ? GetMember( borrowernumber => $loggedinuser )->{userid} : undef;
+my $limitededition = $uid ? haspermission($uid,  {'tools' => 'items_limited_batchmod'}) : undef;
 # In case user is a superlibrarian, edition is not limited
 $limitededition = 0 if ($limitededition != 0 && $limitededition->{'superlibrarian'} eq 1);