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

(-)a/C4/Circulation.pm (+4 lines)
Lines 2586-2591 sub AddReturn { Link Here
2586
        ) if C4::Context->preference('RealTimeHoldsQueue');
2586
        ) if C4::Context->preference('RealTimeHoldsQueue');
2587
    }
2587
    }
2588
2588
2589
    if ( $item->checkin_alert ) {
2590
        $messages->{checkin_alert} = $item->checkin_alert;
2591
    }
2592
2589
    return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} ));
2593
    return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} ));
2590
}
2594
}
2591
2595
(-)a/Koha/Item.pm (+1 lines)
Lines 1695-1700 sub to_api_mapping { Link Here
1695
        copynumber               => 'copy_number',
1695
        copynumber               => 'copy_number',
1696
        stocknumber              => 'inventory_number',
1696
        stocknumber              => 'inventory_number',
1697
        new_status               => 'new_status',
1697
        new_status               => 'new_status',
1698
        checkin_alert            => 'checkin_alert',
1698
        deleted_on               => undef,
1699
        deleted_on               => undef,
1699
    };
1700
    };
1700
}
1701
}
(-)a/Koha/Schema/Result/Deleteditem.pm (+7 lines)
Lines 379-384 inventory number (MARC21 952$i) Link Here
379
379
380
'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
380
'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
381
381
382
=head2 checkin_alert
383
384
  data_type: 'longtext'
385
  is_nullable: 1
386
382
=head2 exclude_from_local_holds_priority
387
=head2 exclude_from_local_holds_priority
383
388
384
  data_type: 'tinyint'
389
  data_type: 'tinyint'
Lines 506-511 __PACKAGE__->add_columns( Link Here
506
  { data_type => "varchar", is_nullable => 1, size => 32 },
511
  { data_type => "varchar", is_nullable => 1, size => 32 },
507
  "new_status",
512
  "new_status",
508
  { data_type => "varchar", is_nullable => 1, size => 32 },
513
  { data_type => "varchar", is_nullable => 1, size => 32 },
514
  "checkin_alert",
515
  { data_type => "longtext", is_nullable => 1 },
509
  "exclude_from_local_holds_priority",
516
  "exclude_from_local_holds_priority",
510
  { data_type => "tinyint", is_nullable => 1 },
517
  { data_type => "tinyint", is_nullable => 1 },
511
);
518
);
(-)a/Koha/Schema/Result/Item.pm (+7 lines)
Lines 383-388 inventory number (MARC21 952$i) Link Here
383
383
384
'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
384
'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
385
385
386
=head2 checkin_alert
387
388
  data_type: 'longtext'
389
  is_nullable: 1
390
386
=head2 exclude_from_local_holds_priority
391
=head2 exclude_from_local_holds_priority
387
392
388
  data_type: 'tinyint'
393
  data_type: 'tinyint'
Lines 520-525 __PACKAGE__->add_columns( Link Here
520
  { data_type => "varchar", is_nullable => 1, size => 32 },
525
  { data_type => "varchar", is_nullable => 1, size => 32 },
521
  "new_status",
526
  "new_status",
522
  { data_type => "varchar", is_nullable => 1, size => 32 },
527
  { data_type => "varchar", is_nullable => 1, size => 32 },
528
  "checkin_alert",
529
  { data_type => "longtext", is_nullable => 1 },
523
  "exclude_from_local_holds_priority",
530
  "exclude_from_local_holds_priority",
524
  { data_type => "tinyint", is_nullable => 1 },
531
  { data_type => "tinyint", is_nullable => 1 },
525
);
532
);
(-)a/api/v1/swagger/definitions/item.yaml (+5 lines)
Lines 220-225 properties: Link Here
220
      - string
220
      - string
221
      - "null"
221
      - "null"
222
    description: "'new' value, whatever free-text information."
222
    description: "'new' value, whatever free-text information."
223
  checkin_alert:
224
    type:
225
      - string
226
      - "null"
227
    description: Chekin alert field. Put html is this field, it will be displayed and printable while checkin item.
223
  exclude_from_local_holds_priority:
228
  exclude_from_local_holds_priority:
224
    type: boolean
229
    type: boolean
225
    description: Exclude this item from local holds priority.
230
    description: Exclude this item from local holds priority.
(-)a/circ/printalert.pl (+45 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 Modern::Perl;
22
use CGI qw ( -utf8 );
23
24
use C4::Auth qw( get_template_and_user );
25
use C4::Output qw( output_html_with_http_headers );
26
use Koha::Items;
27
28
my $input = CGI->new;
29
30
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31
    {
32
        template_name   => "circ/printalert.tt",
33
        query           => $input,
34
        type            => "intranet",
35
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
36
    }
37
);
38
39
my $itemnumber = $input->param('itemnumber');
40
my $item = Koha::Items->find( $itemnumber ) if $itemnumber;
41
my $checkin_alert = $item->checkin_alert if $item;
42
43
$template->param( alert => $checkin_alert ) if $checkin_alert;
44
45
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/circ/returns.pl (+19 lines)
Lines 209-214 if ( $query->param('recall_id') ) { Link Here
209
    }
209
    }
210
}
210
}
211
211
212
if ( $query->param('print_alert') ) {
213
    $template->param(
214
        print_alert => 1,
215
        itemnumber  => $itemnumber,
216
    );
217
}
218
212
my $borrower;
219
my $borrower;
213
my $returned = 0;
220
my $returned = 0;
214
my $messages;
221
my $messages;
Lines 680-685 if ( $messages->{TransferredRecall} ) { Link Here
680
    }
687
    }
681
}
688
}
682
689
690
if ( $messages->{checkin_alert} ) {
691
    $template->param(
692
        found                 => 1,
693
        checkin_alert         => 1,
694
        checkin_alert_message => $messages->{checkin_alert},
695
        itemnumber            => $itemnumber,
696
    );
697
}
698
683
# Error Messages
699
# Error Messages
684
my @errmsgloop;
700
my @errmsgloop;
685
foreach my $code ( keys %$messages ) {
701
foreach my $code ( keys %$messages ) {
Lines 759-764 foreach my $code ( keys %$messages ) { Link Here
759
    elsif ( $code eq 'DataCorrupted' ) {
775
    elsif ( $code eq 'DataCorrupted' ) {
760
        $err{data_corrupted} = 1;
776
        $err{data_corrupted} = 1;
761
    }
777
    }
778
    elsif ( $code eq 'checkin_alert' ) {
779
        ;
780
    }
762
    elsif ( $code eq 'ReturnClaims' ) {
781
    elsif ( $code eq 'ReturnClaims' ) {
763
        $template->param( ReturnClaims => $messages->{ReturnClaims} );
782
        $template->param( ReturnClaims => $messages->{ReturnClaims} );
764
    } elsif ( $code eq 'RecallFound' ) {
783
    } elsif ( $code eq 'RecallFound' ) {
(-)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/kohastructure.sql (+2 lines)
Lines 2780-2785 CREATE TABLE `deleteditems` ( Link Here
2780
  `copynumber` varchar(32) DEFAULT NULL COMMENT 'copy number (MARC21 952$t)',
2780
  `copynumber` varchar(32) DEFAULT NULL COMMENT 'copy number (MARC21 952$t)',
2781
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
2781
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
2782
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
2782
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
2783
  `checkin_alert` longtext DEFAULT NULL, -- Chekin alert field. Put html is this field, it will be displayed and printable while checkin item.
2783
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
2784
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
2784
  PRIMARY KEY (`itemnumber`),
2785
  PRIMARY KEY (`itemnumber`),
2785
  KEY `delitembarcodeidx` (`barcode`),
2786
  KEY `delitembarcodeidx` (`barcode`),
Lines 4037-4042 CREATE TABLE `items` ( Link Here
4037
  `copynumber` varchar(32) DEFAULT NULL COMMENT 'copy number (MARC21 952$t)',
4038
  `copynumber` varchar(32) DEFAULT NULL COMMENT 'copy number (MARC21 952$t)',
4038
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
4039
  `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)',
4039
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
4040
  `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.',
4041
  `checkin_alert` longtext DEFAULT NULL, -- Chekin alert field. Put html is this field, it will be displayed and printable while checkin item.
4040
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
4042
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority',
4041
  PRIMARY KEY (`itemnumber`),
4043
  PRIMARY KEY (`itemnumber`),
4042
  UNIQUE KEY `itembarcodeidx` (`barcode`),
4044
  UNIQUE KEY `itembarcodeidx` (`barcode`),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printalert.tt (+21 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Print alert &rsaquo; Circulation &rsaquo; Koha</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
9
[% Asset.css("css/print.css") | $raw %]
10
[% IF ( Koha.Preference('SlipCSS') ) %]
11
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
12
[% END %]
13
14
[% INCLUDE 'slip-print.inc' #printThenClose %]
15
</head>
16
<body id="circ_printalert" class="circ">
17
<div id="receipt">
18
19
[% IF ( alert ) %][% alert | $raw %][% END %]
20
21
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +34 lines)
Lines 222-227 Link Here
222
                                </div>
222
                                </div>
223
                            [% END %]
223
                            [% END %]
224
224
225
                            [% IF ( checkin_alert ) %]
226
                                <div id="checkin-alert" class="dialog message audio-alert-action">
227
                                   <form method="post" action="returns.pl" class="confirm">
228
                                       <h3>
229
                                           Alert:
230
                                           <br/>
231
                                           <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
232
                                               [% itembarcode | html %]: [% title | html %]
233
                                           </a>
234
                                       </h3>
235
                                       [% checkin_alert_message | $raw %]
236
                                       [% FOREACH inputloo IN inputloop %]
237
                                           <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
238
                                           <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
239
                                           <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
240
                                       [% END %]
241
                                       <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
242
                                       <input type="hidden" name="print_alert" value="0" />
243
                        
244
                                       <button type="submit" class="print" onclick="this.form.print_alert.value = 1; this.form.submit();">
245
                                           <i class="fa fa-print"></i> Print alert
246
                                       </button>
247
                        
248
                                       <button type="submit" class="deny" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;">
249
                                           <i class="fa fa-times"></i> Ignore
250
                                       </button>
251
                                   </form>
252
                                </div>
253
                            [% END %]
254
225
                            <!-- Bundle has items missing -->
255
                            <!-- Bundle has items missing -->
226
                            [% IF missing_items %]
256
                            [% IF missing_items %]
227
                                <div id="bundle_missing_items" class="dialog alert">
257
                                <div id="bundle_missing_items" class="dialog alert">
Lines 1485-1490 Link Here
1485
                Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% recall_id | uri %]');
1515
                Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% recall_id | uri %]');
1486
            [% END %]
1516
            [% END %]
1487
1517
1518
            [% IF print_alert %]
1519
                Dopop('printalert.pl?itemnumber=[% itemnumber | uri %]');
1520
            [% END %]
1521
1488
            var returns_table = KohaTable("checkedintable", {
1522
            var returns_table = KohaTable("checkedintable", {
1489
                    "searching":false,
1523
                    "searching":false,
1490
                    "paginate":false,
1524
                    "paginate":false,
1491
- 

Return to bug 18760