adding date control (expiry after enrollment date)

This commit is contained in:
tipaul 2006-01-09 10:31:36 +00:00
parent b81a08e8b7
commit e079902a8d
2 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,9 @@
<!-- TMPL_IF NAME="ERROR_branch" -->
Branch : member should be of the same branch as you<br>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="ERROR_date" -->
Expiry date BEFORE enrollment date<br>
<!-- /TMPL_IF -->
</div>
<!-- /TMPL_IF -->
<form action="/cgi-bin/koha/members/memberentry.pl" method="post">

View File

@ -117,6 +117,11 @@ if ($op eq 'add' or $op eq 'modify') {
}
}
}
warn "==> ".format_date_in_iso($data{'joining'})." > ".format_date_in_iso($data{'expiry'});
if ($data{'expiry'} && format_date_in_iso($data{'joining'}) > format_date_in_iso($data{'expiry'})) {
push @errors, "ERROR_date";
warn "ERROR DATE";
}
if ($nok) {
foreach my $error (@errors) {
$template->param( $error => 1);