Bugzilla – Attachment 51195 Details for
Bug 16429
Going to circulation from notice triggers may change logged in branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16429 - Fix root problem
Bug-16429---Fix-root-problem.patch (text/plain), 7.22 KB, created by
Jonathan Druart
on 2016-05-04 16:04:25 UTC
(
hide
)
Description:
Bug 16429 - Fix root problem
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-04 16:04:25 UTC
Size:
7.22 KB
patch
obsolete
>From 43ca54290a0fa707b443ec70ed570cd38b052016 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 3 May 2016 10:36:15 +0000 >Subject: [PATCH] Bug 16429 - Fix root problem >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The root of this issue is old code in circulation.pl that is no longer >needed and leaves the affected scripts open to future regressions. > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Heather Braum <hbraum@nekls.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > circ/circulation.pl | 28 ++++------------------ > .../prog/en/includes/patron-search-box.inc | 5 ---- > .../prog/en/modules/circ/circulation.tt | 2 -- > members/routing-lists.pl | 17 ++----------- > 4 files changed, 6 insertions(+), 46 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index c2d9399..0562df5 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -65,29 +65,12 @@ use List::MoreUtils qw/uniq/; > # > my $query = new CGI; > >-my $sessionID = $query->cookie("CGISESSID") ; >-my $session = get_session($sessionID); >- > my $override_high_holds = $query->param('override_high_holds'); > my $override_high_holds_tmp = $query->param('override_high_holds_tmp'); > >-# branch and printer are now defined by the userenv >-# but first we have to check if someone has tried to change them >- >-my $branch = $query->param('branch'); >-if ($branch){ >- # update our session so the userenv is updated >- $session->param('branch', $branch); >- $session->param('branchname', GetBranchName($branch)); >-} >- >-my $printer = $query->param('printer'); >-if ($printer){ >- # update our session so the userenv is updated >- $session->param('branchprinter', $printer); >-} >- >-if (!C4::Context->userenv && !$branch){ >+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"); >@@ -162,8 +145,7 @@ for (@failedreturns) { $return_failed{$_} = 1; } > my $findborrower = $query->param('findborrower') || q{}; > $findborrower =~ s|,| |g; > >-$branch = C4::Context->userenv->{'branch'}; >-$printer = C4::Context->userenv->{'branchprinter'}; >+my $branch = C4::Context->userenv->{'branch'}; > > # If AutoLocation is not activated, we show the Circulation Parameters to chage settings of librarian > if (C4::Context->preference("AutoLocation") != 1) { >@@ -650,8 +632,6 @@ $template->param( > categoryname => $borrower->{'description'}, > branch => $branch, > branchname => GetBranchName($borrower->{'branchcode'}), >- printer => $printer, >- printername => $printer, > was_renewed => scalar $query->param('was_renewed') ? 1 : 0, > expiry => $borrower->{'dateexpiry'}, > roadtype => $roadtype, >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 11ae617..1980318 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,4 +1,3 @@ >-[% USE Branches %] > [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %][% IF ( CircAutocompl ) %]<script type="text/javascript"> > //<![CDATA[ > $(document).ready(function(){ >@@ -28,8 +27,6 @@ $(document).ready(function(){ > <div class="autocomplete"> > <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="head-searchbox 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 %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> >@@ -37,8 +34,6 @@ $(document).ready(function(){ > </div> > [% ELSE %] > <input id="findborrower" name="findborrower" size="40" class="head-searchbox focus" type="text" /> >- <input name="branch" value="[% Branches.GetLoggedInBranchcode() %]" type="hidden" /> >- <input name="printer" value="" type="hidden" /> > [% IF ( stickyduedate ) %] > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index b1e4c9d..1bfe4cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -598,7 +598,6 @@ No patron matched <span class="ex">[% message %]</span> > > [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] > <input type="hidden" name="branch" value="[% branch %]" /> >- <input type="hidden" name="printer" value="[% printer %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> > >@@ -738,7 +737,6 @@ No patron matched <span class="ex">[% message %]</span> > > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="branch" value="[% branch %]" /> >- <input type="hidden" name="printer" value="[% printer %]" /> > <input type="hidden" name="print" value="maybe" /> > <input type="hidden" name="debt_confirmed" value="[% debt_confirmed %]" /> > [% IF ( CHARGES ) %] >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index 1925880..c8377db 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -21,7 +21,7 @@ use strict; > #use warnings; FIXME - Bug 2505 > use CGI qw ( -utf8 ); > use C4::Output; >-use C4::Auth qw/:DEFAULT get_session/; >+use C4::Auth qw/:DEFAULT/; > use C4::Branch; # GetBranches > use C4::Members; > use C4::Members::Attributes qw(GetBorrowerAttributes); >@@ -32,19 +32,6 @@ use CGI::Session; > > my $query = new CGI; > >-my $sessionID = $query->cookie("CGISESSID") ; >-my $session = get_session($sessionID); >- >-# branch are now defined by the userenv >-# but first we have to check if someone has tried to change them >- >-my $branch = $query->param('branch'); >-if ($branch){ >- # update our session so the userenv is updated >- $session->param('branch', $branch); >- $session->param('branchname', GetBranchName($branch)); >-} >- > my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( > { > template_name => 'members/routing-lists.tt', >@@ -62,7 +49,7 @@ $findborrower =~ s|,| |g; > > my $borrowernumber = $query->param('borrowernumber'); > >-$branch = C4::Context->userenv->{'branch'}; >+my $branch = C4::Context->userenv->{'branch'}; > > # get the borrower information..... > my $borrower; >-- >2.7.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 16429
:
51127
|
51128
|
51129
|
51130
|
51134
|
51135
|
51141
|
51142
|
51194
| 51195