Bug 20238

Summary: Show description of ITEMTYPECAT instead of code in itemtypes summary table
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: TemplatesAssignee: Amy King <amyking386>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: amyking386, andrewfh, david, ethan.amohia, fridolin.somers, pierre-marc.thibault, victor
Version: masterKeywords: Academy, Manual
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19978
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement changes the item types page (Koha administration > Basic parameters > Item types) so that the search category column displays the ITEMTYPECAT authorized value's description, instead of the authorized value code. (This makes it consistent with the edit form where it displays the descriptions for authorized values.)
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15
Attachments: Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table
Bug 20238: Descrip of ITEMTYPECAT now shows on itemtypes summary table
Bug 20238: Display description of ITEMTYPECAT in search category
Bug 20238: Display description of ITEMTYPECAT in search category
Bug 20238: Display description of ITEMTYPECAT in search category
Bug 20238: Display description of ITEMTYPECAT in search category

Description Katrin Fischer 2018-02-18 10:58:01 UTC
When working with grouped item types using ITEMTYPECAT authorised values, looking at the item types table, it shows the code, not the description. On editing an item type, we show the description - so there is some confusing mismatch there. Both should show the description.

To check:
- Add a value to the ITEMTYPECAT authorised value category
- Edit an item type and pick that value as search category
- Save
- Verify the code shows up in the table, but not the description
Comment 1 Katrin Fischer 2018-02-18 10:59:18 UTC
Can probably be fixed using a TT plugin.
Comment 2 Ethan 2019-01-17 01:54:59 UTC
Created attachment 84112 [details] [review]
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table

Test plan:
1. From homepage, go to Koha Amdinistration
2. Go to Authorised Values
3. Scroll down to ITEMTYPECAT and click Add
4. Give the new authorised value an Authorised value and Description
5. Save it
6. On the left, go to Item types
7. Click Edit on an item type
8. Under Search Catergory, select the new authorised value you just
created. It should appear in the dropdown as it's description
9. Click Save changes
10. Under Search category for the item type you just edited, you should see your new authorised values' description
Comment 3 Owen Leonard 2019-01-17 12:56:10 UTC
This patch works well, but I think Katrin's suggestion is the more efficient solution. There's a shortcut for getting the description of authorised values. The template already has [% USE AuthorisedValues %] included, so we know the plugin is already being loaded for use:

[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]
Comment 4 Ethan 2019-01-17 20:28:23 UTC
Created attachment 84158 [details] [review]
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table

Test plan:
1. From homepage, go to Koha Amdinistration
2. Go to Authorised Values
3. Scroll down to ITEMTYPECAT and click Add
4. Give the new authorised value an Authorised value and Description
5. Save it
6. On the left, go to Item types
7. Click Edit on an item type
8. Under Search Catergory, select the new authorised value you just
created. It should appear in the dropdown as it's description
9. Click Save changes
10. Under Search category for the item type you just edited, you should see your new authorised values' description
Comment 5 Pierre-Marc Thibault 2019-01-18 21:35:35 UTC
Created attachment 84226 [details] [review]
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table

Test plan:
1. From homepage, go to Koha Amdinistration
2. Go to Authorised Values
3. Scroll down to ITEMTYPECAT and click Add
4. Give the new authorised value an Authorised value and Description
5. Save it
6. On the left, go to Item types
7. Click Edit on an item type
8. Under Search Catergory, select the new authorised value you just
created. It should appear in the dropdown as it's description
9. Click Save changes
10. Under Search category for the item type you just edited, you should see your new authorised values' description

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 6 Katrin Fischer 2019-01-19 22:49:30 UTC
I am sorry, but there are some things wrong with this patch:

1) If you take a look at the changes commited, you can see it includs a lot of unintentional changes:

---
 Koha/Illbackends/BLDSS                                  |   1 +
 Koha/Illbackends/koha-ill-freeform                      |   1 +
 admin/itemtypes.pl                                      |   2 ++
 koha-ill-freeform                                       |   1 +
 .../prog/en/modules/admin/.itemtypes.tt.swp             | Bin 0 -> 40960 bytes
 .../intranet-tmpl/prog/en/modules/admin/itemtypes.tt    |   4 +++-
 6 files changed, 8 insertions(+), 1 deletion(-)
 create mode 160000 Koha/Illbackends/BLDSS
 create mode 160000 Koha/Illbackends/koha-ill-freeform
 create mode 160000 koha-ill-freeform
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/.itemtypes.tt.swp

2) Using the TT plugin on the template side, the changes to admin/itemtypes.pl are no longer needed.
Comment 7 Katrin Fischer 2019-02-10 13:01:10 UTC
This would be a nice one to save!
Comment 8 Amy King 2021-01-21 03:21:46 UTC
Created attachment 115497 [details] [review]
Bug 20238: Descrip of ITEMTYPECAT now shows on itemtypes summary table

Test plan:
1. From homepage, go to Koha Administration
2. Go to Authorised Values
3. Scroll to the bottom of the page and click next
4. Find ITEMTYPECAT and click Add
5. Give the new authorised value an Authorised value and Description
6. Save it
7. On the left, got to Item types
8. Click Edit on an item type
9. Under Search Category, select the new authorised value you just
created. It should appear in the dropdown as it's description
10. Click save changes
11. Under search category for the item type you just edited, you should
see your new authorised values' description
Comment 9 David Nind 2021-01-21 11:35:27 UTC
Comment on attachment 84226 [details] [review]
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table

I think this patch (the original one) is no longer required, so have obsoleted.
Comment 10 David Nind 2021-01-21 12:18:45 UTC
Comment on attachment 84226 [details] [review]
Bug 20238: Description of ITEMTYPECAT now shows on itemtypes summary table

I think I made a mistake, so unobsoleting!
Comment 11 David Nind 2021-01-21 12:36:23 UTC
Hi Amy.

There are two patches for this bug, when I think there should only be one.

If I apply all the patches the patches don't apply.

If I just apply your patch it still requires something additional I think to solve the issue - displaying the authorized value description in the the item types search category column.

Slightly updated bug commit message with description of what the bug does:

Bug 20238: Display description of ITEMTYPECAT on item types summary table

When adding or editing item types (Administration > Basic parameters
> Item types) the drop down list currently displays the ITEMTYPECAT
authorized value description and on the list of item types page the 
authorized value is displayed in the search category column.

This enhancement changes the item types list so that the search 
category column displays the authorized value's description instead
of the authorized value.

Test plan:
1. From homepage, go to Koha Administration
2. Go to Authorized values
3. Scroll to the bottom of the page and click next
4. Find ITEMTYPECAT and click Add
5. Give the new authorized value an Authorised value and Description
6. Save it
7. On the left, got to Item types
8. Click Edit on an item type
9. Under Search category, select the new authorized value you just
   created. It should appear in the dropdown as its description
10. Click save changes
11. Under search category for the item type you just edited, you should
    see your new authorized values' description

Unless I've misunderstood things, then please ignore me!

David
Comment 12 Amy King 2021-01-21 22:48:09 UTC
Created attachment 115633 [details] [review]
Bug 20238: Display description of ITEMTYPECAT in search category

Test plan:
1. From homepage, go to Koha Administration
2. Go to Authorized values
3. Scroll to the bottom of page, or click next at the top, to go to the
next page
4. Find ITEMTYPECAT and click Add
5. Give the new authorized value an Authorized value and Description
6. Save it
7. On the left, go to Item types
8. Click Edit on an item type
9. Under search category, select the new authorized value you just
created. It should appear in the dropdown as its description
10. Click save changes
11. Under search category for the item type you just edited, you should
see your new Authorized values' description
Comment 13 Amy King 2021-01-21 22:49:13 UTC
Created attachment 115634 [details] [review]
Bug 20238: Display description of ITEMTYPECAT in search category

Test plan:
1. From homepage, go to Koha Administration
2. Go to Authorized values
3. Scroll to the bottom of page, or click next at the top, to go to the
next page
4. Find ITEMTYPECAT and click Add
5. Give the new authorized value an Authorized value and Description
6. Save it
7. On the left, go to Item types
8. Click Edit on an item type
9. Under search category, select the new authorized value you just
created. It should appear in the dropdown as its description
10. Click save changes
11. Under search category for the item type you just edited, you should
see your new Authorized values' description
Comment 14 David Nind 2021-01-24 00:19:06 UTC
Created attachment 115716 [details] [review]
Bug 20238: Display description of ITEMTYPECAT in search category

When adding or editing item types (Koha administration > Basic
parameters > Item types) the drop down list currently displays
the ITEMTYPECAT authorized value description. However, on the
item types page the authorized value is displayed in the search
category column.

This enhancement changes the item types page so that the search
category column displays the authorized value's description
instead of the authorized value code.

Test plan:
1. Go to Staff interface home page > Koha administration > Basic
   parameters > Authorized values.
2. Find ITEMTYPECAT and add a new authorized value - make sure it
   has a description.
3. Go to the Basic parameters > Item types page.
4. Edit an item type.
5. For the search category, select the new authorized value you
   created. The desciption should be shown in the dropdown list.
6. Save the changes.
7. In the search category column for the item type you edited, it
   should now display the description instead of the code.
8. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 David Nind 2021-01-24 00:28:18 UTC
Thanks Amy!

I'm not sure why your patch didn't work for me when I originally tested it, but it does now!

I updated the commit message and also added suggested text for the release notes.

Question for QA - If there is no description text for an authorised value, should there be a fallback to displaying the category, rather than displaying nothing? Or is this the default behaviour?

David
Comment 16 Katrin Fischer 2021-01-27 22:24:57 UTC
Created attachment 115913 [details] [review]
Bug 20238: Display description of ITEMTYPECAT in search category

When adding or editing item types (Koha administration > Basic
parameters > Item types) the drop down list currently displays
the ITEMTYPECAT authorized value description. However, on the
item types page the authorized value is displayed in the search
category column.

This enhancement changes the item types page so that the search
category column displays the authorized value's description
instead of the authorized value code.

Test plan:
1. Go to Staff interface home page > Koha administration > Basic
   parameters > Authorized values.
2. Find ITEMTYPECAT and add a new authorized value - make sure it
   has a description.
3. Go to the Basic parameters > Item types page.
4. Edit an item type.
5. For the search category, select the new authorized value you
   created. The desciption should be shown in the dropdown list.
6. Save the changes.
7. In the search category column for the item type you edited, it
   should now display the description instead of the code.
8. Sign off!

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Jonathan Druart 2021-01-28 16:34:31 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 18 Fridolin Somers 2021-02-01 13:47:29 UTC
Pushed to 20.11.x for 20.11.03
Comment 19 Andrew Fuerste-Henry 2021-02-05 12:54:08 UTC
Pushed to 20.05.x for 20.05.09
Comment 20 Victor Grousset/tuxayo 2021-02-09 23:17:17 UTC
Backported: Pushed to 19.11.x branch for 19.11.15