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

(-)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 23-28 Link Here
23
            <th>&nbsp;</th>
23
            <th>&nbsp;</th>
24
            <th>&nbsp;</th>
24
            <th>&nbsp;</th>
25
            <th>Print hold/transfer slip</th>
25
            <th>Print hold/transfer slip</th>
26
            <th>&nbsp;</th>
26
        </tr>
27
        </tr>
27
    </thead>
28
    </thead>
28
    [%- SET first_priority = 0 -%]
29
    [%- SET first_priority = 0 -%]
Lines 253-258 Link Here
253
            [% ELSE %]
254
            [% ELSE %]
254
                <td></td>
255
                <td></td>
255
            [% END %]
256
            [% END %]
257
            <td>
258
                [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
259
                <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
260
                [% END %]
261
            </td>
256
        </tr>
262
        </tr>
257
    [% END %]
263
    [% END %]
258
</table>
264
</table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-9 / +9 lines)
Lines 1342-1347 Circulation: Link Here
1342
                  1: Use
1342
                  1: Use
1343
                  0: "Don't use"
1343
                  0: "Don't use"
1344
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fines rules</a> for recalls once enabled.
1344
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fines rules</a> for recalls once enabled.
1345
        -
1346
            - Recalls can be placed through
1347
            - pref: RecallsInterface
1348
              default: opac
1349
              choices:
1350
                  opac: the OPAC only
1351
                  staff: the staff interface only
1352
                  both: both the OPAC and the staff interface
1353
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1345
1354
1346
    SIP2:
1355
    SIP2:
1347
        -
1356
        -
Lines 1376-1387 Circulation: Link Here
1376
                  1: Enable
1385
                  1: Enable
1377
                  0: Disable
1386
                  0: Disable
1378
            - "the curbside pickup module."
1387
            - "the curbside pickup module."
1379
        -
1380
            - Recalls can be placed through
1381
            - pref: RecallsInterface
1382
              default: opac
1383
              choices:
1384
                  opac: the OPAC only
1385
                  staff: the staff interface only
1386
                  both: both the OPAC and the staff interface
1387
            - . (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 / +14 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 223-229 Link Here
223
                    <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
231
                    <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span>
224
                    [% INCLUDE 'recalls.inc' %]
232
                    [% INCLUDE 'recalls.inc' %]
225
                    <fieldset class="action">
233
                    <fieldset class="action">
226
                        <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button>
234
                        <button type="submit" id="cancel_selected" class="btn btn-primary btn-sm">Cancel selected recalls</button>
227
                    </fieldset>
235
                    </fieldset>
228
                </form>
236
                </form>
229
            [% ELSE %]
237
            [% ELSE %]
Lines 233-238 Link Here
233
            <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>
241
            <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>
234
        [% END %]
242
        [% END %]
235
243
244
        </div> <!-- page-section Existing recalls -->
245
236
    [% END %]
246
    [% END %]
237
247
238
</main>
248
</main>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+4 lines)
Lines 1763-1768 Link Here
1763
                window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1763
                window.open("/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" + reserve_id);
1764
                return false;
1764
                return false;
1765
        })
1765
        })
1766
        $(".convert-to-recall").click(function(){
1767
            var reserve_id = $(this).attr('data-id');
1768
            $("select[class='rank-request'][data-hold-id='"+reserve_id+"']").val('recall');
1769
        });
1766
    </script>
1770
    </script>
1767
[% END %]
1771
[% END %]
1768
1772
(-)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 1830-1835 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1830
            surname      => 'whatever surname',
1830
            surname      => 'whatever surname',
1831
            categorycode => $category->{categorycode},
1831
            categorycode => $category->{categorycode},
1832
            branchcode   => $branch,
1832
            branchcode   => $branch,
1833
            email        => 'name@email.com',
1833
        }
1834
        }
1834
    )->store;
1835
    )->store;
1835
    my $borrowernumber = $patron->borrowernumber;
1836
    my $borrowernumber = $patron->borrowernumber;
Lines 1840-1845 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1840
            surname      => 'whatever surname',
1841
            surname      => 'whatever surname',
1841
            categorycode => $category->{categorycode},
1842
            categorycode => $category->{categorycode},
1842
            branchcode   => $branch,
1843
            branchcode   => $branch,
1844
            email        => 'name2@email.com',
1843
        }
1845
        }
1844
    )->store;
1846
    )->store;
1845
1847
Lines 1859-1864 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1859
        },
1861
        },
1860
    });
1862
    });
1861
1863
1864
    my $notice = Koha::Notice::Template->new({
1865
        name                   => 'Hold cancellation',
1866
        module                 => 'reserves',
1867
        code                   => 'HOLD_CANCELLATION',
1868
        title                  => 'Hold cancelled',
1869
        content                => 'Your hold was cancelled.',
1870
        message_transport_type => 'email',
1871
        branchcode             => q{},
1872
    })->store();
1873
1862
    my $reserve_id = AddReserve(
1874
    my $reserve_id = AddReserve(
1863
        {
1875
        {
1864
            branchcode     => $branch,
1876
            branchcode     => $branch,
1865
- 

Return to bug 31391