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

(-)a/circ/circulation.pl (+26 lines)
Lines 4-9 Link Here
4
4
5
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
6
# copyright 2010 BibLibre
6
# copyright 2010 BibLibre
7
# Copyright 2012 software.coop and MJ Ray
7
#
8
#
8
# This file is part of Koha.
9
# This file is part of Koha.
9
#
10
#
Lines 32-37 use C4::Circulation; Link Here
32
use C4::Overdues qw/CheckBorrowerDebarred/;
33
use C4::Overdues qw/CheckBorrowerDebarred/;
33
use C4::Members;
34
use C4::Members;
34
use C4::Biblio;
35
use C4::Biblio;
36
use C4::Search;
37
use MARC::Record;
35
use C4::Reserves;
38
use C4::Reserves;
36
use C4::Context;
39
use C4::Context;
37
use CGI::Session;
40
use CGI::Session;
Lines 282-287 if ($barcode) { Link Here
282
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
285
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
283
    my $blocker = $invalidduedate ? 1 : 0;
286
    my $blocker = $invalidduedate ? 1 : 0;
284
287
288
    # Fix for bug 7494: optional checkout-time fallback search for a book
289
    if ( $error->{'UNKNOWN_BARCODE'}
290
        && C4::Context->preference("itemBarcodeFallbackSearch") )
291
    {
292
        my $query =
293
            "kw=" 
294
          . $barcode
295
          . " and ( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )";
296
        my ( $searcherror, $results, $total_hits ) = SimpleSearch($query);
297
298
        # if multiple hits, warn librarian
299
        if ( $total_hits > 0 ) {
300
            my $chosen =
301
              TransformMarcToKoha( C4::Context->dbh,
302
                MARC::Record->new_from_usmarc( $results->[0] ) );
303
            # use first barcode if multiple
304
            $barcode = ( $chosen->{barcode} =~ m/^([^|]*)/ )[0];
305
            ( $error, $question ) =
306
              CanBookBeIssued( $borrower, $barcode, $datedue, $inprocess );
307
            $question->{'FALLBACK'} = 1;
308
        }
309
    }
310
285
    delete $question->{'DEBT'} if ($debt_confirmed);
311
    delete $question->{'DEBT'} if ($debt_confirmed);
286
    foreach my $impossible ( keys %$error ) {
312
    foreach my $impossible ( keys %$error ) {
287
        $template->param(
313
        $template->param(
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 165-170 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
165
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
165
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
166
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');
166
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');
167
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','Choice');
167
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','Choice');
168
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');
168
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
169
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
169
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
170
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
170
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
171
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 (+13 lines)
Lines 4994-4999 if ( C4::Context->preference("Version") lt TransformToNum($DBversion) ) { Link Here
4994
    SetVersion($DBversion);
4994
    SetVersion($DBversion);
4995
}
4995
}
4996
4996
4997
4998
4999
$DBversion = '3.07.00.XXX';
5000
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5001
    $dbh->do(
5002
"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')"
5003
    );
5004
    print
5005
      "Upgrade to $DBversion done (Add itemBarcodeFallbackSearch syspref)\n";
5006
5007
    # SetVersion ($DBversion);
5008
}
5009
4997
=head1 FUNCTIONS
5010
=head1 FUNCTIONS
4998
5011
4999
=head2 DropAllForeignKeys($table)
5012
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 18-23 Circulation: Link Here
18
                  libsuite8: Convert from Libsuite8 form
18
                  libsuite8: Convert from Libsuite8 form
19
            - scanned item barcodes.
19
            - scanned item barcodes.
20
        -
20
        -
21
            - pref: itemBarcodeFallbackSearch
22
              choices:
23
                  yes: "Enable"
24
                  no: "Don't enable"
25
            - to use scanned item barcodes as a catalogue search if not found as barcodes.
26
        -
21
            - Sort previous checkouts on the circulation page from
27
            - Sort previous checkouts on the circulation page from
22
            - pref: previousIssuesDefaultSortOrder
28
            - pref: previousIssuesDefaultSortOrder
23
              choices:
29
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +7 lines)
Lines 260-265 function refocus(calendar) { Link Here
260
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber %]">[% issued_firstname %] [% issued_surname %]</a> ([% issued_cardnumber %]). Check in and check out?</li>
260
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber %]">[% issued_firstname %] [% issued_surname %]</a> ([% issued_cardnumber %]). Check in and check out?</li>
261
[% END %]
261
[% END %]
262
262
263
[% IF ( FALLBACK ) %]
264
    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) was found by searching. Check out anyway?</li>
265
[% END %]
266
263
[% IF ( TOO_MANY ) %]
267
[% IF ( TOO_MANY ) %]
264
    <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
268
    <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
265
[% END %]
269
[% END %]
Lines 298-304 function refocus(calendar) { Link Here
298
302
299
    <input type="hidden" name="barcode" value="[% barcode %]" />
303
    <input type="hidden" name="barcode" value="[% barcode %]" />
300
    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
304
    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
305
    [% IF ( FALLBACK ) %]
306
    [% ELSE %]
301
    <input type="hidden" name="issueconfirmed" value="1" />
307
    <input type="hidden" name="issueconfirmed" value="1" />
308
    [% END %]
302
    [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
309
    [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
303
    [% IF ( INVALID_DATE ) %]
310
    [% IF ( INVALID_DATE ) %]
304
    <p>
311
    <p>
305
- 

Return to bug 7494