[Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 6696, New category button broken when no categories defined

Katrin Fischer Katrin.Fischer.83 at web.de
Thu Aug 11 19:45:27 CEST 2011


From: Owen Leonard <oleonard at myacpl.org>

The javascript tablesorter will trigger an error if we try
to apply it to a table with no <tbody>. That error prevented
the YUI button script to complete properly, hence the broken
button.

This patch hides the table in cases where there are no
categories and displays an error message instead.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83 at web.de>
- Deleted all patron categories and checked button was broken
- Applied patch and checked again - button shows up
- Nice: There is a note now that you have to create categories
---
 .../prog/en/modules/admin/categorie.tt             |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
index c2e5062..b05a738 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
@@ -265,6 +265,7 @@ Confirm Deletion of Category [% categorycode |html %][% END %]</legend>
 [% IF ( searchfield ) %]
 		You Searched for [% searchfield %]</span>
 	[% END %]
+[% IF ( loop ) %]
 <span id="pagertable_categorie" class="pager">
 	<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
 		<img src="[% interface %]/prog/img/first.png" class="first"/>
@@ -356,6 +357,9 @@ Confirm Deletion of Category [% categorycode |html %][% END %]</legend>
 		</tr>
 		[% END %]
 	</table>
+[% ELSE %]
+	<div class="dialog alert">No categories have been defined. <a href="/cgi-bin/koha/admin/categorie.pl?op=add_form">Create a new category</a>.</div>
+[% END %]
 [% END %]
 
 </div>
-- 
1.7.4.1



More information about the Koha-patches mailing list