From 385380038bbeb5d329dcba7eebacf0287d0d816e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 11 Feb 2016 12:06:39 -0500 Subject: [PATCH] Bug 15790 - Don't delete a MARC framework if existing records use that framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If a MARC framework is in use by any records it should not be possible to delete it. Deleting a framework which is in use will leave the deleted framework code in those records. This patch modifies the deletion confirmation dialog so that it will not let the user confirm the deletion if there are records using it. Depends on Bug 15785 - Use Font Awesome icons in confirmation dialogs To test, apply the patch and go to Administration -> MARC frameworks 1. Try to delete a framework which is in use by 1 or more records. The resulting confirmation dialog should prevent you from proceeding. 2. Try to delete a framework which is not in use. Test both canceling and confirming that deletion to make both function correctly. Works as expected. Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- .../prog/en/modules/admin/biblio_framework.tt | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt index 8d0b7a823b..2232825dbe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt @@ -175,18 +175,24 @@ [% IF op == 'delete_confirm' %]
-

Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?

[% IF biblios_use_this_framework %] -

This framework is used [% biblios_use_this_framework %] times.

+

This framework cannot be deleted

+

[% framework.frameworktext %] ([% framework.frameworkcode %])

+

The framework is used [% biblios_use_this_framework %] times.

+
+ +
+ [% ELSE %] +

Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?

+
+ + + +
+
+ +
[% END %] -
- - - -
-
- -
[% END %] -- 2.39.5