Bugzilla – Attachment 98935 Details for
Bug 21746
Remove NO_LIBRARY_SET
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21746: Remove LoginBranchname and LoginBranchcode
Bug-21746-Remove-LoginBranchname-and-LoginBranchco.patch (text/plain), 18.07 KB, created by
Jonathan Druart
on 2020-02-14 12:07:47 UTC
(
hide
)
Description:
Bug 21746: Remove LoginBranchname and LoginBranchcode
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-14 12:07:47 UTC
Size:
18.07 KB
patch
obsolete
>From e596e8641c9a18936c26876fbddcaf5745f824e7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 @@ > </div> > <ul id="user-menu" class="nav navbar-nav navbar-right"> > [% IF ( loggedinusername ) %] >+ [% SET logged_in_library = logged_in_user.library %] > <li class="dropdown"> > <a href="#" id="logged-in-menu" role="button" class="dropdown-toggle" data-toggle="dropdown"> > <span id="logged-in-info-brief"> >@@ -74,12 +75,12 @@ > <span class="separator">|</span> > [% IF ( AutoLocation ) %] > <brand> >- [% LoginBranchname | html %] >+ [% logged_in_library.branchname | html %] > </brand> > [% ELSE %] > <strong> >- <span class="logged-in-branch-name">[% LoginBranchname | html %]</span> >- <span class="logged-in-branch-code content_hidden">[% Branches.GetLoggedInBranchcode | html %]</span> >+ <span class="logged-in-branch-name">[% logged_in_library.branchname | html %]</span> >+ <span class="logged-in-branch-code content_hidden">[% logged_in_library.branchcode | html %]</span> > </strong> > [% END %] > </span> >@@ -94,12 +95,12 @@ > <li class="loggedin-menu-label"> > [% IF ( AutoLocation ) %] > <brand> >- [% LoginBranchname | html %] >+ [% logged_in_library.branchname | html %] > </brand> > [% ELSE %] > Location: <br /> >- <span class="logged-in-branch-name">[% LoginBranchname | html %]</span> >- <span class="logged-in-branch-code content_hidden">[% Branches.GetLoggedInBranchcode | html %]</span> >+ <span class="logged-in-branch-name">[% logged_in_library.branchname | html %]</span> >+ <span class="logged-in-branch-code content_hidden">[% logged_in_library.branchcode | html %]</span> > [% END %] > </li> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 90fbd0d59b..7139804c6a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -121,7 +121,7 @@ > </div> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> > <input type="hidden" name="batch" value="[% batch | html %]" /> >- <input type="hidden" name="branchcode" value="[% LoginBranchcode | html %]" /> >+ <input type="hidden" name="branchcode" value="[% logged_in_user.branchcode | html %]" /> > </div> > <div class="modal-footer"> > <button class="btn btn-default approve" type="submit"><i class="fa fa-check"></i> Save</button> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >index 83dc7e30d1..f43082d84e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >@@ -64,7 +64,7 @@ > > [% IF ( loop_budget ) %] > >- <h3>All available funds[% IF LoginBranchname %] for [% LoginBranchname | html %][% END %]</h3> >+ <h3>All available funds for [% logged_in_user.library.branchname | html %]</h3> > > <div id="BudgetsAndFunds"> > <table id="accounts"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 20bb32bb37..fbdf1ca161 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -172,7 +172,7 @@ > <ul> > [% IF (SeparateHoldings) %] > <li> >- <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a> >+ <a href="#holdings">[% logged_in_user.library.branchname | html %] holdings ([% itemloop.size() || 0 | html %])</a> > </li> > <li> > <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >index 37744f6aa4..6dbda16441 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >@@ -1,14 +1,14 @@ > [% USE Branches %] > [% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Circulation › Overdues at [% LoginBranchname | html %]</title> >+<title>Koha › Circulation › Overdues at [% logged_in_user.library.branchname | html %]</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> > <body id="circ_branchoverdues" class="circ"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'circ-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › Overdues at [% LoginBranchname | html %]</div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › Overdues at [% logged_in_user.library.branchname | html %]</div> > > <div class="main container-fluid"> > <div class="row"> >@@ -19,7 +19,7 @@ > [% END %] > <main> > >-<h1>Circulation: Overdues at [% LoginBranchname | html %]</h1> >+<h1>Circulation: Overdues at [% logged_in_user.library.branchname | html %]</h1> > > <form name="selectlocation" action="branchoverdues.pl" method="post"> > <label for="location">Shelving location selected: </label><select id="location" name="location"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >index a46d4e78dd..c21829212b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >@@ -314,7 +314,7 @@ > > function synchronize() { > kohadb.saveSetting("userid", "[% logged_in_user.userid | html %]"); >- kohadb.saveSetting("branchcode", "[% LoginBranchcode | html %]"); >+ kohadb.saveSetting("branchcode", "[% logged_in_user.branchcode | html %]"); > showSyncInfo(); > [% UNLESS (AllowOfflineCirculation) %] > reloadRecords(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/selectbranchprinter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/selectbranchprinter.tt >index f2a65c92ab..70f6bd8a3d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/selectbranchprinter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/selectbranchprinter.tt >@@ -36,7 +36,7 @@ > Updated:<ul> > [% FOREACH update IN updated %] > [% IF ( update.updated_branch ) %] >- <li>Library: [% update.old_branch or "?" | html %] ⇒ [% update.LoginBranchcode or "?" | html %]</li> >+ <li>Library: [% update.old_branch or "?" | html %] ⇒ [% logged_in_user.branchcode | html %]</li> > [% ELSIF ( update.updated_printer ) %] > <!-- FIXME: <li>Printer: [% update.old_printer or "?" | html %] ⇒ [% update.new_printer or "?" | html %]</li> --> > [% ELSE %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >index 27282a95b9..0a2a7771db 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >@@ -57,7 +57,7 @@ > [% END %] > > <div id="manage-label-batches"> >- <div class="hint">Current library: [% LoginBranchname | html %]</div> >+ <div class="hint">Current library: [% logged_in_user.library.branchname | html %]</div> > <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> > <div> > <fieldset class="rows" style="border-bottom: 0px; border: 0px;"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >index 08c5e5d8a2..024c11c951 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >@@ -42,7 +42,7 @@ > [% END %] > > <div id="manage-label-layouts"> >- <div class="hint">Current library: [% LoginBranchname | html %]</div> >+ <div class="hint">Current library: [% logged_in_user.library.branchname | html %]</div> > [% IF ( table_loop ) %] > <form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element | html %]"> > [% IF ( label_element == 'layout' ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >index 459f7d8cda..0edc94372a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >@@ -38,7 +38,7 @@ > > [% INCLUDE 'patroncards-errors.inc' %] > <div id="manage-patroncard-batches"> >- <div class="hint">Current library: [% LoginBranchname | html %]</div> >+ <div class="hint">Current library: [% logged_in_user.library.branchname | html %]</div> > <form name="add_by_bor_num" action="/cgi-bin/koha/patroncards/edit-batch.pl" method="post"> > <div> > <fieldset class="rows" style="border-bottom: 0px; border: 0px;"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt >index 2df180a814..57f2bf6f2f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt >@@ -45,7 +45,7 @@ > [% INCLUDE 'patroncards-toolbar.inc' %] > [% INCLUDE 'patroncards-errors.inc' %] > <div id="manage-patroncards-layouts"> >- <div class="hint">Current library: [% LoginBranchname | html %]</div> >+ <div class="hint">Current library: [% logged_in_user.library.branchname | html %]</div> > [% IF ( table_loop ) %] > <form name="layouts" action="/cgi-bin/koha/manage.pl?card_element=[% card_element | html %]"> > <h2>Currently available [% PROCESS translate_card_element element=card_element_title FILTER lower %]</h2> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc >index ab56ed53d3..ee0dd2641b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc >@@ -1,7 +1,7 @@ > [% USE raw %] > [% SET classprop = 'class="' %] >-[% IF LoginBranchcode.defined %] >- [% classprop = classprop _ 'branch-' _ LoginBranchcode %] >+[% IF logged_in_user %] >+ [% classprop = classprop _ 'branch-' _ logged_in_user.branchcode %] > [% ELSE %] > [% classprop = classprop _ 'branch-default' %] > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 8c1c39e8f5..fbf45ecd59 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -556,7 +556,7 @@ > [% ELSE %] > <li id="tab_holdings"> > [% END %] >- [% BLOCK holding_tab_title %][% IF SeparateHoldings %]<span>[% LoginBranchname | html %] holdings</span>[% ELSE %]<span>Holdings</span>[% END %][% END %] >+ [% BLOCK holding_tab_title %][% IF SeparateHoldings %]<span>[% logged_in_user.library.branchname | html %] holdings</span>[% ELSE %]<span>Holdings</span>[% END %][% END %] > <a href="#holdings">[% PROCESS holding_tab_title %] [% UNLESS too_many_items %][% ' ( ' _ (itemloop.size || 0) _ ' )' | html %][% END %]</a> > </li> > [% IF (SeparateHoldings) %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21746
:
98934
|
98935
|
98936
|
98937
|
99071
|
99681
|
99833