Bug 7557: Change hardcoded routing list note into a system preference
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 19 Feb 2012 11:31:14 +0000 (12:31 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 14 Mar 2012 15:27:07 +0000 (16:27 +0100)
Adds a new system preference RoutingListNote under the Serials tab.

The note will display above the note from the subscription and replace
the current hardcoded note:

"Notes: Please return this item promptly as others are waiting for it."

The patch adds unique ids to all notes and the note in general, so it
can be styled using CSS.

Also corrects the routing slip template to follow the HTML4 rule.

Update 2012-03-12: Fixed problem in updatedatebase.

installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref
koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt
serials/routing-preview.pl

index 2f7824f..5a6c713 100644 (file)
@@ -349,3 +349,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelay',  '0',  '',  'Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay',  'YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.',  'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CalendarFirstDayOfWeek','Sunday','Select the first day of week to use in the calendar.','Sunday|Monday','Choice');
+INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.',  'free')
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RoutingListNote','To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutlingListNote</a> system preference.','Define a note to be shown on all routing lists','70|10','Textarea');
index d370664..49edeb8 100755 (executable)
@@ -4889,6 +4889,12 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.',  'free')");
     $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelay', '0', '', 'Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay', 'YesNo')");
     print "Upgrade to $DBversion done (Added system preference ExpireReservesMaxPickUpDelay, system preference ExpireReservesMaxPickUpDelayCharge, add reseves.charge_if_expired)\n";
+}
+
+$DBversion = "3.07.00.XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do(q{INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RoutingListNote','To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutlingListNote</a> system preference.','Define a note to be shown on all routing lists','70|10','Textarea');});
+    print "Upgrade to $DBversion done (Added system preference RoutingListNote for adding a general note to all routing lists.)\n";
     SetVersion($DBversion);
 }
 
index 58db404..1950ba6 100644 (file)
@@ -25,6 +25,11 @@ Serials:
               yes: Place
               no: "Don't place"
         - received serials on hold if they are on a routing list.
+    -
+        - 'Include following note on all routing lists:'
+        - pref: RoutingListNote
+          type: textarea
+          class: code
     -
         - Show the
         - pref: StaffSerialIssueDisplayCount
index be5084e..f4200e5 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Serials  &rsaquo; Routing Slip Preview</title>
+<title>Koha &rsaquo; Serials  &rsaquo; Routing slip preview</title>
 [% INCLUDE 'doc-head-close.inc' %]
 
 <style type="text/css">
 
 <div id="custom-doc" class="yui-t7">
    <div id="bd">
-       
 
 <table>
-<tr><td colspan="3"><h3>[% libraryname %]</h3></td></tr>
-<tr><td colspan="3"><b>Title:</b> [% title |html %]<br />
-[% issue %]</td></tr>
-<tr><td><b>Name</b></td>
-    <td><b>Date Due</b></td></tr>
-[% FOREACH memberloo IN memberloop %]
-        <tr><td>[% memberloo.name %]</td>
-            <td>&nbsp;</td></tr>
-[% END %]
+    <tr>
+        <td colspan="2"><h3>[% libraryname %]</h3></td>
+    </tr>
+    <tr>
+        <td colspan="2"><b>Title:</b> [% title |html %]<br />[% issue %]</td>
+    </tr>
+    <tr>
+        <td><b>Name</b></td>
+        <td><b>Date due</b></td>
+    </tr>
+    [% FOREACH memberloo IN memberloop %]
+    <tr>
+        <td>[% memberloo.name %]</td>
+        <td>&nbsp;</td>
+    </tr>
+    [% END %]
 </table>
-<p><b>Notes:</b> Please return this item promptly as others are waiting for it.
-<br />[% routingnotes %]</p>
+
+<div id="routingnotes">
+    <p id="generalroutingnote">[% generalroutingnote %]</p>
+    <p id="routingnote">[% routingnotes %]</p>
+</div>
+
    <div id="slip-block-links" class="noprint">
    <a class="button" href="javascript:window.print();self.close()">Print</a> &nbsp; <a class="button" href="javascript:self.close()">Close</a>
    </div>
index 6c8f184..8d6850a 100755 (executable)
@@ -131,6 +131,7 @@ $template->param(
     subscriptionid => $subscriptionid,
     memberloop => $memberloop,
     routingnotes => $routingnotes,
+    generalroutingnote => C4::Context->preference('RoutingListNote'),
     hasRouting => check_routing($subscriptionid),
     );