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

(-)a/Koha/Recall.pm (+14 lines)
Lines 70-75 sub item { Link Here
70
    return $self->{_item};
70
    return $self->{_item};
71
}
71
}
72
72
73
=head3 borrower
74
75
Returns the related Koha::Patron object for this Hold
76
77
=cut
78
79
sub borrower {
80
81
    my ($self) = @_;
82
83
    $self->{_borrower} ||= Koha::Patrons->find( $self->borrowernumber() );
84
85
    return $self->{_borrower};
86
}
73
=head3 branch
87
=head3 branch
74
88
75
Returns the related Koha::Library object for this Hold
89
Returns the related Koha::Library object for this Hold
(-)a/circ/recalls_queue.pl (+61 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_queue.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
warn($op);
43
44
if ($op eq 'cancel_multiple_recalls') {
45
    foreach my $id (@recall_ids) {
46
        warn($id);
47
        Koha::Recalls->find($id)->update({ cancellationdate => dt_from_string(), status => 'C' });
48
        $op = 'list'
49
    }
50
}
51
52
if ($op eq 'list') {
53
    my $recalls = Koha::Recalls->search({});
54
    $template->param( recalls => $recalls );
55
}
56
57
# Checking if there is a Fast Cataloging Framework
58
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
59
60
# writing the template
61
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc (+3 lines)
Lines 39-44 Link Here
39
            [% IF Koha.Preference('OnSiteCheckouts') %]
39
            [% IF Koha.Preference('OnSiteCheckouts') %]
40
                <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li>
40
                <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li>
41
            [% END %]
41
            [% END %]
42
            <li><a href="/cgi-bin/koha/circ/recalls_queue.pl">Recalls queue</a></li>
43
            <li><a href="/cgi-bin/koha/circ/recalls_overdue.pl">Overdue recalls</a></li>
44
            <li><a href="/cgi-bin/koha/circ/recalls_waiting.pl">Recalls awaiting pickup</a></li>
42
        </ul>
45
        </ul>
43
46
44
    </div>
47
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc (+92 lines)
Line 0 Link Here
1
<div id="recalls">
2
[% IF recalls.count %]
3
    <table id="recalls-table">
4
        <thead>
5
            <tr>
6
                <th class="nosort">&nbsp;</th>
7
                <th class="recall-borrower anti-the">Borrower</th>
8
                <th class="recall-title anti-the">Title</th>
9
                <th class="recall-date psort title-string">Placed on</th>
10
                <th class="recall-expiry title-string">Expires on</th>
11
                <th class="recall-branch">Pickup location</th>
12
                <th class="recall-status">Status</th>
13
                <th class="recall-cancel nosort">Cancel</th>
14
            </tr>
15
        </thead>
16
17
        <tbody>
18
            [% FOREACH recall IN recalls %]
19
                <tr>
20
                    <td>
21
                        [% IF recall.is_requested || recall.is_waiting || recall.is_overdue %]
22
                            <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids">
23
                        [% ELSE %]
24
                            &nbsp;
25
                        [% END %]
26
                    </td>
27
                    <td class="recall-borrower">
28
                        <a class="recall-borrower" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">
29
                            [% recall.borrower.firstname %] [% recall.borrower.surname %] ([% recall.borrowernumber %])
30
                        </a>
31
                    </td>
32
                    <td class="recall-title">
33
                        <a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]">
34
                            [% recall.biblio.title %]
35
                            [% FOREACH s IN recall.biblio.subtitles %]
36
                                [% s %]
37
                            [% END %]
38
                            [% recall.item.enumchron %]
39
                        </a>
40
                        [% recall.biblio.author %]
41
                    </td>
42
43
                    <td class="recall-date">
44
                        [% recall.recalldate | $KohaDates %]
45
                    </td>
46
47
                    <td class="recall-expiry">
48
                        [% IF ( recall.is_waiting ) %]
49
                            [% IF ( recall.expirationdate ) %]
50
                                [% recall.expirationdate | $KohaDates %]
51
                            [% ELSE %]
52
                                Never expires
53
                            [% END %]
54
                        [% ELSIF ( recall.has_expired && recall.expirationdate ) %]
55
                            [% recall.expirationdate | $KohaDates %]
56
                        [% ELSE %]
57
                            -
58
                        [% END %]
59
                    </td>
60
61
                    <td class="recall-branch">
62
                        [% recall.branch.branchname %]
63
                    </td>
64
65
                    <td class="recall-status">
66
                        [% IF ( recall.is_requested ) %]
67
                            Requested
68
                        [% ELSIF ( recall.is_waiting ) %]
69
                            Ready for pickup
70
                        [% ELSIF ( recall.has_expired ) %]
71
                            Expired
72
                        [% ELSIF ( recall.is_cancelled ) %]
73
                            Cancelled
74
                        [% ELSIF ( recall.is_overdue ) %]
75
                            Overdue to be returned
76
                        [% END %]
77
                    </td>
78
79
                    <td class="recall-cancel">
80
                        [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %]
81
                            <a class="btn btn-xs btn-default" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a>
82
                        [% END %]
83
                    </td>
84
85
                </tr>
86
            [% END %]
87
        </tbody>
88
    </table>
89
    [% ELSE %]
90
        No recalls have been made.
91
    [% END %]
92
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc (-2 / +2 lines)
Lines 1-6 Link Here
1
<div id="recalls">
1
<div id="recalls">
2
[% IF recalls.count %]
2
[% IF recalls.count %]
3
    <table id="recalls-table" class="table table-bordered table-striped">
3
    <table id="recalls-table">
4
        <thead>
4
        <thead>
5
            <tr>
5
            <tr>
6
                <th class="recall-title anti-the">Title</th>
6
                <th class="recall-title anti-the">Title</th>
Lines 64-70 Link Here
64
64
65
                    <td class="recall-cancel">
65
                    <td class="recall-cancel">
66
                        [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %]
66
                        [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %]
67
                            <a class="btn btn-sm btn-danger" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a>
67
                            <a class="btn btn-xs btn-default" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a>
68
                        [% END %]
68
                        [% END %]
69
                    </td>
69
                    </td>
70
70
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt (+63 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Circulation &rsaquo; Recalls queue</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_view_holdsqueue" 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_queue.pl">Recalls queue</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>Recalls queue</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
                        [% INCLUDE 'recalls-reports.inc' %]
39
40
                        <fieldset class="action">
41
                            <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
42
                        </fieldset>
43
                    </form>
44
45
                [% ELSE %]
46
47
                    <div class="dialog message">No recalls have been made.</div>
48
49
                [% END %]
50
51
            </div>
52
        </div>
53
54
    </div>
55
56
    [% IF Koha.Preference('CircSidebar') %]
57
        <div class="yui-b noprint">
58
            [% INCLUDE 'circ-nav.inc' %]
59
        </div>
60
    [% END %]
61
</div>
62
63
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt (-13 lines)
Lines 6-24 Link Here
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.js"></script>
9
<script type="text/javascript" id="js">
10
//<![CDATA[
11
$(document).ready(function() {
12
    $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
13
        "aoColumnDefs": [
14
            { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
15
        ],
16
        "aaSorting": [[ 1, "asc" ]],
17
        "sPaginationType": "full_numbers"
18
    }));
19
 });
20
//]]>
21
</script>
22
</head>
9
</head>
23
<body id="recalls_history" class="pat">
10
<body id="recalls_history" class="pat">
24
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/recalls.js (-1 / +23 lines)
Lines 26-29 $(document).ready(function() { Link Here
26
            }
26
            }
27
        });
27
        });
28
28
29
        $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
30
            "aoColumnDefs": [
31
                { "aTargets": [ 'nosort' ], "bSortable": false, "bSearchable": false },
32
            ],
33
            "aaSorting": [[ 1, "asc" ]],
34
            "sPaginationType": "full_numbers"
35
        }));
36
37
        $("#cancel_selected").click(function(e){
38
            if ($("input[name='recall_ids']:checked").length > 0){
39
                return confirmDelete(_("Are you sure you want to remove the selected recall(s)?"));
40
            } else {
41
                alert(_("Please make a selection."));
42
            }
43
        });
44
45
        $("#select_all").click(function(){
46
            if ($("#select_all").prop("checked")){
47
                $("input[name='recall_ids']").prop("checked", true);
48
            } else {
49
                $("input[name='recall_ids']").prop("checked", false);
50
            }
51
        });
29
});
52
});
30
- 

Return to bug 19532