Bugzilla – Attachment 25369 Details for
Bug 11779
Unexpected change in logged in branch when changing overdue notice triggers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers
Bug-11779---Unexpected-change-in-logged-in-branch-.patch (text/plain), 3.25 KB, created by
Kyle M Hall (khall)
on 2014-02-18 12:46:38 UTC
(
hide
)
Description:
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-02-18 12:46:38 UTC
Size:
3.25 KB
patch
obsolete
>From 9c5769f7345a59ada98bee6ed9c40ac8cb6ccbf9 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 18 Feb 2014 07:43:44 -0500 >Subject: [PATCH] Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers > >Steps to reproduce: >1) Log into staff intranet >2) Set logged in branch >3) Browse to tools/overdue notice triggers >4) Select a branch from the pulldown that is not your logged in branch >5) use the "Check out" bar at the top of the page to search for a patron >to check out to >6) Once you have landed here, click the "check out" tab link again, or > the Edit button ( any action really ) >7) Note your logged in branch has now changed to the once selected > when editing the notice/status triggers > >This is due to the way the patron search passes the branchcode to be >used via the form. This form assumes the branchcode variable is >always the currently logged in branch, which may not and is not >always the case. > >Test Plan: >1) Apply this patch >2) Repeat the steps to reproduce above >3) Note your logged in branch does not change >--- > Koha/Template/Plugin/Branches.pm | 7 +++++++ > .../prog/en/includes/patron-search-box.inc | 6 ++++-- > 2 files changed, 11 insertions(+), 2 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 343158c..d1801be 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -24,6 +24,7 @@ use base qw( Template::Plugin ); > use Encode qw{encode decode}; > > use C4::Koha; >+use C4::Context; > > sub GetName { > my ( $self, $branchcode ) = @_; >@@ -35,4 +36,10 @@ sub GetName { > return $b ? encode( 'UTF-8', $b->{'branchname'} ) : q{}; > } > >+sub GetLoggedInBranchcode { >+ my ($self) = @_; >+ >+ return C4::Context->userenv->{'branch'} if C4::Context->userenv; >+} >+ > 1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc >index 388c467..8e3bf66 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% IF ( CAN_user_circulate ) %][% IF ( CircAutocompl ) %]<script type="text/javascript"> > //<![CDATA[ > $(document).ready(function(){ >@@ -25,8 +26,9 @@ $(document).ready(function(){ > <form action="/cgi-bin/koha/circ/circulation.pl" id="patronsearch" method="post"> > [% IF ( CircAutocompl ) %] > <div class="autocomplete"> >- <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="focus" type="text" /> <input id="autocsubmit" type="submit" class="submit" value="Submit" /> >- <input name="branch" value="[% branch %]" type="hidden" /> >+ <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="focus" type="text" /> >+ <input id="autocsubmit" type="submit" class="submit" value="Submit" /> >+ <input name="branch" value="[% Branches.GetLoggedInBranchcode() %]" type="hidden" /> > <input name="printer" value="" type="hidden" /> > [% IF ( stickyduedate ) %] > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> >-- >1.7.2.5
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 11779
:
25368
|
25369
|
25398
|
25437