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

(-)a/circ/circulation.pl (+2 lines)
Lines 453-461 if (@$barcodes) { Link Here
453
if ($patron) {
453
if ($patron) {
454
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
454
    my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds
455
    my $waiting_holds = $holds->waiting;
455
    my $waiting_holds = $holds->waiting;
456
    my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, old => undef });
456
    $template->param(
457
    $template->param(
457
        holds_count  => $holds->count(),
458
        holds_count  => $holds->count(),
458
        WaitingHolds => $waiting_holds,
459
        WaitingHolds => $waiting_holds,
460
        recalls => $recalls,
459
    );
461
    );
460
}
462
}
461
463
(-)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 (+114 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
                <th class="recall-date psort">Placed on</th>
9
                <th class="recall-expiry">Expires on</th>
10
                <th class="recall-branch">Pickup location</th>
11
                <th class="recall-status">Status</th>
12
                <th class="recall-duedate">Due date</th>
13
                [% UNLESS viewing_old %]<th class="recall-actions nosort">&nbsp;</th>[% END %]
14
            </tr>
15
        </thead>
16
17
        <tbody>
18
            [% FOREACH recall IN recalls %]
19
                [% IF recall.old %]<tr class="old">[% ELSE %]<tr>[% END %]
20
                    [% IF checkboxes %]
21
                        <td class="recall-checkbox">
22
                            [% IF recall.old %]
23
                                &nbsp;
24
                            [% ELSE %]
25
                                <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids">
26
                            [% END %]
27
                        </td>
28
                    [% END %]
29
                    <td class="recall-title">
30
                        <b><a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]">
31
                            [% recall.biblio.title %]
32
                            [% FOREACH s IN recall.biblio.subtitle %]
33
                                [% s %]
34
                            [% END %]
35
                        </a></b>
36
                        [% IF recall.item %][% recall.item.barcode %][% END %]
37
                        [% recall.biblio.author %]
38
                    </td>
39
40
                    <td class="recall-date">
41
                        [% recall.recalldate | $KohaDates %]
42
                    </td>
43
44
                    <td class="recall-expiry">
45
                        [% IF ( recall.expirationdate ) %]
46
                            [% recall.expirationdate | $KohaDates %]
47
                        [% ELSIF ( !recall.old ) %]
48
                            Never expires
49
                        [% ELSE %]
50
                            -
51
                        [% END %]
52
                    </td>
53
54
                    <td class="recall-branch">
55
                        [% recall.library.branchname %]
56
                    </td>
57
58
                    <td class="recall-status">
59
                        [% IF ( recall.in_transit ) %]
60
                            In transit to [% recall.library.branchname %]
61
                        [% ELSIF ( recall.waiting ) %]
62
                            Ready for pickup
63
                        [% ELSIF ( recall.expired ) %]
64
                            Expired on [% recall.expirationdate | $KohaDates %]
65
                        [% ELSIF ( recall.cancelled ) %]
66
                            Cancelled on [% recall.cancellationdate | $KohaDates %]
67
                        [% ELSIF ( recall.overdue ) %]
68
                            Overdue to be returned
69
                        [% ELSIF ( recall.finished ) %]
70
                            Fulfilled
71
                        [% ELSE %]
72
                            Requested
73
                        [% END %]
74
                    </td>
75
76
                    <td class="recall-duedate">
77
                        [% IF recall.requested %]
78
                            Due to be returned by [% recall.checkout.date_due | $KohaDates %]
79
                        [% ELSIF recall.waiting and RECALL.expirationdate %]
80
                            Pick up by [% RECALL.expirationdate | $KohaDates %]
81
                        [% ELSE %]
82
                            -
83
                        [% END %]
84
                    </td>
85
86
                    [% UNLESS viewing_old %]
87
                    <td class="recall-cancel actions">
88
                        <div class="btn-group">
89
                            <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown" href="#"> Actions <span class="caret"></span></a>
90
                            <ul class="dropdown-menu">
91
                                [% IF ( recall.requested or recall.overdue ) %]
92
                                    <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>
93
                                    <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>
94
                                [% ELSIF ( recall.waiting ) %]
95
                                    <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>
96
                                    <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>
97
                                [% END %]
98
                            </ul>
99
                        </div>
100
                    </td>
101
                    [% END %]
102
103
                </tr>
104
            [% END %]
105
        </tbody>
106
    </table>
107
    [% ELSE %]
108
        [% IF patron.borrowernumber %]
109
            Patron has no current recalls.
110
        [% ELSE %]
111
            There are no recalls to show.
112
        [% END %]
113
    [% END %]
114
</div>
(-)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 (+15 lines)
Lines 900-905 Link Here
900
                                    </a>
900
                                    </a>
901
                                </li>
901
                                </li>
902
                            [% END %]
902
                            [% END %]
903
904
                            [% IF Koha.Preference('UseRecalls') %]
905
                                <li>
906
                                    <a href="#recalls" id="recalls-tab">
907
                                        [% recalls.count %] Recalls
908
                                    </a>
909
                                </li>
910
                            [% END %]
903
                        </ul>
911
                        </ul>
904
912
905
                        <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
913
                        <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
Lines 914-919 Link Here
914
                            </div> <!-- /#clubs-tab -->
922
                            </div> <!-- /#clubs-tab -->
915
                        [% END %]
923
                        [% END %]
916
924
925
                        [% IF Koha.Preference('UseRecalls') %]
926
                            <div id="recalls">
927
                                [% INCLUDE 'recalls.inc' %]
928
                            </div>
929
                        [% END %]
930
917
                        [% INCLUDE borrower_debarments.inc %]
931
                        [% INCLUDE borrower_debarments.inc %]
918
932
919
                        <div id="reserves">
933
                        <div id="reserves">
Lines 1154-1159 Link Here
1154
    </script>
1168
    </script>
1155
    [% INCLUDE 'str/members-menu.inc' %]
1169
    [% INCLUDE 'str/members-menu.inc' %]
1156
    [% Asset.js("js/members-menu.js") | $raw %]
1170
    [% Asset.js("js/members-menu.js") | $raw %]
1171
    [% Asset.js("js/recalls.js") %]
1157
[% END %]
1172
[% END %]
1158
1173
1159
[% INCLUDE 'intranet-bottom.inc' %]
1174
[% INCLUDE 'intranet-bottom.inc' %]
(-)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
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/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_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
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/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">No recalls have been made.</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
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/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 string-sort">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 string-sort">Available item types</th>
50
                            <th class="recall-locations string-sort">Available locations</th>
51
                            <th class="recall-date title-string">Earlier recall date</th>
52
                            <th class="recall-action">&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/js/recalls.js (+136 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
        $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
99
            "aoColumnDefs": [
100
                { "aTargets": [ 'nosort' ], "bSortable": false, "bSearchable": false },
101
            ],
102
            "sPaginationType": "full_numbers"
103
        }));
104
105
        $("#cancel_selected").click(function(e){
106
            if ($("input[name='recall_ids']:checked").length > 0){
107
                return confirmDelete(_("Are you sure you want to remove the selected recall(s)?"));
108
            } else {
109
                alert(_("Please make a selection."));
110
            }
111
        });
112
113
        $("#expire_selected").click(function(e){
114
            if ($("input[name='recall_ids']:checked").length > 0){
115
                return confirmDelete(_("Are you sure you want to expire the selected recall(s)?"));
116
            } else {
117
                alert(_("Please make a selection."));
118
            }
119
        });
120
121
        $("#select_all").click(function(){
122
            if ($("#select_all").prop("checked")){
123
                $("input[name='recall_ids']").prop("checked", true);
124
            } else {
125
                $("input[name='recall_ids']").prop("checked", false);
126
            }
127
        });
128
129
        $("#hide_old").click(function(){
130
            if ($("#hide_old").prop("checked")){
131
                $(".old").show();
132
            } else {
133
                $(".old").hide();
134
            }
135
        });
136
});
(-)a/members/recallshistory.pl (+46 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
);
45
46
output_html_with_http_headers $input, $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
        $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/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