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

(-)a/catalogue/search.pl (-1 / +1 lines)
Lines 380-386 my %is_nolimit = map { $_ => 1 } @nolimits; Link Here
380
@limits = grep { not $is_nolimit{$_} } @limits;
380
@limits = grep { not $is_nolimit{$_} } @limits;
381
381
382
if ( $params->{'multibranchlimit'} ) {
382
if ( $params->{'multibranchlimit'} ) {
383
    my $branchfield  = C4::Context->preference('AdvancedSearchBranchFieldToUse');
383
    my $branchfield  = C4::Context->preference('SearchLimitLibrary');
384
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
384
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
385
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
385
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
386
386
(-)a/installer/data/mysql/atomicupdate/bug_21249-Branch_to_limit_advanced_search_results.sql (-1 lines)
Line 1 Link Here
1
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('AdvancedSearchBranchFieldToUse', 'homebranch and holdingbranch', 'homebranch|holdingbranch|homebranch and holdingbranch', 'When a library or group of libraries is selected from the advanced search compare the selected branch value against this branch field(s) selected', 'choice');
(-)a/installer/data/mysql/atomicupdate/bug_21249-SearchLimitLibrary_syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('SearchLimitLibrary', 'both', 'homebranch|holdingbranch|both', "When limiting search results with a library or library group, use the item's home library, or holding library, or both.", 'Choice')});
4
5
    NewVersion( $DBversion, 21249, "Adding SearchLimitLibrary system preference" );
6
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 593-598 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
593
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
593
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
594
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
594
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
595
('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'),
595
('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'),
596
('SearchLimitLibrary', 'both', 'homebranch|holdingbranch|both', "When limiting search results with a library or library group, use the item's home library, or holding library, or both.", 'Choice'),
596
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
597
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
597
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
598
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
598
('SelfCheckAllowByIPRanges','',NULL,'(Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)','Short'),
599
('SelfCheckAllowByIPRanges','',NULL,'(Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)','Short'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-6 / +5 lines)
Lines 168-180 Searching: Link Here
168
                  az: from A to Z.
168
                  az: from A to Z.
169
                  za: from Z to A.
169
                  za: from Z to A.
170
        -
170
        -
171
            - pref: AdvancedSearchBranchFieldToUse
171
            - When limiting search results with a library or library group, limit by the item's
172
              default: homebranch and holdingbranch
172
            - pref: SearchLimitLibrary
173
              choices:
173
              choices:
174
                  homebranch: homebranch
174
                  homebranch: "home library."
175
                  holdingbranch: holdingbranch
175
                  holdingbranch: "holding library."
176
                  homebranch and holdingbranch: homebranch and holdingbranch
176
                  both: "home library and holding library."
177
            - When a library or group of libraries is selected from the advanced search compare the selected branch value against this branch field(s) selected
178
        -
177
        -
179
            - pref: displayFacetCount
178
            - pref: displayFacetCount
180
              type: boolean
179
              type: boolean
(-)a/opac/opac-search.pl (-5 / +2 lines)
Lines 484-493 if (@searchCategories > 0) { Link Here
484
484
485
@limits = map { uri_unescape($_) } @limits;
485
@limits = map { uri_unescape($_) } @limits;
486
486
487
my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse');
487
if ( $params->{'multibranchlimit'} || ( $branch_group_limit && $branch_group_limit =~ /^multibranchlimit-/ ) ) {
488
488
    my $branchfield  = C4::Context->preference('SearchLimitLibrary');
489
if ( $params->{'multibranchlimit'} ) {
490
    my $branchfield  = C4::Context->preference('AdvancedSearchBranchFieldToUse');
491
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
489
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
492
490
493
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
491
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
494
- 

Return to bug 21249