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

(-)a/C4/Circulation.pm (+4 lines)
Lines 2099-2104 sub AddReturn { Link Here
2099
        }
2099
        }
2100
    }
2100
    }
2101
2101
2102
    if ( $item->{checkin_alert} ) {
2103
        $messages->{checkin_alert} = $item->{checkin_alert};
2104
    }
2105
2102
    return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} ));
2106
    return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} ));
2103
}
2107
}
2104
2108
(-)a/C4/Items.pm (-1 / +4 lines)
Lines 478-483 sub _build_default_values_for_mod_marc { Link Here
478
        stocknumber              => undef,
478
        stocknumber              => undef,
479
        uri                      => undef,
479
        uri                      => undef,
480
        withdrawn                => 0,
480
        withdrawn                => 0,
481
        checkin_alert            => undef,
481
    };
482
    };
482
    my %default_values_for_mod_from_marc;
483
    my %default_values_for_mod_from_marc;
483
    while ( my ( $field, $default_value ) = each %$default_values ) {
484
    while ( my ( $field, $default_value ) = each %$default_values ) {
Lines 1784-1790 sub _koha_new_item { Link Here
1784
            more_subfields_xml  = ?,
1785
            more_subfields_xml  = ?,
1785
            copynumber          = ?,
1786
            copynumber          = ?,
1786
            stocknumber         = ?,
1787
            stocknumber         = ?,
1787
            new_status          = ?
1788
            new_status          = ?,
1789
            checkin_alert       = ?
1788
          ";
1790
          ";
1789
    my $sth = $dbh->prepare($query);
1791
    my $sth = $dbh->prepare($query);
1790
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1792
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1829-1834 sub _koha_new_item { Link Here
1829
            $item->{'copynumber'},
1831
            $item->{'copynumber'},
1830
            $item->{'stocknumber'},
1832
            $item->{'stocknumber'},
1831
            $item->{'new_status'},
1833
            $item->{'new_status'},
1834
            $item->{'checkin_alert'},
1832
    );
1835
    );
1833
1836
1834
    my $itemnumber;
1837
    my $itemnumber;
(-)a/circ/print-alert.pl (+51 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2017 Biblibre
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 Modern::Perl;
22
use C4::Context;
23
use C4::Output;
24
use CGI qw ( -utf8 );
25
use C4::Auth qw/:DEFAULT get_session/;
26
use C4::Items qw/GetItem/;
27
28
use vars qw($debug);
29
30
BEGIN {
31
    $debug = $ENV{DEBUG} || 0;
32
}
33
34
my $input = new CGI;
35
my $itemnumber = $input->param('itemnumber');
36
my $item = GetItem( $itemnumber );
37
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
    {
40
        template_name   => "circ/printalert.tt",
41
        query           => $input,
42
        type            => "intranet",
43
        authnotrequired => 0,
44
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
45
        debug           => $debug,
46
    }
47
);
48
49
$template->param( alert => $item->{checkin_alert} ) if ($item->{checkin_alert});
50
51
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/circ/returns.pl (+19 lines)
Lines 198-203 my $messages; Link Here
198
my $issue;
198
my $issue;
199
my $itemnumber;
199
my $itemnumber;
200
my $barcode     = $query->param('barcode');
200
my $barcode     = $query->param('barcode');
201
202
if ( $query->param('print_alert') ) {
203
    $template->param(
204
        print_alert     => 1,
205
        itemnumber => $query->param('itemnumber')
206
    );
207
}
208
201
my $exemptfine  = $query->param('exemptfine');
209
my $exemptfine  = $query->param('exemptfine');
202
if (
210
if (
203
  $exemptfine &&
211
  $exemptfine &&
Lines 486-491 if ( $messages->{'ResFound'}) { Link Here
486
    } # else { ; }  # error?
494
    } # else { ; }  # error?
487
}
495
}
488
496
497
if ( $messages->{checkin_alert} ) {
498
    $template->param(
499
        found         => 1,
500
        checkin_alert => 1,
501
        checkin_alert_message => $messages->{checkin_alert},
502
        itemnumber     => $itemnumber
503
    );
504
}
505
489
# Error Messages
506
# Error Messages
490
my @errmsgloop;
507
my @errmsgloop;
491
foreach my $code ( keys %$messages ) {
508
foreach my $code ( keys %$messages ) {
Lines 556-561 foreach my $code ( keys %$messages ) { Link Here
556
    elsif ( $code eq 'DataCorrupted' ) {
573
    elsif ( $code eq 'DataCorrupted' ) {
557
        $err{data_corrupted} = 1;
574
        $err{data_corrupted} = 1;
558
    }
575
    }
576
    elsif ( $code eq 'checkin_alert' ) {
577
    }
559
    else {
578
    else {
560
        die "Unknown error code $code";    # note we need all the (empty) elsif's above, or we die.
579
        die "Unknown error code $code";    # note we need all the (empty) elsif's above, or we die.
561
        # This forces the issue of staying in sync w/ Circulation.pm
580
        # This forces the issue of staying in sync w/ Circulation.pm
(-)a/installer/data/mysql/atomicupdate/bug_18760-add-items-checkin-alert-column.sql (+2 lines)
Line 0 Link Here
1
ALTER TABLE items ADD checkin_alert longtext DEFAULT NULL AFTER new_status;
2
ALTER TABLE deleteditems ADD checkin_alert longtext DEFAULT NULL AFTER new_status;
(-)a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql (+1 lines)
Lines 107-112 INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblib Link Here
107
            ('952', 'h', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, 0, '', '', '', NULL),
107
            ('952', 'h', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, 0, '', '', '', NULL),
108
           ('952', 'i', 'Inventory number', 'Inventory number', 0, 0, 'items.stocknumber', 10, '', '', '', 0, 0, '', '', '', NULL),
108
           ('952', 'i', 'Inventory number', 'Inventory number', 0, 0, 'items.stocknumber', 10, '', '', '', 0, 0, '', '', '', NULL),
109
		('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, '', '', '', NULL),
109
		('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, '', '', '', NULL),
110
		('952', 'k', 'Checkin alert', '', 0, 0, 'items.checkin_alert', 10, '', '', '', NULL, -1, '', '', '', NULL),
110
		('952', 'l', 'Total Checkouts', 'Total Checkouts', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, '', '', '', NULL),
111
		('952', 'l', 'Total Checkouts', 'Total Checkouts', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, '', '', '', NULL),
111
		('952', 'm', 'Total Renewals', 'Total Renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, '', '', '', NULL),
112
		('952', 'm', 'Total Renewals', 'Total Renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, '', '', '', NULL),
112
		('952', 'n', 'Total Holds', 'Total Holds', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, '', '', '', NULL),
113
		('952', 'n', 'Total Holds', 'Total Holds', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, '', '', '', NULL),
(-)a/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql (+1 lines)
Lines 148-153 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
148
		('995', 'm', 'Date of loan or deposit', 'Date of loan or deposit', 0, 0, 'items.datelastborrowed', 10, '', '', '', 0, -5, '', '', '', NULL),
148
		('995', 'm', 'Date of loan or deposit', 'Date of loan or deposit', 0, 0, 'items.datelastborrowed', 10, '', '', '', 0, -5, '', '', '', NULL),
149
		('995', 'n', 'Expiration of loan date', 'Expiration of loan date', 0, 0, 'items.onloan', 10, '', '', '', 0, -1, '', '', '', NULL),
149
		('995', 'n', 'Expiration of loan date', 'Expiration of loan date', 0, 0, 'items.onloan', 10, '', '', '', 0, -1, '', '', '', NULL),
150
		('995', 'o', 'Circulation type (not for loan)', 'Circulation type (not for loan)', 0, 0, 'items.notforloan', 10, '', '', '', 0, 0, '', '', '', NULL),
150
		('995', 'o', 'Circulation type (not for loan)', 'Circulation type (not for loan)', 0, 0, 'items.notforloan', 10, '', '', '', 0, 0, '', '', '', NULL),
151
		('952', 'q', 'Checkin alert', '', 0, 0, 'items.checkin_alert', 10, '', '', '', NULL, -1, '', '', '', NULL),
151
		('995', 'r', 'Type of item and material', 'Type of item and material', 0, 1, 'items.itype', 10, 'itemtypes', '', '', 0, 0, '', '', '', NULL),
152
		('995', 'r', 'Type of item and material', 'Type of item and material', 0, 1, 'items.itype', 10, 'itemtypes', '', '', 0, 0, '', '', '', NULL),
152
		('995', 'u', 'Copy note', 'Copy note', 0, 0, 'items.itemnotes', 10, '', '', '', 0, 0, '', '', '', NULL),
153
		('995', 'u', 'Copy note', 'Copy note', 0, 0, 'items.itemnotes', 10, '', '', '', 0, 0, '', '', '', NULL),
153
		('995', 'v', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, -1, '', '', '', NULL);
154
		('995', 'v', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, -1, '', '', '', NULL);
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 692-697 CREATE TABLE `deleteditems` ( Link Here
692
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
692
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
693
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
693
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
694
  `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
694
  `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
695
  `checkin_alert` longtext DEFAULT NULL, -- Chekin alert field. Put html is this field, it will be displayed and printable while checkin item.
695
  PRIMARY KEY  (`itemnumber`),
696
  PRIMARY KEY  (`itemnumber`),
696
  KEY `delitembarcodeidx` (`barcode`),
697
  KEY `delitembarcodeidx` (`barcode`),
697
  KEY `delitemstocknumberidx` (`stocknumber`),
698
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 952-957 CREATE TABLE `items` ( -- holdings/item information Link Here
952
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
953
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
953
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
954
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
954
  `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
955
  `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
956
  `checkin_alert` longtext DEFAULT NULL, -- Chekin alert field. Put html is this field, it will be displayed and printable while checkin item.
955
  PRIMARY KEY  (`itemnumber`),
957
  PRIMARY KEY  (`itemnumber`),
956
  UNIQUE KEY `itembarcodeidx` (`barcode`),
958
  UNIQUE KEY `itembarcodeidx` (`barcode`),
957
  KEY `itemstocknumberidx` (`stocknumber`),
959
  KEY `itemstocknumberidx` (`stocknumber`),
(-)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 577-582 $(document).ready(function () { Link Here
577
            </div>
581
            </div>
578
        </div>
582
        </div>
579
    [% END %]
583
    [% END %]
584
    [% IF ( checkin_alert ) %]
585
        <div id="checkin-alert" class="modal fade audio-alert-action">
586
            <div class="modal-dialog">
587
                <div class="modal-content">
588
                    <form method="post" action="returns.pl" class="confirm">
589
                        <div class="modal-header">
590
                            <h3>
591
                                Alert:
592
                                <br/>
593
                                <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
594
                                    [% itembarcode |html %]: [% title |html %]
595
                                </a>
596
                            </h3>
597
                        </div>
598
599
                        <div class="modal-body">
600
                            [% checkin_alert_message %]
601
                            [% FOREACH inputloo IN inputloop %]
602
                                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
603
                                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
604
                                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
605
                            [% END %]
606
                            <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
607
                            <input type="hidden" name="print_alert" value="0" />
608
                        </div>
609
610
                        <div class="modal-footer">
611
                            <button type="submit" class="btn btn-default print" onclick="this.form.print_alert.value = 1; this.form.submit();">
612
                                <i class="fa fa-print"></i> Print alert
613
                            </button>
614
615
                            <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
616
                                <i class="fa fa-times"></i> Ignore
617
                            </button>
618
                        </div>
619
                    </form>
620
                </div>
621
            </div>
622
        </div>
623
    [% END %]
580
[% END %]
624
[% END %]
581
625
582
[% IF ( errmsgloop ) %]
626
[% IF ( errmsgloop ) %]
583
- 

Return to bug 18760