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

(-)a/C4/Circulation.pm (-5 / +23 lines)
Lines 1674-1679 sub AddIssue { Link Here
1674
    my $auto_renew             = $params && $params->{auto_renew};
1674
    my $auto_renew             = $params && $params->{auto_renew};
1675
    my $cancel_recall          = $params && $params->{cancel_recall};
1675
    my $cancel_recall          = $params && $params->{cancel_recall};
1676
    my $recall_id              = $params && $params->{recall_id};
1676
    my $recall_id              = $params && $params->{recall_id};
1677
    my $confirmations          = $params->{confirmations};
1678
    my $forced                 = $params->{forced};
1677
    my $dbh                    = C4::Context->dbh;
1679
    my $dbh                    = C4::Context->dbh;
1678
    my $barcodecheck           = CheckValidBarcode($barcode);
1680
    my $barcodecheck           = CheckValidBarcode($barcode);
1679
1681
Lines 1985-1995 sub AddIssue { Link Here
1985
                    }
1987
                    }
1986
                );
1988
                );
1987
            }
1989
            }
1988
            logaction(
1990
1989
                "CIRCULATION", "ISSUE",
1991
            # Log the checkout
1990
                $patron->borrowernumber,
1992
            if ( C4::Context->preference('IssueLog') ) {
1991
                $item_object->itemnumber,
1993
                my $info = $item_object->itemnumber;
1992
            ) if C4::Context->preference("IssueLog");
1994
                if ( defined($confirmations) || defined($forced) ) {
1995
                    $info = to_json(
1996
                        {
1997
                            issue         => $issue->issue_id,
1998
                            itemnumber    => $item_object->itemnumber,
1999
                            confirmations => $confirmations,
2000
                            forced        => $forced
2001
                        },
2002
                        { pretty => 1, canonical => 1 }
2003
                    );
2004
                }
2005
                logaction(
2006
                    "CIRCULATION", "ISSUE",
2007
                    $patron->borrowernumber,
2008
                    $info,
2009
                );
2010
            }
1993
2011
1994
            Koha::Plugins->call(
2012
            Koha::Plugins->call(
1995
                'after_circ_action',
2013
                'after_circ_action',
(-)a/C4/SIP/ILS/Transaction/Checkout.pm (-1 / +10 lines)
Lines 174-180 sub do_checkout { Link Here
174
                $recall_id = $messages->{RECALLED};
174
                $recall_id = $messages->{RECALLED};
175
            }
175
            }
176
        }
176
        }
177
        my $issue = AddIssue( $patron, $barcode, $overridden_duedate, 0, undef, undef, { recall_id => $recall_id } );
177
        my $issue = AddIssue(
178
            $patron, $barcode,
179
            $overridden_duedate,
180
            0, undef, undef,
181
            {
182
                recall_id     => $recall_id,
183
                confirmations => [ grep { /^[A-Z_]+$/ } keys %{$needsconfirmation} ],
184
                forced        => [ keys %{$issuingimpossible} ]
185
            }
186
        );
178
        $self->{due} = $self->duedatefromissue( $issue, $itemnumber );
187
        $self->{due} = $self->duedatefromissue( $issue, $itemnumber );
179
    }
188
    }
180
189
(-)a/Koha/CurbsidePickup.pm (-1 / +9 lines)
Lines 252-258 sub mark_as_delivered { Link Here
252
                C4::Circulation::CanBookBeIssued( $patron, $hold->item->barcode );
252
                C4::Circulation::CanBookBeIssued( $patron, $hold->item->barcode );
253
253
254
            unless ( keys %$issuingimpossible ) {
254
            unless ( keys %$issuingimpossible ) {
255
                my $issue = C4::Circulation::AddIssue( $patron, $hold->item->barcode );
255
                my $issue = C4::Circulation::AddIssue(
256
                    $patron,
257
                    $hold->item->barcode,
258
                    undef, undef, undef, undef,
259
                    {
260
                        confirmations => [ grep { /^[A-Z_]+$/ } keys %{$needsconfirmation} ],
261
                        forced        => [ keys %{$issuingimpossible} ]
262
                    }
263
                );
256
                if ($issue) {
264
                if ($issue) {
257
                    Koha::CurbsidePickupIssue->new(
265
                    Koha::CurbsidePickupIssue->new(
258
                        {
266
                        {
(-)a/Koha/REST/V1/Checkouts.pm (-1 / +9 lines)
Lines 299-305 sub add { Link Here
299
        }
299
        }
300
300
301
        # Call 'AddIssue'
301
        # Call 'AddIssue'
302
        my $checkout = AddIssue( $patron, $item->barcode );
302
        my $checkout = AddIssue(
303
            $patron,
304
            $item->barcode,
305
            undef, undef, undef, undef,
306
            {
307
                confirmations => [ grep { /^[A-Z_]+$/ } keys %{$confirmation} ],
308
                forced        => [ keys %{$impossible} ]
309
            }
310
        );
303
        if ($checkout) {
311
        if ($checkout) {
304
            $c->res->headers->location( $c->req->url->to_string . '/' . $checkout->id );
312
            $c->res->headers->location( $c->req->url->to_string . '/' . $checkout->id );
305
            return $c->render(
313
            return $c->render(
(-)a/circ/circulation.pl (-2 / +6 lines)
Lines 552-560 if ( @$barcodes && $op eq 'cud-checkout' ) { Link Here
552
                    $cancelreserve,
552
                    $cancelreserve,
553
                    undef, undef,
553
                    undef, undef,
554
                    {
554
                    {
555
                        onsite_checkout        => $onsite_checkout,        auto_renew => $session->param('auto_renew'),
555
                        onsite_checkout        => $onsite_checkout,
556
                        switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall,
556
                        auto_renew             => $session->param('auto_renew'),
557
                        switch_onsite_checkout => $switch_onsite_checkout,
558
                        cancel_recall          => $cancel_recall,
557
                        recall_id              => $recall_id,
559
                        recall_id              => $recall_id,
560
                        confirmations          => [ grep { /^[A-Z_]+$/ } keys %{$needsconfirmation} ],
561
                        forced                 => [ keys %{$issuingimpossible} ]
558
                    }
562
                    }
559
                );
563
                );
560
                $template_params->{issue} = $issue;
564
                $template_params->{issue} = $issue;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc (+59 lines)
Lines 176-178 Link Here
176
        <span>[% log_interface | html %]</span>
176
        <span>[% log_interface | html %]</span>
177
    [% END %]
177
    [% END %]
178
[% END %]
178
[% END %]
179
180
[% BLOCK translate_log_override %]
181
    [% SWITCH override %]
182
    [% CASE 'INVALID_DATE' %]
183
        <span>Invalid date confirmed</span>
184
    [% CASE 'DEBT_GUARANTEES' %]
185
        <span>Guarantees had debts</span>
186
    [% CASE 'DEBT_GUARANTORS' %]
187
        <span>Guarantors had debts</span>
188
    [% CASE 'DEBT' %]
189
        <span>Patron had debt</span>
190
    [% CASE 'USERBLOCKEDOVERDUE' %]
191
        <span>Patron had overdues</span>
192
    [% CASE 'ADDITIONAL_MATERIALS' %]
193
        <span>Additional materials were confirmed</span>
194
    [% CASE 'RENEW_ISSUE' %]
195
        <span>Renewal</span>
196
    [% CASE 'ISSUED_TO_ANOTHER' %]
197
        <span>Item was issued to another patron prior to this checkout</span>
198
    [% CASE 'PATRON_CANT' %]
199
        <span>Max renewals reached</span>
200
    [% CASE 'TOO_MANY' %]
201
        <span>Max renewals reached</span>
202
    [% CASE 'PREVISSUE' %]
203
        <span>Patron was notified of previous issues</span>
204
    [% CASE 'NOT_FOR_LOAN' %]
205
        <span>Item was not for loan</span>
206
    [% CASE 'NOT_FOR_LOAN_FORCING' %]
207
        <span>Item was not for loan</span>
208
    [% CASE 'ITEM_LOST' %]
209
        <span>Item was reported lost</span>
210
    [% CASE 'BORRNOTSAMEBRANCH' %]
211
        <span>Patron does not belong to this library</span>
212
    [% CASE 'RENTALCHARGE' %]
213
        <span>Item had a rental charge</span>
214
    [% CASE 'RECALLED' %]
215
        <span>Item was recalled</span>
216
    [% CASE 'RESERVE_WAITING' %]
217
        <span>Item had a reserve waiting</span>
218
    [% CASE 'RESERVED' %]
219
        <span>Item was reserved</span>
220
    [% CASE 'TRANSFERRED' %]
221
        <span>Item was transferred</span>
222
    [% CASE 'PROCESSING' %]
223
        <span>Item was in processing</span>
224
    [% CASE 'BOOKED_EARLY' %]
225
        <span>Item was booked and checked out early</span>
226
    [% CASE 'BOOKED_TO_ANOTHER' %]
227
        <span>Item was booked to another patron</span>
228
    [% CASE 'AGE_RESTRICTION' %]
229
        <span>Item has an eage restriction</span>
230
    [% CASE 'HIGHHOLDS' %]
231
        <span>Item had high holds</span>
232
    [% CASE 'BIBLIO_ALREADY_ISSUED' %]
233
        <span>Biblio was already issued</span>
234
    [% CASE %]
235
        <span>[% override | html %]</span>
236
    [% END %]
237
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (+16 lines)
Lines 333-338 Link Here
333
                                            title="Display detail for this item"
333
                                            title="Display detail for this item"
334
                                            >Item [% loopro.barcode | html %]</a
334
                                            >Item [% loopro.barcode | html %]</a
335
                                        >
335
                                        >
336
                                    [% ELSIF ( loopro.module == 'CIRCULATION' && loopro.json_found ) %]
337
                                        <div class="loginfo" id="loginfo[% loopro.action_id | html %]">
338
                                            <div>
339
                                                <a
340
                                                    href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% loopro.json.itemnumber | uri %]&amp;biblionumber=[% loopro.json.biblionumber | uri %]&amp;bi=[% loopro.json.biblioitemnumber | uri %]#item[% loopro.json.itemnumber | uri %]"
341
                                                    title="Display detail for this item"
342
                                                    >Item [% loopro.json.barcode | html %]</a
343
                                                >
344
                                            </div>
345
                                            [% FOREACH force IN loopro.json.forces %]
346
                                                <div class="forced"> [% PROCESS translare_log_override override=force %] </div>
347
                                            [% END %]
348
                                            [% FOREACH confirmation IN loopro.json.confirmations %]
349
                                                <div class="confirmed"> [% PROCESS translate_log_override override=confirmation %] </div>
350
                                            [% END %]
351
                                        </div>
336
                                    [% ELSIF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %]
352
                                    [% ELSIF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %]
337
                                        <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
353
                                        <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
338
                                        <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
354
                                        <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
(-)a/opac/sco/sco-main.pl (-1 / +7 lines)
Lines 281-287 if ( $patron && $op eq "cud-returnbook" && $allowselfcheckreturns ) { Link Here
281
                    )->count;
281
                    )->count;
282
                }
282
                }
283
283
284
                my $new_issue = AddIssue( $patron, $barcode );
284
                my $new_issue = AddIssue(
285
                    $patron, $barcode, undef, undef, undef, undef,
286
                    {
287
                        confirmations => [ grep { /^[A-Z_]+$/ } keys %{$needconfirm} ],
288
                        forced        => [ keys %{$impossible} ]
289
                    }
290
                );
285
                $template->param( issued => 1, new_issue => $new_issue );
291
                $template->param( issued => 1, new_issue => $new_issue );
286
                push @newissueslist, $barcode unless ( grep /^$barcode$/, @newissueslist );
292
                push @newissueslist, $barcode unless ( grep /^$barcode$/, @newissueslist );
287
293
(-)a/tools/viewlog.pl (-4 / +31 lines)
Lines 22-27 use Modern::Perl; Link Here
22
22
23
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( get_template_and_user );
24
use CGI      qw ( -utf8 );
24
use CGI      qw ( -utf8 );
25
use JSON;
25
use Text::CSV::Encoded;
26
use Text::CSV::Encoded;
26
use C4::Context;
27
use C4::Context;
27
use C4::Output  qw( output_html_with_http_headers );
28
use C4::Output  qw( output_html_with_http_headers );
Lines 152-163 if ($do_it) { Link Here
152
        $result->{'biblioitemnumber'} = q{};
153
        $result->{'biblioitemnumber'} = q{};
153
        $result->{'barcode'}          = q{};
154
        $result->{'barcode'}          = q{};
154
155
155
        if ( substr( $log->info, 0, 4 ) eq 'item' || $log->module eq "CIRCULATION" ) {
156
        if ( substr( $log->info, 0, 4 ) eq 'item' ) {
156
157
157
            # get item information so we can create a working link
158
            # get item information so we can create a working link
158
            my $itemnumber = $log->object;
159
            my $itemnumber = $log->object;
159
            $itemnumber = $log->info if ( $log->module eq "CIRCULATION" );
160
            my $item       = Koha::Items->find($itemnumber);
160
            my $item = Koha::Items->find($itemnumber);
161
            if ($item) {
161
            if ($item) {
162
                $result->{'object_found'}     = 1;
162
                $result->{'object_found'}     = 1;
163
                $result->{'biblionumber'}     = $item->biblionumber;
163
                $result->{'biblionumber'}     = $item->biblionumber;
Lines 166-171 if ($do_it) { Link Here
166
            }
166
            }
167
        }
167
        }
168
168
169
        if ( $log->module eq "CIRCULATION" ) {
170
            my $info = $log->info;
171
            my $decoded;
172
            my $is_json = eval {
173
                $decoded = decode_json($info);
174
                1;
175
            };
176
177
            if ( $is_json && ref($decoded) ) {
178
                $result->{'json_found'} = 1;
179
                my $item = Koha::Items->find( $decoded->{itemnumber} );
180
                if ($item) {
181
                    $decoded->{biblionumber}     = $item->biblionumber;
182
                    $decoded->{biblioitemnumber} = $item->biblionumber;
183
                    $decoded->{barcode}          = $item->barcode;
184
                }
185
                $result->{'json'} = $decoded;
186
            } else {
187
                my $item = Koha::Items->find($info);
188
                if ($item) {
189
                    $result->{'object_found'}     = 1;
190
                    $result->{'biblionumber'}     = $item->biblionumber;
191
                    $result->{'biblioitemnumber'} = $item->biblionumber;
192
                    $result->{'barcode'}          = $item->barcode;
193
                }
194
            }
195
        }
196
169
        #always add firstname and surname for librarian/user
197
        #always add firstname and surname for librarian/user
170
        if ( $log->user ) {
198
        if ( $log->user ) {
171
            my $patron = Koha::Patrons->find( $log->user );
199
            my $patron = Koha::Patrons->find( $log->user );
172
- 

Return to bug 9762