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

(-)a/admin/columns_settings.yml (+2 lines)
Lines 2164-2169 modules: Link Here
2164
              columnname: suspend
2164
              columnname: suspend
2165
            -
2165
            -
2166
              columnname: print_slip
2166
              columnname: print_slip
2167
            -
2168
              columnname: convert_to_recall
2167
2169
2168
      modified_holds:
2170
      modified_holds:
2169
        default_display_length: 20
2171
        default_display_length: 20
(-)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 22-27 Link Here
22
            <th id="delete" data-colname="delete">Delete</th>
22
            <th id="delete" data-colname="delete">Delete</th>
23
            <th id="suspend" data-colname="suspend">Suspend</th>
23
            <th id="suspend" data-colname="suspend">Suspend</th>
24
            <th id="print_slip" data-colname="print_slip">Print hold/transfer slip</th>
24
            <th id="print_slip" data-colname="print_slip">Print hold/transfer slip</th>
25
            <th id="convert_to_recall" data-colname="convert_to_recall">Convert hold to recall</th>
25
        </tr>
26
        </tr>
26
    </thead>
27
    </thead>
27
    [%- SET first_priority = 0 -%]
28
    [%- SET first_priority = 0 -%]
Lines 380-385 Link Here
380
                [% ELSE %]
381
                [% ELSE %]
381
                    <td></td>
382
                    <td></td>
382
                [% END %]
383
                [% END %]
384
                <td>
385
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
386
                        <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
387
                    [% END %]
388
                </td>
383
            </tr>
389
            </tr>
384
        [% END %]
390
        [% END %]
385
    </tbody>
391
    </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-9 / +10 lines)
Lines 1500-1505 Circulation: Link Here
1500
                  1: Use
1500
                  1: Use
1501
                  0: "Don't use"
1501
                  0: "Don't use"
1502
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1502
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1503
        -
1504
            - Recalls can be placed through
1505
            - pref: RecallsInterface
1506
              default: opac
1507
              choices:
1508
                  opac: the OPAC only
1509
                  staff: the staff interface only
1510
                  both: both the OPAC and the staff interface
1511
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1503
1512
1504
    SIP2:
1513
    SIP2:
1505
        -
1514
        -
Lines 1550-1561 Circulation: Link Here
1550
                  1: Enable
1559
                  1: Enable
1551
                  0: Disable
1560
                  0: Disable
1552
            - "the booking module."
1561
            - "the booking module."
1553
        -
1562
1554
            - Recalls can be placed through
1555
            - pref: RecallsInterface
1556
              default: opac
1557
              choices:
1558
                  opac: the OPAC only
1559
                  staff: the staff interface only
1560
                  both: both the OPAC and the staff interface
1561
            - . (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 234-243 Link Here
234
    [% Asset.js("js/recalls.js") | $raw %]
240
    [% Asset.js("js/recalls.js") | $raw %]
235
    [% INCLUDE 'datatables.inc' %]
241
    [% INCLUDE 'datatables.inc' %]
236
    [% INCLUDE 'calendar.inc' %]
242
    [% INCLUDE 'calendar.inc' %]
243
    [% INCLUDE 'select2.inc' %]
237
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
244
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
238
    [% 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' %]
245
    [% 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' %]
239
    <script>
246
    <script>
240
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
247
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
248
        $.fn.select2.defaults.set("width", "100%" );
249
        $.fn.select2.defaults.set("dropdownAutoWidth", true );
241
        $(document).ready(function(){
250
        $(document).ready(function(){
242
            $("#recalls_patronsearch").on("submit", filter);
251
            $("#recalls_patronsearch").on("submit", filter);
243
            [% UNLESS patron %]
252
            [% UNLESS patron %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +5 lines)
Lines 319-325 Link Here
319
        [% IF ( recallerror ) %]
319
        [% IF ( recallerror ) %]
320
            <div class="dialog alert">
320
            <div class="dialog alert">
321
                <h3>Hold cannot be converted to a recall</h3>
321
                <h3>Hold cannot be converted to a recall</h3>
322
                <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>
322
                <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>
323
            </div>
323
            </div>
324
        [% END %]
324
        [% END %]
325
325
Lines 2067-2072 Link Here
2067
            window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
2067
            window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
2068
            return false;
2068
            return false;
2069
        });
2069
        });
2070
        $(".convert-to-recall").click(function () {
2071
            var reserve_id = $(this).attr("data-id");
2072
            $("select[class='rank-request'][data-hold-id='" + reserve_id + "']").val("recall");
2073
        });
2070
    </script>
2074
    </script>
2071
[% END %]
2075
[% END %]
2072
2076
(-)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 2162-2167 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
2162
            surname      => 'whatever surname',
2162
            surname      => 'whatever surname',
2163
            categorycode => $category->{categorycode},
2163
            categorycode => $category->{categorycode},
2164
            branchcode   => $branch,
2164
            branchcode   => $branch,
2165
            email        => 'name@email.com',
2165
        }
2166
        }
2166
    )->store;
2167
    )->store;
2167
    my $borrowernumber = $patron->borrowernumber;
2168
    my $borrowernumber = $patron->borrowernumber;
Lines 2172-2177 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
2172
            surname      => 'whatever surname',
2173
            surname      => 'whatever surname',
2173
            categorycode => $category->{categorycode},
2174
            categorycode => $category->{categorycode},
2174
            branchcode   => $branch,
2175
            branchcode   => $branch,
2176
            email        => 'name2@email.com',
2175
        }
2177
        }
2176
    )->store;
2178
    )->store;
2177
2179
Lines 2193-2198 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
2193
        }
2195
        }
2194
    );
2196
    );
2195
2197
2198
    my $notice = Koha::Notice::Template->new(
2199
        {
2200
            name                   => 'Hold cancellation',
2201
            module                 => 'reserves',
2202
            code                   => 'HOLD_CANCELLATION',
2203
            title                  => 'Hold cancelled',
2204
            content                => 'Your hold was cancelled.',
2205
            message_transport_type => 'email',
2206
            branchcode             => q{},
2207
        }
2208
    )->store();
2209
2196
    my $reserve_id = AddReserve(
2210
    my $reserve_id = AddReserve(
2197
        {
2211
        {
2198
            branchcode     => $branch,
2212
            branchcode     => $branch,
2199
- 

Return to bug 31391