Bug 23514

Summary: Call numbers are not splitted in Label Creator with layout types other than Biblio
Product: Koha Reporter: Theodoros Theodoropoulos <theod>
Component: Label/patron card printingAssignee: Theodoros Theodoropoulos <theod>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, katrin.fischer, lucas, martin.renvoize, theod
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11
Attachments: Allow Splitting of Call Numbers for all layout types (apart from BAR)
Allow Splitting of Call Numbers for all layout types (apart from BAR) - based on master
Bug 23514: Split Call Numbers for all layout types
Bug 23514: Split Call Numbers for all layout types

Description Theodoros Theodoropoulos 2019-08-28 10:03:04 UTC
In Label Creator,
- when one chooses any "Layout type" OTHER THAN Biblio
- AND "Split call numbers" IS checked

the splitting does not work at all, regardless of the classification standard used.

Indeed in Label.pm, the splitting functions are applied only when printing_type=BIB
I think this is a residue from the past and should be removed (or altered to exclude printing_type=BAR)
Comment 1 Theodoros Theodoropoulos 2019-08-28 10:26:55 UTC
Created attachment 92486 [details] [review]
Allow Splitting of Call Numbers for all layout types (apart from BAR)

Allow the execution of call number splitting routines for all label layout types apart from Barcodes.
This code is based on 17.11 code, similar code is used in master
Comment 2 Theodoros Theodoropoulos 2019-08-28 10:35:22 UTC
Created attachment 92487 [details] [review]
Allow Splitting of Call Numbers for all layout types (apart from BAR) - based on master

Allow Splitting of Call Numbers for all layout types (apart from BAR)

Allow the execution of call number splitting routines for all label layout types apart from Barcodes.
This patch is based on master code.
Comment 3 Theodoros Theodoropoulos 2019-08-28 10:56:36 UTC
Test plan:

1- Go to Label Creator and choose/create a Label Layout with "Choose layout type: Biblio" 
2- make sure you have at least "itemcallnumber" in Bibliographic data to print/Data fields
3- check "Split call numbers" box and save the layout (ie testlayout)
4- create a label batch, using items that have a call number (ie DC611.B848 H84 1997). LCC is used here, but you may try with Dewey as well.
5- export selected batch using any template and the layout you created in previous step to a PDF
6- Call numbers are splitted (as expected) in the resulting PDF file

7- edit the layout you created in the previous step (ie testlayout) and change the  "Choose layout type:" to either Biblio/Barcode (BIBBAR) or Barcode/Biblio (BARBIB)
8- export the same batch using the same template and layout as before
9- Call numbers are NOT splitted at all

After patch is applied, call numbers splitting functions are applied even in Biblio/Barcode (BIBBAR) or Barcode/Biblio (BARBIB) layout types.

(in Barcode type, there is no need to even try to split any call number)
Comment 4 Katrin Fischer 2019-09-08 19:26:46 UTC
Hi Theodoros, is this ready for testing? Then you should switch this to "Needs Signoff"!
Comment 5 Theodoros Theodoropoulos 2019-09-09 05:20:30 UTC
Thanks Katrin, I forgot to change the status :)

Make sure to use the patch named "Allow Splitting of Call Numbers for all layout types (apart from BAR) - based on master" when testing on master.

ps. I could include screenshots of the labels before and after the patch, but it would provide little additional information.
Comment 6 Martin Renvoize 2020-04-08 07:24:48 UTC
Created attachment 102531 [details] [review]
Bug 23514: Split Call Numbers for all layout types

This patch ensures call numbers are properly split for layout types
other than 'BAR'.

Test plan:

1. Go to Label Creator and choose/create a Label Layout with "Choose
layout type: Biblio"
2. make sure you have at least "itemcallnumber" in Bibliographic data to
print/Data fields
3. check "Split call numbers" box and save the layout (ie testlayout)
4. create a label batch, using items that have a call number (ie
DC611.B848 H84 1997). LCC is used here, but you may try with Dewey as
well.
5. export selected batch using any template and the layout you created
in previous step to a PDF
6. Call numbers are splitted (as expected) in the resulting PDF file
7. edit the layout you created in the previous step (ie testlayout) and
change the  "Choose layout type:" to either Biblio/Barcode (BIBBAR) or
Barcode/Biblio (BARBIB)
8. export the same batch using the same template and layout as before
9. Call numbers are NOT splitted at all

After patch is applied, call numbers splitting functions are applied
even in Biblio/Barcode (BIBBAR) or Barcode/Biblio (BARBIB) layout types.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-04-08 07:25:55 UTC
Works as expected and the code is clear.. signing off.

I've also converted the basic patch to a mailbox patch to allow proper functioning with git bz to allow easier testing.
Comment 8 Jonathan Druart 2020-04-08 10:45:09 UTC
Created attachment 102552 [details] [review]
Bug 23514: Split Call Numbers for all layout types

This patch ensures call numbers are properly split for layout types
other than 'BAR'.

Test plan:

1. Go to Label Creator and choose/create a Label Layout with "Choose
layout type: Biblio"
2. make sure you have at least "itemcallnumber" in Bibliographic data to
print/Data fields
3. check "Split call numbers" box and save the layout (ie testlayout)
4. create a label batch, using items that have a call number (ie
DC611.B848 H84 1997). LCC is used here, but you may try with Dewey as
well.
5. export selected batch using any template and the layout you created
in previous step to a PDF
6. Call numbers are splitted (as expected) in the resulting PDF file
7. edit the layout you created in the previous step (ie testlayout) and
change the  "Choose layout type:" to either Biblio/Barcode (BIBBAR) or
Barcode/Biblio (BARBIB)
8. export the same batch using the same template and layout as before
9. Call numbers are NOT splitted at all

After patch is applied, call numbers splitting functions are applied
even in Biblio/Barcode (BIBBAR) or Barcode/Biblio (BARBIB) layout types.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Martin Renvoize 2020-04-14 07:36:44 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 10 Joy Nelson 2020-05-04 20:57:54 UTC
backported to 19.11.x for 19.11.06
Comment 11 Lucas Gass 2020-05-11 22:32:24 UTC
backported to 19.05.x for 19.05.11