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 1365-1370 sub AddIssue { Link Here
1365
                }
1376
                }
1366
              );
1377
              );
1367
1378
1379
            # Check if a recall
1380
            if ( C4::Context->preference('UseRecalls') ) {
1381
                my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'} });
1382
                if (defined $recall) {
1383
                    $recall->update({ status => "F", old => 1 });
1384
                }
1385
            }
1386
1368
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1387
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1369
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1388
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1370
                CartToShelf( $item->{'itemnumber'} );
1389
                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 (-3 / +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 347-354 __PACKAGE__->has_many( Link Here
347
  { cascade_copy => 0, cascade_delete => 0 },
362
  { cascade_copy => 0, cascade_delete => 0 },
348
);
363
);
349
364
350
365
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
351
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
366
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IReqh9sf7I012bhIlwXHgw
352
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bUv00JjY09Hj2Zj4klqyxA
353
367
354
1;
368
1;
(-)a/Koha/Schema/Result/Borrower.pm (-3 / +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 1385-1393 Composing rels: L</aqorder_users> -> ordernumber Link Here
1385
1400
1386
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1401
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1387
1402
1388
1403
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
1389
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
1404
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sHW5C2MCH5i42XDRs5ZMpg
1390
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wM40W+toV8ca5LFwinkHxA
1391
1405
1392
__PACKAGE__->belongs_to(
1406
__PACKAGE__->belongs_to(
1393
    "guarantor",
1407
    "guarantor",
(-)a/Koha/Schema/Result/Branch.pm (-3 / +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 608-616 __PACKAGE__->has_many( Link Here
608
  { cascade_copy => 0, cascade_delete => 0 },
623
  { cascade_copy => 0, cascade_delete => 0 },
609
);
624
);
610
625
611
626
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
612
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
627
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DOlKnTMaCV7eFTbjQ92/BA
613
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QOMUFz2EjvAVWCkIpNmvtg
614
628
615
629
616
# You can replace this text with custom code or comments, and it will be preserved on regeneration
630
# 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 1860-1873 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
1860
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1860
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1861
    `recallnotes` mediumtext, -- notes related to this recall
1861
    `recallnotes` mediumtext, -- notes related to this recall
1862
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1862
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1863
    `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
1863
    `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, F=finished/completed
1864
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1864
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1865
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1865
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1866
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1866
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1867
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1867
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1868
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1868
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1869
    `old` int(1) default NULL, -- flag if the recall is old and no longer active, i.e. expired, cancelled or completed
1869
    PRIMARY KEY (`recall_id`),
1870
    PRIMARY KEY (`recall_id`),
1870
    KEY `priorityfoundidx` (priority,found),
1871
    KEY `prioritystatusidx` (priority,status),
1871
    KEY `borrowernumber` (`borrowernumber`),
1872
    KEY `borrowernumber` (`borrowernumber`),
1872
    KEY `biblionumber` (`biblionumber`),
1873
    KEY `biblionumber` (`biblionumber`),
1873
    KEY `itemnumber` (`itemnumber`),
1874
    KEY `itemnumber` (`itemnumber`),
Lines 1881-1918 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
1881
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1882
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1882
1883
1883
--
1884
--
1884
-- Table structure for table `old_recalls`
1885
--
1886
1887
DROP TABLE IF EXISTS `old_recalls`;
1888
CREATE TABLE `old_recalls` ( -- information related to recalls in Koha
1889
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
1890
    `borrowernumber` int(11) NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
1891
    `recalldate` date default NULL, -- the date the recall request was placed
1892
    `biblionumber` int(11) NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
1893
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
1894
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1895
    `recallnotes` mediumtext, -- notes related to this recall
1896
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1897
    `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
1898
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1899
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1900
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1901
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1902
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1903
    PRIMARY KEY (`recall_id`),
1904
    KEY `old_recalls_borrowernumber` (`borrowernumber`),
1905
    KEY `old_recalls_biblionumber` (`biblionumber`),
1906
    KEY `old_recalls_itemnumber` (`itemnumber`),
1907
    KEY `old_recalls_branchcode` (`branchcode`),
1908
    KEY `old_recalls_itemtype` (`itemtype`),
1909
    CONSTRAINT `old_recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1910
    CONSTRAINT `old_recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1911
    CONSTRAINT `old_recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1912
    CONSTRAINT `old_recalls_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL
1913
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1914
1915
--
1916
-- Table structure for table `reserves`
1885
-- Table structure for table `reserves`
1917
--
1886
--
1918
1887
(-)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 68-71 Link Here
68
    [% END %]
67
    [% END %]
69
</div>
68
</div>
70
69
70
[% MACRO jsinclude BLOCK %]
71
    [% INCLUDE 'datatables.inc' %]
72
    [% INCLUDE 'columns_settings.inc' %]
73
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
74
    <script type="text/javascript">
75
        $(document).ready(function() {
76
            $(".old").hide();
77
        });
78
    </script>
79
[% END %]
80
71
[% INCLUDE 'intranet-bottom.inc' %]
81
[% 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 530-536 Link Here
530
    [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
530
    [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
531
	</div>
531
	</div>
532
532
533
[% IF Koha.Preference('UseRecalls') && recalls %]
533
[% IF Koha.Preference('UseRecalls') && recalls.count %]
534
    [% INCLUDE 'recalls.inc' %]
534
    [% INCLUDE 'recalls.inc' %]
535
[% END %]
535
[% END %]
536
536
(-)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 (-1 / +1 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>
49
<hr>
48
<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