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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 375-377 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
375
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
375
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
376
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
376
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
377
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
377
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
378
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5566-5571 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5566
    SetVersion ($DBversion);
5566
    SetVersion ($DBversion);
5567
}
5567
}
5568
5568
5569
$DBversion = 'XXX';
5570
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5571
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');");
5572
   print "Upgrade to $DBversion done (Add OpacSuppressionByIPRange syspref)\n";
5573
   SetVersion ($DBversion);
5574
}
5575
5569
=head1 FUNCTIONS
5576
=head1 FUNCTIONS
5570
5577
5571
=head2 TableExists($table)
5578
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+4 lines)
Lines 141-144 Cataloging: Link Here
141
                  yes: Hide
141
                  yes: Hide
142
                  no: "Don't hide"
142
                  no: "Don't hide"
143
            - items marked as suppressed from OPAC search results. Note that you must have the <code>Suppress</code> index set up in Zebra and at least one suppressed item, or your searches will be broken.
143
            - items marked as suppressed from OPAC search results. Note that you must have the <code>Suppress</code> index set up in Zebra and at least one suppressed item, or your searches will be broken.
144
            - Restrict the suppression to IP adresses outside of the IP range
145
            - pref: OpacSuppressionByIPRange
146
              class: short
147
            - (Leave blank if not used. Define a range like <code>192.168.</code>.)
144
148
(-)a/opac/opac-search.pl (-2 / +11 lines)
Lines 449-455 my @limit_inputs = $limit_cgi ? _input_cgi_parse($limit_cgi) : (); Link Here
449
#
449
#
450
# add OPAC suppression - requires at least one item indexed with Suppress
450
# add OPAC suppression - requires at least one item indexed with Suppress
451
if (C4::Context->preference('OpacSuppression')) {
451
if (C4::Context->preference('OpacSuppression')) {
452
    $query = "($query) not Suppress=1";
452
    # OPAC suppression by IP address
453
    if (C4::Context->preference('OpacSuppressionByIPRange')) {
454
        my $IPAddress = $ENV{'REMOTE_ADDR'};
455
        my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
456
        if ($IPAddress !~ /^$IPRange/)  {
457
            $query = "($query) not Suppress=1";
458
        }
459
    }
460
    else {
461
        $query = "($query) not Suppress=1";
462
    }
453
}
463
}
454
464
455
$template->param ( LIMIT_INPUTS => \@limit_inputs );
465
$template->param ( LIMIT_INPUTS => \@limit_inputs );
456
- 

Return to bug 8492