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

(-)a/catalogue/search.pl (-1 / +1 lines)
Lines 421-427 my %is_nolimit = map { $_ => 1 } @nolimits; Link Here
421
@limits = grep { not $is_nolimit{$_} } @limits;
421
@limits = grep { not $is_nolimit{$_} } @limits;
422
422
423
if ( $params->{'multibranchlimit'} ) {
423
if ( $params->{'multibranchlimit'} ) {
424
    my $branchfield  = C4::Context->preference('AdvancedSearchBranchFieldToUse');
424
    my $branchfield  = C4::Context->preference('SearchLimitLibrary');
425
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
425
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
426
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
426
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
427
427
(-)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-add_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 syspref' );
6
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 562-567 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
562
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
562
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
563
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
563
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
564
('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'),
564
('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'),
565
('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'),
565
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
566
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
566
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
567
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
567
('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'),
568
('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 / +3 lines)
Lines 495-504 if (@searchCategories > 0) { Link Here
495
495
496
@limits = map { uri_unescape($_) } @limits;
496
@limits = map { uri_unescape($_) } @limits;
497
497
498
my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse');
498
if ( $params->{'multibranchlimit'} ||
499
499
     $branch_group_limit && $branch_group_limit =~ /^multibranchlimit-/ ) {
500
if ( $params->{'multibranchlimit'} ) {
500
    my $branchfield  = C4::Context->preference('SearchLimitLibrary');
501
    my $branchfield  = C4::Context->preference('AdvancedSearchBranchFieldToUse');
502
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
501
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
503
502
504
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
503
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
505
- 

Return to bug 21249