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

(-)a/C4/Circulation.pm (+19 lines)
Lines 356-361 sub transferbook { Link Here
356
        $dotransfer = 1;
356
        $dotransfer = 1;
357
    }
357
    }
358
358
359
    # check if item has been recalled. do a transfer if the recall branch is different to the item holding branch, otherwise don't do a transfer
360
    my $recall = Koha::Recalls->find({ itemnumber => $item->itemnumber, status => 'R' });
361
    if (defined $recall){
362
        if ($recall->branchcode eq $fbr){
363
            $dotransfer = 0;
364
            $messages->{'RecallPlacedAtHoldingBranch'} = 1;
365
        } else {
366
            $dotransfer = 1;
367
        }
368
    }
369
359
    #actually do the transfer....
370
    #actually do the transfer....
360
    if ($dotransfer) {
371
    if ($dotransfer) {
361
        ModItemTransfer( $itemnumber, $fbr, $tbr );
372
        ModItemTransfer( $itemnumber, $fbr, $tbr );
Lines 1371-1376 sub AddIssue { Link Here
1371
                }
1382
                }
1372
              );
1383
              );
1373
1384
1385
            # Check if a recall
1386
            if ( C4::Context->preference('UseRecalls') ) {
1387
                my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'} });
1388
                if (defined $recall) {
1389
                    $recall->update({ status => "F", old => 1 });
1390
                }
1391
            }
1392
1374
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1393
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1375
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1394
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1376
                CartToShelf( $item->{'itemnumber'} );
1395
                CartToShelf( $item->{'itemnumber'} );
(-)a/Koha/Recall.pm (+13 lines)
Lines 178-183 sub is_cancelled { Link Here
178
    return $status && $status eq 'C';
178
    return $status && $status eq 'C';
179
}
179
}
180
180
181
=head3 is_finished
182
183
Returns true if recall is closed
184
185
=cut
186
187
sub is_finished {
188
    my ($self) = @_;
189
190
    my $status = $self->status;
191
    return $status && $status eq 'F';
192
}
193
181
=head1 AUTHOR
194
=head1 AUTHOR
182
195
183
Aleisha Amohia <aleisha@catalyst.net.nz>
196
Aleisha Amohia <aleisha@catalyst.net.nz>
(-)a/Koha/Schema/Result/Biblio.pm (-2 / +17 lines)
Lines 272-277 __PACKAGE__->has_many( Link Here
272
  { cascade_copy => 0, cascade_delete => 0 },
272
  { cascade_copy => 0, cascade_delete => 0 },
273
);
273
);
274
274
275
=head2 recalls
276
277
Type: has_many
278
279
Related object: L<Koha::Schema::Result::Recall>
280
281
=cut
282
283
__PACKAGE__->has_many(
284
  "recalls",
285
  "Koha::Schema::Result::Recall",
286
  { "foreign.biblionumber" => "self.biblionumber" },
287
  { cascade_copy => 0, cascade_delete => 0 },
288
);
289
275
=head2 reserves
290
=head2 reserves
276
291
277
Type: has_many
292
Type: has_many
Lines 348-354 __PACKAGE__->has_many( Link Here
348
);
363
);
349
364
350
365
351
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
366
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
352
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jis7Sm5+9lVKav+o18JLtA
367
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IReqh9sf7I012bhIlwXHgw
353
368
354
1;
369
1;
(-)a/Koha/Schema/Result/Borrower.pm (-2 / +17 lines)
Lines 1190-1195 __PACKAGE__->has_many( Link Here
1190
  { cascade_copy => 0, cascade_delete => 0 },
1190
  { cascade_copy => 0, cascade_delete => 0 },
1191
);
1191
);
1192
1192
1193
=head2 recalls
1194
1195
Type: has_many
1196
1197
Related object: L<Koha::Schema::Result::Recall>
1198
1199
=cut
1200
1201
__PACKAGE__->has_many(
1202
  "recalls",
1203
  "Koha::Schema::Result::Recall",
1204
  { "foreign.borrowernumber" => "self.borrowernumber" },
1205
  { cascade_copy => 0, cascade_delete => 0 },
1206
);
1207
1193
=head2 reserves
1208
=head2 reserves
1194
1209
1195
Type: has_many
1210
Type: has_many
Lines 1386-1393 Composing rels: L</aqorder_users> -> ordernumber Link Here
1386
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1401
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1387
1402
1388
1403
1389
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-13 14:08:33
1404
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
1390
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pxhUnV9IMvVGml9HFheMLw
1405
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sHW5C2MCH5i42XDRs5ZMpg
1391
1406
1392
__PACKAGE__->belongs_to(
1407
__PACKAGE__->belongs_to(
1393
    "guarantor",
1408
    "guarantor",
(-)a/Koha/Schema/Result/Branch.pm (-2 / +17 lines)
Lines 563-568 __PACKAGE__->has_many( Link Here
563
  { cascade_copy => 0, cascade_delete => 0 },
563
  { cascade_copy => 0, cascade_delete => 0 },
564
);
564
);
565
565
566
=head2 recalls
567
568
Type: has_many
569
570
Related object: L<Koha::Schema::Result::Recall>
571
572
=cut
573
574
__PACKAGE__->has_many(
575
  "recalls",
576
  "Koha::Schema::Result::Recall",
577
  { "foreign.branchcode" => "self.branchcode" },
578
  { cascade_copy => 0, cascade_delete => 0 },
579
);
580
566
=head2 reserves
581
=head2 reserves
567
582
568
Type: has_many
583
Type: has_many
Lines 609-616 __PACKAGE__->has_many( Link Here
609
);
624
);
610
625
611
626
612
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-12-05 14:08:18
627
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
613
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g+WicMjGntjAgcKrbn4IdQ
628
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DOlKnTMaCV7eFTbjQ92/BA
614
629
615
630
616
# You can replace this text with custom code or comments, and it will be preserved on regeneration
631
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/installer/data/mysql/atomicupdate/bug_19532_-_add_recalls_table.sql (-2 / +2 lines)
Lines 9-21 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
9
    `cancellationdate` date default NULL, -- the date this recall was cancelled
9
    `cancellationdate` date default NULL, -- the date this recall was cancelled
10
    `recallnotes` mediumtext, -- notes related to this recall
10
    `recallnotes` mediumtext, -- notes related to this recall
11
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
11
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
12
    `status` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired, C=cancelled
12
    `status` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired, C=cancelled, F=finished/completed
13
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
13
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
14
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
14
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
15
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
15
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
16
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
16
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
17
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
17
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
18
    `old` int(1) default null, -- flag if the recall is old and no longer active, i.e. expired or cancelled
18
    `old` int(1) default null, -- flag if the recall is old and no longer active, i.e. expired, cancelled or completed
19
    PRIMARY KEY (`recall_id`),
19
    PRIMARY KEY (`recall_id`),
20
    KEY `prioritystatusidx` (priority,status),
20
    KEY `prioritystatusidx` (priority,status),
21
    KEY `borrowernumber` (`borrowernumber`),
21
    KEY `borrowernumber` (`borrowernumber`),
(-)a/installer/data/mysql/atomicupdate/bug_19532_-_adding_recalls_circ_rules.perl (-1 / +1 lines)
Lines 1-7 Link Here
1
$DBversion = 'XXX';
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    unless( column_exists( 'issuingrules', 'recall_due_date_interval' ) ) {
3
    unless( column_exists( 'issuingrules', 'recall_due_date_interval' ) ) {
4
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_due_date_interval int(11) default NULL AFTER note|);
4
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_due_date_interval int(11) default NULL AFTER article_requests|);
5
    }
5
    }
6
    unless( column_exists( 'issuingrules', 'recall_overdue_fine' ) ) {
6
    unless( column_exists( 'issuingrules', 'recall_overdue_fine' ) ) {
7
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_overdue_fine decimal(28,6) default NULL AFTER recall_due_date_interval|);
7
        $dbh->do(q|ALTER TABLE issuingrules ADD recall_overdue_fine decimal(28,6) default NULL AFTER recall_due_date_interval|);
(-)a/installer/data/mysql/kohastructure.sql (-34 / +3 lines)
Lines 1858-1871 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
1858
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1858
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1859
    `recallnotes` mediumtext, -- notes related to this recall
1859
    `recallnotes` mediumtext, -- notes related to this recall
1860
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1860
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1861
    `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired
1861
    `status` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired, C=cancelled, F=finished/completed
1862
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1862
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1863
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1863
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1864
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1864
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1865
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1865
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1866
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1866
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1867
    `old` int(1) default NULL, -- flag if the recall is old and no longer active, i.e. expired, cancelled or completed
1867
    PRIMARY KEY (`recall_id`),
1868
    PRIMARY KEY (`recall_id`),
1868
    KEY `priorityfoundidx` (priority,found),
1869
    KEY `prioritystatusidx` (priority,status),
1869
    KEY `borrowernumber` (`borrowernumber`),
1870
    KEY `borrowernumber` (`borrowernumber`),
1870
    KEY `biblionumber` (`biblionumber`),
1871
    KEY `biblionumber` (`biblionumber`),
1871
    KEY `itemnumber` (`itemnumber`),
1872
    KEY `itemnumber` (`itemnumber`),
Lines 1879-1916 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
1879
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1880
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1880
1881
1881
--
1882
--
1882
-- Table structure for table `old_recalls`
1883
--
1884
1885
DROP TABLE IF EXISTS `old_recalls`;
1886
CREATE TABLE `old_recalls` ( -- information related to recalls in Koha
1887
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
1888
    `borrowernumber` int(11) NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
1889
    `recalldate` date default NULL, -- the date the recall request was placed
1890
    `biblionumber` int(11) NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
1891
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
1892
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1893
    `recallnotes` mediumtext, -- notes related to this recall
1894
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1895
    `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired
1896
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1897
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1898
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1899
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1900
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1901
    PRIMARY KEY (`recall_id`),
1902
    KEY `old_recalls_borrowernumber` (`borrowernumber`),
1903
    KEY `old_recalls_biblionumber` (`biblionumber`),
1904
    KEY `old_recalls_itemnumber` (`itemnumber`),
1905
    KEY `old_recalls_branchcode` (`branchcode`),
1906
    KEY `old_recalls_itemtype` (`itemtype`),
1907
    CONSTRAINT `old_recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1908
    CONSTRAINT `old_recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1909
    CONSTRAINT `old_recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1910
    CONSTRAINT `old_recalls_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL
1911
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1912
1913
--
1914
-- Table structure for table `reserves`
1883
-- Table structure for table `reserves`
1915
--
1884
--
1916
1885
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc (-1 / +12 lines)
Lines 8-13 Link Here
8
                <th class="recall-title anti-the">Title</th>
8
                <th class="recall-title anti-the">Title</th>
9
                <th class="recall-barcode">Barcode</th>
9
                <th class="recall-barcode">Barcode</th>
10
                <th class="recall-date psort title-string">Placed on</th>
10
                <th class="recall-date psort title-string">Placed on</th>
11
                <th class="recall-waiting psort title-string">Waiting since</th>
11
                <th class="recall-expiry title-string">Expires on</th>
12
                <th class="recall-expiry title-string">Expires on</th>
12
                <th class="recall-branch">Pickup location</th>
13
                <th class="recall-branch">Pickup location</th>
13
                <th class="recall-status">Status</th>
14
                <th class="recall-status">Status</th>
Lines 18-24 Link Here
18
19
19
        <tbody>
20
        <tbody>
20
            [% FOREACH recall IN recalls %]
21
            [% FOREACH recall IN recalls %]
21
                <tr>
22
                [% IF recall.is_cancelled || recall.has_expired || recall.is_finished %]
23
                    <tr class="old">
24
                [% ELSE %]
25
                    <tr>
26
                [% END %]
22
                    <td>
27
                    <td>
23
                        [% IF recall.is_requested || recall.is_waiting || recall.is_overdue %]
28
                        [% IF recall.is_requested || recall.is_waiting || recall.is_overdue %]
24
                            <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids">
29
                            <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids">
Lines 52-57 Link Here
52
                        [% recall.recalldate | $KohaDates %]
57
                        [% recall.recalldate | $KohaDates %]
53
                    </td>
58
                    </td>
54
59
60
                    <td class="recall-waiting">
61
                        [% IF recall.waitingdate %][% recall.waitingdate | $KohaDates %][% ELSE %]Not waiting[% END %]
62
                    </td>
63
55
                    <td class="recall-expiry">
64
                    <td class="recall-expiry">
56
                        [% IF ( recall.is_waiting ) %]
65
                        [% IF ( recall.is_waiting ) %]
57
                            [% IF ( recall.expirationdate ) %]
66
                            [% IF ( recall.expirationdate ) %]
Lines 81-86 Link Here
81
                            Cancelled
90
                            Cancelled
82
                        [% ELSIF ( recall.is_overdue ) %]
91
                        [% ELSIF ( recall.is_overdue ) %]
83
                            Overdue to be returned
92
                            Overdue to be returned
93
                        [% ELSIF ( recall.is_finished ) %]
94
                            Closed
84
                        [% END %]
95
                        [% END %]
85
                    </td>
96
                    </td>
86
97
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc (+2 lines)
Lines 59-64 Link Here
59
                            Cancelled
59
                            Cancelled
60
                        [% ELSIF ( recall.is_overdue ) %]
60
                        [% ELSIF ( recall.is_overdue ) %]
61
                            Overdue to be returned
61
                            Overdue to be returned
62
                        [% ELSIF ( recall.is_finished ) %]
63
                            Closed
62
                        [% END %]
64
                        [% END %]
63
                    </td>
65
                    </td>
64
66
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt (-1 / +1 lines)
Lines 5-11 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css"> p { margin-top: 0; }</style>
6
<style type="text/css"> p { margin-top: 0; }</style>
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script>
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
9
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
</head>
11
</head>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt (-4 / +14 lines)
Lines 1-13 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Circulation &rsaquo; Recalls queue</title>
5
<title>Koha &rsaquo; Circulation &rsaquo; Recalls queue</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css"> p { margin-top: 0; }</style>
7
<style type="text/css"> p { margin-top: 0; }</style>
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script>
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
</head>
9
</head>
12
<body id="circ_recalls_queue" class="circ">
10
<body id="circ_recalls_queue" class="circ">
13
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
Lines 35-41 Link Here
35
                        <form method="post" action="/cgi-bin/koha/circ/recalls_queue.pl">
33
                        <form method="post" action="/cgi-bin/koha/circ/recalls_queue.pl">
36
                            <input type="hidden" name="op" value="cancel_multiple_recalls">
34
                            <input type="hidden" name="op" value="cancel_multiple_recalls">
37
35
38
                            <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
36
                            <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span> |
37
                            <input type="checkbox" id="hide_old"> <span id="hide_old_text">Show old recalls</span>
39
38
40
                            [% INCLUDE 'recalls-reports.inc' %]
39
                            [% INCLUDE 'recalls-reports.inc' %]
41
40
Lines 67-70 Link Here
67
    [% END %]
66
    [% END %]
68
</div>
67
</div>
69
68
69
[% MACRO jsinclude BLOCK %]
70
    [% INCLUDE 'datatables.inc' %]
71
    [% INCLUDE 'columns_settings.inc' %]
72
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
73
    <script type="text/javascript">
74
        $(document).ready(function() {
75
            $(".old").hide();
76
        });
77
    </script>
78
[% END %]
79
70
[% INCLUDE 'intranet-bottom.inc' %]
80
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt (-3 / +3 lines)
Lines 5-11 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css"> p { margin-top: 0; }</style>
6
<style type="text/css"> p { margin-top: 0; }</style>
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script>
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
9
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript">
10
<script type="text/javascript">
11
    $(document).ready(function() {
11
    $(document).ready(function() {
Lines 76-82 Link Here
76
                                            <br><i>Barcode: [% recall.item.barcode %]</i>
76
                                            <br><i>Barcode: [% recall.item.barcode %]</i>
77
                                        </td>
77
                                        </td>
78
                                        <td>
78
                                        <td>
79
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.borrower.firstname %] [% recall.borrower.surname %]</a>
79
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.patron.firstname %] [% recall.patron.surname %]</a>
80
                                            [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %]
80
                                            [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %]
81
                                            [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %]
81
                                            [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %]
82
                                        </td>
82
                                        </td>
Lines 99-105 Link Here
99
                    </div>
99
                    </div>
100
100
101
                    <div id="recallsover">
101
                    <div id="recallsover">
102
                        [% IF ( over.size > 0 ) %]
102
                        [% IF ( over.count ) %]
103
                            [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') %] days.</p>[% END %]
103
                            [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') %] days.</p>[% END %]
104
                            <table id="recallsover-table">
104
                            <table id="recallsover-table">
105
                                <thead><tr>
105
                                <thead><tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
Lines 652-658 function validate1(date) { Link Here
652
    [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
652
    [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
653
	</div>
653
	</div>
654
654
655
[% IF Koha.Preference('UseRecalls') && recalls %]
655
[% IF Koha.Preference('UseRecalls') && recalls.count %]
656
    [% INCLUDE 'recalls.inc' %]
656
    [% INCLUDE 'recalls.inc' %]
657
[% END %]
657
[% END %]
658
658
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt (-1 / +1 lines)
Lines 5-11 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
7
[% INCLUDE 'datatables.inc' %]
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script>
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
9
</head>
9
</head>
10
<body id="recalls_history" class="pat">
10
<body id="recalls_history" class="pat">
11
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (+4 lines)
Lines 274-279 $(document).ready(function() { Link Here
274
                            onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>";
274
                            onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>";
275
                        }
275
                        }
276
276
277
                        if ( oObj.recalled == 1 ) {
278
                            title += " - <span class='circ-hlt item-recalled'>This item has been recalled and the due date updated.</span>";
279
                        }
280
277
                        title += " "
281
                        title += " "
278
                              + "<a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber="
282
                              + "<a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber="
279
                              + oObj.biblionumber
283
                              + oObj.biblionumber
(-)a/koha-tmpl/intranet-tmpl/prog/js/recalls.js (-2 / +10 lines)
Lines 17-25 $(document).ready(function() { Link Here
17
                .done(function(data) {
17
                .done(function(data) {
18
                    var message = "";
18
                    var message = "";
19
                    if(data.success == 0) {
19
                    if(data.success == 0) {
20
                        message = "The recall may have already been cancelled. Please refresh the page.";
20
                        message = _("The recall may have already been cancelled. Please refresh the page.");
21
                    } else {
21
                    } else {
22
                        message = "Cancelled"
22
                        message = _("Cancelled");
23
                    }
23
                    }
24
                    $self.parent().html(message);
24
                    $self.parent().html(message);
25
                });
25
                });
Lines 49-52 $(document).ready(function() { Link Here
49
                $("input[name='recall_ids']").prop("checked", false);
49
                $("input[name='recall_ids']").prop("checked", false);
50
            }
50
            }
51
        });
51
        });
52
53
        $("#hide_old").click(function(){
54
            if ($("#hide_old").prop("checked")){
55
                $(".old").show();
56
            } else {
57
                $(".old").hide();
58
            }
59
        });
52
});
60
});
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt (-2 / +2 lines)
Lines 45-52 Link Here
45
                        <p>You will be notified when your item is waiting to be picked up at the library.</p>
45
                        <p>You will be notified when your item is waiting to be picked up at the library.</p>
46
                    [% ELSIF not error %]
46
                    [% ELSIF not error %]
47
                        <p>All borrowable material is subject to recall if checked out and needed by someone else. We will ask the person who has checked out this item to return it so you may use it.</p>
47
                        <p>All borrowable material is subject to recall if checked out and needed by someone else. We will ask the person who has checked out this item to return it so you may use it.</p>
48
                        <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p>
48
                        <hr>
49
<hr>
49
50
                        [% IF loggedinusername %]
50
                        [% IF loggedinusername %]
51
                            <div class="dialog">
51
                            <div class="dialog">
52
                            <p>Place a recall on [% biblio.title %] ([% biblio.author %])?</p> <a href="/cgi-bin/koha/opac-recall.pl?op=request&itemnumber=[% itemnumber %]" class="btn btn-default btn-sm">Confirm</a> &nbsp; <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber %]">Cancel</a>
52
                            <p>Place a recall on [% biblio.title %] ([% biblio.author %])?</p> <a href="/cgi-bin/koha/opac-recall.pl?op=request&itemnumber=[% itemnumber %]" class="btn btn-default btn-sm">Confirm</a> &nbsp; <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber %]">Cancel</a>
(-)a/opac/opac-recall.pl (-6 / +9 lines)
Lines 23-28 use DateTime; Link Here
23
use C4::Auth;
23
use C4::Auth;
24
use C4::Output;
24
use C4::Output;
25
use C4::Context;
25
use C4::Context;
26
use C4::Letters;
26
use Koha::Items;
27
use Koha::Items;
27
use Koha::Recall;
28
use Koha::Recall;
28
use Koha::Recalls;
29
use Koha::Recalls;
Lines 48-63 my $biblio = Koha::Biblios->find($item->biblionumber); Link Here
48
my $recalled = Koha::Recalls->find({ itemnumber => $itemnumber });
49
my $recalled = Koha::Recalls->find({ itemnumber => $itemnumber });
49
my $error;
50
my $error;
50
51
52
if ( defined $recalled && $recalled->borrowernumber == $borrowernumber && ($recalled->is_requested || $recalled->is_waiting || $recalled->is_overdue) ){
53
    # can't place a recall on an item that this borrower has already recalled
54
    # if recall is expired or cancelled, user may recall again
55
    $error = 'duplicate';
56
}
57
51
if ($op eq 'request'){
58
if ($op eq 'request'){
52
    if (!defined($borrowernumber)){
59
    if (!defined $borrowernumber){
53
    # can't place recall if not logged in
60
    # can't place recall if not logged in
54
        $error = 'notloggedin';
61
        $error = 'notloggedin';
55
        print $query->redirect('/cgi-bin/koha/opac-detail.pl?biblionumber='.$item->biblionumber);
62
        print $query->redirect('/cgi-bin/koha/opac-detail.pl?biblionumber='.$item->biblionumber);
56
    } elsif ( defined $recalled && $recalled->borrowernumber == $borrowernumber && ($recalled->is_requested || $recalled->is_waiting || $recalled->is_overdue) ){
63
    } elsif (!defined $error) {
57
    # can't place a recall on an item that this borrower has already recalled
58
    # if recall is expired or cancelled, user may recall again
59
        $error = 'duplicate';
60
    } else {
61
    # can recall
64
    # can recall
62
        my $borrower = Koha::Patrons->find($borrowernumber);
65
        my $borrower = Koha::Patrons->find($borrowernumber);
63
        my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch });
66
        my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch });
(-)a/svc/checkouts (+6 lines)
Lines 164-169 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
164
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
164
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
165
        $damaged = $av->count ? $av->next->lib : '';
165
        $damaged = $av->count ? $av->next->lib : '';
166
    }
166
    }
167
    my $recall = Koha::Recalls->find({ itemnumber => $c->{itemnumber}, biblionumber => $c->{biblionumber}, status => { '=', ['R','O'] } });
168
    my $recalled = 0;
169
    if ( defined $recall ){
170
        $recalled = 1;
171
    }
167
    my $checkout = {
172
    my $checkout = {
168
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
173
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
169
        title                => $c->{title},
174
        title                => $c->{title},
Lines 220-225 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
220
            cardnumber => $c->{cardnumber},
225
            cardnumber => $c->{cardnumber},
221
        },
226
        },
222
        issued_today => !$c->{not_issued_today},
227
        issued_today => !$c->{not_issued_today},
228
        recalled => $recalled,
223
    };
229
    };
224
230
225
    if ( $c->{not_issued_today} ) {
231
    if ( $c->{not_issued_today} ) {
(-)a/t/db_dependent/Koha/Recalls.t (-4 / +4 lines)
Lines 62-70 is( $recall->is_waiting, 1, 'Recall is waiting for pickup' ); Link Here
62
$recall->update({ status => 'C', cancellationdate => dt_from_string(), old => 1 });
62
$recall->update({ status => 'C', cancellationdate => dt_from_string(), old => 1 });
63
is( $recall->is_cancelled, 1, 'Recall has been cancelled' );
63
is( $recall->is_cancelled, 1, 'Recall has been cancelled' );
64
64
65
$recall->update({ status => 'E', expirationdate => dt_from_string() });
65
$recall->update({ status => 'E', expirationdate => dt_from_string(), old => 1 });
66
is( $recall->has_expired, 1, 'Recall has expired' );
66
is( $recall->has_expired, 1, 'Recall has expired' );
67
67
68
$recall->update({ status => 'F', old => 1 });
69
is ($recall->is_finished, 1, 'Recall is closed');
70
68
is( $biblio->{biblionumber}, $recall->biblio->biblionumber, 'Can access biblio from recall' );
71
is( $biblio->{biblionumber}, $recall->biblio->biblionumber, 'Can access biblio from recall' );
69
72
70
is( $patron->{borrowernumber}, $recall->patron->borrowernumber, 'Can access borrower from recall' );
73
is( $patron->{borrowernumber}, $recall->patron->borrowernumber, 'Can access borrower from recall' );
Lines 73-78 is( $item->{itemnumber}, $recall->item->itemnumber, 'Can access item from recall Link Here
73
76
74
is( $library->{branchcode}, $recall->library->branchcode, 'Can access branch from recall' );
77
is( $library->{branchcode}, $recall->library->branchcode, 'Can access branch from recall' );
75
78
76
is( $checkout->{issue_id}, $recall->checkout->issue_id, 'Can access checkout from recall' );
77
78
$schema->storage->txn_rollback;
79
$schema->storage->txn_rollback;
79
- 

Return to bug 19532