Bugzilla – Attachment 170400 Details for
Bug 33736
Add bookings to collect circulation report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33736: Add filter for holding library
Bug-33736-Add-filter-for-holding-library.patch (text/plain), 5.69 KB, created by
Martin Renvoize (ashimema)
on 2024-08-15 16:18:52 UTC
(
hide
)
Description:
Bug 33736: Add filter for holding library
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-08-15 16:18:52 UTC
Size:
5.69 KB
patch
obsolete
>From 49b3da4b5f58d8a36a431b480f53a574f9f0435f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 15 Aug 2024 17:04:01 +0100 >Subject: [PATCH] Bug 33736: Add filter for holding library > >This patch adds the option to filter the pending bookings to collect report by >items current holding library and defaults to the users logged in library. > >We also add the 'Pickup library' column to the report output so staff >know whether the item needs collecting for sending to another library or >for their own. >--- > circ/pendingbookings.pl | 17 +++++---- > .../prog/en/modules/circ/pendingbookings.tt | 35 +++++++++++++++++-- > 2 files changed, 43 insertions(+), 9 deletions(-) > >diff --git a/circ/pendingbookings.pl b/circ/pendingbookings.pl >index 677925268dd..5cb4b1eb0c9 100755 >--- a/circ/pendingbookings.pl >+++ b/circ/pendingbookings.pl >@@ -21,8 +21,10 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > >+use C4::Context; >+ > use C4::Output qw( output_html_with_http_headers ); >-use C4::Auth qw( get_template_and_user ); >+use C4::Auth qw( get_template_and_user ); > > use Koha::DateUtils qw(dt_from_string); > >@@ -36,14 +38,17 @@ my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( > } > ); > >-my $today = dt_from_string(); >+my $today = dt_from_string(); > my $startdate = $today->truncate( to => 'day' ); >-my $enddate = $startdate->clone->add( days => 7 ); >+my $enddate = $startdate->clone->add( days => 7 ); >+my $branchcode = >+ defined( $input->param('library') ) ? $input->param('library') : C4::Context->userenv->{'branch'}; > > $template->param( >- todaysdate => $today, >- from => $startdate, >- to => $enddate >+ todaysdate => $today, >+ from => $startdate, >+ to => $enddate, >+ branchcode => $branchcode > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt >index 11cb47241fb..60103d8ab0a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt >@@ -1,5 +1,6 @@ > [% USE raw %] > [% USE Asset %] >+[% USE Branches %] > [% USE Koha %] > [% USE KohaDates %] > [% USE TablesSettings %] >@@ -50,7 +51,7 @@ > </main> > </div> > >- <!-- Filters --> >+ <!-- Filters & Navigation --> > <div class="col-sm-2 col-sm-pull-10"> > <aside> > <div id="filters"> >@@ -58,6 +59,22 @@ > <fieldset class="brief"> > <h4>Refine results</h4> > <ol> >+ <li> >+ <label for="library">Library:</label> >+ <select name="library" id="library"> >+ [% SET libraries = Branches.all( only_from_group => 1 ) %] >+ [% IF libraries.size != 1 %] >+ <option value="">Any</option> >+ [% END %] >+ [% FOREACH l IN libraries %] >+ [% IF (l.branchcode == branchcode) %] >+ <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> >+ [% ELSE %] >+ <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> > <li> > <label for="from">Start date: </label> > <input type="text" size="10" id="from" name="from" value="[% from | html %]" class="flatpickr" data-date_to="to"/> >@@ -74,6 +91,7 @@ > </fieldset> > </form> > </div> >+ [% INCLUDE 'circ-nav.inc' %] > </aside> > </div> > </div> >@@ -106,7 +124,11 @@ > } > > return { '>=': isoFrom, '<=': isoTo }; >- } >+ }, >+ 'item.holding_library_id': function() { >+ let library = $("#library").find(":selected").val(); >+ return library; >+ }, > }; > > var bookings_table_url = '/api/v1/bookings?'; >@@ -117,7 +139,8 @@ > "embed": [ > "biblio", > "item", >- "patron" >+ "patron", >+ "pickup_library" > ], > "order": [[ 1, "asc" ]], > "columns": [{ >@@ -125,6 +148,12 @@ > "title": "Booking ID", > "visible": false > }, >+ { >+ "data": "pickup_library.name", >+ "title": "Pickup library", >+ "searchable": true, >+ "orderable": true, >+ }, > { > "data": "biblio.title", > "title": "Title", >-- >2.46.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 33736
:
158356
|
161044
|
165014
|
165144
|
165277
|
165278
|
165279
|
165280
|
170398
|
170399
|
170400
|
172716
|
172717
|
172718
|
172719
|
172720
|
172721
|
172765
|
172807
|
172808
|
172810
|
172823
|
172836
|
172837
|
172838
|
172839
|
172840
|
172841
|
172842
|
172843
|
172844
|
172845
|
173291
|
173292
|
173293
|
173294
|
173295
|
173296
|
173297
|
173298
|
173299
|
173300
|
173301
|
173302
|
173303
|
174582