[Koha-patches] [PATCH] [SIGNED-OFF] Bug 5283 NEWS ITEM FOR RECEIPT SLIP

Nicole Engard nengard at bywatersolutions.com
Thu Dec 16 02:41:52 CET 2010


From: koha <koha at smfpl.org>

There is no on-off global parameter for it since if a library does not want to
use it, then the library will not use the "slip" category in news - this is
similar to the OPAC news and Staff news categories in the news feature.

We have been using this for months in Koha 3.0 and the librarians like it and
so does PR as it gives a way to advertise events and news to patrons with every
checkout.

The files modified are:
koha-news.tmpl
moremember-receipt.tmpl
moremember.pl

Darrell Ulm

Signed-off-by: Nicole Engard <nengard at bywatersolutions.com>
---
 .../en/modules/members/moremember-receipt.tmpl     |   16 +++++++++++++++-
 .../prog/en/modules/tools/koha-news.tmpl           |   10 +++++++++-
 members/moremember.pl                              |   10 ++++++++++
 3 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl
index 83bd151..4a4d23a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl
@@ -2,7 +2,8 @@
 <title>Print Receipt for <!-- TMPL_VAR NAME="cardnumber" --></title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
-<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/print.css" />
+ <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/print.css" />
+
 <script language="javascript">
         window.print();
         window.close();
@@ -57,4 +58,17 @@ Date due: <!-- TMPL_VAR NAME="date_due" --></p>
 <!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
 
+<!-- TMPL_IF NAME="koha_news_count" -->
+            <hr><h4 style="text-align: center; font-style:italic;">News</h4>
+                       <!-- <!-- TMPL_VAR name="koha_news_count" --> recent news item(s) -->
+            <!-- TMPL_LOOP name="koha_news" -->
+                    <div class="newsitem" id="news<!-- TMPL_VAR NAME="idnew" -->"><h5 style="margin-bottom: 1px; margin-top: 1px"><b><!-- TMPL_VAR name="title" --></b></h5>
+                                        <p style="margin-bottom: 1px; margin-top: 1px"><!-- TMPL_VAR name="new" --></p>
+                                       <p class="newsfooter" style="font-size: 8pt; font-style:italic; margin-bottom: 1px; margin-top: 1px"> Posted on <!-- TMPL_VAR name="newdate" -->
+
+</p><hr /></div>
+            <!-- /TMPL_LOOP -->
+<!-- /TMPL_IF -->
+
+
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
index b7b6748..e6f27c1 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
@@ -55,6 +55,7 @@ Edit News Item<!-- TMPL_ELSE -->Add News Item<!-- /TMPL_IF --><!-- TMPL_ELSE -->
             <label for="lang">Display Location</label>
             <select id="lang" name="lang">
                 <option value="koha">Librarian interface</option>
+		<option value="slip">Slip</option>
                 <!-- TMPL_LOOP name="lang_list" -->
                     <!-- TMPL_IF name="selected" --><option value="<!-- TMPL_VAR name="language" -->" selected="selected">OPAC (<!-- TMPL_VAR name="language" -->)</option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="language" -->">OPAC (<!-- TMPL_VAR name="language" -->)</option><!-- /TMPL_IF -->
                 <!-- /TMPL_LOOP -->
@@ -116,6 +117,7 @@ Edit News Item<!-- TMPL_ELSE -->Add News Item<!-- /TMPL_IF --><!-- TMPL_ELSE -->
             <select name="lang" id="lang">
             <option value="">All</option>
             <option value="koha">Librarian interface</option>
+	    <option value="slip">Slip</option>
                 <!-- TMPL_LOOP name="lang_list" -->
                     <!-- TMPL_IF name="selected" -->
                         <option value="<!-- TMPL_VAR name="language" -->" selected="selected">
@@ -151,7 +153,13 @@ Edit News Item<!-- TMPL_ELSE -->Add News Item<!-- /TMPL_IF --><!-- TMPL_ELSE -->
                             <td>
                                 <input type="checkbox" name="ids" value="<!-- TMPL_VAR NAME="idnew" -->" />
                             </td>
-                            <td><!-- TMPL_IF EXPR="lang eq 'koha'" -->Librarian interface<!-- TMPL_ELSE -->OPAC (<!-- TMPL_VAR NAME="lang" -->)<!-- /TMPL_IF --></td>
+                            <td><!-- TMPL_IF EXPR="lang eq 'koha'" -->Librarian interface<!-- /TMPL_IF -->
+                                 <!-- /TMPL_ELSE -->
+                                 <!-- TMPL_IF EXPR="lang eq 'slip'" -->Slip<!-- /TMPL_IF -->
+                                 <!-- /TMPL_ELSE -->
+                                 <!-- TMPL_IF EXPR="lang ne 'slip'" --><!-- TMPL_IF EXPR="lang ne 'koha'" -->OPAC<!-- /TMPL_IF --><!-- /TMPL_IF -->
+                             </td>
+
                             <td><!-- TMPL_VAR NAME="number" --></td>
                             <td><!-- TMPL_VAR NAME="newdate" --></td>
                             <td><!-- TMPL_VAR NAME="expirationdate" --> <!-- TMPL_IF NAME="expired" -->(<span class="expired">expired</span>)<!-- /TMPL_IF --></td>
diff --git a/members/moremember.pl b/members/moremember.pl
index beec293..aa8165b 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -49,6 +49,7 @@ use C4::Biblio;
 use C4::Reserves;
 use C4::Branch; # GetBranchName
 use C4::Form::MessagingPreferences;
+use C4::NewsChannels; #get slip news
 
 #use Smart::Comments;
 #use Data::Dumper;
@@ -443,4 +444,13 @@ $template->param(
     quickslip		  => $quickslip,
 );
 
+#Get the slip news items
+my $all_koha_news   = &GetNewsToDisplay("slip");
+my $koha_news_count = scalar @$all_koha_news;
+
+$template->param(
+    koha_news       => $all_koha_news,
+    koha_news_count => $koha_news_count
+);
+
 output_html_with_http_headers $input, $cookie, $template->output;
-- 
1.5.6.5



More information about the Koha-patches mailing list