From fbf617b9f67d4d77d796211211945d5eb54274ab Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 3 Jun 2010 13:31:58 -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. --- 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 d579490..27d374e 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 ccd147d..aaa869c 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
-- 1.7.0.4