From 6af71b5f8dc1b0849f561aabffb5d292f7ae9229 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 3 Jun 2010 13:37:33 -0400 Subject: [PATCH] Fix for Bug 3722 - Branch deletion results in incorrect message A fix was submitted by Nahuel on 23 Nov 2009 and pushed, but it combined messages for existing patrons and existing items. This patch defines separate messages for the various cases and corrects a typo in the original fix which left existing patrons unreported. Signed-off-by: Galen Charlton --- admin/branches.pl | 12 ++++++++++-- .../prog/en/modules/admin/branches.tmpl | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/admin/branches.pl b/admin/branches.pl index d57949057d..27d374e987 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -131,8 +131,16 @@ elsif ( $op eq 'delete' ) { $sthitems->execute( $branchcode, $branchcode ); $sthborrowers->execute( $branchcode ); my ($totalitems) = $sthitems->fetchrow_array; - my ($totalborrowers) = $sthitems->fetchrow_array; - if ($totalitems or $totalborrowers) { + my ($totalborrowers) = $sthborrowers->fetchrow_array; + if ($totalitems && !$totalborrowers) { + $template->param( else => 1 ); + default("MESSAGE10", $template); + } + elsif (!$totalitems && $totalborrowers){ + $template->param( else => 1 ); + default("MESSAGE11", $template); + } + elsif ($totalitems && $totalborrowers){ $template->param( else => 1 ); default("MESSAGE7", $template); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl index ccd147df62..aaa869c93f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl @@ -156,9 +156,11 @@
Library category added
Library category modified
Library category deleted
-
Library cannot be deleted because there are patrons or items using that library
+
Library cannot be deleted because there are patrons and items using that library
Category cannot be deleted because there are libraries using that category
Category cannot be added, categorycode already exists
+
Library cannot be deleted because there are items held by that library
+
Library cannot be deleted because there are patrons registered at that library
-- 2.39.5