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

(-)a/C4/Circulation.pm (+19 lines)
Lines 357-362 sub transferbook { Link Here
357
        $dotransfer = 1;
357
        $dotransfer = 1;
358
    }
358
    }
359
359
360
    # 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
361
    my $recall = Koha::Recalls->find({ itemnumber => $item->itemnumber, status => 'R' });
362
    if (defined $recall){
363
        if ($recall->branchcode eq $fbr){
364
            $dotransfer = 0;
365
            $messages->{'RecallPlacedAtHoldingBranch'} = 1;
366
        } else {
367
            $dotransfer = 1;
368
        }
369
    }
370
360
    #actually do the transfer....
371
    #actually do the transfer....
361
    if ($dotransfer) {
372
    if ($dotransfer) {
362
        ModItemTransfer( $itemnumber, $fbr, $tbr );
373
        ModItemTransfer( $itemnumber, $fbr, $tbr );
Lines 1367-1372 sub AddIssue { Link Here
1367
                }
1378
                }
1368
              );
1379
              );
1369
1380
1381
            # Check if a recall
1382
            if ( C4::Context->preference('UseRecalls') ) {
1383
                my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'} });
1384
                if (defined $recall) {
1385
                    $recall->update({ status => "F", old => 1 });
1386
                }
1387
            }
1388
1370
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1389
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1371
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1390
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1372
                CartToShelf( $item->{'itemnumber'} );
1391
                CartToShelf( $item->{'itemnumber'} );
(-)a/Koha/Recall.pm (+12 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
    my $status = $self->status;
190
    return $status && $status eq 'F';
191
}
192
181
=head1 AUTHOR
193
=head1 AUTHOR
182
194
183
Aleisha Amohia <aleisha@catalyst.net.nz>
195
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 @ 2018-02-16 17:54:53
366
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11
352
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bUv00JjY09Hj2Zj4klqyxA
367
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IReqh9sf7I012bhIlwXHgw
353
368
354
1;
369
1;
(-)a/Koha/Schema/Result/Borrower.pm (+16 lines)
Lines 1235-1240 __PACKAGE__->has_many( Link Here
1235
  { cascade_copy => 0, cascade_delete => 0 },
1235
  { cascade_copy => 0, cascade_delete => 0 },
1236
);
1236
);
1237
1237
1238
=head2 recalls
1239
1240
Type: has_many
1241
1242
Related object: L<Koha::Schema::Result::Recall>
1243
1244
=cut
1245
1246
__PACKAGE__->has_many(
1247
    "recalls",
1248
1249
"Koha::Schema::Result::Recall",
1250
{ "foreign.borrowernumber" => "self.borrowernumber" },
1251
{ cascade_copy => 0, cascade_delete => 0 },
1252
);
1253
1238
=head2 reserves
1254
=head2 reserves
1239
1255
1240
Type: has_many
1256
Type: has_many
(-)a/Koha/Schema/Result/Branch.pm (+15 lines)
Lines 601-606 __PACKAGE__->has_many( Link Here
601
  { cascade_copy => 0, cascade_delete => 0 },
601
  { cascade_copy => 0, cascade_delete => 0 },
602
);
602
);
603
603
604
=head2 recalls
605
606
Type: has_many
607
608
Related object: L<Koha::Schema::Result::Recall>
609
610
=cut
611
612
__PACKAGE__->has_many(
613
   "recalls",
614
"Koha::Schema::Result::Recall",
615
{ "foreign.branchcode" => "self.branchcode" },
616
{ cascade_copy => 0, cascade_delete => 0 },
617
);
618
604
=head2 reserves
619
=head2 reserves
605
620
606
Type: has_many
621
Type: has_many
(-)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 1883-1896 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
1883
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1883
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1884
    `recallnotes` mediumtext, -- notes related to this recall
1884
    `recallnotes` mediumtext, -- notes related to this recall
1885
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1885
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1886
    `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
1886
    `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
1887
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1887
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1888
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1888
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1889
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1889
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1890
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1890
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1891
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1891
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1892
    `old` int(1) default NULL, -- flag if the recall is old and no longer active, i.e. expired, cancelled or completed
1892
    PRIMARY KEY (`recall_id`),
1893
    PRIMARY KEY (`recall_id`),
1893
    KEY `priorityfoundidx` (priority,found),
1894
    KEY `prioritystatusidx` (priority,status),
1894
    KEY `borrowernumber` (`borrowernumber`),
1895
    KEY `borrowernumber` (`borrowernumber`),
1895
    KEY `biblionumber` (`biblionumber`),
1896
    KEY `biblionumber` (`biblionumber`),
1896
    KEY `itemnumber` (`itemnumber`),
1897
    KEY `itemnumber` (`itemnumber`),
Lines 1904-1941 CREATE TABLE `recalls` ( -- information related to recalls in Koha Link Here
1904
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1905
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1905
1906
1906
--
1907
--
1907
-- Table structure for table `old_recalls`
1908
--
1909
1910
DROP TABLE IF EXISTS `old_recalls`;
1911
CREATE TABLE `old_recalls` ( -- information related to recalls in Koha
1912
    `recall_id` int(11) NOT NULL auto_increment, -- primary key
1913
    `borrowernumber` int(11) NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall
1914
    `recalldate` date default NULL, -- the date the recall request was placed
1915
    `biblionumber` int(11) NULL default 0, -- foreign key from the biblio table defining which bib record this request is for
1916
    `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from
1917
    `cancellationdate` date default NULL, -- the date this recall was cancelled
1918
    `recallnotes` mediumtext, -- notes related to this recall
1919
    `priority` smallint(6) default NULL, -- where in the queue the patron sits
1920
    `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
1921
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated
1922
    `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on
1923
    `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library
1924
    `expirationdate` DATE DEFAULT NULL, -- the date the recall expires
1925
    `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting
1926
    PRIMARY KEY (`recall_id`),
1927
    KEY `old_recalls_borrowernumber` (`borrowernumber`),
1928
    KEY `old_recalls_biblionumber` (`biblionumber`),
1929
    KEY `old_recalls_itemnumber` (`itemnumber`),
1930
    KEY `old_recalls_branchcode` (`branchcode`),
1931
    KEY `old_recalls_itemtype` (`itemtype`),
1932
    CONSTRAINT `old_recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1933
    CONSTRAINT `old_recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1934
    CONSTRAINT `old_recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
1935
    CONSTRAINT `old_recalls_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL
1936
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1937
1938
--
1939
-- Table structure for table `reserves`
1908
-- Table structure for table `reserves`
1940
--
1909
--
1941
1910
(-)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 / +15 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 31-37 Link Here
31
                    [% IF recalls.count %]
29
                    [% IF recalls.count %]
32
                        <form method="post" action="/cgi-bin/koha/circ/recalls_queue.pl">
30
                        <form method="post" action="/cgi-bin/koha/circ/recalls_queue.pl">
33
                            <input type="hidden" name="op" value="cancel_multiple_recalls">
31
                            <input type="hidden" name="op" value="cancel_multiple_recalls">
34
                            <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
32
                            <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span> |
33
                            <input type="checkbox" id="hide_old"> <span id="hide_old_text">Show old recalls</span>
35
                            [% INCLUDE 'recalls-reports.inc' %]
34
                            [% INCLUDE 'recalls-reports.inc' %]
36
                            <fieldset class="action">
35
                            <fieldset class="action">
37
                                <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
36
                                <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
Lines 56-59 Link Here
56
    [% END %]
55
    [% END %]
57
</div>
56
</div>
58
57
58
[% MACRO jsinclude BLOCK %]
59
    [% INCLUDE 'datatables.inc' %]
60
    [% INCLUDE 'columns_settings.inc' %]
61
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
62
    <script type="text/javascript">
63
    $(document).ready(function() {
64
            $(".old").hide();
65
    });
66
    </script>
67
[% END %]
68
69
59
[% INCLUDE 'intranet-bottom.inc' %]
70
[% 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 74-80 Link Here
74
                                            <br><i>Barcode: [% recall.item.barcode %]</i>
74
                                            <br><i>Barcode: [% recall.item.barcode %]</i>
75
                                        </td>
75
                                        </td>
76
                                        <td>
76
                                        <td>
77
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.borrower.firstname %] [% recall.borrower.surname %]</a>
77
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.patron.firstname %] [% recall.patron.surname %]</a>
78
                                            [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %]
78
                                            [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %]
79
                                            [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %]
79
                                            [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %]
80
                                        </td>
80
                                        </td>
Lines 97-103 Link Here
97
                    </div>
97
                    </div>
98
98
99
                    <div id="recallsover">
99
                    <div id="recallsover">
100
                        [% IF ( over.size > 0 ) %]
100
                        [% IF ( over.count ) %]
101
                            [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') %] days.</p>[% END %]
101
                            [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') %] days.</p>[% END %]
102
                            <table id="recallsover-table">
102
                            <table id="recallsover-table">
103
                                <thead><tr>
103
                                <thead><tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
Lines 780-786 Link Here
780
                                [% END %]
780
                                [% END %]
781
                            </div> [% # /div#reserves %]
781
                            </div> [% # /div#reserves %]
782
                        [% END %]
782
                        [% END %]
783
                        [% IF Koha.Preferernce('UseRecalls') && recalls %]
783
                        [% IF Koha.Preferernce('UseRecalls') && recalls.count %]
784
                            [% INCLUDE 'recalls.inc' %]
784
                            [% INCLUDE 'recalls.inc' %]
785
                        [% END %]
785
                        [% END %]
786
786
(-)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 / +9 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
        $("#hide_old").click(function(){
53
            if ($("#hide_old").prop("checked")){
54
                $(".old").show();
55
            } else {
56
                $(".old").hide();
57
            }
58
        });
52
});
59
});
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt (-1 lines)
Lines 43-49 Link Here
43
                        <p>You will be notified when your item is waiting to be picked up at the library.</p>
43
                        <p>You will be notified when your item is waiting to be picked up at the library.</p>
44
                    [% ELSIF not error %]
44
                    [% ELSIF not error %]
45
                        <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>
45
                        <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>
46
                        <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p>
47
<hr>
46
<hr>
48
                        [% IF loggedinusername %]
47
                        [% IF loggedinusername %]
49
                            <div class="dialog">
48
                            <div class="dialog">
(-)a/opac/opac-recall.pl (-7 / +10 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-64 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
64
        # can recall
58
    # if recall is expired or cancelled, user may recall again
59
        $error = 'duplicate';
60
    } else {
61
    # 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 });
64
        my $recall_request = Koha::Recall->new({
67
        my $recall_request = Koha::Recall->new({
(-)a/svc/checkouts (+7 lines)
Lines 171-176 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
171
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
171
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
172
        $damaged = $av->count ? $av->next->lib : '';
172
        $damaged = $av->count ? $av->next->lib : '';
173
    }
173
    }
174
    my $recall = Koha::Recalls->find({ itemnumber => $c->{itemnumber}, biblionumber => $c->{biblionumber}, status => { '=', ['R','O'] } });
175
    my $recalled = 0;
176
    if ( defined $recall ){
177
        $recalled = 1;
178
    }
179
174
    my $checkout = {
180
    my $checkout = {
175
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
181
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
176
        title                => $c->{title},
182
        title                => $c->{title},
Lines 228-233 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
228
            cardnumber => $c->{cardnumber},
234
            cardnumber => $c->{cardnumber},
229
        },
235
        },
230
        issued_today => !$c->{not_issued_today},
236
        issued_today => !$c->{not_issued_today},
237
            recalled => $recalled,
231
    };
238
    };
232
239
233
    if ( $c->{not_issued_today} ) {
240
    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