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

(-)a/admin/columns_settings.yml (+2 lines)
Lines 1710-1715 modules: Link Here
1710
              columnname: suspend
1710
              columnname: suspend
1711
            -
1711
            -
1712
              columnname: print_slip
1712
              columnname: print_slip
1713
            -
1714
              columnname: convert_to_recall
1713
1715
1714
    holdsratios:
1716
    holdsratios:
1715
      holds-ratios:
1717
      holds-ratios:
(-)a/installer/data/mysql/atomicupdate/bug_31391_-_add_HOLD_CANCELLATION-RECALLED_authorised_value.pl (-1 / +3 lines)
Lines 2-12 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)};
9
9
10
        $dbh->do(q{ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','RECALLED','Hold was converted to a recall') });
10
        $dbh->do(q{ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CANCELLATION','RECALLED','Hold was converted to a recall') });
11
12
        say $out "Added RECALLED value to HOLD_CANCELLATION authorised value category";
11
    },
13
    },
12
};
14
};
(-)a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl (-1 / +3 lines)
Lines 2-12 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)};
9
9
10
        $dbh->do(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') });
10
        $dbh->do(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
12
        say $out "Added system preference 'RecallsInterface'";
11
    },
13
    },
12
};
14
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (+6 lines)
Lines 21-26 Link Here
21
            <th id="delete" data-colname="delete">Delete</th>
21
            <th id="delete" data-colname="delete">Delete</th>
22
            <th id="suspend" data-colname="suspend">Suspend</th>
22
            <th id="suspend" data-colname="suspend">Suspend</th>
23
            <th id="print_slip" data-colname="print_slip">Print hold/transfer slip</th>
23
            <th id="print_slip" data-colname="print_slip">Print hold/transfer slip</th>
24
            <th id="convert_to_recall" data-colname="convert_to_recall">Convert hold to recall</th>
24
        </tr>
25
        </tr>
25
    </thead>
26
    </thead>
26
    [%- SET first_priority = 0 -%]
27
    [%- SET first_priority = 0 -%]
Lines 251-256 Link Here
251
                [% ELSE %]
252
                [% ELSE %]
252
                    <td></td>
253
                    <td></td>
253
                [% END %]
254
                [% END %]
255
                <td>
256
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
257
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
258
                    [% END %]
259
                </td>
254
            </tr>
260
            </tr>
255
        [% END %]
261
        [% END %]
256
    </tbody>
262
    </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-9 / +9 lines)
Lines 1357-1362 Circulation: Link Here
1357
                  1: Use
1357
                  1: Use
1358
                  0: "Don't use"
1358
                  0: "Don't use"
1359
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1359
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1360
        -
1361
            - Recalls can be placed through
1362
            - pref: RecallsInterface
1363
              default: opac
1364
              choices:
1365
                  opac: the OPAC only
1366
                  staff: the staff interface only
1367
                  both: both the OPAC and the staff interface
1368
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1360
1369
1361
    SIP2:
1370
    SIP2:
1362
        -
1371
        -
Lines 1400-1411 Circulation: Link Here
1400
                  1: Enable
1409
                  1: Enable
1401
                  0: Disable
1410
                  0: Disable
1402
            - "the curbside pickup module."
1411
            - "the curbside pickup module."
1403
        -
1404
            - Recalls can be placed through
1405
            - pref: RecallsInterface
1406
              default: opac
1407
              choices:
1408
                  opac: the OPAC only
1409
                  staff: the staff interface only
1410
                  both: both the OPAC and the staff interface
1411
            - . (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 (-4 / +17 lines)
Lines 57-62 Link Here
57
            </div>
57
            </div>
58
        [% END %]
58
        [% END %]
59
59
60
        [% IF patron_holds_count %]
61
            <div class="dialog message">
62
                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>.
63
            </div>
64
        [% END %]
65
60
        <fieldset class="rows">
66
        <fieldset class="rows">
61
            <legend>Recall details</legend>
67
            <legend>Recall details</legend>
62
            <form id="recallform" action="/cgi-bin/koha/recalls/request.pl" method="post">
68
            <form id="recallform" action="/cgi-bin/koha/recalls/request.pl" method="post">
Lines 109-115 Link Here
109
                        <th>Barcode</th>
115
                        <th>Barcode</th>
110
                        [% UNLESS ( single_branch_mode ) %]
116
                        [% UNLESS ( single_branch_mode ) %]
111
                            <th>Home library</th>
117
                            <th>Home library</th>
112
                            <th>Last location</th>
118
                            <th>Holding library</th>
113
                        [% END %]
119
                        [% END %]
114
                        <th>Collection</th>
120
                        <th>Collection</th>
115
                        <th>Call number</th>
121
                        <th>Call number</th>
Lines 146-152 Link Here
146
                                <span class="intransit">In transit from [% Branches.GetName( item.get_transfer.frombranch ) | html %] to [% Branches.GetName( item.get_transfer.tobranch ) | html %] since [% item.get_transfer.datesent | $KohaDates %]</span>
152
                                <span class="intransit">In transit from [% Branches.GetName( item.get_transfer.frombranch ) | html %] to [% Branches.GetName( item.get_transfer.tobranch ) | html %] since [% item.get_transfer.datesent | $KohaDates %]</span>
147
                            [% END %]
153
                            [% END %]
148
                            [% IF ( item.itemlost || item.withdrawn ) %]
154
                            [% IF ( item.itemlost || item.withdrawn ) %]
149
                                <span class="lost">Unavailable (lost or missing)</span>
155
                                <span class="lost">Unavailable (lost or withdrawn)</span>
150
                            [% END %]
156
                            [% END %]
151
                            [% IF ( item.notforloan ) %]
157
                            [% IF ( item.notforloan ) %]
152
                                <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
158
                                <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
Lines 166-172 Link Here
166
                                </span>
172
                                </span>
167
                            [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
173
                            [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
168
                                <span class="waiting">
174
                                <span class="waiting">
169
                                    Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">reserve</a> on this item.
175
                                    Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">hold</a> on this item.
170
                                </span>
176
                                </span>
171
                            [% END # / IF ( item.recall or hold ) %]
177
                            [% END # / IF ( item.recall or hold ) %]
172
                        </td>
178
                        </td>
Lines 213-218 Link Here
213
219
214
        [% END %]
220
        [% END %]
215
221
222
        <div class="page-section">
223
216
        <h2>Existing recalls</h2>
224
        <h2>Existing recalls</h2>
217
225
218
        [% IF Koha.Preference('UseRecalls') %]
226
        [% IF Koha.Preference('UseRecalls') %]
Lines 224-230 Link Here
224
                        <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
232
                        <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
225
                        [% INCLUDE 'recalls.inc' %]
233
                        [% INCLUDE 'recalls.inc' %]
226
                        <fieldset class="action">
234
                        <fieldset class="action">
227
                            <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
235
                            <button type="submit" id="cancel_selected" class="btn btn-primary btn-sm">Cancel selected recalls</button>
228
                        </fieldset>
236
                        </fieldset>
229
                    </form>
237
                    </form>
230
                </div> <!-- /.page-section -->
238
                </div> <!-- /.page-section -->
Lines 235-240 Link Here
235
            <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>
243
            <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>
236
        [% END %]
244
        [% END %]
237
245
246
        </div> <!-- page-section Existing recalls -->
247
238
    [% END %]
248
    [% END %]
239
249
240
</main>
250
</main>
Lines 254-263 Link Here
254
    [% INCLUDE 'datatables.inc' %]
264
    [% INCLUDE 'datatables.inc' %]
255
    [% INCLUDE 'columns_settings.inc' %]
265
    [% INCLUDE 'columns_settings.inc' %]
256
    [% INCLUDE 'calendar.inc' %]
266
    [% INCLUDE 'calendar.inc' %]
267
    [% INCLUDE 'select2.inc' %]
257
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
268
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
258
    [% 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' %]
269
    [% 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' %]
259
    <script>
270
    <script>
260
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
271
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
272
        $.fn.select2.defaults.set("width", "100%" );
273
        $.fn.select2.defaults.set("dropdownAutoWidth", true );
261
        $(document).ready(function(){
274
        $(document).ready(function(){
262
            $("#recalls_patronsearch").on("submit", filter);
275
            $("#recalls_patronsearch").on("submit", filter);
263
            [% UNLESS patron %]
276
            [% UNLESS patron %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +5 lines)
Lines 212-218 Link Here
212
                [% IF ( recallerror ) %]
212
                [% IF ( recallerror ) %]
213
                    <div class="dialog alert">
213
                    <div class="dialog alert">
214
                        <h3>Hold cannot be converted to a recall</h3>
214
                        <h3>Hold cannot be converted to a recall</h3>
215
                        <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>
215
                        <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>
216
                    </div>
216
                    </div>
217
                [% END %]
217
                [% END %]
218
218
Lines 1759-1764 Link Here
1759
                window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1759
                window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1760
                return false;
1760
                return false;
1761
        })
1761
        })
1762
        $(".convert-to-recall").click(function(){
1763
            var reserve_id = $(this).attr('data-id');
1764
            $("select[class='rank-request'][data-hold-id='"+reserve_id+"']").val('recall');
1765
        });
1762
    </script>
1766
    </script>
1763
[% END %]
1767
[% END %]
1764
1768
(-)a/recalls/request.pl (+2 lines)
Lines 122-130 if ( $borrowernumber ) { Link Here
122
        if ( !$biblio->can_be_recalled({ patron => $patron }) ) {
122
        if ( !$biblio->can_be_recalled({ patron => $patron }) ) {
123
            $error = 1;
123
            $error = 1;
124
        }
124
        }
125
        my $patron_holds_count = Koha::Holds->search({ borrowernumber => $borrowernumber, biblionumber => $biblio->biblionumber, item_level_hold => 0 })->count;
125
126
126
        $template->param(
127
        $template->param(
127
            patron => $patron,
128
            patron => $patron,
129
            patron_holds_count => $patron_holds_count,
128
        );
130
        );
129
    }
131
    }
130
}
132
}
(-)a/t/db_dependent/Holds.t (-1 / +12 lines)
Lines 1905-1910 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1905
            surname      => 'whatever surname',
1905
            surname      => 'whatever surname',
1906
            categorycode => $category->{categorycode},
1906
            categorycode => $category->{categorycode},
1907
            branchcode   => $branch,
1907
            branchcode   => $branch,
1908
            email        => 'name@email.com',
1908
        }
1909
        }
1909
    )->store;
1910
    )->store;
1910
    my $borrowernumber = $patron->borrowernumber;
1911
    my $borrowernumber = $patron->borrowernumber;
Lines 1915-1920 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1915
            surname      => 'whatever surname',
1916
            surname      => 'whatever surname',
1916
            categorycode => $category->{categorycode},
1917
            categorycode => $category->{categorycode},
1917
            branchcode   => $branch,
1918
            branchcode   => $branch,
1919
            email        => 'name2@email.com',
1918
        }
1920
        }
1919
    )->store;
1921
    )->store;
1920
1922
Lines 1934-1939 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1934
        },
1936
        },
1935
    });
1937
    });
1936
1938
1939
    my $notice = Koha::Notice::Template->new({
1940
        name                   => 'Hold cancellation',
1941
        module                 => 'reserves',
1942
        code                   => 'HOLD_CANCELLATION',
1943
        title                  => 'Hold cancelled',
1944
        content                => 'Your hold was cancelled.',
1945
        message_transport_type => 'email',
1946
        branchcode             => q{},
1947
    })->store();
1948
1937
    my $reserve_id = AddReserve(
1949
    my $reserve_id = AddReserve(
1938
        {
1950
        {
1939
            branchcode     => $branch,
1951
            branchcode     => $branch,
1940
- 

Return to bug 31391