@@ -, +, @@ on confirm recall popup --- C4/Letters.pm | 1 + circ/recall-pickup-slip.pl | 88 ++++++++++++++++++++++ circ/returns.pl | 10 +++ .../bug_19532_recall_requester_details_notice.sql | 1 + .../prog/en/modules/circ/recall-pickup-slip.tt | 26 +++++++ .../intranet-tmpl/prog/en/modules/circ/returns.tt | 10 +++ 6 files changed, 136 insertions(+) create mode 100755 circ/recall-pickup-slip.pl create mode 100644 installer/data/mysql/atomicupdate/bug_19532_recall_requester_details_notice.sql create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/recall-pickup-slip.tt --- a/C4/Letters.pm +++ a/C4/Letters.pm @@ -40,6 +40,7 @@ use Koha::Notice::Messages; use Koha::DateUtils qw( format_sqldatetime dt_from_string ); use Koha::Patrons; use Koha::Subscriptions; +use Data::Dumper; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); --- a/circ/recall-pickup-slip.pl +++ a/circ/recall-pickup-slip.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl + + +# Copyright 2018 Catalyst IT +# +# 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 C4::Context; +use C4::Output; +use CGI qw ( -utf8 ); +use C4::Auth qw/:DEFAULT get_session/; +use Koha::Recall; +use Koha::Recalls; +use C4::Letters; +use C4::Message; +use Data::Dumper; +use Koha::Patrons; +use Koha::Items; +use Koha::Biblios; +use Koha::Libraries; +use vars qw($debug); + +BEGIN { + $debug = $ENV{DEBUG} || 0; +} + +my $input = new CGI; +my $sessionID = $input->cookie("CGISESSID"); +my $session = get_session($sessionID); + +my $borrowernumber = $input->param('borrowernumber'); +my $biblionumber = $input->param('biblionumber'); +my $itemnumber = $input->param('itemnumber'); +my $recallid = $input->param('recall_id'); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "circ/recall-pickup-slip.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { circulate => "circulate_remaining_permissions" }, + debug => $debug, + } +); + +my $recall = Koha::Recalls->find($recallid); +my $patron = Koha::Patrons->find($borrowernumber); +my $item = Koha::Items->find($recall->itemnumber); +my $biblio = Koha::Biblios->find($item->biblionumber); +my $library = Koha::Libraries->find($recall->branchcode); + +#Print slip to inform library staff of details of recall requester, so the item can be put aside for requester +my ($slip, $is_html); +my $letter = C4::Letters::GetPreparedLetter ( + module => 'circulation', + letter_code => 'RECALL_REQUESTER_DET', + tables => { + 'branches' => $library->branchcode, + 'borrowers' => $patron->borrowernumber, + 'biblio' => $biblio->biblionumber, + 'items' => $item->itemnumber, + 'recalls' => $recall->recall_id + } +); + +if ($letter) { + $slip = $letter->{content}; + $is_html = $letter->{is_html}; +} + +$template->param( slip => $slip ) if ($slip); +$template->param( plain => !$is_html ); + +output_html_with_http_headers $input, $cookie, $template->output; --- a/circ/returns.pl +++ a/circ/returns.pl @@ -89,6 +89,16 @@ if ( $query->param('print_slip') ) { ); } +if ( $query->param('print_recall_slip') ) { + $template->param( + print_recall_slip => 1, + borrowernumber => scalar $query->param('borrowernumber'), + biblionumber => scalar $query->param('biblionumber'), + itemnumber => scalar $query->param('itemnumber'), + recall_id => scalar $query->param('recall_id') + ); +} + ##################### #Global vars my $printers = GetPrinters(); --- a/installer/data/mysql/atomicupdate/bug_19532_recall_requester_details_notice.sql +++ a/installer/data/mysql/atomicupdate/bug_19532_recall_requester_details_notice.sql @@ -0,0 +1, @@ +insert into letter (module, code, name, is_html, title, content, message_transport_type, lang) values ('circulation', 'RECALL_REQUESTER_DET', 'Details of patron who recalled item', 0, 'Details of patorn who recalled item', '
Date: <>

Recall for pickup at <>

<>, <>


ITEM RECALLED

<>

<>

Notes:

<>

', 'email', default); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recall-pickup-slip.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recall-pickup-slip.tt @@ -0,0 +1,26 @@ +[% USE Asset %] +[% USE Koha %] +[% INCLUDE 'doc-head-open.inc' %] +Koha › Circulation › Recall print receipt +[% INCLUDE 'doc-head-close.inc' %] + + +[% Asset.css("css/print.css") %] +[% IF ( Koha.Preference('SlipCSS') ) %] + +[% END %] + +[% INCLUDE 'slip-print.inc' #printThenClose %] + + +
+ +[% IF plain %] +
+[% IF ( slip ) %][% slip %][% ELSE %]No slip template found[% END %]
+
+[% ELSE %] +[% IF ( slip ) %][% slip %][% ELSE %]No slip template found[% END %] +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -559,6 +559,8 @@ + +