Bug 17355: Add the ability to remove authorised value categories
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 28 Apr 2020 09:53:57 +0000 (11:53 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 4 May 2020 06:57:21 +0000 (07:57 +0100)
commit46040fcf862f0c7b6f8bdf9f2b1ecd9f15adf54e
treef22f4cb34e577ac78015826866bc7250f159cf9e
parent78ce445ae49404c7e7344999945abfc576ad8cac
Bug 17355: Add the ability to remove authorised value categories

This new patch set is adding a new DB field is_system to distinguish
internal categories.

The list of internal categories is in the patch "DB changes - set
is_system for categories" and can be discussed/extended.

Test plan:
0.
- Apply patch
- updatedabase
1.
- Create a new AV category
- Create an authorised value
- List the AVs for this category
- Remove all the AVs for this category
=> You see 2 buttons "Add a new authorised value" and "Delete category
'XXX'"
- Click the delete button
=> You get a popup
- Accept
=> The category is deleted

2.
- List the AV for Asort1 (internal category)
/cgi-bin/koha/admin/authorised_values.pl?searchfield=Asort1
- Delete the AVs for this category (if there is any)
=> You do not see the "Delete category" button

3.
- Create a new AV category 'foo'
- Create an authorised value
- Hit /admin/authorised_values.pl?op=delete_category&categor_name=foo
=> You get an error message (expected because the category cannot be
deleted if it has AV linked)
=> message text:
=> An error occurred when deleting this authorized value category. Check the logs.

4.
- Hit /admin/authorised_values.pl?op=delete_category&categor_name=Asort1
=> You get an error message (expected because the category Asort1 cannot
be deleted, it's an internal category.
=> message text:
=> An error occurred when deleting this authorized value category. Check the logs.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
admin/authorised_values.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt