From 8e630a138e3ba2f1e064940216b33dd7b592d733 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Feb 2020 12:36:54 +0100 Subject: [PATCH] Bug 21746: Remove NO_LIBRARY_SET NO_LIBRARY_SET was used when the DB user was logged in. Since bug 20489 it's not longer possible. We could remove the code. One occurrence left in C4::InstallAuth as there is no (real) logged in user yet. Test plan: * Install Koha to make sure NO_LIBRARY_SET is not needed during the install process * Login into Koha * Make sure the your library's name is displayed correctly in the header * Set another library * Confirm that the library's name is updated Signed-off-by: Bernardo Gonzalez Kriegel No problem during install, nor changing library. Fixed (pre-existing) tab in circ/branchtransfers.pl No errors --- acqui/basket.pl | 6 ++---- admin/smart-rules.pl | 2 -- catalogue/detail.pl | 3 +-- circ/branchtransfers.pl | 2 +- circ/circulation.pl | 7 ------- circ/returns.pl | 5 ----- .../intranet-tmpl/prog/en/includes/header.inc | 18 +++++------------- tools/overduerules.pl | 1 - 8 files changed, 9 insertions(+), 35 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index d248f11c92..459f2956bb 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -199,8 +199,7 @@ if ( $op eq 'delete_confirm' ) { # if requested, create basket group, close it and attach the basket if ($query->param('createbasketgroup')) { my $branchcode; - if(C4::Context->userenv and C4::Context->userenv->{'branch'} - and C4::Context->userenv->{'branch'} ne "NO_LIBRARY_SET") { + if(C4::Context->userenv and C4::Context->userenv->{'branch'}) { $branchcode = C4::Context->userenv->{'branch'}; } my $basketgroupid = NewBasketgroup( { name => $basket->{basketname}, @@ -543,8 +542,7 @@ sub edi_close_and_order { if ( $query->param('createbasketgroup') ) { my $branchcode; if ( C4::Context->userenv - and C4::Context->userenv->{'branch'} - and C4::Context->userenv->{'branch'} ne "NO_LIBRARY_SET" ) + and C4::Context->userenv->{'branch'} ) { $branchcode = C4::Context->userenv->{'branch'}; } diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 236ca8f062..6bea920dd9 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -66,8 +66,6 @@ my $can_edit_from_any_library = $logged_in_patron->has_permission( {parameters = $template->param( restricted_to_own_library => not $can_edit_from_any_library ); $branch = C4::Context::mybranch() unless $can_edit_from_any_library; -$branch = '*' if $branch eq 'NO_LIBRARY_SET'; - my $op = $input->param('op') || q{}; my $language = C4::Languages::getlanguage(); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index eb46ea5b95..89ae2689dd 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -382,8 +382,7 @@ foreach my $item (@items) { } } - if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" - and C4::Context->preference('SeparateHoldings')) { + if ($currentbranch and C4::Context->preference('SeparateHoldings')) { if ($itembranchcode and $itembranchcode eq $currentbranch) { push @itemloop, $item; } else { diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index f65402d412..a8637ceba8 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -45,7 +45,7 @@ if (!C4::Context->userenv){ my $sessionID = $query->cookie("CGISESSID"); my $session; $session = get_session($sessionID) if $sessionID; - if (!$session or $session->param('branch') eq 'NO_LIBRARY_SET'){ + if (!$session){ # no branch set we can't transfer print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl"); exit; diff --git a/circ/circulation.pl b/circ/circulation.pl index 731565b268..1572a080e5 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -73,13 +73,6 @@ my $override_high_holds_tmp = $query->param('override_high_holds_tmp'); my $sessionID = $query->cookie("CGISESSID") ; my $session = get_session($sessionID); -if (!C4::Context->userenv){ - if ($session->param('branch') eq 'NO_LIBRARY_SET'){ - # no branch set we can't issue - print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl"); - exit; - } -} my $barcodes = []; my $barcode = $query->param('barcode'); diff --git a/circ/returns.pl b/circ/returns.pl index a9e2bc243c..3bf7feef1f 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -70,11 +70,6 @@ my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( my $sessionID = $query->cookie("CGISESSID"); my $session = get_session($sessionID); -if ($session->param('branch') eq 'NO_LIBRARY_SET'){ - # no branch set we can't return - print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl"); - exit; -} # Print a reserve slip on this page if ( $query->param('print_slip') ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 460fd83f38..512f274662 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -78,12 +78,8 @@ [% ELSE %] - [% IF ( LoginBranchname == 'NO_LIBRARY_SET' ) %] - NO LIBRARY SET - [% ELSE %] - [% LoginBranchname | html %] - [% Branches.GetLoggedInBranchcode | html %] - [% END %] + [% LoginBranchname | html %] + [% Branches.GetLoggedInBranchcode | html %] [% END %] @@ -101,13 +97,9 @@ [% LoginBranchname | html %] [% ELSE %] - [% IF ( LoginBranchname == 'NO_LIBRARY_SET' ) %] - NO LIBRARY SET - [% ELSE %] - Location:
- [% LoginBranchname | html %] - [% Branches.GetLoggedInBranchcode | html %] - [% END %] + Location:
+ [% LoginBranchname | html %] + [% Branches.GetLoggedInBranchcode | html %] [% END %] diff --git a/tools/overduerules.pl b/tools/overduerules.pl index 616f6070ea..da028152c2 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -77,7 +77,6 @@ $branch = : Koha::Libraries->search->count() == 1 ? undef : undef; $branch ||= q{}; -$branch = q{} if $branch eq 'NO_LIBRARY_SET'; my $op = $input->param('op'); $op ||= q{}; -- 2.17.1