Adding manual datedue for renewals on moremember pages.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Henri-Damien LAURENT 2008-01-25 15:04:31 -06:00 committed by Joshua Ferraro
parent 4cc49c9914
commit fc0ac9ea1b
3 changed files with 34 additions and 14 deletions

View file

@ -1,6 +1,7 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Patrons &rsaquo; <!-- TMPL_IF NAME="unknowuser" -->Patron does not exist<!-- TMPL_ELSE -->Patron Details for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> (<!-- TMPL_VAR NAME="cardnumber" -->)<!-- /TMPL_IF --></title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
<script type="text/JavaScript" language="JavaScript">
//<![CDATA[
$(document).ready(function() {
@ -317,14 +318,17 @@ for (var i=0;i<ItemsNodes.length;i++){
</td>
<td><!-- TMPL_VAR NAME="charge" --></td>
<td><!-- TMPL_VAR NAME="replacementprice" --></td>
<!-- TMPL_IF NAME="renew_failed" -->
<td class="problem">Renewal Failed</td>
<!-- TMPL_ELSE -->
<td>
<!-- TMPL_IF name="norenew" -->
<!-- TMPL_IF EXPR="norenew_reason eq 'on_reserve'" -->
<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">On Hold</a>
<!-- /TMPL_IF -->
<!-- TMPL_IF EXPR="norenew_reason eq 'too_many'" -->
Too Many Renewals
<!-- /TMPL_IF -->
<!-- TMPL_IF EXPR="norenew_reason eq 'on_reserve'" -->
<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">On Hold</a>
<!-- /TMPL_IF -->
<!-- TMPL_IF EXPR="norenew_reason eq 'too_many'" -->
Too Many Renewals
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
<!-- TMPL_IF NAME="red" -->
<input type="checkbox" name="items[]" value="<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" onClick="javascript:uncheck_sibling(this);" />
@ -333,12 +337,11 @@ for (var i=0;i<ItemsNodes.length;i++){
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</td>
<td><input type="checkbox" name="barcodes[]" value="<!-- TMPL_VAR NAME="barcode" -->" onClick="javascript:uncheck_sibling(this);" /></td>
<!-- TMPL_IF NAME="renew_failed" -->
<td>Renewal Failed</td>
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="return_failed" -->
<td>Return Failed</td>
<td class="problem">Return Failed</td>
<!--TMPL_ELSE-->
<td><input type="checkbox" name="barcodes[]" value="<!-- TMPL_VAR NAME="barcode" -->" onClick="javascript:uncheck_sibling(this);" /></td>
<!-- /TMPL_IF -->
</tr>
<!-- /tmpl_loop -->
@ -346,7 +349,21 @@ for (var i=0;i<ItemsNodes.length;i++){
<!-- TMPL_UNLESS NAME="noItemTypeImages" --><td>&nbsp;</td><!-- /TMPL_UNLESS -->
<td colspan="5">Total replacement cost:</td>
<td><!-- TMPL_VAR NAME="totalprice" --></td>
<td colspan="2">&nbsp;</td>
<td colspan="2">
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>
</td>
</tr>
</table>
<fieldset class="action">

View file

@ -336,6 +336,7 @@ $template->param($data);
$template->param(
detailview => 1,
DHTMLcalendar_dateformat=>C4::Dates->DHTMLcalendar(),
roaddetails => $roaddetails,
borrowernumber => $borrowernumber,
reregistration => $reregistration,

View file

@ -25,7 +25,8 @@
use CGI;
use C4::Circulation;
use C4::Auth;
use C4::Dates qw/format_date_in_iso/;
use strict;
my $input = new CGI;
#Set Up User_env
@ -55,6 +56,7 @@ else {
}
my @barcodes = $input->param('barcodes[]');
my $branch=$input->param('branch');
my $datedue=C4::Dates->new($input->param('newduedate'));
# warn "barcodes : @barcodes";
#
@ -67,7 +69,7 @@ foreach my $itemno (@data) {
# check status before renewing issue
my ($renewokay,$error) = CanBookBeRenewed($borrowernumber,$itemno);
if ($renewokay){
AddRenewal($borrowernumber,$itemno,$branch);
AddRenewal($borrowernumber,$itemno,$branch,$datedue);
}
else {
$failedrenews.="&failedrenew=$itemno";