Bugzilla – Attachment 64256 Details for
Bug 18760
Printable checkin alerts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18760 - Add item printable checkin alert field
Bug-18760---Add-item-printable-checkin-alert-field.patch (text/plain), 9.08 KB, created by
Alex Arnaud
on 2017-06-13 12:27:52 UTC
(
hide
)
Description:
Bug 18760 - Add item printable checkin alert field
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2017-06-13 12:27:52 UTC
Size:
9.08 KB
patch
obsolete
>From bf0fd541d3bc1bb8159cbfc399e12f025104595f Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Tue, 13 Jun 2017 12:26:45 +0000 >Subject: [PATCH] Bug 18760 - Add item printable checkin alert field > >Test plan: > - Apply this patch(es), > - update databases, > - launch misc/devel/update_dbix_class_files.pl, > - edit an item to have html or text content in chekin_alert (may > need > a koha to marc mapping for gui edition), > - check out this item, > - check it in: you should get a modal showing the alert, > - check that you can print the alert. >--- > C4/Circulation.pm | 4 ++ > circ/print-alert.pl | 52 ++++++++++++++++++++++ > circ/returns.pl | 19 ++++++++ > .../bug_18760-add-items-checkin-alert-column.sql | 1 + > .../prog/en/modules/circ/printalert.tt | 19 ++++++++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 44 ++++++++++++++++++ > 6 files changed, 139 insertions(+) > create mode 100755 circ/print-alert.pl > create mode 100644 installer/data/mysql/atomicupdate/bug_18760-add-items-checkin-alert-column.sql > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/printalert.tt > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index a439021..ce7a3ab 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2106,6 +2106,10 @@ sub AddReturn { > } > } > >+ if ( $item->{checkin_alert} ) { >+ $messages->{checkin_alert} = $item->{checkin_alert}; >+ } >+ > return ( $doreturn, $messages, $issue, $borrower ); > } > >diff --git a/circ/print-alert.pl b/circ/print-alert.pl >new file mode 100755 >index 0000000..628f5f3 >--- /dev/null >+++ b/circ/print-alert.pl >@@ -0,0 +1,52 @@ >+#!/usr/bin/perl >+ >+ >+# Copyright 2008 LibLime >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+use strict; >+#use warnings; FIXME - Bug 2505 >+use C4::Context; >+use C4::Output; >+use CGI qw ( -utf8 ); >+use C4::Auth qw/:DEFAULT get_session/; >+use C4::Items qw/GetItem/; >+ >+use vars qw($debug); >+ >+BEGIN { >+ $debug = $ENV{DEBUG} || 0; >+} >+ >+my $input = new CGI; >+my $itemnumber = $input->param('itemnumber'); >+my $item = GetItem( $itemnumber ); >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "circ/printalert.tt", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => "circulate_remaining_permissions" }, >+ debug => $debug, >+ } >+); >+ >+$template->param( alert => $item->{checkin_alert} ) if ($item->{checkin_alert}); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/circ/returns.pl b/circ/returns.pl >index d1b95e8..a17e61c 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -190,6 +190,14 @@ my $messages; > my $issueinformation; > my $itemnumber; > my $barcode = $query->param('barcode'); >+ >+if ( $query->param('print_alert') ) { >+ $template->param( >+ print_alert => 1, >+ itemnumber => $query->param('itemnumber') >+ ); >+} >+ > my $exemptfine = $query->param('exemptfine'); > if ( > $exemptfine && >@@ -483,6 +491,15 @@ if ( $messages->{'ResFound'}) { > } # else { ; } # error? > } > >+if ( $messages->{checkin_alert} ) { >+ $template->param( >+ found => 1, >+ checkin_alert => 1, >+ checkin_alert_message => $messages->{checkin_alert}, >+ itemnumber => $itemnumber >+ ); >+} >+ > # Error Messages > my @errmsgloop; > foreach my $code ( keys %$messages ) { >@@ -550,6 +567,8 @@ foreach my $code ( keys %$messages ) { > elsif ( $code eq 'NotForLoanStatusUpdated' ) { > $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated}; > } >+ elsif ( $code eq 'checkin_alert' ) { >+ } > else { > die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. > # This forces the issue of staying in sync w/ Circulation.pm >diff --git a/installer/data/mysql/atomicupdate/bug_18760-add-items-checkin-alert-column.sql b/installer/data/mysql/atomicupdate/bug_18760-add-items-checkin-alert-column.sql >new file mode 100644 >index 0000000..1ce7a20 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_18760-add-items-checkin-alert-column.sql >@@ -0,0 +1 @@ >+ALTER TABLE items ADD checkin_alert longtext DEFAULT NULL; >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printalert.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printalert.tt >new file mode 100644 >index 0000000..2f25e1b >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printalert.tt >@@ -0,0 +1,19 @@ >+[% USE Koha %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › Print alert</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >+<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/print.css" /> >+[% IF ( Koha.Preference('SlipCSS') ) %] >+<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') %]" /> >+[% END %] >+ >+[% INCLUDE 'slip-print.inc' #printThenClose %] >+</head> >+<body id="circ_printalert" class="circ"> >+<div id="receipt"> >+ >+[% IF ( alert ) %][% alert %][% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 56bfb6a..c32f260 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -58,6 +58,10 @@ $(document).ready(function () { > Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&biblionumber=[% biblionumber %]'); > [% END %] > >+ [% IF print_alert %] >+ Dopop('print-alert.pl?itemnumber=[% itemnumber %]'); >+ [% END %] >+ > var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %] > var returns_table = KohaTable("#checkedintable", { > "bFilter":false, >@@ -576,6 +580,46 @@ $(document).ready(function () { > </div> > </div> > [% END %] >+ [% IF ( checkin_alert ) %] >+ <div id="checkin-alert" class="modal fade audio-alert-action"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <form method="post" action="returns.pl" class="confirm"> >+ <div class="modal-header"> >+ <h3> >+ Alert: >+ <br/> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber %]"> >+ [% itembarcode |html %]: [% title |html %] >+ </a> >+ </h3> >+ </div> >+ >+ <div class="modal-body"> >+ [% checkin_alert_message %] >+ [% FOREACH inputloo IN inputloop %] >+ <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" /> >+ <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" /> >+ <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" /> >+ [% END %] >+ <input type="hidden" name="itemnumber" value="[% itemnumber %]" /> >+ <input type="hidden" name="print_alert" value="0" /> >+ </div> >+ >+ <div class="modal-footer"> >+ <button type="submit" class="btn btn-default print" onclick="this.form.print_alert.value = 1; this.form.submit();"> >+ <i class="fa fa-print"></i> Print alert >+ </button> >+ >+ <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;"> >+ <i class="fa fa-times"></i> Ignore >+ </button> >+ </div> >+ </form> >+ </div> >+ </div> >+ </div> >+ [% END %] > [% END %] > > [% IF ( errmsgloop ) %] >-- >2.7.4
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 18760
:
64256
|
67185