Bug 37883: Add ability to filter search results location column by logged in location

To test:

1. Apply patch, restart_all, and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ) I also recommend clearing your browser cache.
2. Do a catalog search and notice the 'Show local items only' button above the "Location" column.
3. Click it to show information ( in that column ) that is only related to the branch you are currently logged in at.
4. In the same result set have some items that are checked out, withdrawn, lost, damaged, and notforlaon.
5. Play more with the search results and ensure everything is accurate.

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lucas Gass 2025-02-26 23:07:56 +00:00
parent 0a22703807
commit 580484e2da
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
3 changed files with 21 additions and 7 deletions

View File

@ -200,6 +200,9 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $lang = C4::Languages::getlanguage($cgi);
my $userenv_branch = C4::Context->userenv->{'branch'} || '';
$template->param( userbranch => $userenv_branch );
if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
$template->param( 'UNIMARC' => 1 );
}

View File

@ -2028,6 +2028,14 @@ li {
display: block;
}
}
.all {
display: block;
}
.branch_specific {
display: none;
}
}
#searchresults,

View File

@ -773,12 +773,15 @@
[% ELSE %]
, <span>None available</span>
[% END %]
</span>
[% ELSE %]
[% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %]
, [% SEARCH_RESULT.availablecount | html %] <span>available:</span>
[% ELSE %]
, <span>None available</span>
</div>
[% IF SEARCH_RESULT.branchtotalcount > 0 %]
<div class="branch_specific">
[% tnx('{count} item', '{count} items', SEARCH_RESULT.branchtotalcount, {count = SEARCH_RESULT.branchtotalcount}) | html %][% IF ( SEARCH_RESULT.branchavailablecount ) %]
, [% SEARCH_RESULT.branchavailablecount | html %] <span>available:</span>
[% ELSE %]
, <span>None available</span>
[% END %]
</div>
[% END %]
[% END %]
</div>
@ -875,7 +878,7 @@
[% END %]
</ul>
[% ELSE %]
<span class="unavailable">No items</span>
<span class="unavailable all">No items</span>
[% END %]
[% END # /IF ( SEARCH_RESULT.items_count ) %]
[% IF SEARCH_RESULT.branchtotalcount == 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %]