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

(-)a/C4/Circulation.pm (-5 / +24 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use DateTime;
22
use DateTime;
23
use POSIX qw( floor );
23
use POSIX qw( floor );
24
use Encode;
24
use Encode;
25
use JSON;
25
26
26
use C4::Context;
27
use C4::Context;
27
use C4::Stats qw( UpdateStats );
28
use C4::Stats qw( UpdateStats );
Lines 1590-1595 sub AddIssue { Link Here
1590
    my $auto_renew             = $params && $params->{auto_renew};
1591
    my $auto_renew             = $params && $params->{auto_renew};
1591
    my $cancel_recall          = $params && $params->{cancel_recall};
1592
    my $cancel_recall          = $params && $params->{cancel_recall};
1592
    my $recall_id              = $params && $params->{recall_id};
1593
    my $recall_id              = $params && $params->{recall_id};
1594
    my $confirmations          = $params->{confirmations};
1595
    my $forced                 = $params->{forced};
1593
    my $dbh                    = C4::Context->dbh;
1596
    my $dbh                    = C4::Context->dbh;
1594
    my $barcodecheck           = CheckValidBarcode($barcode);
1597
    my $barcodecheck           = CheckValidBarcode($barcode);
1595
1598
Lines 1894-1904 sub AddIssue { Link Here
1894
                    }
1897
                    }
1895
                );
1898
                );
1896
            }
1899
            }
1897
            logaction(
1900
1898
                "CIRCULATION", "ISSUE",
1901
            # Log the checkout
1899
                $patron->borrowernumber,
1902
            if ( C4::Context->preference('IssueLog') ) {
1900
                $item_object->itemnumber,
1903
                my $info = $item_object->itemnumber;
1901
            ) if C4::Context->preference("IssueLog");
1904
                if ( defined($confirmations) || defined($forced) ) {
1905
                    $info = to_json(
1906
                        {
1907
                            issue         => $issue->issue_id,
1908
                            itemnumber    => $item_object->itemnumber,
1909
                            confirmations => $confirmations,
1910
                            forced        => $forced
1911
                        },
1912
                        { pretty => 1, canonical => 1 }
1913
                    );
1914
                }
1915
                logaction(
1916
                    "CIRCULATION", "ISSUE",
1917
                    $patron->borrowernumber,
1918
                    $info,
1919
                );
1920
            }
1902
1921
1903
            Koha::Plugins->call(
1922
            Koha::Plugins->call(
1904
                'after_circ_action',
1923
                'after_circ_action',
(-)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 542-550 if ( @$barcodes && $op eq 'cud-checkout' ) { Link Here
542
                    $cancelreserve,
542
                    $cancelreserve,
543
                    undef, undef,
543
                    undef, undef,
544
                    {
544
                    {
545
                        onsite_checkout        => $onsite_checkout,        auto_renew => $session->param('auto_renew'),
545
                        onsite_checkout        => $onsite_checkout,
546
                        switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall,
546
                        auto_renew             => $session->param('auto_renew'),
547
                        switch_onsite_checkout => $switch_onsite_checkout,
548
                        cancel_recall          => $cancel_recall,
547
                        recall_id              => $recall_id,
549
                        recall_id              => $recall_id,
550
                        confirmations          => [ grep { /^[A-Z_]+$/ } keys %{$needsconfirmation} ],
551
                        forced                 => [ keys %{$issuingimpossible} ]
548
                    }
552
                    }
549
                );
553
                );
550
                $template_params->{issue} = $issue;
554
                $template_params->{issue} = $issue;
(-)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 (-3 / +21 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-162 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;
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
                my $item = Koha::Items->find($info);
179
                if ($item) {
180
                    $result->{'object_found'}     = 1;
181
                    $result->{'biblionumber'}     = $item->biblionumber;
182
                    $result->{'biblioitemnumber'} = $item->biblionumber;
183
                    $result->{'barcode'}          = $item->barcode;
184
                }
185
            }
186
        }
187
169
        #always add firstname and surname for librarian/user
188
        #always add firstname and surname for librarian/user
170
        if ( $log->user ) {
189
        if ( $log->user ) {
171
            my $patron = Koha::Patrons->find( $log->user );
190
            my $patron = Koha::Patrons->find( $log->user );
172
- 

Return to bug 9762