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

(-)a/C4/Reserves.pm (-1 / +2 lines)
Lines 2179-2184 sub ReserveSlip { Link Here
2179
    my ($args) = @_;
2179
    my ($args) = @_;
2180
    my $branchcode     = $args->{branchcode};
2180
    my $branchcode     = $args->{branchcode};
2181
    my $reserve_id = $args->{reserve_id};
2181
    my $reserve_id = $args->{reserve_id};
2182
    my $itemnumber = $args->{itemnumber};
2182
2183
2183
    my $hold = Koha::Holds->find($reserve_id);
2184
    my $hold = Koha::Holds->find($reserve_id);
2184
    return unless $hold;
2185
    return unless $hold;
Lines 2197-2203 sub ReserveSlip { Link Here
2197
            'borrowers'   => $reserve->{borrowernumber},
2198
            'borrowers'   => $reserve->{borrowernumber},
2198
            'biblio'      => $reserve->{biblionumber},
2199
            'biblio'      => $reserve->{biblionumber},
2199
            'biblioitems' => $reserve->{biblionumber},
2200
            'biblioitems' => $reserve->{biblionumber},
2200
            'items'       => $reserve->{itemnumber},
2201
            'items'       => $reserve->{itemnumber} || $itemnumber,
2201
        },
2202
        },
2202
    );
2203
    );
2203
}
2204
}
(-)a/circ/circulation.pl (-4 / +18 lines)
Lines 38-44 use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue ); Link Here
38
use C4::Members;
38
use C4::Members;
39
use C4::Biblio qw( TransformMarcToKoha );
39
use C4::Biblio qw( TransformMarcToKoha );
40
use C4::Search qw( new_record_from_zebra );
40
use C4::Search qw( new_record_from_zebra );
41
use C4::Reserves;
41
use C4::Reserves qw( ModReserveAffect );
42
use Koha::Holds;
42
use Koha::Holds;
43
use C4::Context;
43
use C4::Context;
44
use CGI::Session;
44
use CGI::Session;
Lines 69-74 my $override_high_holds_tmp = $query->param('override_high_holds_tmp'); Link Here
69
my $sessionID = $query->cookie("CGISESSID") ;
69
my $sessionID = $query->cookie("CGISESSID") ;
70
my $session = get_session($sessionID);
70
my $session = get_session($sessionID);
71
71
72
my $userenv = C4::Context->userenv;
73
my $branch  = $userenv->{'branch'} // '';
74
my $desk_id = $userenv->{"desk_id"} || '';
75
72
my $barcodes = [];
76
my $barcodes = [];
73
my $barcode =  $query->param('barcode');
77
my $barcode =  $query->param('barcode');
74
my $findborrower;
78
my $findborrower;
Lines 88-93 if (C4::Context->preference("AutoSwitchPatron") && $barcode) { Link Here
88
$findborrower ||= $query->param('findborrower') || q{};
92
$findborrower ||= $query->param('findborrower') || q{};
89
$findborrower =~ s|,| |g;
93
$findborrower =~ s|,| |g;
90
94
95
if ( $query->param('confirm_hold') ) {
96
    my $reserve_id          = $query->param('confirm_hold');
97
    my $hold_branch         = $query->param('hold_branch');
98
    my $hold_itemnumber     = $query->param('hold_itemnumber');
99
    my $hold_borrowernumber = $query->param('hold_borrowernumber');
100
    my $diffBranchSend      = ( $branch ne $hold_branch );
101
102
    # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
103
    # i.e., whether to apply waiting status
104
    ModReserveAffect( $hold_itemnumber, $hold_borrowernumber, $diffBranchSend, $reserve_id, $desk_id );
105
}
106
91
# Barcode given by user could be '0'
107
# Barcode given by user could be '0'
92
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
108
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
93
    $barcodes = [ $barcode ];
109
    $barcodes = [ $barcode ];
Lines 134-140 my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( Link Here
134
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
150
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
135
151
136
my $force_allow_issue = $query->param('forceallow') || 0;
152
my $force_allow_issue = $query->param('forceallow') || 0;
137
if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) {
153
if (!C4::Auth::haspermission( $userenv->{id} , { circulate => 'force_checkout' } )) {
138
    $force_allow_issue = 0;
154
    $force_allow_issue = 0;
139
}
155
}
140
my $onsite_checkout = $query->param('onsite_checkout');
156
my $onsite_checkout = $query->param('onsite_checkout');
Lines 151-158 my @failedreturns = $query->multi_param('failedreturn'); Link Here
151
our %return_failed = ();
167
our %return_failed = ();
152
for (@failedreturns) { $return_failed{$_} = 1; }
168
for (@failedreturns) { $return_failed{$_} = 1; }
153
169
154
my $branch = C4::Context->userenv->{'branch'};
155
156
for my $barcode ( @$barcodes ) {
170
for my $barcode ( @$barcodes ) {
157
    $barcode = barcodedecode( $barcode ) if $barcode;
171
    $barcode = barcodedecode( $barcode ) if $barcode;
158
}
172
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +6 lines)
Lines 391-402 Link Here
391
                            [% END # /IF ADDITIONAL_MATERIALS %]
391
                            [% END # /IF ADDITIONAL_MATERIALS %]
392
392
393
                            [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %]
393
                            [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %]
394
                                <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
394
                                <form method="post" action="/cgi-bin/koha/circ/circulation.pl">
395
                                    <input type="hidden" name="restoreduedatespec" />
395
                                    <input type="hidden" name="restoreduedatespec" />
396
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
396
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
397
                                    <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
397
                                    <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
398
                                    <input type="hidden" name="confirm_hold" value="[% reserve_id | html %]" />
399
                                    <input type="hidden" name="hold_branch" value="[% resbranchcode | html %]" />
400
                                    <input type="hidden" name="hold_borrower" value="[% resborrowernumber | html %]" />
401
                                    <input type="hidden" name="hold_itemnumber" value="[% item.itemnumber | html %]" />
398
                                    <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
402
                                    <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
399
                                    <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
403
                                    <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]&itemnumber=[% item.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out, confirm hold, and print slip (P)</button>
400
                                </form>
404
                                </form>
401
                            [% END %]
405
                            [% END %]
402
406
(-)a/t/db_dependent/Reserves/ReserveSlip.t (-2 / +41 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 3;
22
use Test::More tests => 4;
23
use t::lib::TestBuilder;
23
use t::lib::TestBuilder;
24
24
25
use C4::Reserves qw( ReserveSlip );
25
use C4::Reserves qw( ReserveSlip );
Lines 111-116 is (ReserveSlip({ Link Here
111
    })->{content},
111
    })->{content},
112
    sprintf( "Hold found for %s: Please pick up %s with barcode %s at %s.", $patron->{firstname}, $biblio->title, $item1->barcode, $library->{branchcode}),"Hold slip contains correctly parsed content");
112
    sprintf( "Hold found for %s: Please pick up %s with barcode %s at %s.", $patron->{firstname}, $biblio->title, $item1->barcode, $library->{branchcode}),"Hold slip contains correctly parsed content");
113
113
114
subtest 'title level hold' => sub {
115
    plan tests => 2;
116
117
    my $biblio = $builder->build_sample_biblio;
118
    my $item   = $builder->build_sample_item(
119
        {
120
            biblionumber => $biblio->biblionumber,
121
            library      => $library->{branchcode},
122
        }
123
    );
124
    my $hold = $builder->build_object(
125
        {
126
            class => 'Koha::Holds',
127
            value => {
128
                branchcode     => $library->{branchcode},
129
                borrowernumber => $patron->{borrowernumber},
130
                biblionumber   => $biblio->id,
131
                itemnumber     => undef,
132
            }
133
        }
134
    );
135
136
    my $slip = ReserveSlip(
137
        {
138
            branchcode => $hold->branchcode,
139
            reserve_id => $hold->id,
140
            itemnumber => $item->id
141
        }
142
    );
143
    is( $slip->{code}, 'HOLD_SLIP', "We get expected letter" );
144
    is(
145
        $slip->{content},
146
        sprintf(
147
            "Hold found for %s: Please pick up %s with barcode %s at %s.", $patron->{firstname}, $biblio->title,
148
            $item->barcode,                                                $library->{branchcode}
149
        ),
150
        "Hold slip contents correctly use the passed item"
151
    );
152
};
153
114
$schema->storage->txn_rollback;
154
$schema->storage->txn_rollback;
115
155
116
1;
156
1;
117
- 

Return to bug 17798