[Koha] Date problem - tracing from HTML through perl files

Henri-Damien LAURENT laurenthdl at alinto.com
Fri May 18 20:01:04 NZST 2007


Greg Vickers a écrit :
> Hi Mike,
>
> Mike Dalgity wrote:
>> The comma that you're seeing in the Joined field is coming from the
>> template.  Should be a quick fix to edit that out.
>
> Yes, thanks - I figured that out but forgot to take it out of the 
> email, it looks like the comma is mean to be there in the template and 
> does not affect the problem that we are having.
>
> Thanks,
> Greg
>
Thanks for your details.
My problem is that everything goes OK here.
So I have problems tracing a problem I donot have.

you are not right when you say newmember on memberentry calls to 
newmember.pl
Indeed, it calls newmember sub in Members.pm.
And this procedure works as this :
<code>
    $data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
    if ($data{'joining'}){
      $data{'joining'}=format_date_in_iso($data{'joining'});
    } else {
      $data{'joining'} = sprintf("%04d-%02d-%02d",Date::Calc::Today);
    }
    # if expirydate is not set, calculate it from borrower category 
subscription duration
    if ($data{'expiry'}) {
      $data{'expiry'}=format_date_in_iso($data{'expiry'});
    } else {
      my $sth = $dbh->prepare("select enrolmentperiod from categories 
where categorycode=?");
      $sth->execute($data{'categorycode'});
      my ($enrolmentperiod) = $sth->fetchrow;
      $enrolmentperiod = 1 unless ($enrolmentperiod);
      my ($y,$m,$d)=split /-/,$data{'joining'};
      foreach(Add_Delta_YM($y,$m,$d,$enrolmentperiod,0)){warn "$_\t";}
      warn "".$enrolmentperiod;
      $data{'expiry'} = 
sprintf("%04d-%02d-%02d",Add_Delta_YM($y,$m,$d,$enrolmentperiod,0));
    }
</code>
(Extract of C4::Members.pm from line 130 to line 150)
using only Date::Calc module as you can see, and format_date_in_iso and 
not format_date or ParseDate.

What you pointed at can be a source of problems, I can fix it.
But I have seen no code using newmember.pl.
Are you creating a peculiar type of member (institution or child) ?




More information about the Koha mailing list