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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc (+1 lines)
Lines 39-44 Link Here
39
            <span class="item-status checkedout">Checked out</span>
39
            <span class="item-status checkedout">Checked out</span>
40
        [% END %]
40
        [% END %]
41
    [% END %]
41
    [% END %]
42
    [% IF item.avail_for_recall %]<a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% item.biblionumber | uri %]" class="btn btn-default btn-xs">Recall</a>[% END %]
42
[% END %]
43
[% END %]
43
44
44
[% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %]
45
[% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (+5 lines)
Lines 11-16 Link Here
11
        [% END %]
11
        [% END %]
12
    [% END %]
12
    [% END %]
13
13
14
    [% IF Koha.Preference('UseRecalls') %]
15
        <li><a class="recall btn btn-link btn-lg" href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% biblio.biblionumber | html %]"><i class="fa fa-fw fa-bookmark-o"></i>
16
        Place recall</a></li>
17
    [% END %]
18
14
    <li><a class="print-large btn btn-link btn-lg" href="#"><i class="fa fa-fw fa-print" aria-hidden="true"></i> Print</a></li>
19
    <li><a class="print-large btn btn-link btn-lg" href="#"><i class="fa fa-fw fa-print" aria-hidden="true"></i> Print</a></li>
15
20
16
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
21
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/title-actions-menu.inc (+4 lines)
Lines 17-22 Link Here
17
        [% END # / UNLESS items.norequests %]
17
        [% END # / UNLESS items.norequests %]
18
    [% END # / RequestOnOpac %]
18
    [% END # / RequestOnOpac %]
19
19
20
    [% IF Koha.Preference('UseRecalls') %]
21
        <span class="actions"><a class="btn btn-link recall" href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% items.biblionumber | html %]"><i class="fa fa-fw fa-bookmark-o" aria-hidden="true"></i> Place recall</a></span>
22
    [% END %]
23
20
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
24
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
21
        [% IF items.artreqpossible %]
25
        [% IF items.artreqpossible %]
22
            <span class="actions"><a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% items.biblionumber | uri %]" class="btn btn-link btn-sm"><i class="fa fa-file-text" aria-hidden="true"></i> Request article</a></span>
26
            <span class="actions"><a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% items.biblionumber | uri %]" class="btn btn-link btn-sm"><i class="fa fa-file-text" aria-hidden="true"></i> Request article</a></span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc (+9 lines)
Lines 139-144 Link Here
139
                <a href="/cgi-bin/koha/opac-illrequests.pl">your interlibrary loan requests</a></li>
139
                <a href="/cgi-bin/koha/opac-illrequests.pl">your interlibrary loan requests</a></li>
140
            [% END %]
140
            [% END %]
141
141
142
            [% IF Koha.Preference('UseRecalls') %]
143
                [% IF ( recallsview ) %]
144
                    <li class="active">
145
                [% ELSE %]
146
                    <li>
147
                [% END %]
148
                <a href="/cgi-bin/koha/opac-recalls.pl">your recalls history</a>
149
            [% END %]
150
142
        </ul>
151
        </ul>
143
    </div>
152
    </div>
144
[% END %]
153
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt (-1 / +1 lines)
Lines 86-92 Link Here
86
                                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode, opac => 1 ) | html %]</td>
86
                                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode, opac => 1 ) | html %]</td>
87
                                        <td>[% cr.item.itemcallnumber | html %]</td>
87
                                        <td>[% cr.item.itemcallnumber | html %]</td>
88
                                        <td>[% cr.item.copynumber | html %]</td>
88
                                        <td>[% cr.item.copynumber | html %]</td>
89
                                        <td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
89
                                        <td>[% INCLUDE 'item-status.inc' item=cr.course_item issue=cr.issue %]</td>
90
                                        <td data-order="[% cr.issue.date_due | html %]">[% cr.issue.date_due | $KohaDates  as_due_date => 1 %]</td>
90
                                        <td data-order="[% cr.issue.date_due | html %]">[% cr.issue.date_due | $KohaDates  as_due_date => 1 %]</td>
91
                                        <td>[% IF ( cr.public_note ) %]
91
                                        <td>[% IF ( cr.public_note ) %]
92
                                                [% cr.public_note | $raw %]
92
                                                [% cr.public_note | $raw %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt (+199 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE Branches %]
4
[% USE ItemTypes %]
5
[% USE AuthorisedValues %]
6
[% SET footerjs = 1 %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Recall &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% BLOCK cssinclude %][% END %]
11
</head>
12
<body id="opac-recall" class="scrollto">
13
[% INCLUDE 'masthead.inc' %]
14
15
<div class="main">
16
    <ul class="breadcrumb">
17
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
18
        <li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Details for: [% biblio.title | html %]</a> <span class="divider">&rsaquo;</span></li>
19
        <li><a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% biblio.biblionumber | uri %]">Place recall</a></li>
20
    </ul>
21
22
    <div class="container-fluid">
23
        <div class="row-fluid">
24
            <div class="span2">
25
                <div id="navigation">
26
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
27
                </div>
28
            </div>
29
            <div class="span10">
30
                <div id="recall" class="maincontent">
31
                    <h1>Confirm recalls for: [% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])</h1>
32
                    [% IF nosyspref %]
33
                        Recalls have not been enabled. Please contact your library.
34
                    [% ELSIF error == 'unavailable' %]
35
                        There are no items available for recall.
36
                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Return to [% biblio.title | html %]</a>
37
                    [% ELSE %]
38
                        [% IF error %]
39
                            <div class="dialog alert">
40
                                [% IF error == 'duplicate' %]
41
                                    You have reached the maximum number of recalls on this record.
42
                                [% ELSIF error == 'unavailable' %]
43
                                    There are no items available for recall.
44
                                [% ELSIF error == 'cannot' %]
45
                                    You cannot place a recall on this item.
46
                                [% ELSE %]
47
                                    An error has occurred while attempting to place a recall. Please contact your library.
48
                                [% END %]
49
                            </div>
50
                        [% END %]
51
52
                        [% IF success %]
53
                            <p>Your recall has been placed. The patron the item is currently checked out to has been asked to return the item within [% due_interval | html %] days, by [% due_date | $KohaDates %].</p>
54
                            <p>You will be notified when your item is waiting to be picked up at the library.</p>
55
                        [% ELSIF not error %]
56
                            <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>
57
                            [% IF logged_in_user %]
58
                                <div class="dialog">
59
60
                                    <form id="recallform" action="/cgi-bin/koha/opac-recall.pl" method="get">
61
                                        <fieldset class="rows" id="options">
62
                                            <legend>Place a recall on <b>[% biblio.title | html %]</b> ([% biblio.author | html %])?</legend>
63
                                            <ul>
64
65
                                            [% UNLESS ( single_branch_mode ) %]<li>
66
                                                <label for="pickup">Pick up location:</label>
67
                                                <select name="pickup" id="pickup">
68
                                                    [% FOREACH branch IN branches %]
69
                                                        [% IF branch.branchcode == logged_in_user.branchcode %]
70
                                                            <option value="[% branch.branchcode | html %]" selected>[% Branches.GetName( branch.branchcode ) | html %]</option>
71
                                                        [% ELSE %]
72
                                                            <option value="[% branch.branchcode | html %]">[% Branches.GetName( branch.branchcode ) | html %]</option>
73
                                                        [% END %]
74
                                                    [% END %]
75
                                                </select>
76
                                            </li>[% END %]
77
78
                                            <li><label for="expirationdate">Recall not needed after:</label> <input type="text" name="expirationdate" id="expirationdate" size="20"> <a id="cleartext" style="display:none;">Clear text</a><span id="expiration-hint">[% INCLUDE 'date-format.inc' %]</span></li>
79
                                            <li class="level-option" style="display:none;"><label for="bibliolevel">Recall next available item</label> <input type="radio" name="type" id="bibliolevel" value="bibliolevel" checked></li>
80
                                            <li class="level-option" style="display:none;"><label for="itemlevel">Recall a specific item</label> <input type="radio" name="type" id="itemlevel" value="itemlevel"></li>
81
82
                                            <table class="table table-bordered table-striped" id="items">
83
                                                <caption>Select a specific item:</caption>
84
                                                <tr>
85
                                                    <th>&nbsp;</th>
86
                                                    <th>Item type</th>
87
                                                    <th>Barcode</th>
88
                                                    [% UNLESS ( single_branch_mode ) %]
89
                                                        <th>Home library</th>
90
                                                        <th>Last location</th>
91
                                                    [% END %]
92
                                                    <th>Collection</th>
93
                                                    <th>Call number</th>
94
                                                    <th>Copy number</th>
95
                                                    <th>Vol info</th>
96
                                                    <th>Information</th>
97
                                                </tr>
98
                                                [% FOREACH item IN items %]<tr>
99
                                                <td>
100
                                                    [% IF item.can_be_recalled( patron => logged_in_user ) %]
101
                                                        <input type="radio" class="itemnumber" name="itemnumber" value="[% item.itemnumber | html %]">
102
                                                    [% ELSE %]
103
                                                        <input disabled="disabled" type="radio" class="itemnumber" name="itemnumber" value="[% item.itemnumber | html %]" style="display:none;" />
104
                                                        <img src="[% interface | html %]/lib/famfamfam/cross.png" alt="Cannot be recalled" title="Cannot be recalled" />
105
                                                    [% END %]
106
                                                    </td>
107
                                                    <td>[% ItemTypes.GetDescription( item.effective_itemtype ) | html %]</td>
108
                                                    <td>[% item.barcode | html %]</td>
109
                                                    [% UNLESS ( single_branch_mode ) %]
110
                                                        <td>[% Branches.GetName( item.homebranch ) | html %]</td>
111
                                                        <td>[% Branches.GetName( item.holdingbranch) | html %]</td>
112
                                                    [% END %]
113
                                                    <td>[% AuthorisedValues.GetByCode( 'CCODE', item.ccode, 1 ) | html %]</td>
114
                                                    <td>[% item.itemcallnumber | html %]</td>
115
                                                    <td>[% item.copynumber | html %]</td>
116
                                                    <td>[% item.enumchron | html %]</td>
117
                                                    <td>
118
                                                        [% IF ( item.checkout ) %]
119
                                                            <span class="checkedout">Due [% item.checkout.date_due | $KohaDates %]</span>
120
                                                        [% ELSIF ( item.get_transfer ) %]
121
                                                            <span class="intransit">In transit from [% Branches.GetName( item.get_transfer.frombranch ) | html %] to [% Branches.GetName( item.get_transfer.tobranch ) | html %] since [% item.get_transfer.datesent | $KohaDates %]</span>
122
                                                        [% END %]
123
                                                        [% IF ( item.itemlost || item.withdrawn ) %]
124
                                                            <span class="lost">Unavailable (lost or missing)</span>
125
                                                        [% END %]
126
                                                        [% IF ( item.notforloan ) %]
127
                                                            <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
128
                                                        [% END %]
129
                                                        [% hold = item.current_holds.next %]
130
                                                        [% IF ( item.recall ) %]
131
                                                            <span class="waiting">
132
                                                            [% IF ( item.recall.waitingdate ) %]
133
                                                                Waiting for patron at [% Branches.GetName( item.recall.branchcode ) | html %] since [% item.recall.waitingdate | $KohaDates %].
134
                                                            [% ELSE %]
135
                                                                Recalled by patron expected at [% Branches.GetName( item.recall.branchcode ) | html %] since [% item.recall.recalldate | $KohaDates %].
136
                                                            [% END %]
137
                                                            </span>
138
                                                        [% ELSIF ( hold.waitingdate ) %]
139
                                                            <span class="waiting">
140
                                                                Waiting for patron at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].
141
                                                            </span>
142
                                                        [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
143
                                                            <span class="waiting">
144
                                                                You have already placed a <a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">reserve</a> on this item.
145
                                                            </span>
146
                                                        [% END # / IF ( item.recall or hold ) %]
147
                                                    </td>
148
                                                </tr>[% END %]
149
                                            </table>
150
                                        </fieldset>
151
                                        <fieldset class="action">
152
                                            <input type="hidden" name="op" value="request">
153
                                            <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]">
154
                                            <input type="submit" class="btn" value="Confirm">
155
                                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]" class="cancel">Cancel</a>
156
                                        </fieldset>
157
                                    </form>
158
159
                                </div>
160
                            [% ELSE %]
161
                                <div class="dialog alert">You must be logged in to place a recall.</div>
162
                            [% END %]
163
                        [% END %]
164
                    [% END %] <!-- norecalls -->
165
                </div> <!-- / #recall -->
166
            </div> <!-- / .span10 -->
167
        </div> <!-- / .row-fluid -->
168
    </div>  <!-- / .container-fluid -->
169
</div> <!-- / .main -->
170
171
[% INCLUDE 'opac-bottom.inc' %]
172
[% BLOCK jsinclude %]
173
[% INCLUDE 'calendar.inc' %]
174
<script>
175
    $(document).ready(function(){
176
        $(".level-option").show();
177
        $("#cleartext").show();
178
        $("#items").hide();
179
        $("#expiration-hint").hide();
180
        $("#cleartext").click(function(){
181
            $(this).siblings("input").val("");
182
        });
183
        $("#itemlevel").click(function(){
184
            if ( $("#itemlevel").is(':checked') ){
185
                $("#items").show();
186
                $("input:radio[name='itemnumber']:not(:disabled)").first().attr("checked", "checked"); // selects first item in table
187
            }
188
        });
189
        $("#bibliolevel").click(function(){
190
            if ( $("#bibliolevel").is(':checked') ){
191
                $("#items").hide();
192
            }
193
        });
194
        $("#expirationdate").datepicker({
195
            minDate: 0,
196
        });
197
    });
198
</script>
199
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt (+151 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Your recalls history &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% BLOCK cssinclude %][% END %]
7
</head>
8
[% INCLUDE 'bodytag.inc' bodyid='opac-recalls' bodyclass='scrollto' %]
9
[% INCLUDE 'masthead.inc' %]
10
<div class="main">
11
    <ul class="breadcrumb">
12
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
13
        <li><a href="#">Your recalls history</a></li>
14
    </ul>
15
    <div class="container-fluid">
16
        <div class="row-fluid">
17
            <div class="span2">
18
                <div id="navigation">
19
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
20
                </div>
21
            </div>
22
            <div class="span10">
23
                <div id="recalls" class="maincontent">
24
                    <h2>Recalls history</h2>
25
                    [% IF Koha.Preference('UseRecalls') %]
26
                        [% IF RECALLS.count %]
27
                            <div id="opac-user-recalls">
28
                                <table id="recalls-table" class="table table-bordered table-striped">
29
                                    <thead>
30
                                        <tr>
31
                                            <th class="anti-the">Title</th>
32
                                            <th class="psort title-string">Placed on</th>
33
                                            <th class="title-string">Expires on</th>
34
                                            <th>Pickup location</th>
35
                                            <th>Status</th>
36
                                            <th>Due date</th>
37
                                            <th class="nosort">&nbsp;</th>
38
                                        </tr>
39
                                    </thead>
40
                                    <tbody>
41
                                        [% FOREACH RECALL IN RECALLS %]
42
                                            <tr>
43
                                                <td class="title">
44
                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber | html %]">
45
                                                         [% RECALL.biblio.title | html %]
46
                                                         [% FOREACH s IN RECALL.biblio.subtitle %]
47
                                                            [% s | html %]
48
                                                         [% END %]
49
                                                    </a>
50
                                                    [% RECALL.biblio.author | html %]
51
                                                </td>
52
                                                <td class="recalldate">
53
                                                    <span title="[% RECALL.recalldate | html %]">
54
                                                        <span class="tdlabel">Recall date:</span>
55
                                                            [% RECALL.recalldate | $KohaDates %]
56
                                                    </span>
57
                                                </td>
58
                                                <td class="expirationdate">
59
                                                        [% IF ( RECALL.expirationdate ) %]
60
                                                            <span title="[% RECALL.expirationdate | html %]">
61
                                                                <span class="tdlabel">Expiration:</span>
62
                                                                [% RECALL.expirationdate | $KohaDates %]
63
                                                            </span>
64
                                                        [% ELSIF ( !RECALL.old ) %]
65
                                                            <span title="0000-00-00">
66
                                                                <span class="tdlabel">Expiration:</span>
67
                                                                    Never expires
68
                                                                </span>
69
                                                        [% ELSE %]
70
                                                            <span title="0000-00-00">-</span>
71
                                                        [% END %]
72
                                                    </td>
73
                                                    <td class="branch">
74
                                                        <span class="tdlabel">Pick up location:</span>
75
                                                        [% RECALL.library.branchname | html %]
76
                                                    </td>
77
                                                    <td class="status">
78
                                                        <span class="tdlabel">Status:</span>
79
                                                        [% IF ( RECALL.in_transit ) %]
80
                                                            In transit to [% RECALL.library.branchname | html %]
81
                                                        [% ELSIF ( RECALL.waiting ) %]
82
                                                            Ready for pickup
83
                                                        [% ELSIF ( RECALL.overdue ) %]
84
                                                            Overdue to be returned
85
                                                        [% ELSIF ( RECALL.expired ) %]
86
                                                            Expired on [% RECALL.expirationdate | $KohaDates %]
87
                                                        [% ELSIF ( RECALL.cancelled ) %]
88
                                                            Cancelled on [% RECALL.cancellationdate | $KohaDates %]
89
                                                        [% ELSIF ( RECALL.finished ) %]
90
                                                            Fulfilled
91
                                                        [% ELSE %]
92
                                                            Requested
93
                                                        [% END %]
94
                                                    </td>
95
                                                    <td class="due_date">
96
                                                        <span class="tdlabel">Due date</span>
97
                                                        [% IF ( RECALL.requested ) %]
98
                                                            Due to be returned by [% RECALL.checkout.date_due | $KohaDates %]
99
                                                        [% ELSIF ( RECALL.waiting and RECALL.expirationdate ) %]
100
                                                            Pick up by [% RECALL.expirationdate | $KohaDates %]
101
                                                        [% ELSE %]
102
                                                            -
103
                                                        [% END %]
104
                                                    </td>
105
106
                                                    <td class="cancelrecall">
107
                                                        [% IF ( RECALL.requested or RECALL.overdue ) %]
108
                                                            <form action="/cgi-bin/koha/opac-recall.pl" method="post">
109
                                                                <input type="hidden" name="op" value="cancel">
110
                                                                <input type="hidden" name="recall_id" value="[% RECALL.recall_id | html %]">
111
                                                                <input type="hidden" name="biblionumber" value="[% RECALL.biblionumber | html %]">
112
                                                                <input type="submit" name="submit" class="btn btn-danger cancel_recall" value="Cancel">
113
                                                            </form>
114
                                                        [% END %]
115
                                                    </td>
116
                                                [% END %]
117
                                            </tr>
118
                                        </tbody>
119
                                    <table>
120
                                </div>
121
                            [% ELSE %]
122
                                No recalls have been made.
123
                            [% END # / # RECALLS.count %]
124
                        [% ELSE %]
125
                            Recalls have not been enabled. Please contact your library.
126
                        [% END %]
127
                        </div> <!-- /#recalls -->
128
                    </div> <!-- /.span10 -->
129
            </div> <!-- /.row-fluid -->
130
        </div> <!-- /.container-fluid -->
131
</div> <!-- /#main -->
132
133
[% INCLUDE 'opac-bottom.inc' %]
134
[% BLOCK jsinclude %]
135
    [% INCLUDE 'datatables.inc' %]
136
    <script type="text/JavaScript">
137
        //<![CDATA[
138
            $(document).ready(function(){
139
                $(".cancel_recall").click(function(){
140
                    return confirmDelete(_("Are you sure you want to remove this recall?"));
141
                });
142
                $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
143
                    "aoColumnDefs": [
144
                        { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
145
                        { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
146
                        { "sType": "title-string", "aTargets" : [ "title-string" ] }
147
                    ]
148
                }));
149
            });
150
    </script>
151
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (+2 lines)
Lines 201-206 Link Here
201
                                    [% END %]
201
                                    [% END %]
202
                                    [% IF ( bibitemloo.already_reserved ) %]
202
                                    [% IF ( bibitemloo.already_reserved ) %]
203
                                        <div class="alert alert-warning">You have already requested this title.</div>
203
                                        <div class="alert alert-warning">You have already requested this title.</div>
204
                                    [% ELSIF ( bibitemloo.recall ) %]
205
                                        <div class="alert alert-warning">You have already placed a recall on this title.</div>
204
                                    [% ELSE %]
206
                                    [% ELSE %]
205
                                        [% IF ( bibitemloo.already_patron_possession ) %]
207
                                        [% IF ( bibitemloo.already_patron_possession ) %]
206
                                            <div class="alert alert-warning">This title cannot be requested because it's already in your possession.</div>
208
                                            <div class="alert alert-warning">This title cannot be requested because it's already in your possession.</div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+1 lines)
Lines 539-544 Link Here
539
                                                                [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
539
                                                                [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
540
                                                                [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
540
                                                                [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
541
                                                                [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
541
                                                                [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
542
                                                                [% IF ( SEARCH_RESULT.recalledcount ) %] Recalled ([% SEARCH_RESULT.recalledcount | html %]),[% END %]
542
                                                                [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
543
                                                                [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
543
                                                                [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
544
                                                                [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
544
                                                            </span>
545
                                                            </span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+85 lines)
Lines 216-221 Link Here
216
                            [% END %]
216
                            [% END %]
217
217
218
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a></li>[% END %]
218
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a></li>[% END %]
219
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]<li><a href="#opac-user-recalls">Recalls ([% RECALLS.count | html %])</a></li>[% END %]
219
                            [% IF Koha.Preference('ArticleRequests') && logged_in_user.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% logged_in_user.article_requests_current.count | html %])</a></li>[% END %]
220
                            [% IF Koha.Preference('ArticleRequests') && logged_in_user.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% logged_in_user.article_requests_current.count | html %])</a></li>[% END %]
220
                            [% IF ( OverDriveCirculation ) %]
221
                            [% IF ( OverDriveCirculation ) %]
221
                            <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
222
                            <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
Lines 318-323 Link Here
318
                                                    [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
319
                                                    [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
319
                                                        [% INCLUDE 'user-star-ratings.inc' item=ISSUE %]
320
                                                        [% INCLUDE 'user-star-ratings.inc' item=ISSUE %]
320
                                                    [% END %]
321
                                                    [% END %]
322
323
                                                    [% IF ( ISSUE.recall ) %]<br><i>This item has been recalled. Please return by the new due date.</i>[% END %]
321
                                                </td>
324
                                                </td>
322
325
323
                                                <td class="author">[% ISSUE.author | html %]</td>
326
                                                <td class="author">[% ISSUE.author | html %]</td>
Lines 711-716 Link Here
711
714
712
                        [% PROCESS 'holds-table.inc' HOLDS = RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
715
                        [% PROCESS 'holds-table.inc' HOLDS = RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
713
716
717
                        [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
718
                            <div id="opac-user-recalls">
719
                                <table id="recalls-table" class="table table-bordered table-striped">
720
                                    <caption>Recalls <span class="count">([% RECALLS.count | html %])</span></caption>
721
                                    <thead>
722
                                        <tr>
723
                                            <th class="anti-the">Title</th>
724
                                            <th class="psort title-string">Placed on</th>
725
                                            <th class="title-string">Expires on</th>
726
                                            <th>Pickup location</th>
727
                                            <th>Status</th>
728
                                            <th class="nosort">&nbsp;</th>
729
                                        </tr>
730
                                    </thead>
731
                                    <tbody>
732
                                        [% FOREACH RECALL IN RECALLS %]
733
                                        <tr>
734
                                            <td class="title">
735
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber | html %]">
736
                                                    [% RECALL.biblio.title | html %]
737
                                                    [% FOREACH s IN RECALL.biblio.subtitle %]
738
                                                        [% s | html %]
739
                                                    [% END %]
740
                                                </a>
741
                                                [% RECALL.biblio.author | html %]
742
                                            </td>
743
                                            <td class="recalldate">
744
                                                <span title="[% RECALL.recalldate | html %]">
745
                                                    <span class="tdlabel">Recall date:</span>
746
                                                    [% RECALL.recalldate | $KohaDates %]
747
                                                </span>
748
                                            </td>
749
                                            <td class="expirationdate">
750
                                                [% IF ( RECALL.expirationdate ) %]
751
                                                    <span title="[% RECALL.expirationdate | html %]">
752
                                                        <span class="tdlabel">Expiration:</span>
753
                                                        [% RECALL.expirationdate | $KohaDates %]
754
                                                    </span>
755
                                                [% ELSE %]
756
                                                    <span title="0000-00-00">
757
                                                        <span class="tdlabel">Expiration:</span>
758
                                                        Never expires
759
                                                    </span>
760
                                                [% END %]
761
                                            </td>
762
                                            <td class="branch">
763
                                                <span class="tdlabel">Pick up location:</span>
764
                                                [% RECALL.library.branchname | html %]
765
                                            </td>
766
                                            <td class="status">
767
                                                <span class="tdlabel">Status:</span>
768
                                                [% IF ( RECALL.requested ) %]
769
                                                    Requested
770
                                                [% ELSIF ( RECALL.overdue ) %]
771
                                                    Overdue to be returned
772
                                                [% ELSIF ( RECALL.in_transit ) %]
773
                                                    In transit to [% RECALL.library.branchname | html %]
774
                                                [% ELSIF ( RECALL.waiting ) %]
775
                                                    Ready for pickup
776
                                                [% END %]
777
                                            </td>
778
                                            <td class="cancelrecall">
779
                                                [% IF ( RECALL.requested or RECALL.overdue ) %]
780
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
781
                                                        <input type="hidden" name="op" value="cancel">
782
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id | html %]">
783
                                                        <input type="hidden" name="biblionumber" value="[% RECALL.biblionumber | html %]">
784
                                                        <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
785
                                                    </form>
786
                                                [% END %]
787
                                            </td>
788
                                        [% END %]
789
                                        </tr>
790
                                    </tbody>
791
                                </table>
792
                            </div>
793
                        [% END # / # RECALLS.count %]
794
714
                        [% IF Koha.Preference('ArticleRequests') %]
795
                        [% IF Koha.Preference('ArticleRequests') %]
715
                            <div id="opac-user-article-requests">
796
                            <div id="opac-user-article-requests">
716
                                [% IF logged_in_user.article_requests_current.count %]
797
                                [% IF logged_in_user.article_requests_current.count %]
Lines 1057-1062 Link Here
1057
                    $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
1138
                    $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
1058
                });
1139
                });
1059
            }
1140
            }
1141
1142
            $("#cancel_recall").click(function(e){
1143
                return confirmDelete(_("Are you sure you want to remove this recall?"));
1144
            });
1060
        });
1145
        });
1061
1146
1062
        var borrowernumber = "[% borrowernumber | html %]";
1147
        var borrowernumber = "[% borrowernumber | html %]";
(-)a/opac/opac-course-details.pl (+7 lines)
Lines 44-49 die("No course_id given") unless ($course_id); Link Here
44
my $course = GetCourse($course_id);
44
my $course = GetCourse($course_id);
45
my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, include_count => 1 );
45
my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, include_count => 1 );
46
46
47
foreach my $cr ( @$course_reserves ) {
48
    if ( $cr->{issue}->{date_due} and $cr->{issue}->{borrowernumber} and $borrowernumber != $cr->{issue}->{borrowernumber} and C4::Context->preference('UseRecalls') ) {
49
        $cr->{course_item}->{avail_for_recall} = 1;
50
        $cr->{course_item}->{biblionumber} = Koha::Items->find( $cr->{itemnumber} )->biblionumber;
51
    }
52
}
53
47
$template->param(
54
$template->param(
48
    course          => $course,
55
    course          => $course,
49
    course_reserves => $course_reserves,
56
    course_reserves => $course_reserves,
(-)a/opac/opac-detail.pl (-3 / +4 lines)
Lines 766-781 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
766
    }
766
    }
767
767
768
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
768
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
769
      if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
769
     my $recall_status = Koha::Recalls->search({ itemnumber => $itm->{itemnumber}, status => 'W', old => undef });
770
      if( $reserve_status eq "Waiting" or $recall_status->count ){ $itm->{'waiting'} = 1; }
770
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
771
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
771
    
772
772
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
773
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
773
     if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
774
     if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
774
        $itm->{transfertwhen} = $transfertwhen;
775
        $itm->{transfertwhen} = $transfertwhen;
775
        $itm->{transfertfrom} = $transfertfrom;
776
        $itm->{transfertfrom} = $transfertfrom;
776
        $itm->{transfertto}   = $transfertto;
777
        $itm->{transfertto}   = $transfertto;
777
     }
778
     }
778
    
779
779
    if ( C4::Context->preference('OPACAcquisitionDetails') ) {
780
    if ( C4::Context->preference('OPACAcquisitionDetails') ) {
780
        $itm->{on_order} = 1
781
        $itm->{on_order} = 1
781
          if grep { $_ eq $itm->{itemnumber} } @itemnumbers_on_order;
782
          if grep { $_ eq $itm->{itemnumber} } @itemnumbers_on_order;
(-)a/opac/opac-recall.pl (+141 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Copyright 2020 Aleisha Amohia <aleisha@catalyst.net.nz>
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 qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
use C4::Context;
25
26
my $query = new CGI;
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
    {
29
        template_name   => "opac-recall.tt",
30
        query           => $query,
31
        type            => "opac",
32
        authnotrequired => 0,
33
    }
34
);
35
36
my $op = $query->param('op') || '';
37
my $biblionumber = $query->param('biblionumber');
38
my $biblio = Koha::Biblios->find( $biblionumber );
39
40
if ( C4::Context->preference('UseRecalls') ) {
41
42
    my $patron = Koha::Patrons->find( $borrowernumber );
43
    my $error;
44
45
    unless ( $biblio->can_be_recalled({ patron => $patron }) ) { $error = 'unavailable'; }
46
47
    my $items = Koha::Items->search({ biblionumber => $biblionumber });
48
49
    # check if already recalled
50
    my $recalled = scalar $biblio->recalls;
51
    if ( defined $recalled and $recalled > 0 ) {
52
        my $recalls_per_record = Koha::CirculationRules->get_effective_rule({
53
            categorycode => $patron->categorycode,
54
            branchcode => undef,
55
            itemtype => undef,
56
            rule_name => 'recalls_per_record'
57
        });
58
        if ( defined $recalls_per_record and $recalls_per_record->rule_value and $recalled >= $recalls_per_record->rule_value ){
59
            $error = 'duplicate';
60
        }
61
    }
62
63
    # submitting recall request
64
    if ($op eq 'request'){
65
66
        if ( defined $error and $error eq 'unavailable' ){
67
            # no items available for recall
68
            print $query->redirect("/cgi-bin/koha/opac-recall.pl?biblionumber=$biblionumber&error=unavailable");
69
70
        } elsif ( !defined $error ){
71
            # can recall
72
73
            my $level = $query->param('type');
74
            my $pickuploc = $query->param('pickup');
75
            my $expdate = $query->param('expirationdate');
76
            my $itemnumber = $query->param('itemnumber');
77
78
            my ( $recall, $due_interval, $due_date );
79
            if ( $level eq 'itemlevel' and defined $itemnumber ) {
80
                my $item = Koha::Items->find( $itemnumber );
81
                if ( $item->can_be_recalled({ patron => $patron }) ) {
82
                    ( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({
83
                        patron => $patron,
84
                        biblio => $biblio,
85
                        branchcode => $pickuploc,
86
                        item => $item,
87
                        expirationdate => $expdate,
88
                        interface => 'OPAC',
89
                    });
90
                } else {
91
                    $error = 'cannot';
92
                }
93
            } else {
94
                if ( $biblio->can_be_recalled({ patron => $patron }) ) {
95
                    ( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({
96
                        patron => $patron,
97
                        biblio => $biblio,
98
                        branchcode => $pickuploc,
99
                        expirationdate => $expdate,
100
                        interface => 'OPAC',
101
                    });
102
                } else {
103
                    $error = 'cannot';
104
                }
105
            }
106
            if ( defined $recall ) {
107
                $template->param(
108
                    success => 1,
109
                    due_interval => $due_interval,
110
                    due_date => $due_date,
111
                );
112
            } else {
113
                $error = 'failed';
114
            }
115
        }
116
    } elsif ($op eq 'cancel'){
117
        my $recall_id = $query->param('recall_id');
118
        Koha::Recalls->find( $recall_id )->set_cancelled;
119
        print $query->redirect('/cgi-bin/koha/opac-user.pl');
120
    }
121
122
    my $branches = Koha::Libraries->search();
123
    my $single_branch_mode = $branches->count == 1;
124
125
    $template->param(
126
        biblio => $biblio,
127
        error => $error,
128
        items => $items,
129
        single_branch_mode => $single_branch_mode,
130
        branches => $branches,
131
    );
132
133
} else {
134
    # UseRecalls disabled
135
    $template->param(
136
        nosyspref => 1,
137
        biblio => $biblio,
138
    );
139
}
140
141
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
(-)a/opac/opac-recalls.pl (+42 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2020 Aleisha Amohia <aleisha@catalyst.net.nz>
4
#
5
# This file is part of Koha.
6
# Koha is free software; you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 3 of the License, or
9
# (at your option) any later version.
10
11
# Koha is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
15
16
# You should have received a copy of the GNU General Public License
17
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
19
use Modern::Perl;
20
use CGI qw ( -utf8 );
21
use Encode qw( encode );
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
use Koha::Recalls;
25
26
my $input = new CGI;
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
   {
29
      template_name   => "opac-recalls.tt",
30
      query           => $input,
31
      type            => "opac",
32
      authnotrequired => 0,
33
   }
34
);
35
36
my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber }, { order_by => { -desc => 'recalldate' } });
37
$template->param(
38
     RECALLS => $recalls,
39
     recallsview => 1
40
);
41
42
output_html_with_http_headers $input, $cookie, $template->output, undef, { force_no_caching => 1 };
(-)a/opac/opac-reserve.pl (+4 lines)
Lines 625-630 foreach my $biblioNum (@biblionumbers) { Link Here
625
    $biblioLoopIter{holdable} &&= $status eq 'OK';
625
    $biblioLoopIter{holdable} &&= $status eq 'OK';
626
    $biblioLoopIter{already_patron_possession} = $status eq 'alreadypossession';
626
    $biblioLoopIter{already_patron_possession} = $status eq 'alreadypossession';
627
627
628
    if ( CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'recall' ){
629
        $biblioLoopIter{recall} = 1;
630
    }
631
628
    # For multiple holds per record, if a patron has previously placed a hold,
632
    # For multiple holds per record, if a patron has previously placed a hold,
629
    # the patron can only place more holds of the same type. That is, if the
633
    # the patron can only place more holds of the same type. That is, if the
630
    # patron placed a record level hold, all the holds the patron places must
634
    # patron placed a record level hold, all the holds the patron places must
(-)a/opac/opac-user.pl (-1 / +10 lines)
Lines 303-308 if ( $pending_checkouts->count ) { # Useless test Link Here
303
                    $issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g;
303
                    $issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g;
304
                    $issue->{MySummaryHTML} = $my_summary_html;
304
                    $issue->{MySummaryHTML} = $my_summary_html;
305
                }
305
                }
306
307
        my @maybe_recalls = Koha::Recalls->search({ biblionumber => $issue->{biblionumber}, itemnumber => [ undef, $issue->{itemnumber} ], old => undef });
308
        foreach my $recall ( @maybe_recalls ) {
309
            if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) {
310
                $issue->{recall} = 1;
311
                last;
312
            }
313
        }
306
    }
314
    }
307
}
315
}
308
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
316
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
Lines 324-333 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
324
332
325
# now the reserved items....
333
# now the reserved items....
326
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
334
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
335
my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, old => undef });
327
336
328
$template->param(
337
$template->param(
329
    RESERVES       => $reserves,
338
    RESERVES       => $reserves,
330
    showpriority   => $show_priority,
339
    showpriority   => $show_priority,
340
    RECALLS        => $recalls,
331
);
341
);
332
342
333
if (C4::Context->preference('BakerTaylorEnabled')) {
343
if (C4::Context->preference('BakerTaylorEnabled')) {
334
- 

Return to bug 19532