[Koha-patches] [PATCH 1/2] [SIGNED-OFF] Fix for Bug 5051, Renewal due date doesn't always show on patron Checkout tab

Galen Charlton gmcharlt at gmail.com
Sat Nov 13 04:00:26 CET 2010


From: Owen Leonard <oleonard at myacpl.org>

Display of the renewal date footer in the template was conditional upon
the existence of checkouts from today.

In order to fix this bug it was necessary to repeat the markup for the
table footer twice in the template, so I created an include file for it.
The same include file can now be used in moremember.tmpl.

Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
 .../prog/en/includes/checkouts-table-footer.inc    |   25 ++++++++++++++
 .../prog/en/modules/circ/circulation.tmpl          |   36 ++-----------------
 .../prog/en/modules/members/moremember.tmpl        |   36 +++++---------------
 3 files changed, 38 insertions(+), 59 deletions(-)
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc
new file mode 100644
index 0000000..5d05b94
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc
@@ -0,0 +1,25 @@
+<tfoot>
+	<tr>
+		<td colspan="5" style="text-align: right; font-weight:bold;">Totals:</td>
+		<td><!-- TMPL_VAR NAME="totaldue" --></td>
+		<td><!-- TMPL_VAR NAME="totalprice" --></td>
+		<td colspan="2">
+			<p>Renewal due date: <input type="text" size="8" id="newduedate" name="newduedate" value="<!-- TMPL_VAR Name="newduedate" -->" />
+			<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" />
+			<script type="text/javascript"> //<![CDATA[
+			//#TODO - ADD syspref (AllowPostDatedCheckouts).
+			 Calendar.setup(
+			      {
+			         inputField : "newduedate",
+			         ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+			         button : "newduedate_button",
+			         disableFunc : validate1,
+			         dateStatusFunc : validate1,
+			       }
+			    );
+			//]]>
+			</script></p>
+			<p><label>Forgive fines on return: <input type="checkbox" name="exemptfine" value="1" /></label></p>
+		</td>
+	</tr>
+</tfoot>
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
index 0b4ac29..4e1dc1e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -176,7 +176,7 @@ function refocus(calendar) {
     </li>
     <!-- TMPL_IF NAME="canned_bor_notes_loop" -->
         <li>
-                <label for="canned_notes">Predefined notes: </label>
+                <label for="type">Predefined notes: </label>
                 <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
                     <option value="">Select Note</option>
                     <!-- TMPL_LOOP NAME="canned_bor_notes_loop" -->
@@ -193,7 +193,7 @@ function refocus(calendar) {
         <input type="submit" value="Save" /> <a href="#" class="cancel">Cancel</a>
     </fieldset>
 
-        <input type="hidden" name="borrowernumber" id="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
+        <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
         <input type="hidden" name="branchcode" value="<!-- TMPL_VAR NAME="branch" -->" />
 </fieldset>
 </form>
@@ -642,36 +642,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
         <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th>
     </tr>
 <!-- TMPL_IF NAME="todayissues" --></thead>
-<tfoot>
-		<tr>
-            <td colspan="5" style="text-align: right; font-weight:bold;">Totals:</td>
-			<td><!-- TMPL_VAR NAME="totaldue" --></td>
-            <td><!-- TMPL_VAR NAME="totalprice" --></td>
-            <td colspan="2">      
-                <p>
-                    Renewal due date: <input type="text" size="8" id="newduedate" name="newduedate" value="<!-- TMPL_VAR Name="newduedate" -->" />
-                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" />
- <script type="text/javascript"> //<![CDATA[
-				//#TODO - ADD syspref (AllowPostDatedCheckouts).
-                     Calendar.setup(
-                          {
-                             inputField : "newduedate",
-                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
-                             button : "newduedate_button",
-                             disableFunc : validate1,
-                             dateStatusFunc : validate1,
-                             onClose : refocus
-                           }
-                        );
-				//]]>
-				 </script>
-                </p>
-                <p>
-                    <label>Forgive fines on return: <input type="checkbox" name="exemptfine" value="1" /></label>
-                </p>
-            </td>
-        </tr>
-		</tfoot>
+<!-- TMPL_INCLUDE NAME="checkouts-table-footer.inc" -->
 	<tbody>
 
     <!-- TMPL_LOOP NAME="todayissues" -->
@@ -734,6 +705,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
 <!-- TMPL_IF NAME="previssues" -->
 <!-- TMPL_IF NAME="todayissues" --><tr><th colspan="10"><a name="previous" id="previous"></a>Previous checkouts</th></tr><!-- TMPL_ELSE -->
 <tr><th class="{sorter: false}" colspan="10"><a name="previous" id="previous"></a>Previous checkouts</th></tr></thead>
+<!-- TMPL_INCLUDE NAME="checkouts-table-footer.inc" -->
 	<tbody>
 <!-- /TMPL_IF -->
     <!-- TMPL_LOOP NAME="previssues" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
index 5f3bbba..d34fc62 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
@@ -89,7 +89,14 @@ if (nodename =="barcodes[]"){
    }   
 }
 }
-
+function validate1(date) {
+    var today = new Date();
+    if ( date < today ) {
+        return true;
+     } else {
+        return false;
+     }
+};
 //]]>
 </script>
 
@@ -404,32 +411,7 @@ if (nodename =="barcodes[]"){
             <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllitems">select all</a> | <a href="#" id="CheckNoitems">none</a></p></th>
             <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th>
         </tr></thead>
-    	<tfoot>
-		<tr>
-            <td colspan="5" style="text-align: right; font-weight:bold;">Totals:</td>
-			<td><!-- TMPL_VAR NAME="totaldue" --></td>
-            <td><!-- TMPL_VAR NAME="totalprice" --></td>
-            <td colspan="2">      
-                <p>
-                    Renewal due date: <input type="text" size="8" id="newduedate" name="newduedate" value="<!-- TMPL_VAR Name="newduedate" -->" />
-                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="newduedate_button" alt="Show Calendar" />
-                    <script type="text/javascript">
-                        //<![CDATA[
-                        Calendar.setup({
-                            inputField : "newduedate",
-                            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
-                            button : "newduedate_button"
-                        });
-                        //]]>
-                    </script>
-				<span style="display:block;color:#666;font-weight:normal;font-size:90%;"><!-- TMPL_INCLUDE NAME="date-format.inc" --></span>
-                </p>
-                <p>
-                    <label>Forgive fines on return: <input type="checkbox" name="exemptfine" value="1" /></label>
-                </p>
-            </td>
-        </tr>
-		</tfoot>
+        <!-- TMPL_INCLUDE NAME="checkouts-table-footer.inc" -->
        <tbody>
        <!-- TMPL_LOOP name="issueloop" -->
 
-- 
1.7.0



More information about the Koha-patches mailing list