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

(-)a/admin/columns_settings.yml (+2 lines)
Lines 1890-1895 modules: Link Here
1890
              columnname: suspend
1890
              columnname: suspend
1891
            -
1891
            -
1892
              columnname: print_slip
1892
              columnname: print_slip
1893
            -
1894
              columnname: convert_to_recall
1893
1895
1894
    holdsratios:
1896
    holdsratios:
1895
      holds-ratios:
1897
      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 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 277-282 Link Here
277
                [% ELSE %]
278
                [% ELSE %]
278
                    <td></td>
279
                    <td></td>
279
                [% END %]
280
                [% END %]
281
                <td>
282
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
283
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
284
                    [% END %]
285
                </td>
280
            </tr>
286
            </tr>
281
        [% END %]
287
        [% END %]
282
    </tbody>
288
    </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-9 / +9 lines)
Lines 1469-1474 Circulation: Link Here
1469
                  1: Use
1469
                  1: Use
1470
                  0: "Don't use"
1470
                  0: "Don't use"
1471
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1471
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1472
        -
1473
            - Recalls can be placed through
1474
            - pref: RecallsInterface
1475
              default: opac
1476
              choices:
1477
                  opac: the OPAC only
1478
                  staff: the staff interface only
1479
                  both: both the OPAC and the staff interface
1480
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1472
1481
1473
    SIP2:
1482
    SIP2:
1474
        -
1483
        -
Lines 1511-1522 Circulation: Link Here
1511
                  1: Enable
1520
                  1: Enable
1512
                  0: Disable
1521
                  0: Disable
1513
            - "the curbside pickup module."
1522
            - "the curbside pickup module."
1514
        -
1515
            - Recalls can be placed through
1516
            - pref: RecallsInterface
1517
              default: opac
1518
              choices:
1519
                  opac: the OPAC only
1520
                  staff: the staff interface only
1521
                  both: both the OPAC and the staff interface
1522
            - . (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 / +15 lines)
Lines 58-63 Link Here
58
            </div>
58
            </div>
59
        [% END %]
59
        [% END %]
60
60
61
        [% IF patron_holds_count %]
62
            <div class="dialog alert alert-info">
63
                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>.
64
            </div>
65
        [% END %]
66
61
        <fieldset class="rows">
67
        <fieldset class="rows">
62
            <legend>Recall details</legend>
68
            <legend>Recall details</legend>
63
            <form id="recallform" action="/cgi-bin/koha/recalls/request.pl" method="post">
69
            <form id="recallform" action="/cgi-bin/koha/recalls/request.pl" method="post">
Lines 111-117 Link Here
111
                        <th>Barcode</th>
117
                        <th>Barcode</th>
112
                        [% UNLESS ( single_branch_mode ) %]
118
                        [% UNLESS ( single_branch_mode ) %]
113
                            <th>Home library</th>
119
                            <th>Home library</th>
114
                            <th>Last location</th>
120
                            <th>Holding library</th>
115
                        [% END %]
121
                        [% END %]
116
                        <th>Collection</th>
122
                        <th>Collection</th>
117
                        <th>Call number</th>
123
                        <th>Call number</th>
Lines 148-154 Link Here
148
                                <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>
154
                                <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>
149
                            [% END %]
155
                            [% END %]
150
                            [% IF ( item.itemlost || item.withdrawn ) %]
156
                            [% IF ( item.itemlost || item.withdrawn ) %]
151
                                <span class="lost">Unavailable (lost or missing)</span>
157
                                <span class="lost">Unavailable (lost or withdrawn)</span>
152
                            [% END %]
158
                            [% END %]
153
                            [% IF ( item.notforloan ) %]
159
                            [% IF ( item.notforloan ) %]
154
                                <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
160
                                <span class="notforloan">Not for loan ([% item.notforloan | html %])</span>
Lines 168-174 Link Here
168
                                </span>
174
                                </span>
169
                            [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
175
                            [% ELSIF ( hold.borrowernumber == logged_in_user.borrowernumber ) %]
170
                                <span class="waiting">
176
                                <span class="waiting">
171
                                    Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">reserve</a> on this item.
177
                                    Patron has already placed a <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]#reserves">hold</a> on this item.
172
                                </span>
178
                                </span>
173
                            [% END # / IF ( item.recall or hold ) %]
179
                            [% END # / IF ( item.recall or hold ) %]
174
                        </td>
180
                        </td>
Lines 216-221 Link Here
216
222
217
        [% END %]
223
        [% END %]
218
224
225
        <div class="page-section">
226
219
        <h2>Existing recalls</h2>
227
        <h2>Existing recalls</h2>
220
228
221
        [% IF Koha.Preference('UseRecalls') %]
229
        [% IF Koha.Preference('UseRecalls') %]
Lines 228-234 Link Here
228
                        <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
236
                        <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
229
                        [% INCLUDE 'recalls.inc' %]
237
                        [% INCLUDE 'recalls.inc' %]
230
                        <fieldset class="action">
238
                        <fieldset class="action">
231
                            <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
239
                            <button type="submit" id="cancel_selected" class="btn btn-primary btn-sm">Cancel selected recalls</button>
232
                        </fieldset>
240
                        </fieldset>
233
                    </form>
241
                    </form>
234
                </div> <!-- /.page-section -->
242
                </div> <!-- /.page-section -->
Lines 258-267 Link Here
258
    [% INCLUDE 'datatables.inc' %]
266
    [% INCLUDE 'datatables.inc' %]
259
    [% INCLUDE 'columns_settings.inc' %]
267
    [% INCLUDE 'columns_settings.inc' %]
260
    [% INCLUDE 'calendar.inc' %]
268
    [% INCLUDE 'calendar.inc' %]
269
    [% INCLUDE 'select2.inc' %]
261
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
270
    [% SET url_biblio_params = "biblionumber=" _ biblio.biblionumber %]
262
    [% 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' %]
271
    [% 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' %]
263
    <script>
272
    <script>
264
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
273
        table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %];
274
        $.fn.select2.defaults.set("width", "100%" );
275
        $.fn.select2.defaults.set("dropdownAutoWidth", true );
265
        $(document).ready(function(){
276
        $(document).ready(function(){
266
            $("#recalls_patronsearch").on("submit", filter);
277
            $("#recalls_patronsearch").on("submit", filter);
267
            [% UNLESS patron %]
278
            [% UNLESS patron %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +5 lines)
Lines 259-265 Link Here
259
                [% IF ( recallerror ) %]
259
                [% IF ( recallerror ) %]
260
                    <div class="dialog alert">
260
                    <div class="dialog alert">
261
                        <h3>Hold cannot be converted to a recall</h3>
261
                        <h3>Hold cannot be converted to a recall</h3>
262
                        <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>
262
                        <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>
263
                    </div>
263
                    </div>
264
                [% END %]
264
                [% END %]
265
265
Lines 2021-2026 Link Here
2021
            window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
2021
            window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
2022
            return false;
2022
            return false;
2023
        })
2023
        })
2024
        $(".convert-to-recall").click(function(){
2025
            var reserve_id = $(this).attr('data-id');
2026
            $("select[class='rank-request'][data-hold-id='"+reserve_id+"']").val('recall');
2027
        });
2024
    </script>
2028
    </script>
2025
[% END %]
2029
[% END %]
2026
2030
(-)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 1897-1902 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1897
            surname      => 'whatever surname',
1897
            surname      => 'whatever surname',
1898
            categorycode => $category->{categorycode},
1898
            categorycode => $category->{categorycode},
1899
            branchcode   => $branch,
1899
            branchcode   => $branch,
1900
            email        => 'name@email.com',
1900
        }
1901
        }
1901
    )->store;
1902
    )->store;
1902
    my $borrowernumber = $patron->borrowernumber;
1903
    my $borrowernumber = $patron->borrowernumber;
Lines 1907-1912 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1907
            surname      => 'whatever surname',
1908
            surname      => 'whatever surname',
1908
            categorycode => $category->{categorycode},
1909
            categorycode => $category->{categorycode},
1909
            branchcode   => $branch,
1910
            branchcode   => $branch,
1911
            email        => 'name2@email.com',
1910
        }
1912
        }
1911
    )->store;
1913
    )->store;
1912
1914
Lines 1926-1931 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1926
        },
1928
        },
1927
    });
1929
    });
1928
1930
1931
    my $notice = Koha::Notice::Template->new({
1932
        name                   => 'Hold cancellation',
1933
        module                 => 'reserves',
1934
        code                   => 'HOLD_CANCELLATION',
1935
        title                  => 'Hold cancelled',
1936
        content                => 'Your hold was cancelled.',
1937
        message_transport_type => 'email',
1938
        branchcode             => q{},
1939
    })->store();
1940
1929
    my $reserve_id = AddReserve(
1941
    my $reserve_id = AddReserve(
1930
        {
1942
        {
1931
            branchcode     => $branch,
1943
            branchcode     => $branch,
1932
- 

Return to bug 31391