@@ -, +, @@ have items owned by the logged in library, and records which have no items owned by the logged in library. by the currently logged in library should not appear. --- catalogue/search.pl | 8 ++- installer/data/mysql/updatedatabase.pl | 20 ++++++ .../intranet-tmpl/prog/en/includes/cat-search.inc | 64 +++++++++++--------- .../prog/en/modules/admin/preferences/admin.pref | 7 ++ .../prog/en/modules/catalogue/advsearch.tt | 59 ++++++++++-------- 5 files changed, 104 insertions(+), 54 deletions(-) --- a/catalogue/search.pl +++ a/catalogue/search.pl @@ -179,9 +179,11 @@ else { flagsrequired => { catalogue => 1 }, } ); + if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { $template->param('UNIMARC' => 1); } + if (C4::Context->preference("IntranetNumbersPreferPhrase")) { $template->param('numbersphr' => 1); } @@ -411,7 +413,11 @@ my @operands = $cgi->param('q'); # limits are use to limit to results to a pre-defined category such as branch or language my @limits = $cgi->param('limit'); -if($params->{'multibranchlimit'}) { +if ( C4::Context->preference('IndependentBranchesIntranetSearch') ) { + @limits = map { ( $_ =~ /^branch:/ ) ? undef : $_ } @limits; + push( @limits, "branch: " . C4::Context->userenv->{branch} ); +} +elsif( $params->{'multibranchlimit'} ) { push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; } --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6784,6 +6784,26 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.11.00.XXX"; +if ( CheckVersion($DBversion) ) { + print "Upgrade to $DBversion done (IndependentBranches)\n"; + $dbh->do(" + INSERT INTO systempreferences ( + variable, + value, + options, + explanation, + type + ) VALUES ( + 'IndependentBranchesIntranetSearch', + '0', + '', + 'If on, the staff interface search will hide all records that do not contain an item owned by the logged in branch.', + 'YesNo' + ) + "); + SetVersion ($DBversion); +} =head1 FUNCTIONS --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc @@ -1,33 +1,41 @@
-

[% LibraryName %]

-
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -70,6 +70,13 @@ Administration: yes: Prevent no: "Don't prevent" - staff (but not superlibrarians) from modifying objects (holds, items, patrons, etc.) belonging to other libraries. + - + - pref: IndependentBranchesIntranetSearch + default: 0 + choices: + yes: Prevent + no: "Don't prevent" + - staff from seeing records without items owned by the logged in branch. CAS Authentication: - - pref: casAuthentication --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Koha › Catalog › Advanced search [% INCLUDE 'doc-head-close.inc' %] @@ -229,34 +230,42 @@ [% END %] -
Location and availability -
-

-
+
Location and availability +
+

+
+ + [% UNLESS Koha.Preference('IndependentBranchesIntranetSearch') %] +
+

+ + +

-
-

- - [% IF ( searchdomainloop ) %] -

OR

-

+ [% IF ( searchdomainloop ) %] +

OR

+

+ + +

+ [% END %] +
[% END %]
-
--