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

(-)a/admin/columns_settings.yml (+2 lines)
Lines 1790-1795 modules: Link Here
1790
              columnname: suspend
1790
              columnname: suspend
1791
            -
1791
            -
1792
              columnname: print_slip
1792
              columnname: print_slip
1793
            -
1794
              columnname: convert_to_recall
1793
1795
1794
    holdsratios:
1796
    holdsratios:
1795
      holds-ratios:
1797
      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 275-280 Link Here
275
                [% ELSE %]
276
                [% ELSE %]
276
                    <td></td>
277
                    <td></td>
277
                [% END %]
278
                [% END %]
279
                <td>
280
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
281
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
282
                    [% END %]
283
                </td>
278
            </tr>
284
            </tr>
279
        [% END %]
285
        [% END %]
280
    </tbody>
286
    </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-9 / +9 lines)
Lines 1450-1455 Circulation: Link Here
1450
                  1: Use
1450
                  1: Use
1451
                  0: "Don't use"
1451
                  0: "Don't use"
1452
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1452
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1453
        -
1454
            - Recalls can be placed through
1455
            - pref: RecallsInterface
1456
              default: opac
1457
              choices:
1458
                  opac: the OPAC only
1459
                  staff: the staff interface only
1460
                  both: both the OPAC and the staff interface
1461
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1453
1462
1454
    SIP2:
1463
    SIP2:
1455
        -
1464
        -
Lines 1492-1503 Circulation: Link Here
1492
                  1: Enable
1501
                  1: Enable
1493
                  0: Disable
1502
                  0: Disable
1494
            - "the curbside pickup module."
1503
            - "the curbside pickup module."
1495
        -
1496
            - Recalls can be placed through
1497
            - pref: RecallsInterface
1498
              default: opac
1499
              choices:
1500
                  opac: the OPAC only
1501
                  staff: the staff interface only
1502
                  both: both the OPAC and the staff interface
1503
            - . (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 2025-2030 Link Here
2025
                window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
2025
                window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
2026
                return false;
2026
                return false;
2027
        })
2027
        })
2028
        $(".convert-to-recall").click(function(){
2029
            var reserve_id = $(this).attr('data-id');
2030
            $("select[class='rank-request'][data-hold-id='"+reserve_id+"']").val('recall');
2031
        });
2028
    </script>
2032
    </script>
2029
[% END %]
2033
[% END %]
2030
2034
(-)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