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

(-)a/circ/circulation.pl (+26 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 33-38 use C4::Circulation; Link Here
33
use C4::Overdues qw/CheckBorrowerDebarred/;
34
use C4::Overdues qw/CheckBorrowerDebarred/;
34
use C4::Members;
35
use C4::Members;
35
use C4::Biblio;
36
use C4::Biblio;
37
use C4::Search;
38
use MARC::Record;
36
use C4::Reserves;
39
use C4::Reserves;
37
use C4::Context;
40
use C4::Context;
38
use CGI::Session;
41
use CGI::Session;
Lines 279-284 if ($barcode) { Link Here
279
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
282
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
280
    my $blocker = $invalidduedate ? 1 : 0;
283
    my $blocker = $invalidduedate ? 1 : 0;
281
284
285
    # Fix for bug 7494: optional checkout-time fallback search for a book
286
    if ( $error->{'UNKNOWN_BARCODE'}
287
        && C4::Context->preference("itemBarcodeFallbackSearch") )
288
    {
289
        my $query =
290
            "kw="
291
          . $barcode
292
          . " and ( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )";
293
        my ( $searcherror, $results, $total_hits ) = SimpleSearch($query);
294
295
        # if multiple hits, warn librarian
296
        if ( $total_hits > 0 ) {
297
            my $chosen =
298
              TransformMarcToKoha( C4::Context->dbh,
299
                MARC::Record->new_from_usmarc( $results->[0] ) );
300
            # use first barcode if multiple
301
            $barcode = ( $chosen->{barcode} =~ m/^([^|]*)/ )[0];
302
            ( $error, $question ) =
303
              CanBookBeIssued( $borrower, $barcode, $datedue, $inprocess );
304
            $question->{'FALLBACK'} = 1;
305
        }
306
    }
307
282
    delete $question->{'DEBT'} if ($debt_confirmed);
308
    delete $question->{'DEBT'} if ($debt_confirmed);
283
    foreach my $impossible ( keys %$error ) {
309
    foreach my $impossible ( keys %$error ) {
284
        $template->param(
310
        $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 (+12 lines)
Lines 5146-5151 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5146
    SetVersion($DBversion);
5146
    SetVersion($DBversion);
5147
}
5147
}
5148
5148
5149
5150
5151
$DBversion = '3.07.00.XXX';
5152
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5153
    $dbh->do(
5154
	"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')"
5155
	);
5156
    print
5157
	"Upgrade to $DBversion done (Add itemBarcodeFallbackSearch syspref)\n";
5158
    # SetVersion ($DBversion);
5159
}
5160
5149
=head1 FUNCTIONS
5161
=head1 FUNCTIONS
5150
5162
5151
=head2 DropAllForeignKeys($table)
5163
=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