Bug 15354

Summary: item types aren't showing in default hold policies
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, julian.maurice, jweaver
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15337
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 14100    
Bug Blocks: 15755    
Attachments: default hold policies
Bug 15354: Fix translted itemtype description
Bug 15354: Fix translated itemtype descriptions in circ rules
Bug 15354: Fix translated itemtype descriptions in circ rules
Bug 15354: Sort itemtypes by translated description everywhere on circ rules admin page
Bug 15354: Fix translated itemtype descriptions in circ rules
Bug 15354: Sort itemtypes by translated description everywhere on circ rules admin page
Bug 15354: (QA followup) remove tab character
[PASSED QA] Bug 15354: Fix translated itemtype descriptions in circ rules
[PASSED QA] Bug 15354: Sort itemtypes by translated description everywhere on circ rules admin page
[PASSED QA] Bug 15354: (QA followup) remove tab character

Description Nicole C. Engard 2015-12-11 14:31:48 UTC
Created attachment 45609 [details]
default hold policies

See attached. The data is in the database, but the item type is not showing. I'm not sure if this is just my system or if it's all systems.
Comment 1 Jonathan Druart 2015-12-14 10:19:13 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-12-14 10:20:35 UTC Comment hidden (obsolete)
Comment 3 Frédéric Demians 2015-12-16 06:59:46 UTC Comment hidden (obsolete)
Comment 4 Jesse Weaver 2015-12-31 19:55:32 UTC
Minor whitespace issues:

 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
   FAIL   forbidden patterns
                forbidden pattern: tab char (line 188)
   SKIP   spelling
   OK     tt_valid
   OK     valid_template

(These aren't really your fault; I put a patch to fix all this mess on bug 15456 that you can rebase onto if you'd prefer.)

More importantly, though, I noticed that while the item type descriptions now correctly show, and the list of rules is sorted by the translated description, the item type selection dropdown is not sorted by the translated description.
Comment 5 Jonathan Druart 2016-01-04 10:03:23 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2016-01-04 10:05:56 UTC
(In reply to Jesse Weaver from comment #4)
> Minor whitespace issues:
> 
>  FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
>    FAIL   forbidden patterns
>                 forbidden pattern: tab char (line 188)
>    SKIP   spelling
>    OK     tt_valid
>    OK     valid_template
> 
> (These aren't really your fault; I put a patch to fix all this mess on bug
> 15456 that you can rebase onto if you'd prefer.)

I think it should be fixed asap and not depend on something else to ease a possible backport.

> More importantly, though, I noticed that while the item type descriptions
> now correctly show, and the list of rules is sorted by the translated
> description, the item type selection dropdown is not sorted by the
> translated description.

Good catch. I have fixed it.
Not that C4::Koha::GetItemTypes should be fixed for a global fix.
It will be easy to do on top of bug 14828.
Comment 7 Jonathan Druart 2016-01-05 14:30:01 UTC
(In reply to Jonathan Druart from comment #6)
> Not that C4::Koha::GetItemTypes should be fixed for a global fix.
> It will be easy to do on top of bug 14828.

Finally done on bug 15337
Comment 8 Jesse Weaver 2016-01-05 20:45:40 UTC Comment hidden (obsolete)
Comment 9 Jesse Weaver 2016-01-05 20:45:44 UTC Comment hidden (obsolete)
Comment 10 Jesse Weaver 2016-01-05 20:45:50 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2016-01-19 22:27:35 UTC
Created attachment 46949 [details] [review]
[PASSED QA] Bug 15354: Fix translated itemtype descriptions in circ rules

In bug 14100, the admin/smart-rules.pl needed much more love.
Indeed, the translated_description string should be used everywhere and
replaced the previous 'humanitemtype'.

Test plan:
1/ Translate some item types.
2/ Define some holds policy using these item types.
3/ Update the template strings
4/ Confirm that the "holds policy by item type" are displayed (for the
default and specific library) and sorted by translated item type descriptions.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Passes QA tools.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2016-01-19 22:27:38 UTC
Created attachment 46950 [details] [review]
[PASSED QA] Bug 15354: Sort itemtypes by translated description everywhere on circ rules admin page

It's better to cmp on lc.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Passes QA tools. Fixes sorting of dropdown for translated itemtype
descriptions.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2016-01-19 22:27:41 UTC
Created attachment 46951 [details] [review]
[PASSED QA] Bug 15354: (QA followup) remove tab character

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Jesse Weaver 2016-01-19 22:39:37 UTC
Pushed to master (after Cait added her QA stamp). Thanks for the work!
Comment 15 Julian Maurice 2016-01-25 11:55:45 UTC
Patches pushed to 3.22.x, will be in 3.22.2