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

(-)a/admin/columns_settings.yml (-1 / +3 lines)
Lines 1955-1960 modules: Link Here
1955
              columnname: suspend
1955
              columnname: suspend
1956
            -
1956
            -
1957
              columnname: print_slip
1957
              columnname: print_slip
1958
            -
1959
              columnname: convert_to_recall
1958
1960
1959
    holdsratios:
1961
    holdsratios:
1960
      holds-ratios:
1962
      holds-ratios:
Lines 2545-2548 modules: Link Here
2545
            -
2547
            -
2546
              columnname: actions
2548
              columnname: actions
2547
              cannot_be_toggled: 1
2549
              cannot_be_toggled: 1
2548
              cannot_be_modified: 1
2550
              cannot_be_modified: 1
(-)a/installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl (-1 / +3 lines)
Lines 2-8 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number  => "31391",
4
    bug_number  => "31391",
5
    description => "Add new RECALLED value to HOLD_CANCELLATION authorised value category",
5
    description => "Staff-side recalls",
6
    up          => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
Lines 10-14 return { Link Here
10
        $dbh->do(
10
        $dbh->do(
11
            q{ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','RECALLED','Hold was converted to a recall') }
11
            q{ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','RECALLED','Hold was converted to a recall') }
12
        );
12
        );
13
14
        say $out "Added RECALLED value to HOLD_CANCELLATION authorised value category";
13
    },
15
    },
14
};
16
};
(-)a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl (-1 / +3 lines)
Lines 2-8 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number  => "31391",
4
    bug_number  => "31391",
5
    description => "Add new system preference RecallsInterface",
5
    description => "Staff-side recalls",
6
    up          => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
Lines 10-14 return { Link Here
10
        $dbh->do(
10
        $dbh->do(
11
            q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice') }
11
            q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice') }
12
        );
12
        );
13
14
        say $out "Added system preference 'RecallsInterface'";
13
    },
15
    },
14
};
16
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (+6 lines)
Lines 25-30 Link Here
25
            <th id="delete" data-colname="delete">Delete</th>
25
            <th id="delete" data-colname="delete">Delete</th>
26
            <th id="suspend" data-colname="suspend">Suspend</th>
26
            <th id="suspend" data-colname="suspend">Suspend</th>
27
            <th id="print_slip" data-colname="print_slip">Print hold/transfer slip</th>
27
            <th id="print_slip" data-colname="print_slip">Print hold/transfer slip</th>
28
            <th id="convert_to_recall" data-colname="convert_to_recall">Convert hold to recall</th>
28
        </tr>
29
        </tr>
29
    </thead>
30
    </thead>
30
    [%- SET first_priority = 0 -%]
31
    [%- SET first_priority = 0 -%]
Lines 365-370 Link Here
365
                [% ELSE %]
366
                [% ELSE %]
366
                    <td></td>
367
                    <td></td>
367
                [% END %]
368
                [% END %]
369
                <td>
370
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
371
                        <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
372
                    [% END %]
373
                </td>
368
            </tr>
374
            </tr>
369
        [% END %]
375
        [% END %]
370
    </tbody>
376
    </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-10 / +10 lines)
Lines 1474-1479 Circulation: Link Here
1474
                  1: Use
1474
                  1: Use
1475
                  0: "Don't use"
1475
                  0: "Don't use"
1476
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1476
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1477
        -
1478
            - Recalls can be placed through
1479
            - pref: RecallsInterface
1480
              default: opac
1481
              choices:
1482
                  opac: the OPAC only
1483
                  staff: the staff interface only
1484
                  both: both the OPAC and the staff interface
1485
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1477
1486
1478
    SIP2:
1487
    SIP2:
1479
        -
1488
        -
Lines 1515-1527 Circulation: Link Here
1515
              choices:
1524
              choices:
1516
                  1: Enable
1525
                  1: Enable
1517
                  0: Disable
1526
                  0: Disable
1518
            - "the curbside pickup module."
1527
            - "the curbside pickup module."
1519
        -
1520
            - Recalls can be placed through
1521
            - pref: RecallsInterface
1522
              default: opac
1523
              choices:
1524
                  opac: the OPAC only
1525
                  staff: the staff interface only
1526
                  both: both the OPAC and the staff interface
1527
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt (-23 / +32 lines)
Lines 52-57 Link Here
52
            <div class="dialog alert"> Unable to place a recall. Check your circulation rules. </div>
52
            <div class="dialog alert"> Unable to place a recall. Check your circulation rules. </div>
53
        [% END %]
53
        [% END %]
54
54
55
        [% IF patron_holds_count %]
56
            <div class="dialog alert alert-info"> Patron has placed one or more record-level holds. <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | html %]">Convert a hold to a recall</a>. </div>
57
        [% END %]
58
55
        <fieldset class="rows">
59
        <fieldset class="rows">
56
            <legend>Recall details</legend>
60
            <legend>Recall details</legend>
57
            <form id="recallform" action="/cgi-bin/koha/recalls/request.pl" method="post">
61
            <form id="recallform" action="/cgi-bin/koha/recalls/request.pl" method="post">
Lines 103-109 Link Here
103
                            <th>Barcode</th>
107
                            <th>Barcode</th>
104
                            [% UNLESS ( single_branch_mode ) %]
108
                            [% UNLESS ( single_branch_mode ) %]
105
                                <th>Home library</th>
109
                                <th>Home library</th>
106
                                <th>Last location</th>
110
                                <th>Holding library</th>
107
                            [% END %]
111
                            [% END %]
108
                            <th>Collection</th>
112
                            <th>Collection</th>
109
                            <th>Call number</th>
113
                            <th>Call number</th>
Lines 144-150 Link Here
144
                                        >
148
                                        >
145
                                    [% END %]
149
                                    [% END %]
146
                                    [% IF ( item.itemlost || item.withdrawn ) %]
150
                                    [% IF ( item.itemlost || item.withdrawn ) %]
147
                                        <span class="lost">Unavailable (lost or missing)</span>
151
                                        <span class="lost">Unavailable (lost or withdrawn)</span>
148
                                    [% END %]
152
                                    [% END %]
149
                                    [% IF ( item.notforloan ) %]
153
                                    [% IF ( item.notforloan ) %]
150
                                        <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
154
                                        <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
Lines 161-167 Link Here
161
                                    [% ELSIF ( hold.waitingdate ) %]
165
                                    [% ELSIF ( hold.waitingdate ) %]
162
                                        <span class="waiting"> Waiting for patron at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %]. </span>
166
                                        <span class="waiting"> Waiting for patron at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %]. </span>
163
                                    [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
167
                                    [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
164
                                        <span class="waiting"> Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">reserve</a> on this item. </span>
168
                                        <span class="waiting"> Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">hold</a> on this item. </span>
165
                                    [% END # / IF ( item.recall or hold ) %]
169
                                    [% END # / IF ( item.recall or hold ) %]
166
                                </td>
170
                                </td>
167
                            </tr>
171
                            </tr>
Lines 204-232 Link Here
204
            </fieldset>
208
            </fieldset>
205
        [% END %]
209
        [% END %]
206
210
207
        <h2>Existing recalls</h2>
211
        <div class="page-section">
212
            <h2>Existing recalls</h2>
208
213
209
        [% IF Koha.Preference('UseRecalls') %]
214
            [% IF Koha.Preference('UseRecalls') %]
210
            [% IF recalls.count %]
215
                [% IF recalls.count %]
211
                <div class="page-section">
216
                    <div class="page-section">
212
                    <form method="post" action="/cgi-bin/koha/recalls/request.pl">
217
                        <form method="post" action="/cgi-bin/koha/recalls/request.pl">
213
                        [% INCLUDE 'csrf-token.inc' %]
218
                            [% INCLUDE 'csrf-token.inc' %]
214
                        <input type="hidden" name="op" value="cud-cancel_multiple_recalls" />
219
                            <input type="hidden" name="op" value="cud-cancel_multiple_recalls" />
215
                        <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />
220
                            <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />
216
                        <input type="checkbox" id="select_all" /> <span id="select_all_text">Select all</span>
221
                            <input type="checkbox" id="select_all" /> <span id="select_all_text">Select all</span>
217
                        [% INCLUDE 'recalls.inc' %]
222
                            [% INCLUDE 'recalls.inc' %]
218
                        <fieldset class="action">
223
                            <fieldset class="action">
219
                            <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
224
                                <button type="submit" id="cancel_selected" class="btn btn-primary btn-sm">Cancel selected recalls</button>
220
                        </fieldset>
225
                            </fieldset>
221
                    </form>
226
                        </form>
222
                </div>
227
                    </div>
223
                <!-- /.page-section -->
228
                    <!-- /.page-section -->
229
                [% ELSE %]
230
                    <div class="alert alert-info">No recalls have been made.</div>
231
                [% END %]
224
            [% ELSE %]
232
            [% ELSE %]
225
                <div class="alert alert-info">No recalls have been made.</div>
233
                <div class="alert alert-info">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>
226
            [% END %]
234
            [% END %]
227
        [% ELSE %]
235
        </div>
228
            <div class="alert alert-info">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>
229
        [% END %]
230
    [% END %]
236
    [% END %]
231
[% END %]
237
[% END %]
232
238
Lines 235-244 Link Here
235
    [% INCLUDE 'datatables.inc' %]
241
    [% INCLUDE 'datatables.inc' %]
236
    [% INCLUDE 'columns_settings.inc' %]
242
    [% INCLUDE 'columns_settings.inc' %]
237
    [% INCLUDE 'calendar.inc' %]
243
    [% INCLUDE 'calendar.inc' %]
244
    [% INCLUDE 'select2.inc' %]
238
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
245
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
239
    [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/recalls/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/recalls/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %]
246
    [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/recalls/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/recalls/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %]
240
    <script>
247
    <script>
241
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
248
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
249
        $.fn.select2.defaults.set("width", "100%" );
250
        $.fn.select2.defaults.set("dropdownAutoWidth", true );
242
        $(document).ready(function(){
251
        $(document).ready(function(){
243
            $("#recalls_patronsearch").on("submit", filter);
252
            $("#recalls_patronsearch").on("submit", filter);
244
            [% UNLESS patron %]
253
            [% UNLESS patron %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +5 lines)
Lines 255-261 Link Here
255
        [% IF ( recallerror ) %]
255
        [% IF ( recallerror ) %]
256
            <div class="dialog alert">
256
            <div class="dialog alert">
257
                <h3>Hold cannot be converted to a recall</h3>
257
                <h3>Hold cannot be converted to a recall</h3>
258
                <p>A recall cannot be placed on one or more holds. Check your <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a>.</p>
258
                <p>A recall cannot be placed for one or more holds. Check your <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a>.</p>
259
            </div>
259
            </div>
260
        [% END %]
260
        [% END %]
261
261
Lines 1961-1966 Link Here
1961
            window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1961
            window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1962
            return false;
1962
            return false;
1963
        });
1963
        });
1964
        $(".convert-to-recall").click(function () {
1965
            var reserve_id = $(this).attr("data-id");
1966
            $("select[class='rank-request'][data-hold-id='" + reserve_id + "']").val("recall");
1967
        });
1964
    </script>
1968
    </script>
1965
[% END %]
1969
[% END %]
1966
1970
(-)a/recalls/request.pl (-1 / +4 lines)
Lines 138-146 if ($borrowernumber) { Link Here
138
        if ( !$biblio->can_be_recalled( { patron => $patron } ) ) {
138
        if ( !$biblio->can_be_recalled( { patron => $patron } ) ) {
139
            $error = 1;
139
            $error = 1;
140
        }
140
        }
141
        my $patron_holds_count = Koha::Holds->search(
142
            { borrowernumber => $borrowernumber, biblionumber => $biblio->biblionumber, item_level_hold => 0 } )->count;
141
143
142
        $template->param(
144
        $template->param(
143
            patron => $patron,
145
            patron             => $patron,
146
            patron_holds_count => $patron_holds_count,
144
        );
147
        );
145
    }
148
    }
146
}
149
}
(-)a/t/db_dependent/Holds.t (-1 / +14 lines)
Lines 2125-2130 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
2125
            surname      => 'whatever surname',
2125
            surname      => 'whatever surname',
2126
            categorycode => $category->{categorycode},
2126
            categorycode => $category->{categorycode},
2127
            branchcode   => $branch,
2127
            branchcode   => $branch,
2128
            email        => 'name@email.com',
2128
        }
2129
        }
2129
    )->store;
2130
    )->store;
2130
    my $borrowernumber = $patron->borrowernumber;
2131
    my $borrowernumber = $patron->borrowernumber;
Lines 2135-2140 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
2135
            surname      => 'whatever surname',
2136
            surname      => 'whatever surname',
2136
            categorycode => $category->{categorycode},
2137
            categorycode => $category->{categorycode},
2137
            branchcode   => $branch,
2138
            branchcode   => $branch,
2139
            email        => 'name2@email.com',
2138
        }
2140
        }
2139
    )->store;
2141
    )->store;
2140
2142
Lines 2156-2161 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
2156
        }
2158
        }
2157
    );
2159
    );
2158
2160
2161
    my $notice = Koha::Notice::Template->new(
2162
        {
2163
            name                   => 'Hold cancellation',
2164
            module                 => 'reserves',
2165
            code                   => 'HOLD_CANCELLATION',
2166
            title                  => 'Hold cancelled',
2167
            content                => 'Your hold was cancelled.',
2168
            message_transport_type => 'email',
2169
            branchcode             => q{},
2170
        }
2171
    )->store();
2172
2159
    my $reserve_id = AddReserve(
2173
    my $reserve_id = AddReserve(
2160
        {
2174
        {
2161
            branchcode     => $branch,
2175
            branchcode     => $branch,
2162
- 

Return to bug 31391