From 500884e8c9b8875e5620ceb62b0e8a35a895b8d3 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 16 Feb 2012 11:00:16 +0000 Subject: [PATCH] Bug 7546 Do not call routine as bareword Fixes compilation errors due to calling routine without parens Also nothing was gained (and obfuscation added) by forcing the return into a hash ref have changed variable to hash tidied up the if else chain These routines should be refactored out future Signed-off-by: Paul Poulain --- serials/serials-edit.pl | 13 +++++++------ serials/subscription-detail.pl | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 9ecd09f..12f568c 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -403,14 +403,15 @@ output_html_with_http_headers $query, $cookie, $template->output; sub get_default_view { my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); - my $views = { C4::Search::enabled_staff_search_views }; - if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { + my %views = C4::Search::enabled_staff_search_views(); + if ( $defaultview eq 'isbd' && $views{can_view_ISBD} ) { return 'ISBDdetail'; - } elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { + } + elsif ( $defaultview eq 'marc' && $views{can_view_MARC} ) { return 'MARCdetail'; - } elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) { + } + elsif ( $defaultview eq 'labeled_marc' && $views{can_view_labeledMARC} ) { return 'labeledMARCdetail'; - } else { - return 'detail'; } + return 'detail'; } diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 8e7f418..d267bc3 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -143,14 +143,15 @@ output_html_with_http_headers $query, $cookie, $template->output; sub get_default_view { my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); - my $views = { C4::Search::enabled_staff_search_views }; - if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { + my %views = C4::Search::enabled_staff_search_views(); + if ( $defaultview eq 'isbd' && $views{can_view_ISBD} ) { return 'ISBDdetail'; - } elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { + } + elsif ( $defaultview eq 'marc' && $views{can_view_MARC} ) { return 'MARCdetail'; - } elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) { + } + elsif ( $defaultview eq 'labeled_marc' && $views{can_view_labeledMARC} ) { return 'labeledMARCdetail'; - } else { - return 'detail'; } + return 'detail'; } -- 1.7.5.4