From e596e8641c9a18936c26876fbddcaf5745f824e7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Feb 2020 12:43:14 +0100 Subject: [PATCH] Bug 21746: Remove LoginBranchname and LoginBranchcode Those 2 variables can be replaced by logged_in_user that is passed to all the template via C4::Auth --- C4/Auth.pm | 3 --- circ/selectbranchprinter.pl | 2 -- koha-tmpl/intranet-tmpl/prog/en/includes/header.inc | 13 +++++++------ .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- .../intranet-tmpl/prog/en/modules/circ/branchoverdues.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt | 2 +- .../prog/en/modules/circ/selectbranchprinter.tt | 2 +- .../prog/en/modules/labels/label-edit-batch.tt | 2 +- .../intranet-tmpl/prog/en/modules/labels/label-manage.tt | 2 +- .../intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt | 2 +- .../intranet-tmpl/prog/en/modules/patroncards/manage.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- 15 files changed, 22 insertions(+), 26 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index c825136af1..917f245df8 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -460,7 +460,6 @@ sub get_template_and_user { GoogleJackets => C4::Context->preference("GoogleJackets"), OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"), KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"), - LoginBranchcode => ( C4::Context->userenv ? C4::Context->userenv->{"branch"} : undef ), LoginFirstname => ( C4::Context->userenv ? C4::Context->userenv->{"firstname"} : "Bel" ), LoginSurname => C4::Context->userenv ? C4::Context->userenv->{"surname"} : "Inconnu", emailaddress => C4::Context->userenv ? C4::Context->userenv->{"emailaddress"} : undef, @@ -488,7 +487,6 @@ sub get_template_and_user { IntranetNav => C4::Context->preference("IntranetNav"), IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"), LibraryName => C4::Context->preference("LibraryName"), - LoginBranchname => ( C4::Context->userenv ? C4::Context->userenv->{"branchname"} : undef ), advancedMARCEditor => C4::Context->preference("advancedMARCEditor"), canreservefromotherbranches => C4::Context->preference('canreservefromotherbranches'), intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), @@ -557,7 +555,6 @@ sub get_template_and_user { opac_name => $opac_name, LibraryName => "" . C4::Context->preference("LibraryName"), LibraryNameTitle => "" . $LibraryNameTitle, - LoginBranchname => C4::Context->userenv ? C4::Context->userenv->{"branchname"} : "", OPACAmazonCoverImages => C4::Context->preference("OPACAmazonCoverImages"), OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"), OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), diff --git a/circ/selectbranchprinter.pl b/circ/selectbranchprinter.pl index 0febd0ffb7..a15e0d0bbf 100755 --- a/circ/selectbranchprinter.pl +++ b/circ/selectbranchprinter.pl @@ -58,8 +58,6 @@ my @updated; if ( $branch and my $library = Koha::Libraries->find($branch) ) { if (! $userenv_branch or $userenv_branch ne $branch ) { my $branchname = $library->branchname; - $template->param(LoginBranchname => $branchname); # update template for new branch - $template->param(LoginBranchcode => $branch); # update template for new branch $session->param('branchname', $branchname); # update sesssion in DB $session->param('branch', $branch); # update sesssion in DB $session->flush(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 512f274662..734b394d07 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -63,6 +63,7 @@