Bug 17252

Summary: Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Product: Koha Reporter: Jonathan Druart <jonathan.druart+koha>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart+koha>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: kyle, martin.renvoize
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17251    
Bug Blocks: 15799, 17253    
Attachments: Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
[PASSED QA] Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

Description Jonathan Druart 2016-09-05 14:18:48 UTC

    
Comment 1 Jonathan Druart 2016-09-05 16:05:10 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-09-13 08:58:57 UTC
Created attachment 55519 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED
Comment 3 Jonathan Druart 2016-10-12 10:29:21 UTC
Created attachment 56245 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED
Comment 4 Jonathan Druart 2016-10-12 10:29:45 UTC
Rebased patches.
Comment 5 Jonathan Druart 2016-10-12 13:53:22 UTC
Created attachment 56282 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED
Comment 6 Claire Gravely 2016-10-12 15:12:19 UTC
Created attachment 56296 [details] [review]
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 7 Martin Renvoize 2016-10-13 13:27:41 UTC
Created attachment 56398 [details] [review]
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2016-10-13 13:28:10 UTC
Loving to cleaner code this tree is moving to :)
Comment 9 Martin Renvoize 2016-10-13 13:41:23 UTC
Created attachment 56402 [details] [review]
[PASSED QA] Bug 17251: Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping

This subroutine was only used once in GetItemsForInventory.
It can be replaced with a quite simple search on AV join on
authorised_value_categories and marc_subfield_structures tables.

Note that the "interface" parameter was always set to "staff" and was
useless.

Test plan:
Play with the inventory and confirm that the AV descriptions are
correctly displayed.

The tests in t/db_dependent/Items/GetItemsForInventory.t cover this
change and should still pass.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2016-10-13 13:41:39 UTC
Created attachment 56403 [details] [review]
[PASSED QA] Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode

The subroutine C4::Koha::GetAuthorisedValueByCode returned the
description (staff or opac) for a given authorised value.

Note that we may need a unique key to ->find instead of ->search.

Test plan:
- Checkin an item that cannot be checked in because it's lost, the
  message should display the AV description
- Generate a letter with borrowers.streettype equals an ROADTYPE AV, the
  description should be displayed.
- Edit a patron attribute type, the AV dropdown list should be
  displayed
- Create the PA_CLASS AV category (see bug 7154) and make sure it
  behaves as before when editing a patron
- The checkout list should display descriptions for LOC, LOST and
  DAMAGED

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2016-10-13 13:42:58 UTC
ack.. wrong bug.. already qa'd this one five minutes ago. ignore last two comments and the double commit line.. will clean that back out now.
Comment 12 Kyle M Hall 2016-10-21 16:15:08 UTC
Pushed to master for 16.11, thanks Jonathan!