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

(-)a/Koha/Recall.pm (-4 / +19 lines)
Lines 43-49 sub _type { Link Here
43
43
44
=head3 biblio
44
=head3 biblio
45
45
46
Returns the related Koha::Biblio object for this hold
46
Returns the related Koha::Biblio object for this recall
47
47
48
=cut
48
=cut
49
49
Lines 57-63 sub biblio { Link Here
57
57
58
=head3 item
58
=head3 item
59
59
60
Returns the related Koha::Item object for this Hold
60
Returns the related Koha::Item object for this recall
61
61
62
=cut
62
=cut
63
63
Lines 72-78 sub item { Link Here
72
72
73
=head3 borrower
73
=head3 borrower
74
74
75
Returns the related Koha::Patron object for this Hold
75
Returns the related Koha::Patron object for this recall
76
76
77
=cut
77
=cut
78
78
Lines 84-92 sub borrower { Link Here
84
84
85
    return $self->{_borrower};
85
    return $self->{_borrower};
86
}
86
}
87
87
=head3 branch
88
=head3 branch
88
89
89
Returns the related Koha::Library object for this Hold
90
Returns the related Koha::Library object for this recall
90
91
91
=cut
92
=cut
92
93
Lines 98-103 sub branch { Link Here
98
    return $self->{_branch};
99
    return $self->{_branch};
99
}
100
}
100
101
102
=head3 checkout
103
104
Returns the related Koha::Checkout object for this recall
105
106
=cut
107
108
sub checkout {
109
    my ($self) = @_;
110
111
    $self->{_checkout} ||= Koha::Checkouts->find({ itemnumber => $self->itemnumber() });
112
113
    return $self->{_checkout};
114
}
115
101
=head3 is_waiting
116
=head3 is_waiting
102
117
103
Returns true if recall is awaiting pickup
118
Returns true if recall is awaiting pickup
(-)a/circ/recalls_overdue.pl (+59 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2017 Aleisha Amohia <aleisha@catalyst.net.nz>
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
use CGI qw ( -utf8 );
22
use C4::Auth;
23
use C4::Output;
24
use Koha::Recalls;
25
use Koha::BiblioFrameworks;
26
use Koha::DateUtils;
27
28
my $query = new CGI;
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
30
    {
31
        template_name   => "circ/recalls_overdue.tt",
32
        query           => $query,
33
        type            => "intranet",
34
        authnotrequired => 0,
35
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
36
        debug           => 1,
37
    }
38
);
39
40
my $op = $query->param('op') || 'list';
41
my @recall_ids = $query->multi_param('recall_ids');
42
43
if ($op eq 'cancel_multiple_recalls') {
44
    foreach my $id (@recall_ids) {
45
        Koha::Recalls->find($id)->update({ cancellationdate => dt_from_string(), status => 'C' });
46
        $op = 'list'
47
    }
48
}
49
50
if ($op eq 'list') {
51
    my $recalls = Koha::Recalls->search({ status => 'O' });
52
    $template->param( recalls => $recalls );
53
}
54
55
# Checking if there is a Fast Cataloging Framework
56
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
57
58
# writing the template
59
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/circ/recalls_queue.pl (-2 lines)
Lines 39-49 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
39
39
40
my $op = $query->param('op') || 'list';
40
my $op = $query->param('op') || 'list';
41
my @recall_ids = $query->multi_param('recall_ids');
41
my @recall_ids = $query->multi_param('recall_ids');
42
warn($op);
43
42
44
if ($op eq 'cancel_multiple_recalls') {
43
if ($op eq 'cancel_multiple_recalls') {
45
    foreach my $id (@recall_ids) {
44
    foreach my $id (@recall_ids) {
46
        warn($id);
47
        Koha::Recalls->find($id)->update({ cancellationdate => dt_from_string(), status => 'C' });
45
        Koha::Recalls->find($id)->update({ cancellationdate => dt_from_string(), status => 'C' });
48
        $op = 'list'
46
        $op = 'list'
49
    }
47
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc (-1 / +1 lines)
Lines 4-10 Link Here
4
        <thead>
4
        <thead>
5
            <tr>
5
            <tr>
6
                <th class="nosort">&nbsp;</th>
6
                <th class="nosort">&nbsp;</th>
7
                <th class="recall-borrower anti-the">Borrower</th>
7
                <th class="recall-borrower anti-the">Requested by</th>
8
                <th class="recall-title anti-the">Title</th>
8
                <th class="recall-title anti-the">Title</th>
9
                <th class="recall-date psort title-string">Placed on</th>
9
                <th class="recall-date psort title-string">Placed on</th>
10
                <th class="recall-expiry title-string">Expires on</th>
10
                <th class="recall-expiry title-string">Expires on</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt (+118 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Circulation &rsaquo; Overdue recalls</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css"> p { margin-top: 0; }</style>
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>
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
</head>
12
<body id="circ_recalls_overdue" class="circ">
13
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'cat-search.inc' %]
15
16
<div id="breadcrumbs">
17
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
18
    &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
19
    &rsaquo; <a href="/cgi-bin/koha/circ/recalls_overdue.pl">Overdue recalls</a>
20
</div>
21
22
[% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc2" class="yui-t7">[% END %]
23
24
<div id="bd">
25
    <div id="yui-main">
26
        [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
27
            <div class="yui-g">
28
29
                <h1>Overdue recalls</h1>
30
31
                [% IF recalls.count %]
32
33
                    <form method="post" action="/cgi-bin/koha/circ/recalls_queue.pl">
34
                        <input type="hidden" name="op" value="cancel_multiple_recalls">
35
36
                        <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
37
38
                        <div id="recalls">
39
                            <table id="recalls-table">
40
                                <thead>
41
                                    <tr>
42
                                        <th class="nosort">&nbsp;</th>
43
                                        <th class="recall-borrower anti-the">Requested by</th>
44
                                        <th class="recall-title anti-the">Title</th>
45
                                        <th class="recall-date psort title-string">Placed on</th>
46
                                        <th class="recall-due title-string">Due date</th>
47
                                        <th class="recall-current-borrower">Currently checked out to</th>
48
                                        <th class="recall-branch">Pickup location</th>
49
                                        <th class="recall-cance nosort">Cancel</th>
50
                                    </tr>
51
                                </thead>
52
                                <tbody>
53
                                    [% FOREACH recall IN recalls %]
54
                                        <tr>
55
                                            <td>
56
                                                <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids">
57
                                            </td>
58
                                            <td class="recall-borrower">
59
                                                <a class="recall-borrower" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">
60
                                                    [% recall.borrower.firstname %] [% recall.borrower.surname %] ([% recall.borrowernumber %])
61
                                                </a>
62
                                            </td>
63
                                            <td class="recall-title">
64
                                                <a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]">
65
                                                    [% recall.biblio.title %]
66
                                                    [% FOREACH s IN recall.biblio.subtitles %]
67
                                                        [% s %]
68
                                                    [% END %]
69
                                                    [% recall.item.enumchron %]
70
                                                </a>
71
                                                [% recall.biblio.author %]
72
                                            </td>
73
                                            <td class="recall-date">
74
                                                [% recall.recalldate | $KohaDates %]
75
                                            </td>
76
                                            <td class="recall-due">
77
                                                [% recall.checkout.date_due %]
78
                                            </td>
79
                                            <td class="recall-current-borrower">
80
                                                <a class="recall-current-borrower" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.checkout.borrowernumber %]">
81
                                                    [% recall.checkout.patron.firstname %] [% recall.checkout.patron.surname %] ([% recall.checkout.borrowernumber %])
82
                                                </a>
83
                                            </td>
84
                                            <td class="recall-branch">
85
                                                [% recall.branch.branchname %]
86
                                            </td>
87
                                            <td class="recall-cancel">
88
                                                <a class="btn btn-xs btn-default" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a>
89
                                            </td>
90
                                        </tr>
91
                                    [% END %]
92
                                </tbody>
93
                            </table>
94
                        </div>
95
                        <fieldset class="action">
96
                            <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
97
                        </fieldset>
98
                    </form>
99
100
                [% ELSE %]
101
102
                    <div class="dialog message">There are no overdue recalls.</div>
103
104
                [% END %]
105
106
            </div>
107
        </div>
108
109
    </div>
110
111
    [% IF Koha.Preference('CircSidebar') %]
112
        <div class="yui-b noprint">
113
            [% INCLUDE 'circ-nav.inc' %]
114
        </div>
115
    [% END %]
116
</div>
117
118
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt (-2 / +1 lines)
Lines 9-15 Link Here
9
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
</head>
11
</head>
12
<body id="circ_view_holdsqueue" class="circ">
12
<body id="circ_recalls_queue" class="circ">
13
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'cat-search.inc' %]
14
[% INCLUDE 'cat-search.inc' %]
15
15
16
- 

Return to bug 19532