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 <bgkriegel@gmail.com>
No problem during install, nor changing library.
Fixed (pre-existing) tab in circ/branchtransfers.pl
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-02-14 12:36:54 +01:00 committed by Martin Renvoize
parent f870d027e4
commit a28e1928d3
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
8 changed files with 9 additions and 35 deletions

View File

@ -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'};
}

View File

@ -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();

View File

@ -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 {

View File

@ -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;

View File

@ -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');

View File

@ -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') ) {

View File

@ -78,12 +78,8 @@
</brand>
[% ELSE %]
<strong>
[% IF ( LoginBranchname == 'NO_LIBRARY_SET' ) %]
NO LIBRARY SET
[% ELSE %]
<span class="logged-in-branch-name">[% LoginBranchname | html %]</span>
<span class="logged-in-branch-code content_hidden">[% Branches.GetLoggedInBranchcode | html %]</span>
[% END %]
<span class="logged-in-branch-name">[% LoginBranchname | html %]</span>
<span class="logged-in-branch-code content_hidden">[% Branches.GetLoggedInBranchcode | html %]</span>
</strong>
[% END %]
</span>
@ -101,13 +97,9 @@
[% LoginBranchname | html %]
</brand>
[% ELSE %]
[% IF ( LoginBranchname == 'NO_LIBRARY_SET' ) %]
NO LIBRARY SET
[% ELSE %]
Location: <br />
<span class="logged-in-branch-name">[% LoginBranchname | html %]</span>
<span class="logged-in-branch-code content_hidden">[% Branches.GetLoggedInBranchcode | html %]</span>
[% END %]
Location: <br />
<span class="logged-in-branch-name">[% LoginBranchname | html %]</span>
<span class="logged-in-branch-code content_hidden">[% Branches.GetLoggedInBranchcode | html %]</span>
[% END %]
</li>

View File

@ -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{};