Bug 15803

Summary: Koha::AuthorisedValues - Remove GetAuthorisedValueCategories
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: chris, kyle, mtj, nick
Version: Main   
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: 15797, 15801    
Bug Blocks: 15799, 17537    
Attachments: Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
[SIGNED-OFF] Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories

Description Jonathan Druart 2016-02-11 15:27:57 UTC
The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all the authorised value categories.
We already have a method in the Koha::AuthorisedValues module to do this job, let's use it!
Comment 1 Jonathan Druart 2016-02-11 15:41:22 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2016-06-03 11:26:28 UTC
I applied 15801, but when I try to  apply this one it wont apply
Comment 3 Jonathan Druart 2016-06-05 17:05:57 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-08-10 07:26:05 UTC Comment hidden (obsolete)
Comment 5 Aleisha Amohia 2016-08-23 00:58:41 UTC
Created attachment 54731 [details] [review]
[SIGNED-OFF] Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories

The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all
the authorised value categories.
We already have a method in the Koha::AuthorisedValues module to do this
job, let's use it!

Technical explanations:
The new subroutine of the AuthorisedValues TT plugin will allow to get
the authorised value categories from the templates.
The new html_helpers include file will get rid of the if selected else
end statements. Bug 15758 already uses this file, see the commit
description for more informations.

Test plan:
1/ Create or edit a new fund (aqbudgets.pl), the fields "statistic 1"
and "statistic 2" should be correctly filled with the list of authorised
value categories
2/ Edit subfields for a biblio and authority framework.
The "Authorized value" dropdown list should be correctly filled on both
pages
3/ Create new items search fields (from the administration area), same
as previously, the authorised value category dropdown list should be
correctly filled
4/ Add and edit patron attribute types, check the authorised value
category list.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 6 Nick Clemens 2016-10-14 08:24:40 UTC
Tried on top of 15801, needs a rebase
Comment 7 Jonathan Druart 2016-10-14 09:30:33 UTC
Created attachment 56497 [details] [review]
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories

The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all
the authorised value categories.
We already have a method in the Koha::AuthorisedValues module to do this
job, let's use it!

Technical explanations:
The new subroutine of the AuthorisedValues TT plugin will allow to get
the authorised value categories from the templates.
The new html_helpers include file will get rid of the if selected else
end statements. Bug 15758 already uses this file, see the commit
description for more informations.

Test plan:
1/ Create or edit a new fund (aqbudgets.pl), the fields "statistic 1"
and "statistic 2" should be correctly filled with the list of authorised
value categories
2/ Edit subfields for a biblio and authority framework.
The "Authorized value" dropdown list should be correctly filled on both
pages
3/ Create new items search fields (from the administration area), same
as previously, the authorised value category dropdown list should be
correctly filled
4/ Add and edit patron attribute types, check the authorised value
category list.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 8 Jonathan Druart 2016-10-14 09:31:09 UTC
FYI,

 FAIL   koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc
   FAIL   valid_template
                options_for_authorised_value_categories: not found

Is a false positive
Comment 9 Nick Clemens 2016-10-14 13:34:28 UTC
Created attachment 56540 [details] [review]
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories

The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all
the authorised value categories.
We already have a method in the Koha::AuthorisedValues module to do this
job, let's use it!

Technical explanations:
The new subroutine of the AuthorisedValues TT plugin will allow to get
the authorised value categories from the templates.
The new html_helpers include file will get rid of the if selected else
end statements. Bug 15758 already uses this file, see the commit
description for more informations.

Test plan:
1/ Create or edit a new fund (aqbudgets.pl), the fields "statistic 1"
and "statistic 2" should be correctly filled with the list of authorised
value categories
2/ Edit subfields for a biblio and authority framework.
The "Authorized value" dropdown list should be correctly filled on both
pages
3/ Create new items search fields (from the administration area), same
as previously, the authorised value category dropdown list should be
correctly filled
4/ Add and edit patron attribute types, check the authorised value
category list.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Kyle M Hall 2016-10-28 15:01:34 UTC
Jonathan, can you please rebase this patch? Thanks!
Comment 11 Jonathan Druart 2016-10-28 15:59:02 UTC
Created attachment 56960 [details] [review]
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories

The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all
the authorised value categories.
We already have a method in the Koha::AuthorisedValues module to do this
job, let's use it!

Technical explanations:
The new subroutine of the AuthorisedValues TT plugin will allow to get
the authorised value categories from the templates.
The new html_helpers include file will get rid of the if selected else
end statements. Bug 15758 already uses this file, see the commit
description for more informations.

Test plan:
1/ Create or edit a new fund (aqbudgets.pl), the fields "statistic 1"
and "statistic 2" should be correctly filled with the list of authorised
value categories
2/ Edit subfields for a biblio and authority framework.
The "Authorized value" dropdown list should be correctly filled on both
pages
3/ Create new items search fields (from the administration area), same
as previously, the authorised value category dropdown list should be
correctly filled
4/ Add and edit patron attribute types, check the authorised value
category list.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Kyle M Hall 2016-10-28 16:39:15 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 13 Mason James 2016-12-14 12:05:17 UTC
Enhancement, skipping for 16.05.x