Bugzilla – Attachment 22019 Details for
Bug 8074
Define default library for holds to pull report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8074 - Define default library for holds to pull report
Bug-8074---Define-default-library-for-holds-to-pul.patch (text/plain), 5.85 KB, created by
Olli-Antti Kivilahti
on 2013-10-16 14:45:25 UTC
(
hide
)
Description:
Bug 8074 - Define default library for holds to pull report
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2013-10-16 14:45:25 UTC
Size:
5.85 KB
patch
obsolete
>From ae4052fc63ff06365e3682b89f47db434339ef3e Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Wed, 16 Oct 2013 17:20:14 +0300 >Subject: [PATCH] Bug 8074 - Define default library for holds to pull report > >Modified the BIG SQL in pendingreserves.pl to limit the hold requests shown >by the items.holdingbranch. The behaviour mimics IndependentBranches behaviour. > >Also added a branch picker to circ/pendingreserves.tt with an optional >Show all requests-option. >Changed the form from post to get so librarians can bookmark the page. > >Made stuff localizable! >--- > circ/pendingreserves.pl | 25 ++++++++++ > .../prog/en/modules/circ/pendingreserves.tt | 54 ++++++++++++++-------- > 2 files changed, 60 insertions(+), 19 deletions(-) > >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 0110deb..0f95609 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -40,6 +40,7 @@ use Date::Calc qw/Today Add_Delta_YMD/; > my $input = new CGI; > my $startdate=$input->param('from'); > my $enddate=$input->param('to'); >+my $branchLimiter = $input->param('branchLimiter'); > my $run_report = ( not defined $input->param('run_report') ) ? 1 : $input->param('run_report'); > > my $theme = $input->param('theme'); # only used if allowthemeoverride is set >@@ -88,6 +89,11 @@ if (!defined($enddate) or $enddate eq "") { > $enddate = format_date($d); > } > >+if (! defined $branchLimiter) { >+ $branchLimiter = C4::Context->userenv->{branch}; >+} >+ >+ > my @reservedata; > if ( $run_report ) { > my $dbh = C4::Context->dbh; >@@ -152,6 +158,14 @@ if ( $run_report ) { > # GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when > # multiple patrons have a hold on an item > >+ #Always show just the requests that can be fulfilled from userenv or the desired branch. >+ if ($branchLimiter ne '_ShowAll') { >+ $strsth .= " AND items.holdingbranch=? "; >+ push @query_params, $branchLimiter; >+ } >+ else { >+ #Show all requests if $branchLimiter eq '_ShowAll' >+ } > > if (C4::Context->preference('IndependentBranches')){ > $strsth .= " AND items.holdingbranch=? "; >@@ -196,6 +210,16 @@ if ( $run_report ) { > } > $sth->finish; > } >+##Prepare the custom branches loop containing the _ShowAll entry to show all requests. >+my $branchloop; >+if ($branchLimiter eq '_ShowAll') { >+ $branchloop = C4::Branch::GetBranchesLoop(); >+ unshift @$branchloop, { branchcode => '_ShowAll', branchname => 'Show all requests', selected => '1', value => '_ShowAll'}; >+} >+else { >+ $branchloop = C4::Branch::GetBranchesLoop($branchLimiter); >+ unshift @$branchloop, { branchcode => '_ShowAll', branchname => 'Show all requests', selected => '0', value => '_ShowAll'}; >+} > > $template->param( > todaysdate => format_date($todaysdate), >@@ -206,6 +230,7 @@ $template->param( > "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, > HoldsToPullStartDate=> C4::Context->preference('HoldsToPullStartDate')||TWO_DAYS, > HoldsToPullEndDate => C4::Context->preference('ConfirmFutureHolds')||0, >+ branchloop => $branchloop, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >index 18b3db3..b87845f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -158,25 +158,41 @@ $(document).ready(function() { > <div class="yui-b"> > <div id="filters"> > >-<form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" > >-<fieldset class="brief"> >-<h4>Refine results</h4> >-<ol> >-<li> >-<label for="from"> >- Start date: >-</label> >-<input type="text" size="10" id="from" name="from" value="[% from %]" class="datepickerfrom" /> >-</li> >-<li><label for="to"> >- End date: >-</label> >-<input type="text" size="10" id="to" name="to" value="[% to %]" class="datepickerto" /> >-</li> >-</ol> >-<p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% IF ( HoldsToPullEndDate ) %][% HoldsToPullEndDate %] days ahead[% ELSE %]today[% END %], set other date ranges as needed. )</i></p> >-<fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset> >-</fieldset> >+<form action="/cgi-bin/koha/circ/pendingreserves.pl" method="get"> >+ <fieldset class="brief"> >+ <h4>Refine results</h4> >+ <ol> >+ <li> >+ <label for="from"> >+ Start date: >+ </label> >+ <input type="text" size="10" id="from" name="from" value="[% from %]" class="datepickerfrom" /> >+ </li> >+ <li><label for="to"> >+ End date: >+ </label> >+ <input type="text" size="10" id="to" name="to" value="[% to %]" class="datepickerto" /> >+ </li> >+ </ol> >+ <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% IF ( HoldsToPullEndDate ) %][% HoldsToPullEndDate %] days ahead[% ELSE %]today[% END %], set other date ranges as needed. )</i></p> >+ >+ <label for="branchLimiter">Limit displaying pull requests to the requests we have items for in this branch:</label> >+ <select name="branchLimiter" size="1" id="branchLimiter"> >+ [%- FOREACH branchloo IN branchloop %] >+ [% IF ( branchloo.selected ) -%] >+ <option value="[% branchloo.branchcode %]" selected="selected"> >+ [%- ELSE -%] >+ <option value="[% branchloo.branchcode %]"> >+ [%- END -%] >+ [% IF ( branchloo.branchcode ) == '_ShowAll' -%] >+ Show all requests</option> >+ [%- ELSE -%] >+ [% branchloo.branchname %]</option> >+ [%- END -%] >+ [%- END %] >+ >+ <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset> >+ </fieldset> > </form> > > </div> >-- >1.8.1.2
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 8074
: 22019