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 287-292 if ($barcode) { Link Here
287
290
288
    $template->param( alert => $alerts );
291
    $template->param( alert => $alerts );
289
292
293
    # Fix for bug 7494: optional checkout-time fallback search for a book
294
    if ( $error->{'UNKNOWN_BARCODE'}
295
        && C4::Context->preference("itemBarcodeFallbackSearch") )
296
    {
297
	$template->param( FALLBACK => 1 );
298
299
        my $query = "kw=" . $barcode;
300
        my ( $searcherror, $results, $total_hits ) = SimpleSearch($query);
301
302
        # if multiple hits, offer options to librarian
303
        if ( $total_hits > 0 ) {
304
            my @options = ();
305
            foreach my $hit ( @{$results} ) {
306
                my $chosen =
307
                  TransformMarcToKoha( C4::Context->dbh,
308
                    MARC::Record->new_from_usmarc($hit) );
309
310
                # offer all barcodes individually
311
                foreach my $barcode ( sort split(/\s*\|\s*/,$chosen->{barcode}) ) {
312
		    my %chosen_single = %{$chosen};
313
		    $chosen_single{barcode} = $barcode;
314
		    push( @options, \%chosen_single );
315
		}
316
            }
317
            $template->param( options => \@options );
318
        }
319
    }
320
290
    delete $question->{'DEBT'} if ($debt_confirmed);
321
    delete $question->{'DEBT'} if ($debt_confirmed);
291
    foreach my $impossible ( keys %$error ) {
322
    foreach my $impossible ( keys %$error ) {
292
        $template->param(
323
        $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 6181-6186 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6181
    SetVersion ($DBversion);
6181
    SetVersion ($DBversion);
6182
}
6182
}
6183
6183
6184
$DBversion = "3.09.00.XXX";
6185
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6186
    $dbh->do(
6187
"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')"
6188
    );
6189
    print
6190
      "Upgrade to $DBversion done (Add itemBarcodeFallbackSearch syspref)\n";
6191
    # SetVersion($DBversion);
6192
}
6193
6194
6184
=head1 FUNCTIONS
6195
=head1 FUNCTIONS
6185
6196
6186
=head2 TableExists($table)
6197
=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 (-3 / +24 lines)
Lines 453-464 function validate1(date) { Link Here
453
        [% END %]
453
        [% END %]
454
454
455
        [% IF ( UNKNOWN_BARCODE ) %]
455
        [% IF ( UNKNOWN_BARCODE ) %]
456
            <li>The barcode was not found [% barcode %]</li>
456
            <li>The barcode "[% barcode %]" was not found.
457
457
	    [% IF ( fast_cataloging ) %]
458
	    [% IF ( fast_cataloging ) %]
458
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
459
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
459
                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode %]&amp;borrowernumber=[% borrowernumber %]&amp;branch=[% branch %]&amp;duedatespec=[% duedatespec %]&amp;stickyduedate=[% stickyduedate %]">Fast cataloging</a>
460
                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode %]&amp;borrowernumber=[% borrowernumber %]&amp;branch=[% branch %]&amp;duedatespec=[% duedatespec %]&amp;stickyduedate=[% stickyduedate %]">Fast cataloging</a>.
461
		[% END %]
462
	    [% END %]
463
464
	    [% IF ( FALLBACK ) %]
465
	        [% IF options %]
466
		    <br />The following items were found by searching:
467
		    [% FOREACH book IN options %]
468
		        <br />
469
			<form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
470
			    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
471
			    <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
472
			    <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
473
			    <input type="hidden" name="branch" value="[% branch %]" />
474
			    <input type="hidden" name="barcode" value="[% book.barcode %]" />
475
			    <input type="submit" name="x" value="Issue [% book.barcode %]: [% book.title %]" />
476
			</form>
477
		    [% END %]
478
                [% ELSE %]
479
		    <br />No items were found by searching.
460
		[% END %]
480
		[% END %]
461
	    [% END %]
481
	    [% END %]
482
483
	    </li>
462
        [% END %]
484
        [% END %]
463
485
464
        [% IF ( NOT_FOR_LOAN ) %]
486
        [% IF ( NOT_FOR_LOAN ) %]
465
- 

Return to bug 7494