modify bad field name
use fonction Today from date::calc
This commit is contained in:
parent
ea0297b7fa
commit
447b0fa609
5 changed files with 27 additions and 47 deletions
|
@ -20,9 +20,9 @@
|
|||
<form name="form_double">
|
||||
<div id="problem">
|
||||
Duplicate suspected
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->');" >Detail</a>
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->');" >Detail</a>
|
||||
Duplicate ?
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->">Yes</a>
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->">Yes</a>
|
||||
No, it is not
|
||||
<!-- TMPL_IF NAME="checked"-->
|
||||
<input type="checkbox" checked name="answernodouble" >
|
||||
|
@ -62,7 +62,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
<!-- from form 2 -->
|
||||
|
@ -245,7 +245,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
<!-- from form 1 -->
|
||||
|
@ -471,7 +471,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
<!-- from form 1 -->
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
<form name="form_double">
|
||||
<div id="problem">
|
||||
Duplicate suspected
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->');" class="borrowers_button">Details</a>
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->');" class="borrowers_button">Details</a>
|
||||
Duplicate ?
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->" class="borrowers_button">Yes</a>
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->" class="borrowers_button">Yes</a>
|
||||
No, it is not
|
||||
<INPUT type="checkbox" <!-- TMPL_IF NAME="checked"--> checked <!--/TMPL_IF--> name="answernodouble" >
|
||||
</div>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" " value="<!-- TMPL_VAR NAME="nodouble" -->"/>
|
||||
|
||||
<!-- input from form 2 -->
|
||||
|
@ -244,7 +244,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" " value="<!-- TMPL_VAR NAME="nodouble" -->"/>
|
||||
|
||||
<!-- input from form 1 -->
|
||||
|
@ -496,7 +496,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" " value="<!-- TMPL_VAR NAME="nodouble" -->"/>
|
||||
|
||||
<!-- input from form 1 -->
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
<form name="form_double">
|
||||
<div id="problem">
|
||||
Duplicate suspected
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->');" class="borrowers_button">Details</a>
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->');" class="borrowers_button">Details</a>
|
||||
Duplicate ?
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->" class="borrowers_button">Yes</a>
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->" class="borrowers_button">Yes</a>
|
||||
No, it is not
|
||||
<INPUT type="checkbox" <!-- TMPL_IF NAME="checked"--> checked <!--/TMPL_IF--> name="answernodouble" >
|
||||
</div>
|
||||
|
@ -54,7 +54,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
<!-- from form 2 -->
|
||||
|
@ -162,7 +162,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
|
||||
|
@ -327,7 +327,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->"/>
|
||||
|
||||
<!-- from form 1 -->
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
<form name="form_double">
|
||||
<div id="problem">
|
||||
Duplicate suspected
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->');" class="borrowers_button">Details</a>
|
||||
<a href="javascript:Dopop('borrowers_details.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->');" class="borrowers_button">Details</a>
|
||||
Duplicate ?
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowerid=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->" class="borrowers_button">Yes</a>
|
||||
<a href="/cgi-bin/koha/members/memberentry.pl?borrowernumber=<!--TMPL_VAR NAME="check_member"-->&category_type=<!--TMPL_VAR NAME="check_categorytype"-->" class="borrowers_button">Yes</a>
|
||||
No, it is not
|
||||
<INPUT type="checkbox" <!-- TMPL_IF NAME="checked"--> checked <!--/TMPL_IF--> name="answernodouble" >
|
||||
</div>
|
||||
|
@ -55,7 +55,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->"/>
|
||||
|
||||
<!-- from form 2 -->
|
||||
|
@ -243,7 +243,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
|
||||
|
@ -505,7 +505,7 @@
|
|||
<input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
|
||||
<input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
|
||||
<input type="hidden" name="flags" value="<!-- TMPL_VAR NAME="flags" -->" />
|
||||
<input type="hidden" name="borrowerid" value="<!-- TMPL_VAR NAME="borrowerid" -->">
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
|
||||
<input type="hidden" name="nodouble" value="<!-- TMPL_VAR NAME="nodouble" -->" />
|
||||
|
||||
<!-- from form 1 -->
|
||||
|
|
|
@ -159,9 +159,7 @@ SELECT upperagelimit,
|
|||
my $sth=$dbh->prepare($query);
|
||||
$sth->execute($categorycode);
|
||||
my $category_info = $sth->fetchrow_hashref;
|
||||
|
||||
my $age = get_age(format_date_in_iso($data{dateofbirth}));
|
||||
|
||||
if ($age > $category_info->{upperagelimit}
|
||||
or $age < $category_info->{dateofbirthrequired}
|
||||
) {
|
||||
|
@ -178,14 +176,14 @@ SELECT upperagelimit,
|
|||
$data{'login'}=lc($onefirstnameletter.$fivesurnameletter);
|
||||
}
|
||||
if ($op eq 'add' and $data{'dateenrolled'} eq ''){
|
||||
my $today=today();
|
||||
my $today= sprintf('%04d-%02d-%02d', Today());
|
||||
#insert ,in field "dateenrolled" , the current date
|
||||
$data{'dateenrolled'}=$today;
|
||||
#if date expiry is null u must calculate the value only in this case
|
||||
$data{'dateexpiry'} = calcexpirydate($data{'categorycode'},$today);
|
||||
}
|
||||
if ($op eq 'modify' ){
|
||||
my $today=today();
|
||||
my $today= sprintf('%04d-%02d-%02d', Today());
|
||||
# if date expiry is null u must calculate the value only in this case
|
||||
if ($data{'dateexpiry'} eq ''){
|
||||
$data{'dateexpiry'} = calcexpirydate($data{'categorycode'},$today);
|
||||
|
@ -459,7 +457,7 @@ if ($delete){
|
|||
$step++;
|
||||
}
|
||||
|
||||
warn "CITY".$data{city};
|
||||
|
||||
$template->param(
|
||||
BorrowerMandatoryField => C4::Context->preference("BorrowerMandatoryField"),#field to test with javascript
|
||||
category_type => $category_type,#to know the category type of the borrower
|
||||
|
@ -472,7 +470,7 @@ if ($delete){
|
|||
"op$op" => 1,
|
||||
# op => $op,
|
||||
nodouble => $nodouble,
|
||||
borrowerid => $borrowerid,#register number
|
||||
borrowernumber => $borrowernumber,#register number
|
||||
cardnumber => $data{'cardnumber'},
|
||||
surname => uc($data{'surname'}),
|
||||
firstname => ucfirst($data{'firstname'}),
|
||||
|
@ -525,11 +523,11 @@ if ($delete){
|
|||
contacttype => $data{'contacttype'},
|
||||
organisations => $data{'organisations'},
|
||||
flagloop => \@flagdata,
|
||||
# "contacttype_".$data{'contacttype'} =>" SELECTED ",
|
||||
# "contacttype_".$data{'contacttype'} =>" SELECTED ",
|
||||
dateformat => display_date_format(),
|
||||
check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function
|
||||
modify => $modify,
|
||||
# city_choice => $city_choice ,#check if the city was selected
|
||||
modify => $modify,
|
||||
# city_choice => $city_choice ,#check if the city was selected
|
||||
nok => $nok,#flag to konw if an error
|
||||
CGIbranch => $CGIbranch,
|
||||
memberofinstution => $member_of_institution,
|
||||
|
@ -539,24 +537,6 @@ if ($delete){
|
|||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
}
|
||||
|
||||
sub get_age {
|
||||
my ($date, $date_ref) = @_;
|
||||
|
||||
if (not defined $date_ref) {
|
||||
$date_ref = sprintf('%04d-%02d-%02d', Today());
|
||||
}
|
||||
|
||||
my ($year1, $month1, $day1) = split /-/, $date;
|
||||
my ($year2, $month2, $day2) = split /-/, $date_ref;
|
||||
|
||||
my $age = $year2 - $year1;
|
||||
if ($month1.$day1 > $month2.$day2) {
|
||||
$age--;
|
||||
}
|
||||
|
||||
return $age;
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# End:
|
||||
|
|
Loading…
Reference in a new issue