Bug 7960 - Choice to not show the text labels for item types
Summary: Choice to not show the text labels for item types
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Josef Moravec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-13 19:38 UTC by Nicole C. Engard
Modified: 2023-12-28 20:43 UTC (History)
13 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds the class "itypetext" around item type descriptions so they can be hidden with CSS. To hide the descriptions, add .itypetext { display:none; } to the OPACUserCSS (for the OPAC) or IntranetUserCSS (for the staff interface) system preferences.
Version(s) released in:
22.11.00


Attachments
label and icon (22.44 KB, image/png)
2012-04-13 19:38 UTC, Nicole C. Engard
Details
Bug 7960: Add syspref to hide/show item type text labels in catalog (5.83 KB, patch)
2017-04-19 00:46 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7960: [FOLLOW-UP] Adding to places missed in first patch (19.99 KB, patch)
2017-04-28 01:43 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED OFF] Bug 7960: Add syspref to hide/show item type text labels in catalog (5.90 KB, patch)
2017-05-01 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED OFF] Bug 7960: [FOLLOW-UP] Adding to places missed in first patch (20.06 KB, patch)
2017-05-01 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (18.28 KB, patch)
2018-07-01 23:56 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (18.73 KB, patch)
2019-01-13 21:26 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (18.79 KB, patch)
2019-01-18 20:51 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (19.28 KB, patch)
2020-02-12 20:51 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (16.80 KB, patch)
2022-07-15 14:07 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (17.32 KB, patch)
2022-09-05 23:32 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (17.28 KB, patch)
2022-09-06 21:07 UTC, David Nind
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (17.34 KB, patch)
2022-10-03 17:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 7960: Add class to item type descriptions so they can be hidden with CSS (17.32 KB, patch)
2022-10-03 18:24 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2012-04-13 19:38:50 UTC
Created attachment 9189 [details]
label and icon

It would be nice if on the opac there was a way to choose not to show the text labels next to item types. For libraries with clear types this text looks ugly and many have asked to have it removed.
Comment 1 Aleisha Amohia 2017-04-19 00:46:12 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2017-04-20 13:24:08 UTC
This looks fine to me but it doesn't cover all item type image instances. Searching the templates for ".imageurl" shows several others.
Comment 3 Aleisha Amohia 2017-04-28 01:43:41 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2017-05-01 20:41:02 UTC
Created attachment 62932 [details] [review]
[SIGNED OFF] Bug 7960: Add syspref to hide/show item type text labels in catalog

To test:
1) Apply patch and update database
2) Go to Admin -> Sysprefs -> Find system preference 'ItemTypeText'
3) Should have default value 'Show'. Change to 'Don't show'.
4) Make sure 'noItemTypeImages' is enabled.
5) Search for a record in catalog on staff client. Go to detail page.
6) Confirm the text label for the item type is hidden, but the item type
image still shows.
7) Search for a record in catalog on OPAC. Go to detail page.
8) Confirm the text label for the item type is hidden, but the item type
image still shows.
9) Go back to sysprefs and set 'ItemTypeText' to 'Show'.
10) Confirm text labels now show on detail pages.

Sponsored-by: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2017-05-01 20:41:51 UTC
Created attachment 62933 [details] [review]
[SIGNED OFF] Bug 7960: [FOLLOW-UP] Adding to places missed in first patch

This patch adds the use of the syspref to:
= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-results-grouped.tt
 - opac-shelves.tt
 - opac-user.tt

Sponsored-by: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2017-05-01 20:43:24 UTC
Nice one to test!

2 notes:
- In order to see some of the changes you need to set item-level_itypes to 'biblio record'. 
- In the OPAC the 'most popular' page currently displays the biblio level itemtype description. A later patch could make it show the icon and add support for the system preferences.
Comment 7 Marcel de Rooy 2017-06-23 09:55:16 UTC
Have the impression that we should not hide labels with a syspref but resolve this with custom css. Please convince me that I am wrong.
Comment 8 Aleisha Amohia 2017-06-26 21:07:42 UTC
(In reply to Marcel de Rooy from comment #7)
> Have the impression that we should not hide labels with a syspref but
> resolve this with custom css. Please convince me that I am wrong.

The syspref just provides the functionality for the library to hide or show the text, without having to play around with css or ask us to do it for them. I don't think it's fair to assume that librarians know how to write css.
Comment 9 Marcel de Rooy 2017-06-27 11:43:08 UTC
(In reply to Aleisha Amohia from comment #8)
> (In reply to Marcel de Rooy from comment #7)
> > Have the impression that we should not hide labels with a syspref but
> > resolve this with custom css. Please convince me that I am wrong.
> 
> The syspref just provides the functionality for the library to hide or show
> the text, without having to play around with css or ask us to do it for
> them. I don't think it's fair to assume that librarians know how to write
> css.

We have to find a balance between adding a syspref for showing/hiding elements and css customization. Yes, not each librarian writes css. I will not block this patch and change the status to Signed off again. Another QA opinion please.
Comment 10 Kyle M Hall 2017-09-01 14:13:04 UTC
(In reply to Marcel de Rooy from comment #9)
> (In reply to Aleisha Amohia from comment #8)
> > (In reply to Marcel de Rooy from comment #7)
> > > Have the impression that we should not hide labels with a syspref but
> > > resolve this with custom css. Please convince me that I am wrong.
> > 
> > The syspref just provides the functionality for the library to hide or show
> > the text, without having to play around with css or ask us to do it for
> > them. I don't think it's fair to assume that librarians know how to write
> > css.
> 
> We have to find a balance between adding a syspref for showing/hiding
> elements and css customization. Yes, not each librarian writes css. I will
> not block this patch and change the status to Signed off again. Another QA
> opinion please.

I must agree, my first thought was to ask why not just add a class to make it easy to hide with css.
Comment 11 Nick Clemens 2017-10-26 11:04:03 UTC
Agreeing with other QA here, moving to failed QA
Comment 12 Fridolin Somers 2018-03-06 10:42:11 UTC
> add a class to make it easy to hide with css.
+1

Not another system preference please :(

Actually you may use a trick by painting text with background color :
  #holdings_table .itype { color: #F3F3F3; }
Comment 13 Fridolin Somers 2018-03-06 10:44:37 UTC
Or maybe one could change the existing preference noItemTypeImages to use choices : image and text, image only, text only.
My2c
Comment 14 Aleisha Amohia 2018-07-01 23:56:32 UTC Comment hidden (obsolete)
Comment 15 Aleisha Amohia 2018-07-04 00:36:22 UTC
Forgot to make original patches obsolete. Ready to test.
Comment 16 Charles Farmer 2019-01-11 19:33:11 UTC Comment hidden (obsolete)
Comment 17 Aleisha Amohia 2019-01-13 21:26:33 UTC Comment hidden (obsolete)
Comment 18 Charles Farmer 2019-01-18 20:51:02 UTC
Created attachment 84219 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-results-grouped.tt
 - opac-shelves.tt
 - opac-user.tt

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 19 Josef Moravec 2019-01-21 15:01:53 UTC
Comment on attachment 84219 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

Review of attachment 84219 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
@@ +121,4 @@
>          <tr>
>      [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
>          <td><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">[% UNLESS ( noItemTypeImages ) %][% IF ( itemtypeloo.imageurl ) %]<img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />[% END %]&nbsp;[% END %]
> +        <span class="itypetext">[% itemtypeloo.description | html %]<span></label></td>

Bad ending tag - missing "/"

::: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
@@ +534,4 @@
>                                          [% IF ( onloan_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% onloan_items_loo.itemcallnumber |uri %]%22">[% onloan_items_loo.itemcallnumber | html %]</a>][% END %]
>                                          ([% onloan_items_loo.count | html %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue | html %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %]
>                                          [% IF item_level_itypes && onloan_items_loo.description %]
> +<<<<<<< HEAD

Merge markers

@@ +566,4 @@
>                                          [% IF ( other_items_loo.notforloan ) %][% other_items_loo.notforloan | html %][% END %]
>                                          ([% other_items_loo.count | html %])
>                                          [% IF item_level_itypes && other_items_loo.description %]
> +<<<<<<< HEAD

Merge markers
Comment 20 Aleisha Amohia 2020-02-12 20:51:26 UTC
Created attachment 98778 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-results-grouped.tt
 - opac-shelves.tt
 - opac-user.tt

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 21 David Nind 2020-02-13 04:07:04 UTC
Hi Aleisha.

Everything looks okay to me except for the details page for records on the staff interface from search results.

I think this is this file about line 269:
koha/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

Note for testing:
- Some icons only display for some pages if the item-level_itypes system preference is set to bibliographic record
Comment 22 Nick Clemens 2022-07-15 14:07:38 UTC
Created attachment 137760 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-results-grouped.tt
 - opac-shelves.tt
 - opac-user.tt

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 23 David Nind 2022-07-16 01:37:42 UTC
I've tested, but haven't signed off.

Notes from testing (using koha-testing-docker):

1. Some icons only display for some pages if the item-level_itypes system preference is set to bibliographic record.

2. May also need to set the noItemTypeImages (for staff interface) or OpacNoItemTypeImages system preferences to 'Show'.

3. For the staff interface and with the CSS to hide the text description:
   . catalogue/detail.tt: see note for staff interface and catalogue/detail.tt - can't hide text description for 'Itemtype' shown on the details page before the holdings tab

4. For the OPAC, I'm not sure how to test opac-results-grouped.tt: there is no opac-results-grouped.tt file, item type icon and text show for normal OPAC search results when OPACnoItemTypeImages system preference is set to 'Show', with OPAC CSS to hide no text description is shown in search results (but icon is).

5. How to access pages to test, along with some notes: 

= STAFF INTERFACE =
 - catalogue/advsearch.tt (Home page > Advanced search)
 - catalogue/detail.tt (view the details page for a record with items - note: 
   . if item-level_itypes = specific item and noItemTypeImages set to 'Don't show' ==> text only descriptions shown for both
   . if item-level_itypes = specific item and noItemTypeImages set to 'Show' ==> icons and text description shown for both
   . if item-level_itypes = bibliographic record and noItemTypeImages set to 'Show' ==> icons and text description only shown for the record, the Item types column under the holdings tab is not shown
    . if item-level_itypes = bibliographic record and noItemTypeImages set to 'Don't show' ==> text description only for the record,  the Item types column under the holdings tab is not shown
 - catalogue/results.tt (set noItemTypeImages system preference to 'Show', search in the staff interface)
 - reserve/request.tt (place a hold for a record, select a patron, item type column displayed for specific items) 
 - virtualshelves/shelves.tt (set noItemTypeImages to 'Show', set item-level_itypes to bibliographic record: create and add items to a public list, Lists > select the list)

= OPAC =
 - opac-advsearch.tt (advanced search page)
 - opac-detail.tt (view the details page for a record with items)
 - opac-readingrecord.tt (check out some items for a patron, go to Your account > your checkout history for that patron)
 - opac-reserve.tt (place a hold for a record, select 'a specific item', table lists the item type)
 - opac-results-grouped.tt (not sure how to test this on, no longer an opac-results-grouped.tt file; item type icon and text show on normal OPAC search results when OPACnoItemTypeImages system preference set to 'Show')
 - opac-shelves.tt (set OPACnoItemTypeImages to 'Show', set item-level_itypes to bibliographic record: add items to a list, view list More > Lists > select the list)
 - opac-user.tt (set OPACnoItemTypeImages to 'Show', set item-level_itypes to bibliographic record: check some items to a patron, go to Your account > summary for the patron)

6. Personally, I think enhancing the existing system preferences item-level_itypes, noItemTypeImages and OpacNoItemTypeImages would be a better way to go. But having some way to do it is better than no way...
Comment 24 Aleisha Amohia 2022-09-05 23:32:53 UTC
Created attachment 140217 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-shelves.tt
 - opac-user.tt

Refer to David Nind's test notes from Comment 23 for a more detailed
plan for acessing these pages.

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 25 Aleisha Amohia 2022-09-05 23:34:44 UTC
Have rebased and addressed:

(In reply to David Nind from comment #23)
> I've tested, but haven't signed off.
> 

> 3. For the staff interface and with the CSS to hide the text description:
>    . catalogue/detail.tt: see note for staff interface and
> catalogue/detail.tt - can't hide text description for 'Itemtype' shown on
> the details page before the holdings tab
> 

Fixed this

> 4. For the OPAC, I'm not sure how to test opac-results-grouped.tt: there is
> no opac-results-grouped.tt file, item type icon and text show for normal
> OPAC search results when OPACnoItemTypeImages system preference is set to
> 'Show', with OPAC CSS to hide no text description is shown in search results
> (but icon is).
>

From an old version of Koha, have removed this from the test plan
Comment 26 David Nind 2022-09-06 21:07:26 UTC
Created attachment 140237 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-shelves.tt
 - opac-user.tt

Refer to David Nind's test notes from Comment 23 for a more detailed
plan for acessing these pages.

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 27 Katrin Fischer 2022-10-03 17:29:34 UTC
Just realized that I tested this for the first time in 2017... ouch.
Comment 28 Katrin Fischer 2022-10-03 17:30:13 UTC
Created attachment 141284 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-shelves.tt
 - opac-user.tt

Refer to David Nind's test notes from Comment 23 for a more detailed
plan for acessing these pages.

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 29 Tomás Cohen Arazi 2022-10-03 18:09:24 UTC
Please rebase ASAP.
Comment 30 Katrin Fischer 2022-10-03 18:24:24 UTC
Created attachment 141286 [details] [review]
Bug 7960: Add class to item type descriptions so they can be hidden with CSS

This patch adds the class "itypetext" around item type descriptions so
they can easily be hidden with CSS.

To test:
1. Navigate to the pages listed below to confirm that the text
descriptions do show.
2. Add
.itypetext { display:none; }
to IntranetUserCSS and OPACUserCSS system preferences and save.
3. Go back to the pages listed below and confirm that the text
descriptions DO NOT show.

= STAFF CLIENT =
 - catalogue/advsearch.tt
 - catalogue/detail.tt
 - catalogue/results.tt
 - reserve/request.tt
 - virtualshelves/shelves.tt
= OPAC =
 - opac-advsearch.tt
 - opac-detail.tt
 - opac-readingrecord.tt
 - opac-reserve.tt
 - opac-shelves.tt
 - opac-user.tt

Refer to David Nind's test notes from Comment 23 for a more detailed
plan for acessing these pages.

Sponsored-by: Catalyst IT

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 31 David Nind 2022-10-07 20:35:52 UTC
Patch now applies - have changed status back to Passed QA.
Comment 32 Tomás Cohen Arazi 2022-10-24 20:37:33 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!