From 75345cdbf064e40d60d826cc9b507279cfbb2f9d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 19 Oct 2021 13:57:00 +0100 Subject: [PATCH] Bug 33736: Add pendingbookings report This patch adds a 'Bookings to collect' page to circulation that allows for a workflow similar to 'Holds to pull', but for bookings. NOTE: Refinements still required Signed-off-by: Esther --- api/v1/swagger/paths/bookings.yaml | 4 + circ/pendingbookings.pl | 49 ++++ .../prog/en/modules/circ/circulation-home.tt | 5 +- .../prog/en/modules/circ/pendingbookings.tt | 209 ++++++++++++++++++ 4 files changed, 266 insertions(+), 1 deletion(-) create mode 100755 circ/pendingbookings.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt diff --git a/api/v1/swagger/paths/bookings.yaml b/api/v1/swagger/paths/bookings.yaml index f7bb0b8804..11ef64168a 100644 --- a/api/v1/swagger/paths/bookings.yaml +++ b/api/v1/swagger/paths/bookings.yaml @@ -74,6 +74,10 @@ x-koha-authorization: permissions: catalogue: 1 + x-koha-embed: + - biblio + - item + - patron post: operationId: addBooking parameters: diff --git a/circ/pendingbookings.pl b/circ/pendingbookings.pl new file mode 100755 index 0000000000..45a9a2605e --- /dev/null +++ b/circ/pendingbookings.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +# Copyright PTFS Europe 2021 +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use CGI qw ( -utf8 ); + +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); + +use Koha::DateUtils qw(dt_from_string); + +my $input = CGI->new; +my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( + { + template_name => "circ/pendingbookings.tt", + query => $input, + type => "intranet", + flagsrequired => { circulate => 'manage_bookings' }, + } +); + +my $today = dt_from_string(); +my $startdate = $today->truncate( to => 'day' ); +my $enddate = $startdate->clone->add( days => 1 ); + +$template->param( + todaysdate => $today, + from => $startdate, + to => $enddate +); + +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt index e636ddb0db..086ebb773d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt @@ -78,7 +78,7 @@
-

Holds

+

Holds & Bookings

[% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt new file mode 100644 index 0000000000..11cb47241f --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt @@ -0,0 +1,209 @@ +[% USE raw %] +[% USE Asset %] +[% USE Koha %] +[% USE KohaDates %] +[% USE TablesSettings %] +[% PROCESS 'i18n.inc' %] +[% SET footerjs = 1 %] +[% INCLUDE 'doc-head-open.inc' %] +[% FILTER collapse %] + [% t("Bookings to collect") | html %] › + [% t("Circulation") | html %] › + [% t("Koha") | html %] +[% END %] +[% INCLUDE 'doc-head-close.inc' %] + + + + [% INCLUDE 'header.inc' %] + [% INCLUDE 'circ-search.inc' %] + + + +
+
+ + +
+
+

Items required for bookings between [% from | $KohaDates %] and [% to | $KohaDates %]

+

Reported on [% todaysdate | $KohaDates %]

+

The following items have not been collected for bookings. Please retrieve them + and check them in.

+
+
+
+
+
+ + +
+ +
+
+ + + [% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] + [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] + [% INCLUDE 'js-biblio-format.inc' %] + [% INCLUDE 'js-date-format.inc' %] + [% INCLUDE 'js-patron-format.inc' %] + + [% END %] + [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.2