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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 374-376 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
374
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');
374
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,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
375
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('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');
376
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('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5635-5640 if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5635
    SetVersion($DBversion);
5635
    SetVersion($DBversion);
5636
}
5636
}
5637
5637
5638
$DBversion = 'XXX';
5639
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5640
   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');");
5641
   print "Upgrade to $DBversion done (Add OpacSuppressionByIPRange syspref)\n";
5642
   SetVersion ($DBversion);
5643
}
5644
5638
=head1 FUNCTIONS
5645
=head1 FUNCTIONS
5639
5646
5640
=head2 TableExists($table)
5647
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+4 lines)
Lines 142-145 Cataloging: Link Here
142
                  yes: Hide
142
                  yes: Hide
143
                  no: "Don't hide"
143
                  no: "Don't hide"
144
            - 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
            - 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.
145
            - Restrict the suppression to IP adresses outside of the IP range
146
            - pref: OpacSuppressionByIPRange
147
              class: short
148
            - (Leave blank if not used. Define a range like <code>192.168.</code>.)
145
149
(-)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