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

(-)a/circ/circulation.pl (+31 lines)
Lines 5-10 Link Here
5
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
6
# copyright 2010 BibLibre
6
# copyright 2010 BibLibre
7
# Copyright 2011 PTFS-Europe Ltd.
7
# Copyright 2011 PTFS-Europe Ltd.
8
# Copyright 2012 software.coop and MJ Ray
8
#
9
#
9
# This file is part of Koha.
10
# This file is part of Koha.
10
#
11
#
Lines 34-39 use C4::Circulation; Link Here
34
use C4::Overdues qw/CheckBorrowerDebarred/;
35
use C4::Overdues qw/CheckBorrowerDebarred/;
35
use C4::Members;
36
use C4::Members;
36
use C4::Biblio;
37
use C4::Biblio;
38
use C4::Search;
39
use MARC::Record;
37
use C4::Reserves;
40
use C4::Reserves;
38
use C4::Context;
41
use C4::Context;
39
use CGI::Session;
42
use CGI::Session;
Lines 291-296 if ($barcode) { Link Here
291
    $template->param(
294
    $template->param(
292
        authvalcode_notforloan => C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}),
295
        authvalcode_notforloan => C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}),
293
    );
296
    );
297
    # Fix for bug 7494: optional checkout-time fallback search for a book
298
299
    if ( $error->{'UNKNOWN_BARCODE'}
300
        && C4::Context->preference("itemBarcodeFallbackSearch") )
301
    {
302
     $template->param( FALLBACK => 1 );
303
304
        my $query = "kw=" . $barcode;
305
        my ( $searcherror, $results, $total_hits ) = SimpleSearch($query);
306
307
        # if multiple hits, offer options to librarian
308
        if ( $total_hits > 0 ) {
309
            my @options = ();
310
            foreach my $hit ( @{$results} ) {
311
                my $chosen =
312
                  TransformMarcToKoha( C4::Context->dbh,
313
                    MARC::Record->new_from_usmarc($hit) );
314
315
                # offer all barcodes individually
316
                foreach my $barcode ( sort split(/\s*\|\s*/, $chosen->{barcode}) ) {
317
                    my %chosen_single = %{$chosen};
318
                    $chosen_single{barcode} = $barcode;
319
                    push( @options, \%chosen_single );
320
                }
321
            }
322
            $template->param( options => \@options );
323
        }
324
    }
294
325
295
    delete $question->{'DEBT'} if ($debt_confirmed);
326
    delete $question->{'DEBT'} if ($debt_confirmed);
296
    foreach my $impossible ( keys %$error ) {
327
    foreach my $impossible ( keys %$error ) {
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 158-163 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
158
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
158
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
159
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','off|test|production','Choice');
159
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','off|test|production','Choice');
160
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8|EAN13','Choice');
160
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8|EAN13','Choice');
161
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeFallbackSearch','','If set, uses scanned item barcodes as a catalogue search if not found as barcodes',NULL,'YesNo');
161
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
162
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
162
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
163
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
163
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
164
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 6990-6995 if ( CheckVersion($DBversion) ) { Link Here
6990
    SetVersion($DBversion);
6990
    SetVersion($DBversion);
6991
}
6991
}
6992
6992
6993
$DBversion = "3.13.00.XXX";
6994
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6995
    $dbh->do(
6996
"INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeFallbackSearch','','If set, uses scanned item barcodes as a catalogue search if not found as barcodes',NULL,'YesNo')"
6997
    );
6998
    print "Upgrade to $DBversion done (Add itemBarcodeFallbackSearch syspref)\n";
6999
    # SetVersion($DBversion);
7000
}
7001
6993
7002
6994
=head1 FUNCTIONS
7003
=head1 FUNCTIONS
6995
7004
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 19-24 Circulation: Link Here
19
                  EAN13: EAN-13 or zero-padded UPC-A from
19
                  EAN13: EAN-13 or zero-padded UPC-A from
20
            - scanned item barcodes.
20
            - scanned item barcodes.
21
        -
21
        -
22
            - pref: itemBarcodeFallbackSearch
23
              choices:
24
                  yes: "Enable"
25
                  no: "Don't enable"
26
            - to use scanned item barcodes as a catalogue search if not found as barcodes.
27
        -
22
            - Sort previous checkouts on the circulation page from
28
            - Sort previous checkouts on the circulation page from
23
            - pref: previousIssuesDefaultSortOrder
29
            - pref: previousIssuesDefaultSortOrder
24
              choices:
30
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +22 lines)
Lines 469-480 function validate1(date) { Link Here
469
        [% END %]
469
        [% END %]
470
470
471
        [% IF ( UNKNOWN_BARCODE ) %]
471
        [% IF ( UNKNOWN_BARCODE ) %]
472
            <li>The barcode was not found [% barcode |html %]</li>
472
            <li>The barcode was not found [% barcode |html %]
473
	    [% IF ( fast_cataloging ) %]
473
	    [% IF ( fast_cataloging ) %]
474
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
474
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
475
            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% borrowernumber %]&amp;branch=[% branch %]&amp;duedatespec=[% duedatespec %]&amp;stickyduedate=[% stickyduedate %]">Fast cataloging</a>
475
            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% borrowernumber %]&amp;branch=[% branch %]&amp;duedatespec=[% duedatespec %]&amp;stickyduedate=[% stickyduedate %]">Fast cataloging</a>
476
		[% END %]
476
		[% END %]
477
	    [% END %]
477
	    [% END %]
478
479
        [% IF ( FALLBACK ) %]
480
            [% IF options %]
481
                <br />The following items were found by searching:
482
                [% FOREACH book IN options %]
483
                    <br />
484
                    <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
485
                        <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
486
                        <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
487
                        <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
488
                        <input type="hidden" name="branch" value="[% branch %]" />
489
                        <input type="hidden" name="barcode" value="[% book.barcode %]" />
490
                        <input type="submit" name="x" value="Check out [% book.barcode %]: [% book.title %]" />
491
                    </form>
492
                [% END %]
493
            [% ELSE %]
494
                <br />No items were found by searching.
495
            [% END %]
496
        [% END %]
497
498
     </li>
478
        [% END %]
499
        [% END %]
479
500
480
        [% IF ( NOT_FOR_LOAN ) %]
501
        [% IF ( NOT_FOR_LOAN ) %]
481
- 

Return to bug 7494