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

(-)a/catalogue/search.pl (-1 / +1 lines)
Lines 376-382 my %is_nolimit = map { $_ => 1 } @nolimits; Link Here
376
@limits = grep { not $is_nolimit{$_} } @limits;
376
@limits = grep { not $is_nolimit{$_} } @limits;
377
377
378
if ( $params->{'multibranchlimit'} ) {
378
if ( $params->{'multibranchlimit'} ) {
379
    my $branchfield  = C4::Context->preference('AdvancedSearchBranchFieldToUse');
379
    my $branchfield  = C4::Context->preference('SearchLimitLibrary');
380
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
380
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
381
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
381
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
382
382
(-)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 582-587 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
582
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
582
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
583
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
583
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
584
('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'),
584
('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'),
585
('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'),
585
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
586
('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'),
586
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
587
('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'),
587
('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'),
588
('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 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'} || ( $branch_group_limit && $branch_group_limit =~ /^multibranchlimit-/ ) ) {
499
499
    my $branchfield  = C4::Context->preference('SearchLimitLibrary');
500
if ( $params->{'multibranchlimit'} ) {
501
    my $branchfield  = C4::Context->preference('AdvancedSearchBranchFieldToUse');
502
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
500
    my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
503
501
504
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
502
    my @branchcodes  = map { $_->branchcode } $search_group->all_libraries;
505
- 

Return to bug 21249