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

(-)a/catalogue/detail.pl (+6 lines)
Lines 395-400 foreach my $item (@items) { Link Here
395
        }
395
        }
396
    }
396
    }
397
397
398
    my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, old => undef });
399
    if ( defined $recall ) {
400
        $item->{recalled} = 1;
401
        $item->{recall} = $recall;
402
    }
403
398
    if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
404
    if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
399
        if ($itembranchcode and $itembranchcode eq $currentbranch) {
405
        if ($itembranchcode and $itembranchcode eq $currentbranch) {
400
            push @itemloop, $item;
406
            push @itemloop, $item;
(-)a/circ/circulation.pl (-1 / +3 lines)
Lines 410-416 if (@$barcodes) { Link Here
410
        }
410
        }
411
        unless($confirm_required) {
411
        unless($confirm_required) {
412
            my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
412
            my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
413
            my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, } );
413
            my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $session->param('cancel_recall'), recall_id => $session->param('recall_id'), } );
414
            $template_params->{issue} = $issue;
414
            $template_params->{issue} = $issue;
415
            $session->clear('auto_renew');
415
            $session->clear('auto_renew');
416
            $inprocess = 1;
416
            $inprocess = 1;
Lines 456-461 if ($patron) { Link Here
456
    $template->param(
456
    $template->param(
457
        holds_count  => $holds->count(),
457
        holds_count  => $holds->count(),
458
        WaitingHolds => $waiting_holds,
458
        WaitingHolds => $waiting_holds,
459
        recalls => $patron->recalls,
460
        specific_patron => 1,
459
    );
461
    );
460
}
462
}
461
463
(-)a/circ/transferstoreceive.pl (+7 lines)
Lines 117-122 while ( my $library = $libraries->next ) { Link Here
117
            if ( my $first_hold = $holds->next ) {
117
            if ( my $first_hold = $holds->next ) {
118
                $getransf{patron} = Koha::Patrons->find( $first_hold->borrowernumber );
118
                $getransf{patron} = Koha::Patrons->find( $first_hold->borrowernumber );
119
            }
119
            }
120
121
            # check for a recall for this transfer
122
            my $recall = $item->recall;
123
            if ( defined $recall ) {
124
                $getransf{recall} = $recall;
125
            }
126
120
            push( @transferloop, \%getransf );
127
            push( @transferloop, \%getransf );
121
        }
128
        }
122
129
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (+3 lines)
Lines 41-45 Link Here
41
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id | url  %]" >Checkout history</a></li>
41
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id | url  %]" >Checkout history</a></li>
42
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id | url  %]&amp;object_type=biblio">Modification log</a> </li>[% END %]
42
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id | url  %]&amp;object_type=biblio">Modification log</a> </li>[% END %]
43
[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/stockrotation.pl?biblionumber=[% biblio_object_id | uri %]">Rota</a> </li>[% END %]
43
[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/stockrotation.pl?biblionumber=[% biblio_object_id | uri %]">Rota</a> </li>[% END %]
44
    [% IF ( Koha.Preference('UseRecalls') && CAN_user_recalls ) %]
45
        [% IF ( recallsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% biblio_object_id | url %]">Recalls ([% Biblio.RecallsCount( biblio_object_id ) %])</a></li>
46
    [% END %]
44
</ul>
47
</ul>
45
</div>
48
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+3 lines)
Lines 139-144 Link Here
139
    [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
139
    [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
140
        [% IF illview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a></li>
140
        [% IF illview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a></li>
141
    [% END %]
141
    [% END %]
142
    [% IF Koha.Preference('UseRecalls') && CAN_user_recalls %]
143
        [% IF recallsview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/recallshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Recalls history</a></li>
144
    [% END %]
142
</ul></div>
145
</ul></div>
143
146
144
<!-- Modal -->
147
<!-- Modal -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc (+8 lines)
Lines 39-44 Link Here
39
            [% IF Koha.Preference('OnSiteCheckouts') %]
39
            [% IF Koha.Preference('OnSiteCheckouts') %]
40
                <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li>
40
                <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li>
41
            [% END %]
41
            [% END %]
42
43
            [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
44
                <li><a href="/cgi-bin/koha/recalls/recalls_queue.pl" title="All active recalls">Recalls queue</a></li>
45
                <li><a href="/cgi-bin/koha/recalls/recalls_to_pull.pl" title="Recalls that could be filled but have not been set waiting">Recalls to pull</a></li>
46
                <li><a href="/cgi-bin/koha/recalls/recalls_overdue.pl" title="Recalled items that are overdue to be returned">Overdue recalls</a></li>
47
                <li><a href="/cgi-bin/koha/recalls/recalls_waiting.pl" title="Recalled items awaiting pickup">Recalls awaiting pickup</a></li>
48
                <li><a href="/cgi-bin/koha/recalls/recalls_old_queue.pl" title="Inactive recalls">Old recalls</a></li>
49
            [% END %]
42
        </ul>
50
        </ul>
43
51
44
    </div>
52
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc (+123 lines)
Line 0 Link Here
1
<div id="recalls">
2
[% IF recalls.count %]
3
    <table id="recalls-table">
4
        <thead>
5
            <tr>
6
                [% IF checkboxes %]<th class="recall-checkbox nosort">&nbsp;</th>[% END %]
7
                <th class="recall-title anti-the">Title</th>
8
                [% UNLESS specific_patron %]<th class="recall-patron">Requested by</th>[% END %]
9
                <th class="recall-date">Placed on</th>
10
                <th class="recall-expiry">Expires on</th>
11
                <th class="recall-branch">Pickup location</th>
12
                <th class="recall-status">Status</th>
13
                <th class="recall-duedate">Due date</th>
14
                [% UNLESS viewing_old %]<th class="recall-actions nosort">&nbsp;</th>[% END %]
15
            </tr>
16
        </thead>
17
18
        <tbody>
19
            [% FOREACH recall IN recalls %]
20
                [% IF recall.old %]<tr class="old">[% ELSE %]<tr>[% END %]
21
22
                    [% IF checkboxes %]
23
                        <td class="recall-checkbox">
24
                            [% IF recall.old %]
25
                                &nbsp;
26
                            [% ELSE %]
27
                                <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids">
28
                            [% END %]
29
                        </td>
30
                    [% END %]
31
32
                    <td class="recall-title">
33
                        <b><a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]">
34
                            [% recall.biblio.title %]
35
                            [% FOREACH s IN recall.biblio.subtitle %]
36
                                [% s %]
37
                            [% END %]
38
                        </a></b>
39
                        [% IF recall.item %][% recall.item.barcode %][% END %]
40
                        [% recall.biblio.author %]
41
                    </td>
42
43
                    [% UNLESS specific_patron %]
44
                        <td class="recall-patron">
45
                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.patron.firstname %] [% recall.patron.surname %] ([% recall.patron.cardnumber %])</a>
46
                        </td>
47
                    [% END %]
48
49
                    <td class="recall-date">
50
                        [% recall.recalldate | $KohaDates %]
51
                    </td>
52
53
                    <td class="recall-expiry">
54
                        [% IF ( recall.expirationdate ) %]
55
                            [% recall.expirationdate | $KohaDates %]
56
                        [% ELSIF ( !recall.old ) %]
57
                            Never expires
58
                        [% ELSE %]
59
                            -
60
                        [% END %]
61
                    </td>
62
63
                    <td class="recall-branch">
64
                        [% recall.library.branchname %]
65
                    </td>
66
67
                    <td class="recall-status">
68
                        [% IF ( recall.in_transit ) %]
69
                            In transit to [% recall.library.branchname %]
70
                        [% ELSIF ( recall.waiting ) %]
71
                            Ready for pickup
72
                        [% ELSIF ( recall.expired ) %]
73
                            Expired on [% recall.expirationdate | $KohaDates %]
74
                        [% ELSIF ( recall.cancelled ) %]
75
                            Cancelled on [% recall.cancellationdate | $KohaDates %]
76
                        [% ELSIF ( recall.overdue ) %]
77
                            Overdue to be returned
78
                        [% ELSIF ( recall.finished ) %]
79
                            Fulfilled
80
                        [% ELSE %]
81
                            Requested
82
                        [% END %]
83
                    </td>
84
85
                    <td class="recall-duedate">
86
                        [% IF recall.requested %]
87
                            Due to be returned by [% recall.checkout.date_due | $KohaDates %]
88
                        [% ELSIF recall.waiting and RECALL.expirationdate %]
89
                            Pick up by [% RECALL.expirationdate | $KohaDates %]
90
                        [% ELSE %]
91
                            -
92
                        [% END %]
93
                    </td>
94
95
                    [% UNLESS viewing_old %]
96
                    <td class="recall-cancel actions">
97
                        <div class="btn-group">
98
                            <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown" href="#"> Actions <span class="caret"></span></a>
99
                            <ul class="dropdown-menu">
100
                                [% IF ( recall.requested or recall.overdue ) %]
101
                                    <li><a class="cancel_recall" data-id="[% recall.recall_id %]" data-action="cancel" data-parent="one"><i class="fa fa-times"></i> Cancel</a></li>
102
                                    <li><a class="checkin_recall" data-id="[% recall.recall_id %]" data-action="checkin" data-parent="one"><i class="fa fa-download"></i> Check in and set waiting</a></li>
103
                                [% ELSIF ( recall.waiting ) %]
104
                                    <li><a class="revert_recall" data-id="[% recall.recall_id %]" data-action="revert" data-parent="one"><i class="fa fa-undo"></i> Revert waiting</a></li>
105
                                    <li><a class="expire_recall" data-id="[% recall.recall_id %]" data-action="expire" data-parent="one"><i class="fa fa-times"></i> Expire</a></li>
106
                                [% END %]
107
                            </ul>
108
                        </div>
109
                    </td>
110
                    [% END %]
111
112
                </tr>
113
            [% END %]
114
        </tbody>
115
    </table>
116
    [% ELSE %]
117
        [% IF patron.borrowernumber %]
118
            <div class="dialog message">Patron has no current recalls.</div>
119
        [% ELSE %]
120
            <div class="dialog message">There are no recalls to show.</div>
121
        [% END %]
122
    [% END %]
123
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +11 lines)
Lines 391-404 Note that permanent location is a code, and location may be an authval. Link Here
391
                                There is an item level hold on this item (priority = [% hold.priority | html %]).
391
                                There is an item level hold on this item (priority = [% hold.priority | html %]).
392
                            [% END %]
392
                            [% END %]
393
                        [% END %]
393
                        [% END %]
394
                        [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || hold ) %]
394
395
                        [% IF item.recalled %]
396
                            [% IF item.recall.waitingdate %]
397
                                Waiting at [% Branches.GetName( item.recall.branchcode ) | html %] since [% item.recall.waitingdate | $KohaDates %]
398
                            [% ELSE %]
399
                                Item recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.recall.borrowernumber %]">[% item.recall.patron.firstname %] [% item.recall.patron.surname %] ([% item.recall.patron.cardnumber %])</a> on [% item.recall.recalldate | $KohaDates %]
400
                            [% END %]
401
                        [% END %]
402
403
                        [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || hold || item.recalled ) %]
395
                            Available
404
                            Available
396
                        [% END %]
405
                        [% END %]
397
406
398
                        [% IF ( item.restricted ) %]
407
                        [% IF ( item.restricted ) %]
399
                            <span class="restricted">([% item.restrictedvalue | html %])</span>
408
                            <span class="restricted">([% item.restrictedvalue | html %])</span>
400
                        [% END %]
409
                        [% END %]
401
402
                    </td>
410
                    </td>
403
                    <td class="datelastseen"><span title="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</span></td>
411
                    <td class="datelastseen"><span title="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</span></td>
404
                    <td class="dateaccessioned"><span title="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</span></td>
412
                    <td class="dateaccessioned"><span title="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</span></td>
Lines 895-900 Note that permanent location is a code, and location may be an authval. Link Here
895
[% MACRO jsinclude BLOCK %]
903
[% MACRO jsinclude BLOCK %]
896
    [% INCLUDE 'catalog-strings.inc' %]
904
    [% INCLUDE 'catalog-strings.inc' %]
897
    [% Asset.js("js/catalog.js") | $raw %]
905
    [% Asset.js("js/catalog.js") | $raw %]
906
    [% Asset.js("js/recalls.js") | $raw %]
898
    [% Asset.js("js/coce.js") | $raw %]
907
    [% Asset.js("js/coce.js") | $raw %]
899
    <script>
908
    <script>
900
        var interface = "[% interface | html %]";
909
        var interface = "[% interface | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (+12 lines)
Lines 70-75 Link Here
70
                        <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa fa-line-chart"></i> Hold ratios</a>
70
                        <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa fa-line-chart"></i> Hold ratios</a>
71
                    </li>
71
                    </li>
72
                </ul>
72
                </ul>
73
74
                [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
75
                    <h3>Recalls</h3>
76
77
                    <ul class="buttons-list">
78
                        <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_queue.pl" title="All active recalls"><i class="fa fa-tasks"></i> Recalls queue</a></li>
79
                        <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_to_pull.pl" title="Recalls that could be filled but have not been set waiting"><i class="fa fa-hand-grab-o"></i> Recalls to pull</a></li>
80
                        <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_overdue.pl" title="Recalled items that are overdue to be returned"><i class="fa fa-clock-o"></i> Overdue recalls</a></li>
81
                        <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_waiting.pl" title="Recalled items awaiting pickup"><i class="fa fa-calendar"></i> Recalls awaiting pickup</a></li>
82
                        <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_old_queue.pl" title="Inactive recalls"><i class="fa fa-tasks"></i> Old recalls</a></li>
83
                    </ul>
84
                [% END %]
73
            </div>
85
            </div>
74
86
75
            <!-- Add the extra clearfix for only the required viewport -->
87
            <!-- Add the extra clearfix for only the required viewport -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +46 lines)
Lines 196-201 Link Here
196
                                        [% END %]
196
                                        [% END %]
197
                                    </li>
197
                                    </li>
198
                                [% END %]
198
                                [% END %]
199
200
                                [% IF RECALLED %]
201
                                    [% IF recall.waiting %]
202
                                        <li>Item <i>[% recall.biblio.title | html %]</i> ([% recall.item.barcode | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a> ([% recall.patron.cardnumber | html %]) at [% Branches.GetName( recall.branchcode ) | html %] since [% recall.waitingdate | $KohaDates %]</li>
203
                                    [% ELSIF recall.requested or recall.overdue %]
204
                                        <li>Item <i>[% recall.biblio.title | html %]</i> [% IF recall.item %]([% recall.item.barcode | html %])[% END %] has been recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a> ([% recall.patron.cardnumber | html %]) at [% Branches.GetName( recall.branchcode ) | html %] since [% recall.recalldate | $KohaDates %]</li>
205
                                    [% END %]
206
                                [% END %]
207
199
                            </ul>
208
                            </ul>
200
209
201
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
210
                            [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
Lines 227-232 Link Here
227
                                        </p>
236
                                        </p>
228
                                    [% END %]
237
                                    [% END %]
229
238
239
                                    [% IF ( RECALLED ) %]
240
                                        <p>
241
                                            <label for="cancelrecall">Cancel hold</label>
242
                                            <input type="radio" value="cancel" name="cancel_recall" id="cancelrecall" />
243
                                            <input type="hidden" value="[% recall.recall_id %]" name="recall_id" />
244
                                        </p>
245
                                        [% IF recall.waiting %]
246
                                            <p>
247
                                                <label for="revertrecall">Revert waiting status</label>
248
                                                <input type="radio" value="revert" name="cancel_recall" id="revertrecall" checked="checked"/>
249
                                                <input type="hidden" value="[% recall.recall_id %]" name="recall_id" />
250
                                            </p>
251
                                        [% END %]
252
                                    [% END %]
253
230
                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
254
                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
231
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
255
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
232
                                    <input type="hidden" name="issueconfirmed" value="1" />
256
                                    <input type="hidden" name="issueconfirmed" value="1" />
Lines 277-282 Link Here
277
                                </form>
301
                                </form>
278
                            [% END %]
302
                            [% END %]
279
303
304
                            [% IF ( RECALLED ) %]
305
                                <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
306
                                    <button class="print" type="submit" onclick="Dopop('recall-pickup-slip.pl?recall_id=[% recall.recall_id %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
307
                                </form>
308
                            [% END %]
309
280
                            <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
310
                            <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
281
                                [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
311
                                [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
282
                                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
312
                                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
Lines 294-300 Link Here
294
                                [% END %]
324
                                [% END %]
295
                            </form>
325
                            </form>
296
326
297
                            [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
327
                            [% IF ( RESERVED || ISSUED_TO_ANOTHER || RECALLED ) && (CAN_user_reserveforothers_place_holds ) %]
298
                                [% UNLESS noissues %]
328
                                [% UNLESS noissues %]
299
                                    <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
329
                                    <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
300
                                [% END %]
330
                                [% END %]
Lines 900-905 Link Here
900
                                    </a>
930
                                    </a>
901
                                </li>
931
                                </li>
902
                            [% END %]
932
                            [% END %]
933
934
                            [% IF Koha.Preference('UseRecalls') %]
935
                                <li>
936
                                    <a href="#recalls" id="recalls-tab">
937
                                        [% recalls.count %] Recalls
938
                                    </a>
939
                                </li>
940
                            [% END %]
903
                        </ul>
941
                        </ul>
904
942
905
                        <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
943
                        <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
Lines 914-919 Link Here
914
                            </div> <!-- /#clubs-tab -->
952
                            </div> <!-- /#clubs-tab -->
915
                        [% END %]
953
                        [% END %]
916
954
955
                        [% IF Koha.Preference('UseRecalls') %]
956
                            <div id="recalls">
957
                                [% INCLUDE 'recalls.inc' %]
958
                            </div>
959
                        [% END %]
960
917
                        [% INCLUDE borrower_debarments.inc %]
961
                        [% INCLUDE borrower_debarments.inc %]
918
962
919
                        <div id="reserves">
963
                        <div id="reserves">
Lines 1154-1159 Link Here
1154
    </script>
1198
    </script>
1155
    [% INCLUDE 'str/members-menu.inc' %]
1199
    [% INCLUDE 'str/members-menu.inc' %]
1156
    [% Asset.js("js/members-menu.js") | $raw %]
1200
    [% Asset.js("js/members-menu.js") | $raw %]
1201
    [% Asset.js("js/recalls.js") %]
1157
[% END %]
1202
[% END %]
1158
1203
1159
[% INCLUDE 'intranet-bottom.inc' %]
1204
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt (+2 lines)
Lines 68-73 Link Here
68
                                    [% reser.patron.first_valid_email_address | html %]
68
                                    [% reser.patron.first_valid_email_address | html %]
69
                                </a>
69
                                </a>
70
                            [% END %]
70
                            [% END %]
71
                        [% ELSIF ( reser.recall ) %]
72
                            Recall requested by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reser.recall.borrowernumber %]">[% reser.recall.patron.surname %][% IF reser.recall.patron.firstname %], [% reser.recall.patron.firstname %][% END %] ([% reser.recall.patron.cardnumber %])</a>
71
                        [% ELSE %]
73
                        [% ELSE %]
72
                        <p>None</p>
74
                        <p>None</p>
73
                    [% END %]
75
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+14 lines)
Lines 760-765 Link Here
760
                                    </a>
760
                                    </a>
761
                                </li>
761
                                </li>
762
                            [% END %]
762
                            [% END %]
763
764
                            [% IF Koha.Preference('UseRecalls') %]
765
                                <li>
766
                                    <a href="#recalls" id="recalls-tab">
767
                                        [% recalls.count %] Recalls
768
                                    </a>
769
                                </li>
770
                            [% END %]
763
                        </ul>
771
                        </ul>
764
772
765
                        [% INCLUDE "checkouts-table.inc" %]
773
                        [% INCLUDE "checkouts-table.inc" %]
Lines 782-787 Link Here
782
                            </div>
790
                            </div>
783
                        [% END %]
791
                        [% END %]
784
792
793
                        [% IF Koha.Preference('UseRecalls') %]
794
                            <div id="recalls">
795
                                [% INCLUDE 'recalls.inc' %]
796
                            </div>
797
                        [% END %]
798
785
                        [% INCLUDE borrower_debarments.inc %]
799
                        [% INCLUDE borrower_debarments.inc %]
786
800
787
                        [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
801
                        [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt (+45 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% USE Koha %]
3
[% USE Asset %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Recalls history for [% INCLUDE 'patron-title.inc' %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% Asset.css("css/datatables.css") %]
9
</head>
10
11
<body id="recalls_history" class="pat">
12
    [% INCLUDE 'header.inc' %]
13
    [% INCLUDE 'patron-search.inc' %]
14
15
    <div id="breadcrumbs">
16
        <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
17
        <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo;
18
        Recalls history for [% INCLUDE 'patron-title.inc' %]
19
    </div>
20
    <div class="main container-fluid">
21
        <div class="row">
22
            <div class="col-sm-10 col-sm-push-2">
23
                <main>
24
                    [% INCLUDE 'members-toolbar.inc' %]
25
                    <h1>Recalls history</h1>
26
                    [% IF Koha.Preference('UseRecalls') %]
27
                         [% INCLUDE 'recalls.inc' %]
28
                    [% ELSE %]
29
                         <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
30
                    [% END %]
31
                </main>
32
            </div>
33
        <div class="col-sm-2 col-sm-pull-10">
34
            <aside>
35
                [% INCLUDE 'circ-menu.inc' %]
36
            </aside>
37
        </div>
38
    </div>
39
40
[% MACRO jsinclude BLOCK %]
41
    [% INCLUDE 'datatables.inc' %]
42
    [% Asset.js("js/recalls.js") %]
43
[% END %]
44
45
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt (+57 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE Asset %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Old recalls</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
<style type="text/css"> p { margin-top: 0; }</style>
9
[% Asset.css("css/datatables.css") %]
10
</head>
11
<body id="circ_recalls_old_queue" class="circ">
12
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'cat-search.inc' %]
14
15
<div id="breadcrumbs">
16
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17
    &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
18
    &rsaquo; <a href="/cgi-bin/koha/recalls/recalls_old_queue.pl">Old recalls</a>
19
</div>
20
21
<div class="main container-fluid">
22
    <div class="row">
23
        [% IF Koha.Preference('CircSidebar') %]
24
            <div class="col-sm-10 col-sm-push-2">
25
        [% ELSE %]
26
            <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
27
        [% END %]
28
        <main>
29
30
        <h1>Old recalls</h1>
31
        [% IF Koha.Preference('UseRecalls') %]
32
            [% INCLUDE 'recalls.inc' %]
33
        [% ELSE %]
34
            <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
35
        [% END %]
36
37
        </main>
38
        </div> <!-- /.col-etc -->
39
40
        [% IF Koha.Preference('CircSidebar') %]
41
            <div class="col-sm-2 col-sm-pull-10">
42
                <aside>
43
                    [% INCLUDE 'circ-nav.inc' %]
44
                </aside>
45
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
46
        [% END %]
47
48
    </div> <!-- /.row -->
49
</div>
50
51
[% MACRO jsinclude BLOCK %]
52
    [% INCLUDE 'datatables.inc' %]
53
    [% INCLUDE 'columns_settings.inc' %]
54
    [% Asset.js("js/recalls.js") %]
55
[% END %]
56
57
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt (+68 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE Asset %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Overdue recalls</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
<style type="text/css"> p { margin-top: 0; }</style>
9
[% Asset.css("css/datatables.css") %]
10
</head>
11
<body id="circ_overdue_recalls" class="circ">
12
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'cat-search.inc' %]
14
15
<div id="breadcrumbs">
16
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17
    &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
18
    &rsaquo; <a href="/cgi-bin/koha/recalls/recalls_overdue.pl">Overdue recalls</a>
19
</div>
20
21
<div class="main container-fluid">
22
    <div class="row">
23
        [% IF Koha.Preference('CircSidebar') %]
24
            <div class="col-sm-10 col-sm-push-2">
25
        [% ELSE %]
26
            <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
27
        [% END %]
28
        <main>
29
30
        <h1>Overdue recalls</h1>
31
        [% IF Koha.Preference('UseRecalls') %]
32
            [% IF recalls.count %]
33
                <form method="post" action="/cgi-bin/koha/recalls/recalls_overdue.pl">
34
                    <input type="hidden" name="op" value="cancel_multiple_recalls">
35
                    <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
36
                    [% INCLUDE 'recalls.inc' %]
37
                    <fieldset class="action">
38
                        <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
39
                    </fieldset>
40
                </form>
41
            [% ELSE %]
42
                <div class="dialog message">There are no recalls to show.</div>
43
            [% END %]
44
        [% ELSE %]
45
            <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
46
        [% END %]
47
48
        </main>
49
        </div> <!-- /.col-etc -->
50
51
        [% IF Koha.Preference('CircSidebar') %]
52
            <div class="col-sm-2 col-sm-pull-10">
53
                <aside>
54
                    [% INCLUDE 'circ-nav.inc' %]
55
                </aside>
56
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
57
        [% END %]
58
59
    </div> <!-- /.row -->
60
</div>
61
62
[% MACRO jsinclude BLOCK %]
63
    [% INCLUDE 'datatables.inc' %]
64
    [% INCLUDE 'columns_settings.inc' %]
65
    [% Asset.js("js/recalls.js") %]
66
[% END %]
67
68
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt (+68 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE Asset %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Recalls queue</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
<style type="text/css"> p { margin-top: 0; }</style>
9
[% Asset.css("css/datatables.css") %]
10
</head>
11
<body id="circ_recalls_queue" class="circ">
12
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'cat-search.inc' %]
14
15
<div id="breadcrumbs">
16
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17
    &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
18
    &rsaquo; <a href="/cgi-bin/koha/recalls/recalls_queue.pl">Recalls queue</a>
19
</div>
20
21
<div class="main container-fluid">
22
    <div class="row">
23
        [% IF Koha.Preference('CircSidebar') %]
24
            <div class="col-sm-10 col-sm-push-2">
25
        [% ELSE %]
26
            <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
27
        [% END %]
28
        <main>
29
30
        <h1>Recalls queue</h1>
31
        [% IF Koha.Preference('UseRecalls') %]
32
            [% IF recalls.count %]
33
                <form method="post" action="/cgi-bin/koha/recalls/recalls_queue.pl">
34
                    <input type="hidden" name="op" value="cancel_multiple_recalls">
35
                    <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
36
                    [% INCLUDE 'recalls.inc' %]
37
                    <fieldset class="action">
38
                        <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
39
                    </fieldset>
40
                </form>
41
            [% ELSE %]
42
                <div class="dialog message">There are no recalls to show.</div>
43
            [% END %]
44
        [% ELSE %]
45
            <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
46
        [% END %]
47
48
        </main>
49
        </div> <!-- /.col-etc -->
50
51
        [% IF Koha.Preference('CircSidebar') %]
52
            <div class="col-sm-2 col-sm-pull-10">
53
                <aside>
54
                    [% INCLUDE 'circ-nav.inc' %]
55
                </aside>
56
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
57
        [% END %]
58
59
    </div> <!-- /.row -->
60
</div>
61
62
[% MACRO jsinclude BLOCK %]
63
    [% INCLUDE 'datatables.inc' %]
64
    [% INCLUDE 'columns_settings.inc' %]
65
    [% Asset.js("js/recalls.js") %]
66
[% END %]
67
68
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt (+151 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE AuthorisedValues %]
4
[% USE Branches %]
5
[% USE ItemTypes %]
6
[% USE Asset %]
7
[% SET footerjs = 1 %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
<title>Koha &rsaquo; Circulation &rsaquo; Recalls to pull</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
<style type="text/css"> p { margin-top: 0; }</style>
12
[% Asset.css("css/datatables.css") %]
13
</head>
14
<body id="circ_recalls_to_pull" class="circ">
15
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'cat-search.inc' %]
17
18
<div id="breadcrumbs">
19
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
20
    &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
21
    &rsaquo; <a href="/cgi-bin/koha/recalls/recalls_to_pull.pl">Recalls to pull</a>
22
</div>
23
24
<div class="main container-fluid">
25
    <div class="row">
26
        [% IF Koha.Preference('CircSidebar') %]
27
            <div class="col-sm-10 col-sm-push-2">
28
        [% ELSE %]
29
            <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
30
        [% END %]
31
        <main>
32
33
        <h1>Recalls to pull</h1>
34
        [% IF Koha.Preference('UseRecalls') %]
35
            <div id="recalls">
36
                [% IF recalls.count %]
37
                <table id="recalls-table">
38
                    <thead>
39
                        <tr>
40
                            <th class="recall-topull">Pull this many items</th>
41
                            <th class="recall-items">Items available</th>
42
                            <th class="recall-patrons">Patrons with recalls</th>
43
                            <th class="recall-firstpatron">First patron</th>
44
                            <th class="recall-title anti-the">Title</th>
45
                            <th class="recall-libraries">Libraries</th>
46
                            <th class="recall-callnumbers">Available call numbers</th>
47
                            <th class="recall-copynumbers">Available copy numbers</th>
48
                            <th class="recall-enumeration">Available enumeration</th>
49
                            <th class="recall-itemtypes">Available item types</th>
50
                            <th class="recall-locations">Available locations</th>
51
                            <th class="recall-date title-string">Earlier recall date</th>
52
                            <th class="recall-action nosort">&nbsp;</th>
53
                        </tr>
54
                    </thead>
55
                    <tbody>
56
                        [% FOREACH recall IN recalls %]
57
                        <tr>
58
                            <td class="recall-topull"><b>[% recall.pull_count %]</b></td>
59
                            <td class="recall-items">[% recall.items_count %]</td>
60
                            <td class="recall-patrons">[% recall.patrons_count %]</td>
61
                            <td class="recall-firstpatron"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.first_patron.borrowernumber %]">[% recall.first_patron.firstname %] [% recall.first_patron.surname %]</a></td>
62
                            <td class="recall-title">
63
                                [% INCLUDE 'biblio-default-view.inc' biblionumber=recall.biblio.biblionumber %]
64
                                [% INCLUDE 'biblio-title.inc' biblio=recall.biblio %]
65
                                [% IF recall.biblio.author %] by [% recall.biblio.author %][% END %]
66
                            </td>
67
                            <td class="recall-libraries">
68
                                <ul>
69
                                    [% FOREACH library IN recall.libraries %]
70
                                        <li>[% Branches.GetName( library ) %]</li>
71
                                    [% END %]
72
                                </ul>
73
                            </td>
74
                            <td class="recall-callnumbers">
75
                                <ul>
76
                                    [% FOREACH callnumber IN recall.callnumbers %]
77
                                        <li>[% callnumber %]</li>
78
                                    [% END %]
79
                                </ul>
80
                            </td>
81
                            <td class="recall-copynumbers">
82
                                <ul>
83
                                    [% FOREACH copyno IN recall.copynumbers %]
84
                                        <li>[% copyno %]</li>
85
                                    [% END %]
86
                                </ul>
87
                            </td>
88
                            <td class="recall-enumeration">
89
                                <ul>
90
                                    [% FOREACH enumchron IN recall.enumchrons %]
91
                                        <li>[% enumchron %]</li>
92
                                    [% END %]
93
                                </ul>
94
                            </td>
95
                            <td class="recall-itemtypes">
96
                                <ul>
97
                                    [% FOREACH itemtype IN recall.itemtypes %]
98
                                        <li>[% ItemTypes.GetDescription( itemtype ) %]</li>
99
                                    [% END %]
100
                                </ul>
101
                            </td>
102
                            <td class="recall-locations">
103
                                <ul>
104
                                    [% FOREACH loc IN recall.locations %]
105
                                        <li>[% AuthorisedValues.GetByCode('LOC', loc) %]</li>
106
                                    [% END %]
107
                                </ul>
108
                            </td>
109
                            <td class="recall-date">
110
                                <span title="[% recall.first_date %]">[% recall.first_date | $KohaDates %] in [% recall.first_library.branchname %]</span>
111
                            </td>
112
                            <td class="recall-action">
113
                                <form action="/cgi-bin/koha/recalls/recalls_to_pull.pl" method="post">
114
                                    <input type="hidden" name="op" value="cancel">
115
                                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]">
116
                                    <input type="submit" value="Cancel recall">
117
                                </form>
118
                            </td>
119
                        </tr>
120
                        [% END %]
121
                    </tbody>
122
                </table>
123
                [% ELSE %]
124
                    <div class="dialog message">There are no recalls to pull.</div>
125
                [% END %]
126
            </div>
127
        [% ELSE %]
128
            <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
129
        [% END %]
130
131
        </main>
132
        </div> <!-- /.col-etc -->
133
134
        [% IF Koha.Preference('CircSidebar') %]
135
            <div class="col-sm-2 col-sm-pull-10">
136
                <aside>
137
                    [% INCLUDE 'circ-nav.inc' %]
138
                </aside>
139
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
140
        [% END %]
141
142
    </div> <!-- /.row -->
143
</div>
144
145
[% MACRO jsinclude BLOCK %]
146
    [% INCLUDE 'datatables.inc' %]
147
    [% INCLUDE 'columns_settings.inc' %]
148
    [% Asset.js("js/recalls.js") %]
149
[% END %]
150
151
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt (+183 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE Asset %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Recalls awaiting pickup</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
<style type="text/css"> p { margin-top: 0; }</style>
9
[% Asset.css("css/datatables.css") %]
10
</head>
11
<body id="circ_recalls_awaiting_pickup" class="circ">
12
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'cat-search.inc' %]
14
15
<div id="breadcrumbs">
16
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17
    &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
18
    &rsaquo; <a href="/cgi-bin/koha/recalls/recalls_waiting.pl">Recalls awaiting pickup</a>
19
</div>
20
21
<div class="main container-fluid">
22
    <div class="row">
23
        [% IF Koha.Preference('CircSidebar') %]
24
            <div class="col-sm-10 col-sm-push-2">
25
        [% ELSE %]
26
            <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
27
        [% END %]
28
        <main>
29
                <h1>Recalls awaiting pickup</h1>
30
31
                [% IF Koha.Preference('UseRecalls') %]
32
33
                <div id="results" class="toptabs">
34
35
                    <ul>
36
                        <li><a href="#recallswaiting">Recalls waiting: [% recalls.count %]</a></li>
37
                        <li><a href="#recallsover">Recalls waiting over [% Koha.Preference('RecallsMaxPickUpDelay') %] days: [% over.count %]</a></li>
38
                    </ul>
39
40
                    <div id="recallswaiting">
41
                        [% IF ( recalls.size > 0 ) %]
42
                            <table id="recallswaiting-table">
43
                                <thead><tr>
44
                                    <th class="recall-waitingdate title-string">Available since</th>
45
                                    <th class="recall-title anti-the">Title</th>
46
                                    <th class="recall-patron">Requested by</th>
47
                                    <th class="recall-library">Pickup location</th>
48
                                    <th class="recall-action nosort">&nbsp;</th>
49
                                </tr></thead>
50
                                <tbody>
51
                                    [% FOREACH recall IN recalls %]<tr>
52
                                        <td class="recall-waitingdate">[% recall.waitingdate | $KohaDates %]</td>
53
                                        <td class="recall-title">
54
                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]">
55
                                                [% recall.biblio.title %]
56
                                                [% FOREACH s IN recall.biblio.subtitles %]
57
                                                    [% s %]
58
                                                [% END %]
59
                                            </a>
60
                                            [% recall.biblio.author %]
61
                                            <br><i>Barcode: [% recall.item.barcode %]</i>
62
                                        </td>
63
                                        <td class="recall-patron">
64
                                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.patron.firstname %] [% recall.patron.surname %]</a>
65
                                             [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %]
66
                                             [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %]
67
                                        </td>
68
                                        <td class="recall-library">[% recall.library.branchname %]</td>
69
                                        <td class="recall-action actions">
70
                                            <form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
71
                                                <input type="hidden" name="recall_id" value="[% recall.recall_id %]">
72
                                                <input type="hidden" name="op" value="modify">
73
                                                <fieldset class="action">
74
                                                    <input type="submit" name="expire" class="expire_recall" value="Expire recall">
75
                                                    <input type="submit" name="revert" class="revert_recall" value="Revert waiting status">
76
                                                </fieldset>
77
                                            </form>
78
                                        </td>
79
                                    </tr>[% END %]
80
                                </tbody>
81
                            </table>
82
                        [% ELSE %]
83
                            <div class="dialog message">There are no recalls to show.</div>
84
                        [% END %]
85
                    </div> <!-- recallswaiting -->
86
87
                    <div id="recallsover">
88
                        [% IF ( over.size ) %]
89
                            [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') %] days.</p>[% END %]
90
                            <table id="recallsover-table">
91
                                <thead><tr>
92
                                    <th class="recall-waitingdate title-string">Available since</th>
93
                                    <th class="recall-title anti-the">Title</th>
94
                                    <th class="recall-patron">Requested by</th>
95
                                    <th class="recall-library">Pickup location</th>
96
                                    <th class="recall-action nosort">&nbsp;</th>
97
                                </tr></thead>
98
                                <tbody>
99
                                    [% FOREACH recall IN over %]<tr>
100
                                        <td class="recall-waitingdate">[% recall.waitingdate | $KohaDates %]</td>
101
                                        <td class="recall-title">
102
                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]">
103
                                                [% recall.biblio.title %]
104
                                                [% FOREACH s IN recall.biblio.subtitles %]
105
                                                    [% s %]
106
                                                [% END %]
107
                                                [% recall.item.enumchron %]
108
                                            </a>
109
                                            [% recall.biblio.author %]
110
                                            <br><i>Barcode: [% recall.item.barcode %]</i>
111
                                        </td>
112
                                        <td class="recall-patron">
113
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.patron.firstname %] [% recall.patron.surname %]</a>
114
                                            [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %]
115
                                            [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %]
116
                                        </td>
117
                                        <td class="recall-library">[% recall.library.branchname %]</td>
118
                                        <td class="recall-action actions">
119
                                            <form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
120
                                                <input type="hidden" name="recall_id" value="[% recall.recall_id %]">
121
                                                <input type="hidden" name="op" value="modify">
122
                                                <fieldset class="action">
123
                                                    <input type="submit" name="expire" class="expire_recall" value="Expire recall">
124
                                                    <input type="submit" name="revert" class="revert_recall" value="Revert waiting status">
125
                                                </fieldset>
126
                                            </form>
127
                                        </td>
128
                                    </tr>[% END %]
129
                                </tbody>
130
                            </table>
131
                        [% ELSE %]
132
                            <div class="dialog message">There are no recalls to show.</div>
133
                        [% END %]
134
                    </div> <!-- recallsover -->
135
136
                </div> <!-- results-->
137
138
                [% ELSE %]
139
                    <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
140
                [% END %] <!-- Koha.Preference('UseRecalls') -->
141
142
        </main>
143
        </div> <!-- /.col-etc -->
144
145
        [% IF Koha.Preference('CircSidebar') %]
146
            <div class="col-sm-2 col-sm-pull-10">
147
                <aside>
148
                    [% INCLUDE 'circ-nav.inc' %]
149
                </aside>
150
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
151
        [% END %]
152
153
    </div> <!-- /.row -->
154
</div>
155
156
[% MACRO jsinclude BLOCK %]
157
    [% INCLUDE 'datatables.inc' %]
158
    <script type="text/javascript">
159
        $(document).ready(function() {
160
            $('#results').tabs();
161
162
            $("#recallswaiting-table, #recallsover-table").dataTable($.extend(true, {}, dataTablesDefaults, {
163
                "autoWidth": false,
164
                "aoColumnDefs": [
165
                    { 'bSortable': false, 'aTargets': [ 'nosort' ] },
166
                ],
167
                "sPaginationType": "full_numbers"
168
            }));
169
170
            $(".cancel_recall").click(function(e) {
171
                e.preventDefault();
172
                return confirmDelete(_("Are you sure you want to remove this recall?"));
173
            });
174
175
            $(".expire_recall").click(function(e) {
176
                e.preventDefault();
177
                return confirmDelete(_("Are you sure you want to remove this recall?"));
178
            });
179
        });
180
    </script>
181
[% END %]
182
183
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt (+66 lines)
Line 0 Link Here
1
[% USE Asset %]
2
[% USE Koha %]
3
[% USE KohaDates %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Recalls &rsaquo; Confirm recalls</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% Asset.css("css/datatables.css") %]
9
</head>
10
<body id="recalls-request" class="catalog">
11
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'circ-search.inc' %]
13
14
<div id="breadcrumbs">
15
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
16
    <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> &rsaquo;
17
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">[% biblio.title | html %]</a> &rsaquo;
18
    Confirm recalls on [% biblio.title | html %]
19
</div>
20
21
<div class="main container-fluid">
22
<div class="row">
23
<div class="col-sm-10 col-sm-push-2">
24
<main>
25
26
    <h1>Existing recalls</h1>
27
28
    [% IF Koha.Preference('UseRecalls') %]
29
        [% IF recalls.count %]
30
            <form method="post" action="/cgi-bin/koha/recalls/request.pl">
31
                <input type="hidden" name="op" value="cancel_multiple_recalls">
32
                <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
33
                [% INCLUDE 'recalls.inc' %]
34
                <fieldset class="action">
35
                    <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
36
                </fieldset>
37
            </form>
38
        [% ELSE %]
39
            <div class="dialog message">No recalls have been made.</div>
40
        [% END %]
41
    [% ELSE %]
42
        <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
43
    [% END %]
44
45
</main>
46
</div> <!-- /.col-sm-10.col-sm-push-2 -->
47
48
<div class="col-sm-2 col-sm-pull-10">
49
    <aside>
50
        [% INCLUDE 'biblio-view-menu.inc' %]
51
    </aside>
52
</div> <!-- .col-sm-2.col-sm-pull-10 -->
53
54
</div> <!-- /.row -->
55
</div> <!-- /.main.container-fluid -->
56
57
[% MACRO jsinclude BLOCK %]
58
    [% Asset.js("js/recalls.js") %]
59
    [% INCLUDE 'datatables.inc' %]
60
    <script type="text/javascript">
61
        $(document).ready(function(){
62
            $(".old").hide();
63
        });
64
    </script>
65
[% END %]
66
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +3 lines)
Lines 296-302 Link Here
296
                    </div>
296
                    </div>
297
                [% END %]
297
                [% END %]
298
298
299
                [% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
299
                [% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %]
300
                    <div class="dialog alert">
300
                    <div class="dialog alert">
301
301
302
                        [% UNLESS ( multi_hold ) %]
302
                        [% UNLESS ( multi_hold ) %]
Lines 316-321 Link Here
316
                                    <li> <strong>No items are available</strong> to be placed on hold.</li>
316
                                    <li> <strong>No items are available</strong> to be placed on hold.</li>
317
                                [% ELSIF ( maxreserves ) %]
317
                                [% ELSIF ( maxreserves ) %]
318
                                    <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> has too many holds.</li>
318
                                    <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> has too many holds.</li>
319
                                [% ELSIF ( recall ) %]
320
                                    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a> has <strong>already placed a recall</strong> on this item.</li>
319
                                [% END # /IF exceeded_maxreserves %]
321
                                [% END # /IF exceeded_maxreserves %]
320
                            </ul>
322
                            </ul>
321
                        [% ELSE # UNLESS multi_hold %]
323
                        [% ELSE # UNLESS multi_hold %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/recalls.js (+172 lines)
Line 0 Link Here
1
$(document).ready(function() {
2
3
        $(".cancel_recall").click(function(e){
4
            if (confirmDelete(_("Are you sure you want to remove this recall?"))){
5
                var $self = $(this);
6
                var $recall_id = $(this).data('id');
7
                var $action = $(this).data('action');
8
                var ajaxData = {
9
                    'recall_id': $recall_id,
10
                    'action'   : $action,
11
                };
12
                var $howmanyparents = $(this).data('parent');
13
14
                $.ajax({
15
                    url: '/cgi-bin/koha/svc/recall',
16
                    type: 'POST',
17
                    dataType: 'json',
18
                    data: ajaxData,
19
                })
20
                .done(function(data) {
21
                    var message = "";
22
                    if(data.success == 0) {
23
                        message = _("The recall may have already been cancelled. Please refresh the page.");
24
                    } else {
25
                        message = _("Cancelled");
26
                    }
27
                    if ( $howmanyparents == "one" ){
28
                        $self.parent().html(message);
29
                    } else {
30
                        $self.parent().parent().parent().parent().html(message);
31
                    }
32
                });
33
            }
34
        });
35
36
        $(".checkin_recall").click(function(e){
37
            if (confirmDelete(_("Are you sure you want to check in this item and confirm the recall as 'waiting'?"))){
38
                var $self = $(this);
39
                var $recall_id = $(this).data('id');
40
                var $action = $(this).data('action');
41
                var ajaxData = {
42
                    'recall_id': $recall_id,
43
                    'action'   : $action,
44
                };
45
46
                $.ajax({
47
                    url: '/cgi-bin/koha/svc/recall',
48
                    type: 'POST',
49
                    dataType: 'json',
50
                    data: ajaxData,
51
                })
52
                .done(function(data) {
53
                    var message = "";
54
                    if(data.success == 0) {
55
                        message = _("The recall may have already been checked in. Please refresh the page.");
56
                    } else {
57
                        message = _("Completed");
58
                    }
59
                    $self.parent().parent().parent().parent().html(message);
60
                });
61
            }
62
        });
63
64
        $(".expire_recall").click(function(e){
65
            if (confirmDelete(_("Are you sure you want to expire this recall?"))){
66
                var $self = $(this);
67
                var $recall_id = $(this).data('id');
68
                var $action = $(this).data('action');
69
                var ajaxData = {
70
                    'recall_id': $recall_id,
71
                    'action'   : $action,
72
                };
73
74
                var $howmanyparents = $(this).data('parent');
75
76
                $.ajax({
77
                    url: '/cgi-bin/koha/svc/recall',
78
                    type: 'POST',
79
                    dataType: 'json',
80
                    data: ajaxData,
81
                })
82
                .done(function(data) {
83
                    var message = "";
84
                    if(data.success == 0) {
85
                        message = _("The recall may have already been expired. Please refresh the page.");
86
                    } else {
87
                        message = _("Expired");
88
                    }
89
                    if ( $howmanyparents == "one" ){
90
                        $self.parent().html(message);
91
                    } else {
92
                        $self.parent().parent().parent().parent().html(message);
93
                    }
94
                });
95
            }
96
        });
97
98
        $(".revert_recall").click(function(e){
99
            if (confirmDelete(_("Are you sure you want to revert the waiting status of this recall?"))){
100
                var $self = $(this);
101
                var $recall_id = $(this).data('id');
102
                var $action = $(this).data('action');
103
                var ajaxData = {
104
                    'recall_id': $recall_id,
105
                    'action'   : $action,
106
                };
107
108
                var $howmanyparents = $(this).data('parent');
109
110
                $.ajax({
111
                    url: '/cgi-bin/koha/svc/recall',
112
                    type: 'POST',
113
                    dataType: 'json',
114
                    data: ajaxData,
115
                })
116
                .done(function(data) {
117
                    var message = "";
118
                    if(data.success == 0) {
119
                        message = _("The recall waiting status may have already been reverted. Please refresh the page.");
120
                    } else {
121
                        message = _("Status updated");
122
                    }
123
                    if ( $howmanyparents == "one" ){
124
                        $self.parent().html(message);
125
                    } else {
126
                        $self.parent().parent().parent().parent().html(message);
127
                    }
128
                });
129
            }
130
        });
131
132
        $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
133
            "aoColumnDefs": [
134
                { 'bSortable': false, 'aTargets': [ 'nosort' ] },
135
                { "sType": "title-string", "aTargets" : [ "title-string" ] },
136
                { "sType": "anti-the", "aTargets": [ "anti-the" ] }
137
            ],
138
            "sPaginationType": "full_numbers"
139
        }));
140
141
        $("#cancel_selected").click(function(e){
142
            if ($("input[name='recall_ids']:checked").length > 0){
143
                return confirmDelete(_("Are you sure you want to remove the selected recall(s)?"));
144
            } else {
145
                alert(_("Please make a selection."));
146
            }
147
        });
148
149
        $("#expire_selected").click(function(e){
150
            if ($("input[name='recall_ids']:checked").length > 0){
151
                return confirmDelete(_("Are you sure you want to expire the selected recall(s)?"));
152
            } else {
153
                alert(_("Please make a selection."));
154
            }
155
        });
156
157
        $("#select_all").click(function(){
158
            if ($("#select_all").prop("checked")){
159
                $("input[name='recall_ids']").prop("checked", true);
160
            } else {
161
                $("input[name='recall_ids']").prop("checked", false);
162
            }
163
        });
164
165
        $("#hide_old").click(function(){
166
            if ($("#hide_old").prop("checked")){
167
                $(".old").show();
168
            } else {
169
                $(".old").hide();
170
            }
171
        });
172
});
(-)a/members/moremember.pl (+2 lines)
Lines 210-215 $template->param( Link Here
210
    relatives_issues_count => $relatives_issues_count,
210
    relatives_issues_count => $relatives_issues_count,
211
    relatives_borrowernumbers => \@relatives,
211
    relatives_borrowernumbers => \@relatives,
212
    logged_in_user => $logged_in_user,
212
    logged_in_user => $logged_in_user,
213
    recalls         => $patron->recalls,
214
    specific_patron => 1,
213
);
215
);
214
216
215
output_html_with_http_headers $input, $cookie, $template->output;
217
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/members/recallshistory.pl (+47 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
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
# 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 C4::Auth;
22
use C4::Output;
23
24
my $input = CGI->new;
25
my ($template, $loggedinuser, $cookie)= get_template_and_user(
26
    {
27
       template_name => "members/recallshistory.tt",
28
       query => $input,
29
       type => "intranet",
30
       authnotrequired => 0,
31
       flagsrequired => { recalls => 1 },
32
       debug => 1,
33
    }
34
);
35
36
my $borrowernumber = $input->param('borrowernumber');
37
my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber });
38
my $patron = Koha::Patrons->find( $borrowernumber );
39
40
$template->param(
41
        patron          => $patron,
42
        recalls         => $recalls,
43
        recallsview     => 1,
44
        specific_patron => 1,
45
);
46
47
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/recalls/recalls_old_queue.pl (+47 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 C4::Auth;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
24
25
my $query = new CGI;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
28
      template_name   => "recalls/recalls_old_queue.tt",
29
      query           => $query,
30
      type            => "intranet",
31
      authnotrequired => 0,
32
      flagsrequired   => { recalls => "manage_recalls" },
33
      debug           => 1,
34
    }
35
);
36
37
my $recalls = Koha::Recalls->search({ old => 1 });
38
$template->param(
39
    recalls => $recalls,
40
    viewing_old => 1
41
);
42
43
# Checking if there is a Fast Cataloging Framework
44
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
45
46
# writing the template
47
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/recalls/recalls_overdue.pl (+61 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 C4::Auth;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
24
use Koha::DateUtils;
25
26
my $query = new CGI;
27
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
28
    {
29
       template_name   => "recalls/recalls_overdue.tt",
30
       query           => $query,
31
       type            => "intranet",
32
       authnotrequired => 0,
33
       flagsrequired   => { recalls => "manage_recalls" },
34
       debug           => 1,
35
    }
36
);
37
38
my $op = $query->param('op') || 'list';
39
my @recall_ids = $query->multi_param('recall_ids');
40
41
if ( $op eq 'cancel_multiple_recalls' ) {
42
    foreach my $id ( @recall_ids ) {
43
        Koha::Recalls->find( $id )->set_cancelled;
44
    }
45
    $op = 'list'
46
}
47
48
if ( $op eq 'list' ) {
49
    my $recalls = Koha::Recalls->search({ status => 'O' });
50
    # will be set as Overdue by the misc/cronjobs/recall/overdue_recalls.pl cronjob
51
    $template->param(
52
        recalls => $recalls,
53
        checkboxes => 1,
54
    );
55
}
56
57
# Checking if there is a Fast Cataloging Framework
58
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
59
60
# writing the template
61
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/recalls/recalls_queue.pl (+57 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 C4::Auth;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
24
25
my $query = new CGI;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
28
      template_name   => "recalls/recalls_queue.tt",
29
      query           => $query,
30
      type            => "intranet",
31
      authnotrequired => 0,
32
      flagsrequired   => { recalls => 'manage_recalls' },
33
      debug           => 1,
34
    }
35
);
36
37
my $op = $query->param('op') || 'list';
38
my @recall_ids = $query->multi_param('recall_ids');
39
if ( $op eq 'cancel_multiple_recalls' ) {
40
    foreach my $id ( @recall_ids ) {
41
        Koha::Recalls->find( $id )->set_cancelled;
42
    }
43
    $op = 'list'
44
}
45
elsif ( $op eq 'list' ) {
46
    my $recalls = Koha::Recalls->search({ old => undef });
47
    $template->param(
48
        recalls => $recalls,
49
        checkboxes => 1,
50
    );
51
}
52
53
# Checking if there is a Fast Cataloging Framework
54
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
55
56
# writing the template
57
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/recalls/recalls_to_pull.pl (+95 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 C4::Auth;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
24
25
my $query = new CGI;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
28
      template_name   => "recalls/recalls_to_pull.tt",
29
      query           => $query,
30
      type            => "intranet",
31
      authnotrequired => 0,
32
      flagsrequired   => { recalls => 'manage_recalls' },
33
      debug           => 1,
34
    }
35
);
36
37
my $op = $query->param('op') || 'list';
38
my $recall_id = $query->param('recall_id');
39
if ( $op eq 'cancel' ) {
40
    Koha::Recalls->find( $recall_id )->set_cancelled;
41
    $op = 'list';
42
}
43
elsif ( $op eq 'list' ) {
44
    my @recalls = Koha::Recalls->search({ status => [ 'R','O' ] });
45
    my @pull_list;
46
    foreach my $recall ( @recalls ) {
47
        my @items = Koha::Items->search({ biblionumber => $recall->biblionumber });
48
        my $distinct_recalls = Koha::Recalls->search({ biblionumber => $recall->biblionumber, status => [ 'R','O' ] }, { columns => [ 'borrowernumber' ], distinct => 1, order_by => { -asc => 'recalldate' } });
49
        my $recalls_count = $distinct_recalls->count;
50
        my $first_recall = $distinct_recalls->next;
51
        my $items_count;
52
        my @callnumbers;
53
        my @copynumbers;
54
        my @enumchrons;
55
        my @itemtypes;
56
        my @locations;
57
        my @libraries;
58
        foreach my $item ( @items ) {
59
            if ( $item->can_be_waiting_recall ) {
60
                $items_count++;
61
                push( @callnumbers, $item->itemcallnumber );
62
                push( @copynumbers, $item->copynumber );
63
                push( @enumchrons, $item->enumchron );
64
                push( @itemtypes, $item->effective_itemtype );
65
                push( @locations, $item->location );
66
                push( @libraries, $item->holdingbranch );
67
            }
68
        }
69
        push( @pull_list, {
70
            recall => $recall,
71
            biblio => $recall->biblio,
72
            items_count => $items_count,
73
            recalls_count => $recalls_count,
74
            pull_count => $items_count <= $recalls_count ? $items_count : $recalls_count,
75
            first_patron => $first_recall->patron,
76
            first_date => $first_recall->recalldate,
77
            first_library => $first_recall->library,
78
            callnumbers => @callnumbers,
79
            copynumbers => @copynumbers,
80
            enumchrons => @enumchrons,
81
            itemtypes => @itemtypes,
82
            locations => @locations,
83
            libraries => @libraries,
84
        });
85
    }
86
    $template->param(
87
        recalls => \@pull_list,
88
    );
89
}
90
91
# Checking if there is a Fast Cataloging Framework
92
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
93
94
# writing the template
95
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/recalls/recalls_waiting.pl (+76 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 C4::Auth;
22
use C4::Output;
23
use Koha::Recalls;
24
use Koha::BiblioFrameworks;
25
use Koha::DateUtils;
26
use Koha::Patrons;
27
28
my $query = new CGI;
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
30
    {
31
        template_name   => "recalls/recalls_waiting.tt",
32
        query           => $query,
33
        type            => "intranet",
34
        authnotrequired => 0,
35
        flagsrequired   => { recalls => "manage_recalls" },
36
        debug           => 1,
37
    }
38
);
39
40
my $op = $query->param('op') || 'list';
41
42
if ( $op eq 'modify' ) {
43
    my $expire = $query->param('expire');
44
    my $revert = $query->param('revert');
45
    my $recall_id = $query->param('recall_id');
46
    if ( $expire ) {
47
        Koha::Recalls->find( $recall_id )->set_expired({ interface => 'INTRANET' });
48
    } elsif ( $revert ) {
49
        Koha::Recalls->find( $recall_id )->revert_waiting;
50
    }
51
    $op = 'list';
52
}
53
54
elsif ( $op eq 'list' ) {
55
    my @recalls = Koha::Recalls->search({ status => 'W' });
56
    my $borrower = Koha::Patrons->find( $loggedinuser );
57
    my @over;
58
    my $maxdelay = C4::Context->preference('RecallsMaxPickUpDelay') || 7;
59
    my $today = dt_from_string();
60
    foreach my $r ( @recalls ){
61
        my $lastwaitingday = dt_from_string( $r->waitingdate )->add( days => $maxdelay );
62
        if ( $today > $lastwaitingday ){
63
            push @over, $r;
64
        }
65
    }
66
    $template->param(
67
        recalls => \@recalls,
68
        over => \@over,
69
    );
70
}
71
72
# Checking if there is a Fast Cataloging Framework
73
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
74
75
# writing the template
76
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/recalls/request.pl (+63 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 C4::Auth;
22
use C4::Output;
23
use C4::Search;
24
use Koha::Recalls;
25
use Koha::Biblios;
26
27
my $input = CGI->new;
28
my ($template, $loggedinuser, $cookie)= get_template_and_user(
29
    {
30
       template_name => "recalls/request.tt",
31
       query => $input,
32
       type => "intranet",
33
       authnotrequired => 0,
34
       flagsrequired => { recalls => "manage_recalls" },
35
       debug => 1,
36
    }
37
);
38
39
my $op = $input->param('op') || 'list';
40
my @recall_ids = $input->multi_param('recall_ids');
41
my $biblionumber = $input->param('biblionumber');
42
my $recalls = Koha::Recalls->search({ biblionumber => $biblionumber, old => undef });
43
my $biblio = Koha::Biblios->find( $biblionumber );
44
45
if ( $op eq 'cancel_multiple_recalls' ) {
46
    foreach my $id ( @recall_ids ) {
47
        Koha::Recalls->find( $id )->set_cancelled;
48
    }
49
    $op = 'list'
50
} else {
51
    $recalls = Koha::Recalls->search({ biblionumber => $biblionumber, old => undef });
52
    $biblio = Koha::Biblios->find( $biblionumber );
53
}
54
55
$template->param(
56
    recalls     => $recalls,
57
    recallsview => 1,
58
    biblio      => $biblio,
59
    checkboxes  => 1,
60
    C4::Search::enabled_staff_search_views,
61
);
62
63
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/reserve/request.pl (+4 lines)
Lines 314-319 foreach my $biblionumber (@biblionumbers) { Link Here
314
                $template->param( $canReserve->{status} => 1 );
314
                $template->param( $canReserve->{status} => 1 );
315
                $biblioloopiter{ $canReserve->{status} } = 1;
315
                $biblioloopiter{ $canReserve->{status} } = 1;
316
            }
316
            }
317
            elsif ( $canReserve->{status} eq 'recall' ) {
318
                $template->param( $canReserve->status} } = 1 );
319
                $biblioloopiter{ $canReserve->{status} } = 1;
320
            }
317
            else {
321
            else {
318
                $biblioloopiter{ $canReserve->{status} } = 1;
322
                $biblioloopiter{ $canReserve->{status} } = 1;
319
            }
323
            }
(-)a/svc/recall (+96 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
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use CGI;
23
use JSON qw(encode_json);
24
25
use C4::Context;
26
use C4::Auth qw(check_cookie_auth);
27
use C4::Output qw(output_with_http_headers);
28
use C4::Circulation qw(AddReturn);
29
use Koha::Recalls;
30
31
my $input = new CGI;
32
33
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { recall => 'manage_recalls' } );
34
35
if ( $auth_status ne "ok" ) {
36
    print $input->header(-type => 'text/plain', -status => '403 Forbidden');
37
    exit 0;
38
}
39
40
my $recall_id = $input->param('recall_id');
41
my $recall = Koha::Recalls->find( $recall_id );
42
unless ( $recall ) {
43
    my $json = encode_json({ success => 0 });
44
    output_with_http_headers( $input, undef, $json, "json" );
45
    exit;
46
}
47
48
my $op = $input->param('action');
49
50
if ( $op eq 'cancel' ) {
51
    # cancel recall
52
    $recall->set_cancelled;
53
} elsif ( $op eq 'checkin' ) {
54
    # check in recall and set to waiting
55
    my $branch = $input->param('branchcode');
56
    my $item;
57
    if ( $recall->item_level_recall ) {
58
        $item = $recall->item;
59
    } elsif ( $recall->checkout ) {
60
        # biblio-level recall with a relevant item that is still checked out to another borrower
61
       $item = $recall->checkout->item;
62
    } else {
63
        # biblio-level recall with no items checked out, so take the first available and recallable item
64
        my @items = Koha::Items->search({ biblionumber => $recall->biblionumber });
65
        foreach ( @items ) {
66
            if ( $_->can_be_waiting_recall ){
67
                $item = $_;
68
                last;
69
            }
70
        }
71
    }
72
73
    my $barcode = $item->barcode;
74
75
    my ( $result, $messages ) = AddReturn( $barcode, $branch );
76
77
    foreach my $code ( %$messages ) {
78
        if ( $code eq 'RecallFound' ) {
79
            my $expirationdate = $recall->calc_expirationdate;
80
            if ( $recall->item_level_recall ) {
81
                $recall->set_waiting({ expirationdate => $expirationdate });
82
            } else {
83
                $recall->set_waiting({ expirationdate => $expirationdate, item => $item });
84
            }
85
        }
86
    }
87
} elsif ( $op eq 'expire' ) {
88
    # expire recall
89
    $recall->set_expired({ interface => 'INTRANET' });
90
} elsif ( $op eq 'revert' ) {
91
    # revert recall waiting status
92
    $recall->revert_waiting;
93
}
94
95
my $json = encode_json({ success => 1 });
96
output_with_http_headers( $input, undef, $json, "json" );
(-)a/tools/letter.pl (-2 / +1 lines)
Lines 248-254 sub add_form { Link Here
248
            {value => 'items.fine',    text => 'items.fine'},
248
            {value => 'items.fine',    text => 'items.fine'},
249
            add_fields('borrowers');
249
            add_fields('borrowers');
250
        if ($module eq 'circulation') {
250
        if ($module eq 'circulation') {
251
            push @{$field_selection}, add_fields('opac_news');
251
            push @{$field_selection}, add_fields('opac_news', 'recalls');
252
252
253
        }
253
        }
254
254
255
- 

Return to bug 19532