Fix for Bug 5051, Renewal due date doesn't always show on patron Checkout tab

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@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 083d3b1a92)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Owen Leonard 2010-11-12 22:00:26 -05:00 committed by Chris Nighswonger
parent 92b4ccdbaf
commit ebb6e40ccd
3 changed files with 38 additions and 59 deletions

View File

@ -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>

View File

@ -167,7 +167,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" -->
@ -184,7 +184,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>
@ -633,36 +633,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" -->
@ -725,6 +696,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" -->

View File

@ -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" -->