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

(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 449-455 if ($patron) { Link Here
449
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
449
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
450
    my $waiting_holds = $holds->waiting;
450
    my $waiting_holds = $holds->waiting;
451
451
452
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber });
452
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, status => { '=', ['R','W'] } });
453
453
454
    $template->param(
454
    $template->param(
455
        holds_count  => $holds->count(),
455
        holds_count  => $holds->count(),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+1 lines)
Lines 120-124 Link Here
120
    [% IF Koha.Preference('ILLModule') %]
120
    [% IF Koha.Preference('ILLModule') %]
121
        <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% borrowernumber %]">Interlibrary loans</a></li>
121
        <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% borrowernumber %]">Interlibrary loans</a></li>
122
    [% END %]
122
    [% END %]
123
    <li><a href="/cgi-bin/koha/members/recallshistory.pl">Recalls history</a></li>
123
</ul></div>
124
</ul></div>
124
[% END %]
125
[% 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 (+8 lines)
Lines 113-118 Link Here
113
                [% END %]
113
                [% END %]
114
                <a href="/cgi-bin/koha/opac-illrequests.pl">your interlibrary loan requests</a></li>
114
                <a href="/cgi-bin/koha/opac-illrequests.pl">your interlibrary loan requests</a></li>
115
            [% END %]
115
            [% END %]
116
117
            [% IF ( recallsview ) %]
118
                <li class="active">
119
            [% ELSE %]
120
                <li>
121
            [% END %]
122
            <a href="/cgi-bin/koha/opac-recalls.pl">your recalls history</a></li>
123
116
        </ul>
124
        </ul>
117
    </div>
125
    </div>
118
[% END %]
126
[% 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 789-795 Using this account is not recommended because some parts of Koha will not functi Link Here
789
                                            <th class="title-string">Expires on</th>
789
                                            <th class="title-string">Expires on</th>
790
                                            <th>Pickup location</th>
790
                                            <th>Pickup location</th>
791
                                            <th>Status</th>
791
                                            <th>Status</th>
792
                                            <th>Cancel</th>
792
                                            <th class="nosort">Cancel</th>
793
                                        </tr>
793
                                        </tr>
794
                                    </thead>
794
                                    </thead>
795
                                    <tbody>
795
                                    <tbody>
Lines 843-862 Using this account is not recommended because some parts of Koha will not functi Link Here
843
                                                        Requested
843
                                                        Requested
844
                                                    [% ELSIF ( RECALL.is_waiting ) %]
844
                                                    [% ELSIF ( RECALL.is_waiting ) %]
845
                                                        Ready for pickup
845
                                                        Ready for pickup
846
                                                    [% ELSIF ( RECALL.has_expired ) %]
847
                                                        Expired
848
                                                    [% END %]
846
                                                    [% END %]
849
                                                </td>
847
                                                </td>
850
                                                <td class="cancelrecall">
848
                                                <td class="cancelrecall">
851
                                                    [% IF ( !RECALL.cancellationdate ) %]
849
                                                    [% IF ( !RECALL.cancellationdate && ( RECALL.is_requested || RECALL.is_overdue ) ) %]
852
                                                        <form action="/cgi-bin/koha/opac-recall.pl" method="post">
850
                                                        <form action="/cgi-bin/koha/opac-recall.pl" method="post">
853
                                                            <input type="hidden" name="op" value="cancel">
851
                                                            <input type="hidden" name="op" value="cancel">
854
                                                            <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
852
                                                            <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
855
                                                            <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
853
                                                            <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
856
                                                            <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
854
                                                            <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
857
                                                        </form>
855
                                                        </form>
858
                                                    [% ELSE %]
859
                                                        Cancelled
860
                                                    [% END %]
856
                                                    [% END %]
861
                                                </td>
857
                                                </td>
862
                                            [% END %]
858
                                            [% END %]
Lines 1004-1010 Using this account is not recommended because some parts of Koha will not functi Link Here
1004
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1000
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1005
            });
1001
            });
1006
1002
1007
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1003
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table,#recalls-table");
1008
            dTables.each(function(){
1004
            dTables.each(function(){
1009
                var thIndex = $(this).find("th.psort").index();
1005
                var thIndex = $(this).find("th.psort").index();
1010
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
1006
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
(-)a/members/moremember.pl (-1 / +1 lines)
Lines 255-261 if ( $data->{dateofbirth} ) { Link Here
255
# BUILD HTML
255
# BUILD HTML
256
# show all recalls and reserves of this borrower, and the position of the reservation ....
256
# show all recalls and reserves of this borrower, and the position of the reservation ....
257
if ($borrowernumber) {
257
if ($borrowernumber) {
258
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber });
258
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, status => { '=', ['R','W'] } });
259
    $template->param(
259
    $template->param(
260
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
260
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
261
          ->count( { borrowernumber => $borrowernumber } ),
261
          ->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 294-300 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
294
294
295
# now the reserved items....
295
# now the reserved items....
296
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
296
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
297
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber } );
297
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber, status => { '=', ['R', 'W'] } } );
298
298
299
$template->param(
299
$template->param(
300
    RESERVES       => $reserves,
300
    RESERVES       => $reserves,
301
- 

Return to bug 19532