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/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc (+59 lines)
Lines 170-172 Link Here
170
        <span>[% log_interface | html %]</span>
170
        <span>[% log_interface | html %]</span>
171
    [% END %]
171
    [% END %]
172
[% END %]
172
[% END %]
173
174
[% BLOCK translate_log_override %]
175
    [% SWITCH override %]
176
    [% CASE 'INVALID_DATE' %]
177
        <span>Invalid date confirmed</span>
178
    [% CASE 'DEBT_GUARANTEES' %]
179
        <span>Guarantees had debts</span>
180
    [% CASE 'DEBT_GUARANTORS' %]
181
        <span>Guarantors had debts</span>
182
    [% CASE 'DEBT' %]
183
        <span>Patron had debt</span>
184
    [% CASE 'USERBLOCKEDOVERDUE' %]
185
        <span>Patron had overdues</span>
186
    [% CASE 'ADDITIONAL_MATERIALS' %]
187
        <span>Additional materials were confirmed</span>
188
    [% CASE 'RENEW_ISSUE' %]
189
        <span>Renewal</span>
190
    [% CASE 'ISSUED_TO_ANOTHER' %]
191
        <span>Item was issued to another patron prior to this checkout</span>
192
    [% CASE 'PATRON_CANT' %]
193
        <span>Max renewals reached</span>
194
    [% CASE 'TOO_MANY' %]
195
        <span>Max renewals reached</span>
196
    [% CASE 'PREVISSUE' %]
197
        <span>Patron was notified of previous issues</span>
198
    [% CASE 'NOT_FOR_LOAN' %]
199
        <span>Item was not for loan</span>
200
    [% CASE 'NOT_FOR_LOAN_FORCING' %]
201
        <span>Item was not for loan</span>
202
    [% CASE 'ITEM_LOST' %]
203
        <span>Item was reported lost</span>
204
    [% CASE 'BORRNOTSAMEBRANCH' %]
205
        <span>Patron does not belong to this library</span>
206
    [% CASE 'RENTALCHARGE' %]
207
        <span>Item had a rental charge</span>
208
    [% CASE 'RECALLED' %]
209
        <span>Item was recalled</span>
210
    [% CASE 'RESERVE_WAITING' %]
211
        <span>Item had a reserve waiting</span>
212
    [% CASE 'RESERVED' %]
213
        <span>Item was reserved</span>
214
    [% CASE 'TRANSFERRED' %]
215
        <span>Item was transferred</span>
216
    [% CASE 'PROCESSING' %]
217
        <span>Item was in processing</span>
218
    [% CASE 'BOOKED_EARLY' %]
219
        <span>Item was booked and checked out early</span>
220
    [% CASE 'BOOKED_TO_ANOTHER' %]
221
        <span>Item was booked to another patron</span>
222
    [% CASE 'AGE_RESTRICTION' %]
223
        <span>Item has an eage restriction</span>
224
    [% CASE 'HIGHHOLDS' %]
225
        <span>Item had high holds</span>
226
    [% CASE 'BIBLIO_ALREADY_ISSUED' %]
227
        <span>Biblio was already issued</span>
228
    [% CASE %]
229
        <span>[% override | html %]</span>
230
    [% END %]
231
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (+16 lines)
Lines 332-337 Link Here
332
                                            title="Display detail for this item"
332
                                            title="Display detail for this item"
333
                                            >Item [% loopro.barcode | html %]</a
333
                                            >Item [% loopro.barcode | html %]</a
334
                                        >
334
                                        >
335
                                    [% ELSIF ( loopro.module == 'CIRCULATION' && loopro.json_found ) %]
336
                                        <div class="loginfo" id="loginfo[% loopro.action_id | html %]">
337
                                            <div>
338
                                                <a
339
                                                    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 %]"
340
                                                    title="Display detail for this item"
341
                                                    >Item [% loopro.json.barcode | html %]</a
342
                                                >
343
                                            </div>
344
                                            [% FOREACH force IN loopro.json.forces %]
345
                                                <div class="forced"> [% PROCESS translare_log_override override=force %] </div>
346
                                            [% END %]
347
                                            [% FOREACH confirmation IN loopro.json.confirmations %]
348
                                                <div class="confirmed"> [% PROCESS translate_log_override override=confirmation %] </div>
349
                                            [% END %]
350
                                        </div>
335
                                    [% ELSIF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %]
351
                                    [% ELSIF loopro.module == "SYSTEMPREFERENCE" || loopro.module == "REPORTS" || loopro.module == "NEWS" %]
336
                                        <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
352
                                        <div class="loginfo" id="loginfo[% loopro.action_id | html %]">[% loopro.info | trim | html %]</div>
337
                                        <div class="compare_info" id="compare_info[% loopro.action_id | html %]">
353
                                        <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