[Koha-patches] [PATCH] Bug 9650 - Show message if there are no notices

Owen Leonard oleonard at myacpl.org
Sun Feb 17 01:17:19 CET 2013


When there are no notices for the selected library, the
interface displays a table header with an empty table.

This patch adds a message which appears when there are no
notices for the selected library, or if no library selected
and there are no notices at all.

To test, visit the notices and slips page and
select a library for which there are no notices. A message
should be displayed, "There are no notices for this library."
---
 koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt |   11 +++++++++++
 tools/letter.pl                                         |    1 +
 2 files changed, 12 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
index e095bdc..c6150bb 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
@@ -166,6 +166,8 @@ $(document).ready(function() {
             </select>
             [% END %]
         [% END %]
+
+[% IF ( letter ) %]
         <table id="lettert">
 		<thead><tr>
 			<th>Library</th>
@@ -218,6 +220,15 @@ $(document).ready(function() {
     [% END %]
         </tbody>
 		</table>
+[% ELSE %]
+    <div class="dialog message">
+        [% IF ( branchcode ) %]
+           <p>There are no notices for this library.</p>
+        [% ELSE %]
+            <p>There are no notices.</p>
+        [% END %]
+    </div>
+[% END %]
 [% END %]
 
 	
diff --git a/tools/letter.pl b/tools/letter.pl
index 317ea83..a462aba 100755
--- a/tools/letter.pl
+++ b/tools/letter.pl
@@ -115,6 +115,7 @@ $template->param(
     independant_branch => $my_branch,
 	script_name => $script_name,
   searchfield => $searchfield,
+    branchcode => $branchcode,
 	action => $script_name
 );
 
-- 
1.7.10.4


More information about the Koha-patches mailing list