View | Details | Raw Unified | Return to bug 18760
Collapse All | Expand All

(-)a/C4/Circulation.pm (+4 lines)
Lines 2106-2111 sub AddReturn { Link Here
2106
        }
2106
        }
2107
    }
2107
    }
2108
2108
2109
    if ( $item->{checkin_alert} ) {
2110
        $messages->{checkin_alert} = $item->{checkin_alert};
2111
    }
2112
2109
    return ( $doreturn, $messages, $issue, $borrower );
2113
    return ( $doreturn, $messages, $issue, $borrower );
2110
}
2114
}
2111
2115
(-)a/circ/print-alert.pl (+52 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2008 LibLime
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use strict;
22
#use warnings; FIXME - Bug 2505
23
use C4::Context;
24
use C4::Output;
25
use CGI qw ( -utf8 );
26
use C4::Auth qw/:DEFAULT get_session/;
27
use C4::Items qw/GetItem/;
28
29
use vars qw($debug);
30
31
BEGIN {
32
    $debug = $ENV{DEBUG} || 0;
33
}
34
35
my $input = new CGI;
36
my $itemnumber = $input->param('itemnumber');
37
my $item = GetItem( $itemnumber );
38
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
    {
41
        template_name   => "circ/printalert.tt",
42
        query           => $input,
43
        type            => "intranet",
44
        authnotrequired => 0,
45
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
46
        debug           => $debug,
47
    }
48
);
49
50
$template->param( alert => $item->{checkin_alert} ) if ($item->{checkin_alert});
51
52
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/circ/returns.pl (+19 lines)
Lines 190-195 my $messages; Link Here
190
my $issueinformation;
190
my $issueinformation;
191
my $itemnumber;
191
my $itemnumber;
192
my $barcode     = $query->param('barcode');
192
my $barcode     = $query->param('barcode');
193
194
if ( $query->param('print_alert') ) {
195
    $template->param(
196
        print_alert     => 1,
197
        itemnumber => $query->param('itemnumber')
198
    );
199
}
200
193
my $exemptfine  = $query->param('exemptfine');
201
my $exemptfine  = $query->param('exemptfine');
194
if (
202
if (
195
  $exemptfine &&
203
  $exemptfine &&
Lines 483-488 if ( $messages->{'ResFound'}) { Link Here
483
    } # else { ; }  # error?
491
    } # else { ; }  # error?
484
}
492
}
485
493
494
if ( $messages->{checkin_alert} ) {
495
    $template->param(
496
        found         => 1,
497
        checkin_alert => 1,
498
        checkin_alert_message => $messages->{checkin_alert},
499
        itemnumber     => $itemnumber
500
    );
501
}
502
486
# Error Messages
503
# Error Messages
487
my @errmsgloop;
504
my @errmsgloop;
488
foreach my $code ( keys %$messages ) {
505
foreach my $code ( keys %$messages ) {
Lines 550-555 foreach my $code ( keys %$messages ) { Link Here
550
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
567
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
551
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
568
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
552
    }
569
    }
570
    elsif ( $code eq 'checkin_alert' ) {
571
    }
553
    else {
572
    else {
554
        die "Unknown error code $code";    # note we need all the (empty) elsif's above, or we die.
573
        die "Unknown error code $code";    # note we need all the (empty) elsif's above, or we die.
555
        # This forces the issue of staying in sync w/ Circulation.pm
574
        # This forces the issue of staying in sync w/ Circulation.pm
(-)a/installer/data/mysql/atomicupdate/bug_18760-add-items-checkin-alert-column.sql (+1 lines)
Line 0 Link Here
1
ALTER TABLE items ADD checkin_alert longtext DEFAULT NULL;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printalert.tt (+19 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Circulation &rsaquo; Print alert</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/print.css" />
8
[% IF ( Koha.Preference('SlipCSS') ) %]
9
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') %]" />
10
[% END %]
11
12
[% INCLUDE 'slip-print.inc' #printThenClose %]
13
</head>
14
<body id="circ_printalert" class="circ">
15
<div id="receipt">
16
17
[% IF ( alert ) %][% alert %][% END %]
18
19
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +44 lines)
Lines 58-63 $(document).ready(function () { Link Here
58
        Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
58
        Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
59
    [% END %]
59
    [% END %]
60
60
61
    [% IF print_alert %]
62
        Dopop('print-alert.pl?itemnumber=[% itemnumber %]');
63
    [% END %]
64
61
    var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
65
    var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
62
    var returns_table = KohaTable("#checkedintable", {
66
    var returns_table = KohaTable("#checkedintable", {
63
            "bFilter":false,
67
            "bFilter":false,
Lines 576-581 $(document).ready(function () { Link Here
576
            </div>
580
            </div>
577
        </div>
581
        </div>
578
    [% END %]
582
    [% END %]
583
    [% IF ( checkin_alert ) %]
584
        <div id="checkin-alert" class="modal fade audio-alert-action">
585
            <div class="modal-dialog">
586
                <div class="modal-content">
587
                    <form method="post" action="returns.pl" class="confirm">
588
                        <div class="modal-header">
589
                            <h3>
590
                                Alert:
591
                                <br/>
592
                                <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
593
                                    [% itembarcode |html %]: [% title |html %]
594
                                </a>
595
                            </h3>
596
                        </div>
597
598
                        <div class="modal-body">
599
                            [% checkin_alert_message %]
600
                            [% FOREACH inputloo IN inputloop %]
601
                                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
602
                                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
603
                                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
604
                            [% END %]
605
                            <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
606
                            <input type="hidden" name="print_alert" value="0" />
607
                        </div>
608
609
                        <div class="modal-footer">
610
                            <button type="submit" class="btn btn-default print" onclick="this.form.print_alert.value = 1; this.form.submit();">
611
                                <i class="fa fa-print"></i> Print alert
612
                            </button>
613
614
                            <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
615
                                <i class="fa fa-times"></i> Ignore
616
                            </button>
617
                        </div>
618
                    </form>
619
                </div>
620
            </div>
621
        </div>
622
    [% END %]
579
[% END %]
623
[% END %]
580
624
581
[% IF ( errmsgloop ) %]
625
[% IF ( errmsgloop ) %]
582
- 

Return to bug 18760