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

(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 466-472 if ($patron) { Link Here
466
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
466
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
467
    my $waiting_holds = $holds->waiting;
467
    my $waiting_holds = $holds->waiting;
468
468
469
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber });
469
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, status => { '=', ['R','W'] } });
470
470
471
    $template->param(
471
    $template->param(
472
        holds_count  => $holds->count(),
472
        holds_count  => $holds->count(),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+1 lines)
Lines 124-128 Link Here
124
    [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
124
    [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
125
        <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">Interlibrary loans</a></li>
125
        <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">Interlibrary loans</a></li>
126
    [% END %]
126
    [% END %]
127
    <li><a href="/cgi-bin/koha/members/recallshistory.pl">Recalls history</a></li>
127
</ul></div>
128
</ul></div>
128
[% END %]
129
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc (-3 / +5 lines)
Lines 55-68 Link Here
55
                            Ready for pickup
55
                            Ready for pickup
56
                        [% ELSIF ( recall.has_expired ) %]
56
                        [% ELSIF ( recall.has_expired ) %]
57
                            Expired
57
                            Expired
58
                        [% ELSIF ( recall.is_cancelled ) %]
59
                            Cancelled
60
                        [% ELSIF ( recall.is_overdue ) %]
61
                            Overdue to be returned
58
                        [% END %]
62
                        [% END %]
59
                    </td>
63
                    </td>
60
64
61
                    <td class="recall-cancel">
65
                    <td class="recall-cancel">
62
                        [% IF ( !recall.cancellationdate ) %]
66
                        [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %]
63
                            <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-sm btn-danger" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a>
64
                        [% ELSE %]
65
                            Cancelled
66
                        [% END %]
68
                        [% END %]
67
                    </td>
69
                    </td>
68
70
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt (+51 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% USE Koha %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Recalls history for [% patron.firstname %] [% patron.surname %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
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>
23
<body id="recalls_history" class="pat">
24
[% INCLUDE 'header.inc' %]
25
[% INCLUDE 'patron-search.inc' %]
26
27
<div id="breadcrumbs">
28
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
29
    <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo;
30
    Recalls history for [% patron.firstname %] [% patron.surname %]
31
</div>
32
33
<div id="doc3" class="yui-t2">
34
    <div id="bd">
35
        <div id="yui-main">
36
            <div class="yui-b">
37
38
            [% INCLUDE 'members-toolbar.inc' %]
39
40
            <h1>Recalls history</h1>
41
42
             [% INCLUDE 'recalls.inc' %]
43
44
            </div>
45
        </div>
46
47
    <div class="yui-b">
48
        [% INCLUDE 'circ-menu.inc' %]
49
    </div>
50
</div>
51
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc (+6 lines)
Lines 131-136 Link Here
131
                <a href="/cgi-bin/koha/opac-illrequests.pl">your interlibrary loan requests</a></li>
131
                <a href="/cgi-bin/koha/opac-illrequests.pl">your interlibrary loan requests</a></li>
132
            [% END %]
132
            [% END %]
133
133
134
            [% IF ( recallsview ) %]
135
                <li class="active">
136
            [% ELSE %]
137
                <li>
138
            [% END %]
139
            <a href="/cgi-bin/koha/opac-recalls.pl">your recalls history</a></li>
134
        </ul>
140
        </ul>
135
    </div>
141
    </div>
136
[% END %]
142
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt (+145 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your recalls history</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% BLOCK cssinclude %][% END %]
8
</head>
9
[% INCLUDE 'bodytag.inc' bodyid='opac-recalls' bodyclass='scrollto' %]
10
[% INCLUDE 'masthead.inc' %]
11
12
<div class="main">
13
    <ul class="breadcrumb">
14
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
15
        <li><a href="#">Your recalls history</a></li>
16
    </ul>
17
18
    <div class="container-fluid">
19
        <div class="row-fluid">
20
            <div class="span2">
21
                <div id="navigation">
22
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
23
                </div>
24
            </div>
25
            <div class="span10">
26
                <div id="recalls" class="maincontent">
27
28
                <h2>Recalls history</h2>
29
30
                    [% IF RECALLS.count %]
31
                        <div id="opac-user-recalls">
32
                            <table id="recalls-table" class="table table-bordered table-striped">
33
                                <thead>
34
                                    <tr>
35
                                        <th class="anti-the">Title</th>
36
                                        <th class="psort title-string">Placed on</th>
37
                                        <th class="title-string">Expires on</th>
38
                                        <th>Pickup location</th>
39
                                        <th>Status</th>
40
                                        <th class="nosort">Cancel</th>
41
                                    </tr>
42
                                </thead>
43
                                <tbody>
44
                                    [% FOREACH RECALL IN RECALLS %]
45
                                        <tr>
46
                                            <td class="title">
47
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]">
48
                                                    [% RECALL.biblio.title %]
49
                                                    [% FOREACH s IN RECALL.biblio.subtitles %]
50
                                                        [% s %]
51
                                                    [% END %]
52
                                                    [% RECALL.item.enumchron %]
53
                                                </a>
54
                                                [% RECALL.biblio.author %]
55
                                            </td>
56
                                            <td class="recalldate">
57
                                                <span title="[% RECALL.recalldate %]">
58
                                                    <span class="tdlabel">Recall date:</span>
59
                                                    [% RECALL.recalldate | $KohaDates %]
60
                                                </span>
61
                                            </td>
62
                                            <td class="expirationdate">
63
                                                [% IF ( RECALL.is_waiting ) %]
64
                                                    [% IF ( RECALL.expirationdate ) %]
65
                                                        <span title="[% RECALL.expirationdate %]">
66
                                                            <span class="tdlabel">Expiration:</span>
67
                                                            [% RECALL.expirationdate | $KohaDates %]
68
                                                        </span>
69
                                                    [% ELSE %]
70
                                                        <span title="0000-00-00">
71
                                                            <span class="tdlabel">Expiration:</span>
72
                                                            Never expires
73
                                                        </span>
74
                                                    [% END %]
75
                                                [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %]
76
                                                    <span title="[% RECALL.expirationdate %]" class="overdue">
77
                                                        <span class="tdlabel">Expiration:</span>
78
                                                        [% RECALL.expirationdate | $KohaDates %]
79
                                                    </span>
80
                                                [% ELSE %]
81
                                                    <span title="0000-00-00">-</span>
82
                                                [% END %]
83
                                            </td>
84
                                            <td class="branch">
85
                                                <span class="tdlabel">Pick up location:</span>
86
                                                [% RECALL.branch.branchname %]
87
                                            </td>
88
                                            <td class="status">
89
                                                <span class="tdlabel">Status:</span>
90
                                                [% IF ( RECALL.is_requested ) %]
91
                                                    Requested
92
                                                [% ELSIF ( RECALL.is_waiting ) %]
93
                                                    Ready for pickup
94
                                                [% ELSIF ( RECALL.has_expired ) %]
95
                                                    Expired
96
                                                [% ELSIF ( RECALL.is_cancelled ) %]
97
                                                    Cancelled
98
                                                [% END %]
99
                                            </td>
100
                                            <td class="cancelrecall">
101
                                                [% IF ( !RECALL.cancellationdate && ( RECALL.is_requested || RECALL.is_overdue ) ) %]
102
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
103
                                                        <input type="hidden" name="op" value="cancel">
104
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
105
                                                        <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
106
                                                        <button type="submit" name="submit" class="btn btn-mini btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
107
                                                    </form>
108
                                                [% END %]
109
                                            </td>
110
                                        [% END %]
111
                                    </tr>
112
                                </tbody>
113
                            <table>
114
                        </div>
115
                    [% END # / # RECALLS.count %]
116
117
                </div> <!-- /#recalls -->
118
            </div> <!-- /.span10 -->
119
        </div> <!-- /.row-fluid -->
120
    </div> <!-- /.container-fluid -->
121
</div> <!-- /#main -->
122
123
[% INCLUDE 'opac-bottom.inc' %]
124
125
[% BLOCK jsinclude %]
126
    [% INCLUDE 'datatables.inc' %]
127
    <script type="text/JavaScript">
128
        //<![CDATA[
129
        var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?");
130
131
        $(document).ready(function(){
132
            $("#cancel_recall").click(function(e){
133
                e.preventDefault();
134
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
135
            });
136
            $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
137
                "aoColumnDefs": [
138
                    { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
139
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
140
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
141
                ]
142
            }));
143
        });
144
    </script>
145
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-7 / +3 lines)
Lines 799-805 Link Here
799
                                            <th class="title-string">Expires on</th>
799
                                            <th class="title-string">Expires on</th>
800
                                            <th>Pickup location</th>
800
                                            <th>Pickup location</th>
801
                                            <th>Status</th>
801
                                            <th>Status</th>
802
                                            <th>Cancel</th>
802
                                            <th class="nosort">Cancel</th>
803
                                        </tr>
803
                                        </tr>
804
                                    </thead>
804
                                    </thead>
805
                                    <tbody>
805
                                    <tbody>
Lines 853-872 Link Here
853
                                                        Requested
853
                                                        Requested
854
                                                    [% ELSIF ( RECALL.is_waiting ) %]
854
                                                    [% ELSIF ( RECALL.is_waiting ) %]
855
                                                        Ready for pickup
855
                                                        Ready for pickup
856
                                                    [% ELSIF ( RECALL.has_expired ) %]
857
                                                        Expired
858
                                                    [% END %]
856
                                                    [% END %]
859
                                                </td>
857
                                                </td>
860
                                                <td class="cancelrecall">
858
                                                <td class="cancelrecall">
861
                                                    [% IF ( !RECALL.cancellationdate ) %]
859
                                                    [% IF ( !RECALL.cancellationdate && ( RECALL.is_requested || RECALL.is_overdue ) ) %]
862
                                                        <form action="/cgi-bin/koha/opac-recall.pl" method="post">
860
                                                        <form action="/cgi-bin/koha/opac-recall.pl" method="post">
863
                                                            <input type="hidden" name="op" value="cancel">
861
                                                            <input type="hidden" name="op" value="cancel">
864
                                                            <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
862
                                                            <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
865
                                                            <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
863
                                                            <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
866
                                                            <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
864
                                                            <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
867
                                                        </form>
865
                                                        </form>
868
                                                    [% ELSE %]
869
                                                        Cancelled
870
                                                    [% END %]
866
                                                    [% END %]
871
                                                </td>
867
                                                </td>
872
                                            [% END %]
868
                                            [% END %]
Lines 1020-1026 Link Here
1020
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1016
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1021
            });
1017
            });
1022
1018
1023
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1019
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table,#recalls-table");
1024
            dTables.each(function(){
1020
            dTables.each(function(){
1025
                var thIndex = $(this).find("th.psort").index();
1021
                var thIndex = $(this).find("th.psort").index();
1026
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
1022
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
(-)a/members/moremember.pl (-1 / +1 lines)
Lines 233-239 if ( $data->{dateofbirth} ) { Link Here
233
# BUILD HTML
233
# BUILD HTML
234
# show all recalls and reserves of this borrower, and the position of the reservation ....
234
# show all recalls and reserves of this borrower, and the position of the reservation ....
235
if ($borrowernumber) {
235
if ($borrowernumber) {
236
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber });
236
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, status => { '=', ['R','W'] } });
237
    $template->param(
237
    $template->param(
238
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
238
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
239
          ->count( { borrowernumber => $borrowernumber } ),
239
          ->count( { borrowernumber => $borrowernumber } ),
(-)a/members/recallshistory.pl (+53 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
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Output;
26
27
use Koha::Recalls;
28
use Koha::Patrons;
29
30
my $input = CGI->new;
31
32
my ($template, $loggedinuser, $cookie)= get_template_and_user(
33
    {
34
        template_name => "members/recallshistory.tt",
35
        query => $input,
36
        type => "intranet",
37
        authnotrequired => 0,
38
        flagsrequired => {borrowers => 1},
39
        debug => 1,
40
    }
41
);
42
43
my $recalls = Koha::Recalls->search({ borrowernumber => $loggedinuser });
44
45
my $patron = Koha::Patrons->find($loggedinuser);
46
47
$template->param(
48
    recalls => $recalls,
49
    patron => $patron,
50
    recallsview => 1
51
);
52
53
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/opac/opac-recalls.pl (+45 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
22
use CGI qw ( -utf8 );
23
use Encode qw( encode );
24
use C4::Auth;    # get_template_and_user
25
use C4::Output;
26
use Koha::Recalls;
27
28
my $input = new CGI;
29
30
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
    {
32
        template_name   => "opac-recalls.tt",
33
        query           => $input,
34
        type            => "opac",
35
        authnotrequired => 0,
36
    }
37
);
38
39
my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber });
40
$template->param(
41
    RECALLS => $recalls,
42
    recallsview => 1
43
);
44
45
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/opac/opac-user.pl (-2 / +1 lines)
Lines 305-311 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
305
305
306
# now the reserved items....
306
# now the reserved items....
307
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
307
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
308
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber } );
308
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber, status => { '=', ['R', 'W'] } } );
309
309
310
$template->param(
310
$template->param(
311
    RESERVES       => $reserves,
311
    RESERVES       => $reserves,
312
- 

Return to bug 19532