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 286-291 if ($barcode) { Link Here
286
289
287
    $template->param( alert => $alerts );
290
    $template->param( alert => $alerts );
288
291
292
    # Fix for bug 7494: optional checkout-time fallback search for a book
293
    if ( $error->{'UNKNOWN_BARCODE'}
294
        && C4::Context->preference("itemBarcodeFallbackSearch") )
295
    {
296
	$template->param( FALLBACK => 1 );
297
298
        my $query = "kw=" . $barcode;
299
        my ( $searcherror, $results, $total_hits ) = SimpleSearch($query);
300
301
        # if multiple hits, offer options to librarian
302
        if ( $total_hits > 0 ) {
303
            my @options = ();
304
            foreach my $hit ( @{$results} ) {
305
                my $chosen =
306
                  TransformMarcToKoha( C4::Context->dbh,
307
                    MARC::Record->new_from_usmarc($hit) );
308
309
                # offer all barcodes individually
310
                foreach my $barcode ( sort split(/\s*\|\s*/,$chosen->{barcode}) ) {
311
		    my %chosen_single = %{$chosen};
312
		    $chosen_single{barcode} = $barcode;
313
		    push( @options, \%chosen_single );
314
		}
315
            }
316
            $template->param( options => \@options );
317
        }
318
    }
319
289
    delete $question->{'DEBT'} if ($debt_confirmed);
320
    delete $question->{'DEBT'} if ($debt_confirmed);
290
    foreach my $impossible ( keys %$error ) {
321
    foreach my $impossible ( keys %$error ) {
291
        $template->param(
322
        $template->param(
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 160-165 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
160
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
160
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
161
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');
161
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');
162
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');
162
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');
163
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');
163
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
164
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
164
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
165
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
165
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
166
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 (+11 lines)
Lines 6532-6537 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6532
    SetVersion ($DBversion);
6532
    SetVersion ($DBversion);
6533
}
6533
}
6534
6534
6535
$DBversion = "3.09.00.XXX";
6536
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6537
    $dbh->do(
6538
"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')"
6539
    );
6540
    print
6541
      "Upgrade to $DBversion done (Add itemBarcodeFallbackSearch syspref)\n";
6542
    # SetVersion($DBversion);
6543
}
6544
6545
6535
=head1 FUNCTIONS
6546
=head1 FUNCTIONS
6536
6547
6537
=head2 TableExists($table)
6548
=head2 TableExists($table)
(-)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 445-456 function validate1(date) { Link Here
445
        [% END %]
445
        [% END %]
446
446
447
        [% IF ( UNKNOWN_BARCODE ) %]
447
        [% IF ( UNKNOWN_BARCODE ) %]
448
            <li>The barcode was not found [% barcode |html %]</li>
448
            <li>The barcode was not found [% barcode |html %]
449
	    [% IF ( fast_cataloging ) %]
449
	    [% IF ( fast_cataloging ) %]
450
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
450
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
451
            <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>
451
            <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>
452
		[% END %]
452
		[% END %]
453
	    [% END %]
453
	    [% END %]
454
455
	    [% IF ( FALLBACK ) %]
456
	        [% IF options %]
457
		    <br />The following items were found by searching:
458
		    [% FOREACH book IN options %]
459
		        <br />
460
			<form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
461
			    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
462
			    <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
463
			    <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
464
			    <input type="hidden" name="branch" value="[% branch %]" />
465
			    <input type="hidden" name="barcode" value="[% book.barcode %]" />
466
			    <input type="submit" name="x" value="Check out [% book.barcode %]: [% book.title %]" />
467
			</form>
468
		    [% END %]
469
                [% ELSE %]
470
		    <br />No items were found by searching.
471
		[% END %]
472
	    [% END %]
473
474
	    </li>
454
        [% END %]
475
        [% END %]
455
476
456
        [% IF ( NOT_FOR_LOAN ) %]
477
        [% IF ( NOT_FOR_LOAN ) %]
457
- 

Return to bug 7494