From a10081c439ba5cb19a8dc168e785796f2f158849 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 10 Sep 2024 15:39:53 +0000 Subject: [PATCH] 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: Brendan Lawlor --- catalogue/search.pl | 3 + .../prog/css/src/staff-global.scss | 9 +- .../prog/en/modules/catalogue/results.tt | 1464 ++++++++--------- 3 files changed, 679 insertions(+), 797 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index b64f0551b05..91ce2fa0908 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -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 ); } diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 878634a08a4..7aed0c99baf 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2006,7 +2006,6 @@ li { &.unavailable { clear: left; - display: block; } } @@ -2023,6 +2022,12 @@ li { display: block; } } + .all { + display: block; + } + .branch_specific { + display: none; + } } #searchresults, @@ -4895,4 +4900,4 @@ div .suggestion_note { display: block; } } -} +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index ade947fd89d..5aff1e6cb60 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -11,28 +11,27 @@ [% USE AuthorisedValues %] [% INCLUDE 'doc-head-open.inc' %] -[% FILTER collapse %] - [% IF ( searchdesc ) %] - [% IF ( query_desc ) %] - [% IF ( limit_desc ) %] - [% tx("Results of search for {query_desc} with limit(s): '{limit_desc}'", { query_desc = query_desc, limit_desc = limit_desc }) | html %] - [% ELSE %] - [% tx("Results of search for {query_desc}", { query_desc = query_desc }) | html %] - [% END %] +<title>[% FILTER collapse %] + [% IF ( searchdesc ) %] + [% IF ( query_desc ) %] + [% IF ( limit_desc ) %] + [% tx("Results of search for {query_desc} with limit(s): '{limit_desc}'", { query_desc = query_desc, limit_desc = limit_desc }) | html %] [% ELSE %] - [% IF ( limit_desc ) %] - [% tx("Results of search for {limit_desc}", { limit_desc = limit_desc }) | html %] - [% ELSE %] - [% t("Results of search") | html %] - [% END %] + [% tx("Results of search for {query_desc}", { query_desc = query_desc }) | html %] [% END %] [% ELSE %] - [% t("You did not specify any search criteria") | html %] + [% IF ( limit_desc ) %] + [% tx("Results of search for {limit_desc}", { limit_desc = limit_desc }) | html %] + [% ELSE %] + [% t("Results of search") | html %] + [% END %] [% END %] - › [% t("Catalog") | html %] › [% t("Koha") | html %] - [% END %] + [% ELSE %] + [% t("You did not specify any search criteria") | html %] + [% END %] › + [% t("Catalog") | html %] › + [% t("Koha") | html %] +[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -67,855 +66,718 @@ [% END #/ WRAPPER sub-header.inc %] [% WRAPPER 'main-container.inc' aside='facets' %] -

Search results

- - [% IF ( total ) %] -

- [% total | html %] result(s) found - [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF limit_desc %] -  with limit(s): '[% limit_desc | html %]' - [% END %][% IF ( LibraryName ) %]in [% LibraryName | html %] Catalog[% END %]. -

- - [% UNLESS scan %] - + +

Search results

+ + [% IF ( total ) %] + +

+ [% total | html %] result(s) found [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF limit_desc %] with limit(s): '[% limit_desc | html %]'[% END %][% IF ( LibraryName ) %] in [% LibraryName | html %] Catalog[% END %]. +

+ + [% UNLESS scan %] + Edit this search - [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %] - | Save search as filter - [% END %] - -
- -
- -
-
- Select all - Clear all - | - [% IF Koha.Preference("StaffHighlightedWords") == 1 %] - Unhighlight - Highlight - | + [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %] + | Save search as filter [% END %] - [% IF (Koha.Preference("intranetbookbag")) %] - - [% END %] +
+ +
- [% IF Koha.Preference('virtualshelves') %] -
- - -
- [% END # /IF virtualshelves %] +
+ [% END %] - [% IF ( CAN_user_reserveforothers_place_holds && DisplayMultiPlaceHold ) %] - [% IF ( holdfor or holdforclub ) %] -
- - + [% IF ( searchdesc ) %] + [% BLOCK sort_search_query ~%] + [%~ FOREACH QUERY_INPUT IN QUERY_INPUTS ~%] + &[% QUERY_INPUT.input_name | uri %]=[% QUERY_INPUT.input_value | uri %] + [%~ END ~%] + [%~ FOREACH LIMIT_INPUT IN LIMIT_INPUTS ~%] + &[% LIMIT_INPUT.input_name | uri %]=[% LIMIT_INPUT.input_value | uri %] + [%~ END ~%] + [%~ END %] + [% END %] + + - [% ELSE %] - - [% END # /IF holfor %] - [% END # /IF CAN_user_reserveforothers_place_holds %] - [% IF Koha.Preference('BrowseResultSelection') %] - - [% END %] + [% IF ( sort_by == "popularity_asc" ) %] +
  • Popularity (least to most)
  • + [% ELSE %] +
  • Popularity (least to most)
  • + [% END %] - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - +
  • -
    - - [% IF ( CAN_user_tools_records_batchmod || CAN_user_tools_records_batchdel || CAN_user_editcatalogue_edit_catalogue ) %] - - [% END %] -
    - [% END %] - [% IF ( searchdesc ) %] - [% BLOCK sort_search_query ~%] - [%~ FOREACH QUERY_INPUT IN QUERY_INPUTS ~%] - &[% QUERY_INPUT.input_name | uri %]=[% QUERY_INPUT.input_value | uri %] - [%~ END ~%] - [%~ FOREACH LIMIT_INPUT IN LIMIT_INPUTS ~%] - &[% LIMIT_INPUT.input_name | uri %]=[% LIMIT_INPUT.input_value | uri %] - [%~ END ~%] - [%~ END %] - [% END %] +
  • -
    - - +
    + + [% IF Koha.Preference('numSearchResultsDropdown') %] + [% END %] -
  • - [% IF ( sort_by == "pubdate_dsc" ) %] -
  • Publication/Copyright date: newest to oldest
  • - [% ELSE %] -
  • Publication/Copyright date: newest to oldest
  • - [% END %] +
    +
    + [% INCLUDE 'csrf-token.inc' %] + + + +
    +
    + [% END %] - [% IF ( sort_by == "pubdate_asc" ) %] -
  • Publication/Copyright date: oldest to newest
  • - [% ELSE %] -
  • Publication/Copyright date: oldest to newest
  • - [% END %] + [% ELSE # /IF total %] + - [% IF ( sort_by == "acqdate_dsc" ) %] -
  • Acquisition date: newest to oldest
  • - [% ELSE %] -
  • Acquisition date: newest to oldest
  • - [% END %] - [% IF ( sort_by == "acqdate_asc" ) %] -
  • Acquisition date: oldest to newest
  • - [% ELSE %] -
  • Acquisition date: oldest to newest
  • +
    +

    No results found

    + [% IF ( searchdesc ) %] +

    + No results match your search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %][% IF ( LibraryName ) %] in [% LibraryName | html %] Catalog[% END %]. +

    + [% IF CAN_user_acquisition_order_manage && searchtoorder_basketno && searchtoorder_vendorid %][%# Coming from the basket or vendor view %] +

    View basket

    [% END %] - -
  • - [% IF ( sort_by == "title_az" || sort_by == "title_asc" ) %] -
  • Title (A-Z)
  • - [% ELSE %] -
  • Title (A-Z)
  • + + Edit this search + + [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %] + | Save search as filter [% END %] + [% ELSE %] +

    You did not specify any search criteria.

    + [% END %] +
    + [% END # /IF total %] + + [% IF ( query_error ) %] +

    Error: [% query_error | html %]

    + [% END %] - [% IF ( sort_by == "title_za" || sort_by == "title_dsc" ) %] -
  • Title (Z-A)
  • + + [% IF ( total ) %] + [% IF ( scan ) %] +
    +

    Scan index

    +
    + + + [% IF ( scan_search_term_to_use ) %] + [% ELSE %] -
  • Title (Z-A)
  • + Scan index for: [% END %] - + + +
    + +
    + + + + + + [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] + + + + + [% END %] +
    Term/PhraseCount
    + [% SEARCH_RESULT.title | html %] + + [% SEARCH_RESULT.author | html %] +
    +
    - - - [% IF Koha.Preference('numSearchResultsDropdown') %] -
    - - + + + + + + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + + [% END %] + + + + + + [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %] + + [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] + + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + + + [% END # /FOREACH SEARCH_RESULT %] + +
     ResultsLocation
    +
    + [% IF ( LocalCoverImages && SEARCH_RESULT.has_local_cover_image ) %] +
    + + Local cover image + +
    Local cover image
    +
    + [% END %] + + [% IF ( AmazonCoverImages && SEARCH_RESULT.normalized_isbn ) %] +
    + + Cover image from Amazon.com + +
    Amazon cover image
    +
    + [% END # /IF AmazonCoverImages %] + + [% IF ( SyndeticsCovers ) %] + [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %] +
    + + Cover from Syndetics + +
    Syndetics cover image
    - [% END %] -
    - - - [% INCLUDE 'csrf-token.inc' %] - - - - - - - [% END %] - [% ELSE # /IF total %] - + [% END %] -
    -

    No results found

    - [% IF ( searchdesc ) %] -

    - No results match your search - [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] -  with limit(s): '[% limit_desc | html %]' - [% END %][% IF ( LibraryName ) %]in [% LibraryName | html %] Catalog[% END %]. -

    - [% IF CAN_user_acquisition_order_manage && searchtoorder_basketno && searchtoorder_vendorid %] - [%# Coming from the basket or vendor view %] -

    View basket

    + [% IF ( IntranetCoce && CoceProviders && SEARCH_RESULT.normalized_isbn ) %] + [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %] + [% IF ( coce_id ) %] +
    + + + +
    Coce cover image
    +
    [% END %] - - Edit this search - - [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %] - | Save search as filter + [% END %] + + [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] + [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %] + [% IF custom_cover_image_url %] +
    + + Custom cover image + +
    Custom cover image
    +
    [% END %] - [% ELSE %] -

    You did not specify any search criteria.

    [% END %]
    - [% END # /IF total %] - - [% IF ( query_error ) %] -

    Error: [% query_error | html %]

    - [% END %] - - - [% IF ( total ) %] - [% IF ( scan ) %] -
    -

    Scan index

    -
    - - - [% IF ( scan_search_term_to_use ) %] - - [% ELSE %] - Scan index for: - [% END %] - - -
    - -
    - - - - - - [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] - - - - - [% END %] -
    Term/PhraseCount
    - [% SEARCH_RESULT.title | html %] - [% SEARCH_RESULT.author | html %]
    -
    -
    - [% ELSE # /IF scan %] -
    - [% INCLUDE 'page-numbers.inc' %] - -
    - [% IF ( searchdesc ) %] - [% FOREACH QUERY_INPUT IN QUERY_INPUTS %] - - [% END %] - [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %] - - [% END %] - [% END %] - - - - - - [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] - - [% END %] - - - - - - [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %] - - [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] - - [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] - +[% END # /IF( AmazonCoverImages || LocalCoverImages || IntranetCoce )%] + + + + - [% END # /IF( AmazonCoverImages || LocalCoverImages || IntranetCoce ) %] - + [% IF Koha.Preference('intranetbookbag') == 1 %] + [% IF ( SEARCH_RESULT.incart ) %] + | In your cart(remove) + [% ELSE %] + | Add to cart + [% END %] + [% END # / IF intranetbookbag %] - + + - - - - [% END # /FOREACH SEARCH_RESULT %] - -
     ResultsLocation
    -
    - [% IF ( LocalCoverImages && SEARCH_RESULT.has_local_cover_image ) %] -
    - - Local cover image - -
    Local cover image
    +
    + + + [% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeInfo') %] +
    + [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] + [%  SEARCH_RESULT.description | html %] + [% END %] + [% SEARCH_RESULT.description | html %]
    [% END %] - [% IF ( AmazonCoverImages && SEARCH_RESULT.normalized_isbn ) %] -
    - - Cover image from Amazon.com - -
    Amazon cover image
    -
    - [% END # /IF AmazonCoverImages %] - - [% IF ( SyndeticsCovers ) %] - [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %] -
    - - Cover from Syndetics - -
    Syndetics cover image
    -
    - [% END %] - [% END %] + [% SEARCH_RESULT.result_number | html %]. + [% SEARCH_RESULT.XSLTResultsRecord | $raw %] - [% IF ( IntranetCoce && CoceProviders && SEARCH_RESULT.normalized_isbn ) %] - [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %] - [% IF ( coce_id ) %] -
    - - - -
    Coce cover image
    -
    - [% END %] - [% END %] - - [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] - [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %] - [% IF custom_cover_image_url %] -
    - - Custom cover image - -
    Custom cover image
    -
    +

    + [% IF ( SEARCH_RESULT.norequests ) %] + No holds allowed + [% ELSE %] + [% IF CAN_user_reserveforothers_place_holds %] + Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %]) + [% IF ( holdfor ) %] | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %][% END %] + [% IF ( holdforclub ) %] | Place hold for [% holdforclub_name | html %][% END %] + [% ELSE %] + Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %]) + [% END %] + [% END # /IF SEARCH_RESULT.norequests %] + [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] + | Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %]) [% END %] - [% END %] - -

    - - - [% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeInfo') %] -
    - [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] - [% SEARCH_RESULT.description | html %] - [% END %] - [% SEARCH_RESULT.description | html %] -
    - [% END %] + [% IF Koha.Preference('ArticleRequests') %] + | Request article + [% END %] - [% SEARCH_RESULT.result_number | html %]. - [% SEARCH_RESULT.XSLTResultsRecord | $raw %] - -

    - [% IF ( SEARCH_RESULT.norequests ) %] - No holds allowed - [% ELSE %] - [% IF CAN_user_reserveforothers_place_holds %] - Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %]) - [% IF ( holdfor ) %] - | - Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] + | Edit record [% END %] - [% IF ( holdforclub ) %] - | - Place hold for [% holdforclub_name | html %] + [% IF ( CAN_user_editcatalogue_edit_items ) %] + | Edit items [% END %] - [% ELSE %] - Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %]) - [% END %] - [% END # /IF SEARCH_RESULT.norequests %] - [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] - | - Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %]) - [% END %] - [% IF Koha.Preference('intranetbookbag') == 1 %] - [% IF ( SEARCH_RESULT.incart ) %] - | In your cart - (remove) - [% ELSE %] - | Add to cart - - [% END %] - [% END # / IF intranetbookbag %] - - [% IF Koha.Preference('ArticleRequests') %] - | Request article - [% END %] + [% IF ( CAN_user_acquisition_order_manage ) %] + [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %] + | Add order + [% END %] + [% END %] - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - | Edit record - [% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %] - | Edit items - [% END %] + [% IF ( OPACBaseURL ) %] + + | OPAC view + + [% END %] +

    +
    +
    + [% IF ( SEARCH_RESULT.items_count ) %] +
    + [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] + + [% END %] - [% IF ( CAN_user_acquisition_order_manage ) %] - [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %] - | - Add order - [% END %] - [% END %] +
    [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] available:[% ELSE %], None available[% END %]
    + [% IF SEARCH_RESULT.branchtotalcount > 0 %] +
    [% tnx('{count} item', '{count} items', SEARCH_RESULT.branchtotalcount, {count = SEARCH_RESULT.branchtotalcount}) | html %][% IF ( SEARCH_RESULT.branchavailablecount ) %], [% SEARCH_RESULT.branchavailablecount | html %] available:[% ELSE %], None available[% END %]
    + [% END %] - [% IF ( OPACBaseURL ) %] - - | OPAC view - - [% END %] -

    - -
    -
    - [% IF ( SEARCH_RESULT.items_count ) %] -
    - [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] - - [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %] - , [% SEARCH_RESULT.availablecount | html %] available: + [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] + [% ELSE %] - , None available + [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] available:[% ELSE %], None available[% END %] [% END %] - - [% ELSE %] - [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %] - , [% SEARCH_RESULT.availablecount | html %] available: - [% ELSE %] - , None available - [% END %] - [% END %] -
    - +
    - [% BLOCK search_result_items %] - [% IF status_count == "onloancount" %] - [% IF SEARCH_RESULT.${status_count} > 0 %] -
    [% SEARCH_RESULT.${status_count} | html %] checked out:
    - [% END %] - [% ELSIF status_count == "othercount" %] - [% IF SEARCH_RESULT.${status_count} > 0 %] -
    [% SEARCH_RESULT.${status_count} | html %] unavailable:
    - [% END %] - [% END %] - [% IF SEARCH_RESULT.${items_loop}.size > 0 %] -
      - [% FOREACH items_loo IN SEARCH_RESULT.${items_loop} %] - [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %] - [% SET li_class='result_itype_image' %] + [% BLOCK search_result_items %] + [% IF status_count == "onloancount" %] + [% IF SEARCH_RESULT.${status_count} > 0 %] +
      [% SEARCH_RESULT.${status_count} | html %] checked out:
      +
      [% SEARCH_RESULT.branchonloancount | html %] checked out:
      [% END %] -
    • - [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %] - [% items_loo.description | html %] - [% END %] - [% IF ( items_loo.branchname ) %] - [% items_loo.branchname | html %] - [% END %] - [% IF ( items_loo.location ) %] - [% items_loo.location | html %] - [% END %] - [% IF ( items_loo.collectioncode ) %] - [% items_loo.collectioncode | html %] - [% END %] - - [% IF ( items_loo.itemcallnumber ) %] - [% items_loo.itemcallnumber | html %] - [% END %] -
      - [% IF ( items_loo.withdrawn ) %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => items_loo.withdrawn ) | html %]) - [% END %] - [% IF ( items_loo.itemlost ) %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => items_loo.itemlost ) | html %]) - [% END %] - [% IF ( items_loo.damaged ) %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => items_loo.damaged ) | html %]) + [% ELSIF status_count == "othercount" %] + [% IF SEARCH_RESULT.${status_count} > 0 %] +
      [% SEARCH_RESULT.${status_count} | html %] unavailable:
      +
      [% SEARCH_RESULT.branchothercount | html %] unavailable:
      + [% END %] + [% END %] + [% IF SEARCH_RESULT.${items_loop}.size > 0 %] +
        + [% FOREACH items_loo IN SEARCH_RESULT.${items_loop} %] + [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %] + [% SET li_class='result_itype_image'%] [% END %] - [% IF ( items_loo.intransit ) %] - (In transit) +
      • + [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %] + [% items_loo.description | html %] + [% END %] + [% IF ( items_loo.branchname ) %] + [% items_loo.branchname | html %] [% END %] - [% IF ( items_loo.onhold ) %] - (On hold) + [% IF ( items_loo.location ) %] + [% items_loo.location | html %] [% END %] - [% IF ( items_loo.notforloan ) %] - [% items_loo.notforloan | html %] + [% IF ( items_loo.collectioncode ) %] + [% items_loo.collectioncode | html %] [% END %] - [% items_loo.count | html %] -
      - - - [% IF status_count == "onloancount" %] - Due: [% items_loo.due_date | $KohaDates %] - [% END %] - - [% IF item_level_itypes && items_loo.description %] - [% items_loo.description | html %] - [% END %] -
    • - [% END # /FOREACH other_items_loo %] -
    - - [% END # /IF SEARCH_RESULT.${items_loop}.size %] - [% END # /BLOCK search_result_items %] - - [% PROCESS search_result_items status_count="availablecount" items_loop="available_items_loop" %] - - [% PROCESS search_result_items status_count="onloancount" items_loop="onloan_items_loop" %] - - [% PROCESS search_result_items status_count="othercount" items_loop="other_items_loop" %] - [% ELSE # /IF ( SEARCH_RESULT.items_count ) %] - - [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.size ) %] - Other holdings: -
      - [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %] -
    • [% ALTERNATEHOLDING.holding | html %]
    • + + [% IF ( items_loo.itemcallnumber ) %] + [% items_loo.itemcallnumber | html %] + [% END %] +
      + [% IF ( items_loo.withdrawn ) %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => items_loo.withdrawn ) | html %]) + [% END %] + [% IF ( items_loo.itemlost ) %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => items_loo.itemlost ) | html %]) + [% END %] + [% IF ( items_loo.damaged ) %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => items_loo.damaged ) | html %]) + [% END %] + [% IF ( items_loo.intransit ) %] + (In transit) + [% END %] + [% IF ( items_loo.onhold ) %] + (On hold) + [% END %] + [% IF ( items_loo.notforloan ) %] + [% items_loo.notforloan | html %] + [% END %] + [% items_loo.count | html %] +
      + + [% IF status_count == "onloancount" %] + + Due: [% items_loo.due_date | $KohaDates %] + + [% END %] + + [% IF item_level_itypes && items_loo.description %] + [% items_loo.description | html %] + [% END %] + + [% END # /FOREACH other_items_loo %] +
    + [% END # /IF SEARCH_RESULT.${items_loop}.size %] + [% END # /BLOCK search_result_items %] + + [% PROCESS search_result_items status_count="availablecount" items_loop="available_items_loop" %] + + [% PROCESS search_result_items status_count="onloancount" items_loop="onloan_items_loop" %] + + [% PROCESS search_result_items status_count="othercount" items_loop="other_items_loop" %] + + + [% ELSE # /IF ( SEARCH_RESULT.items_count ) %] + + [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.size ) %] + Other holdings: +
      + [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %] +
    • [% ALTERNATEHOLDING.holding | html %]
    • + [% END %] +
    + [% ELSE %] + No items [% END %] - - [% ELSE %] - No items - [% END %] - [% END # /IF ( SEARCH_RESULT.items_count ) %] - - -
    -
    -
    - - [% END # /IF scan %] - [% INCLUDE 'page-numbers.inc' %] - [% ELSE #/IF total %] - - [% END #/IF total %] - - [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %] -
    + +
    + [% END # /IF scan %] + [% INCLUDE 'page-numbers.inc' %] + [% ELSE #/IF total %] + + [% END #/IF total %] + + [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %] + - - - - [% END %] - -
    - - - -
    - -
    - - -
    + [% END %] + +
    + + + +
    + +
    + + +
    + [% END %] - - + + [% MACRO jsinclude BLOCK %] [% Asset.js("js/browser.js") | $raw %] [% Asset.js("js/coce.js") | $raw %] @@ -935,6 +797,18 @@ var biblionumber = "[% biblionumber | html %]"; var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]"; var holdforclub = "[% holdforclub | html %]"; + var userbranch = "[% userbranch | html %]"; + + $('#toggleitems').click( function() { + $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only"); + $('.branch_specific').toggle(); + $('.all').toggle(); + $('ul[class*="_loop_items"] li').each( function() { + if ( !$(this).hasClass(userbranch) ) { + $(this).toggle(); + } + }); + }); [% IF SEARCH_RESULTS %] var SEARCH_RESULTS = 1; [% ELSE %] @@ -1057,4 +931,4 @@ [% CoverImagePlugins | $raw %] [% END %] -[% INCLUDE 'intranet-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' %] \ No newline at end of file -- 2.39.5