From 99586ed5f33499d64132da06a76aa26572cb8843 Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 24 May 2012 04:32:17 +1200 Subject: [PATCH] Bug 6679: Fixing 5 perlcritic violations in opac/* Content-Type: text/plain; charset="UTF-8" 1 more to go... :) opac/changelanguage.pl: Code before strictures are enabled at line 24, column 1. See page 429 of PBP. (Severity: 5) Note: Rebased on master 06/09/2012 by jcamins --- opac/changelanguage.pl | 4 ++-- opac/opac-detail.pl | 9 ++++++--- opac/opac-reserve.pl | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/opac/changelanguage.pl b/opac/changelanguage.pl index 3d1c2a8..6095324 100755 --- a/opac/changelanguage.pl +++ b/opac/changelanguage.pl @@ -15,8 +15,8 @@ # 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; FIXME - Bug 2505 +use strict; +use warnings; use C4::Templates; use CGI; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 4a92d9a..eaad3e2 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -143,8 +143,10 @@ if ($session->param('busc')) { my @servers; @servers = @{$arrParamsBusc->{'server'}} if $arrParamsBusc->{'server'}; @servers = ("biblioserver") unless (@servers); - my $default_sort_by = C4::Context->preference('OPACdefaultSortField')."_".C4::Context->preference('OPACdefaultSortOrder') if (C4::Context->preference('OPACdefaultSortField') && C4::Context->preference('OPACdefaultSortOrder')); - my @sort_by = @{$arrParamsBusc->{'sort_by'}} if $arrParamsBusc->{'sort_by'}; + + my ($default_sort_by, @sort_by); + $default_sort_by = C4::Context->preference('OPACdefaultSortField')."_".C4::Context->preference('OPACdefaultSortOrder') if (C4::Context->preference('OPACdefaultSortField') && C4::Context->preference('OPACdefaultSortOrder')); + @sort_by = @{$arrParamsBusc->{'sort_by'}} if $arrParamsBusc->{'sort_by'}; $sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by); my ($error, $results_hashref, $facets); eval { @@ -420,7 +422,8 @@ my @items; my @hiddenitems = GetHiddenItemnumbers(@all_items); # Are there items to hide? -my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitems) > 0; +my $hideitems; +$hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitems) > 0; # Hide items if ($hideitems) { diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index aae8314..1fb4df0 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -57,7 +57,7 @@ for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { m/priority/ and $show_priority = 1; } -sub get_out ($$$) { +sub get_out { output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output; exit; } -- 1.7.2.5