From 447b0fa6090eb48f22b90edb27cd02031842cc88 Mon Sep 17 00:00:00 2001 From: btoumi Date: Fri, 2 Jun 2006 15:37:29 +0000 Subject: [PATCH] modify bad field name use fonction Today from date::calc --- .../prog/en/members/memberentryA.tmpl | 10 +++--- .../prog/en/members/memberentryC.tmpl | 10 +++--- .../prog/en/members/memberentryI.tmpl | 10 +++--- .../prog/en/members/memberentryP.tmpl | 10 +++--- members/memberentry.pl | 34 ++++--------------- 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryA.tmpl b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryA.tmpl index cf9150aada..269a507ad8 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryA.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryA.tmpl @@ -20,9 +20,9 @@
Duplicate suspected - ');" >Detail + ');" >Detail Duplicate ? - &category_type=">Yes + &category_type=">Yes     No, it is not @@ -62,7 +62,7 @@ " /> " /> " /> - "> + "> " /> @@ -245,7 +245,7 @@ " /> " /> " /> - "> + "> " /> @@ -471,7 +471,7 @@ " /> " /> " /> - "> + "> " /> diff --git a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryC.tmpl b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryC.tmpl index ff9657c8e5..098519fd0b 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryC.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryC.tmpl @@ -20,9 +20,9 @@ @@ -56,7 +56,7 @@ " /> " /> " /> - "> + "> "/> @@ -244,7 +244,7 @@ " /> " /> " /> - "> + "> "/> @@ -496,7 +496,7 @@ " /> " /> " /> - "> + "> "/> diff --git a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryI.tmpl b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryI.tmpl index d2b351070b..bdd06be30b 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryI.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryI.tmpl @@ -20,9 +20,9 @@ @@ -54,7 +54,7 @@ " /> " /> " /> - "> + "> " /> @@ -162,7 +162,7 @@ " /> " /> " /> - "> + "> " /> @@ -327,7 +327,7 @@ " /> " /> " /> - "> + "> "/> diff --git a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryP.tmpl b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryP.tmpl index 94cee98257..efb5d2fd1b 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/members/memberentryP.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/members/memberentryP.tmpl @@ -20,9 +20,9 @@ @@ -55,7 +55,7 @@ " /> " /> " /> - "> + "> "/> @@ -243,7 +243,7 @@ " /> " /> " /> - "> + "> " /> @@ -505,7 +505,7 @@ " /> " /> " /> - "> + "> " /> diff --git a/members/memberentry.pl b/members/memberentry.pl index 67e12a2ee5..36548f7dcf 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -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: -- 2.39.5