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 35-40 use C4::Circulation; Link Here
35
use C4::Overdues qw/CheckBorrowerDebarred/;
36
use C4::Overdues qw/CheckBorrowerDebarred/;
36
use C4::Members;
37
use C4::Members;
37
use C4::Biblio;
38
use C4::Biblio;
39
use C4::Search;
40
use MARC::Record;
38
use C4::Reserves;
41
use C4::Reserves;
39
use C4::Context;
42
use C4::Context;
40
use CGI::Session;
43
use CGI::Session;
Lines 293-298 if ($barcode) { Link Here
293
    $template->param(
296
    $template->param(
294
        authvalcode_notforloan => C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}),
297
        authvalcode_notforloan => C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}),
295
    );
298
    );
299
    # Fix for bug 7494: optional checkout-time fallback search for a book
300
301
    if ( $error->{'UNKNOWN_BARCODE'}
302
        && C4::Context->preference("itemBarcodeFallbackSearch") )
303
    {
304
     $template->param( FALLBACK => 1 );
305
306
        my $query = "kw=" . $barcode;
307
        my ( $searcherror, $results, $total_hits ) = SimpleSearch($query);
308
309
        # if multiple hits, offer options to librarian
310
        if ( $total_hits > 0 ) {
311
            my @options = ();
312
            foreach my $hit ( @{$results} ) {
313
                my $chosen =
314
                  TransformMarcToKoha( C4::Context->dbh,
315
                    MARC::Record->new_from_usmarc($hit) );
316
317
                # offer all barcodes individually
318
                foreach my $barcode ( sort split(/\s*\|\s*/,$chosen->{barcode}) ) {
319
                  my %chosen_single = %{$chosen};
320
                $chosen_single{barcode} = $barcode;
321
                    push( @options, \%chosen_single );
322
         }
323
            }
324
            $template->param( options => \@options );
325
        }
326
    }
296
327
297
    delete $question->{'DEBT'} if ($debt_confirmed);
328
    delete $question->{'DEBT'} if ($debt_confirmed);
298
    foreach my $impossible ( keys %$error ) {
329
    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 6771-6776 if ( CheckVersion($DBversion) ) { Link Here
6771
   SetVersion ($DBversion);
6771
   SetVersion ($DBversion);
6772
}
6772
}
6773
6773
6774
$DBversion = "3.09.00.XXX";
6775
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6776
    $dbh->do(
6777
"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')"
6778
    );
6779
    print "Upgrade to $DBversion done (Add itemBarcodeFallbackSearch syspref)\n";
6780
    # SetVersion($DBversion);
6781
}
6782
6774
6783
6775
=head1 FUNCTIONS
6784
=head1 FUNCTIONS
6776
6785
(-)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 454-465 function validate1(date) { Link Here
454
        [% END %]
454
        [% END %]
455
455
456
        [% IF ( UNKNOWN_BARCODE ) %]
456
        [% IF ( UNKNOWN_BARCODE ) %]
457
            <li>The barcode was not found [% barcode |html %]</li>
457
            <li>The barcode was not found [% barcode |html %]
458
	    [% IF ( fast_cataloging ) %]
458
	    [% IF ( fast_cataloging ) %]
459
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
459
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
460
            <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>
460
            <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>
461
		[% END %]
461
		[% END %]
462
	    [% 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="Check out [% book.barcode %]: [% book.title %]" />
476
                    </form>
477
                    [% END %]
478
                [% ELSE %]
479
                   <br />No items were found by searching.
480
            [% END %]
481
          [% END %]
482
483
     </li>
463
        [% END %]
484
        [% END %]
464
485
465
        [% IF ( NOT_FOR_LOAN ) %]
486
        [% IF ( NOT_FOR_LOAN ) %]
466
- 

Return to bug 7494