koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha newmember.pl,1.14,1.15


From: Mike Hansen
Subject: [Koha-cvs] CVS: koha newmember.pl,1.14,1.15
Date: Sat, 09 Aug 2003 17:30:24 -0700

Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1:/tmp/cvs-serv12744/koha

Modified Files:
        newmember.pl 
Log Message:
Get the enrollmentperiod from the database when adding members


Index: newmember.pl
===================================================================
RCS file: /cvsroot/koha/koha/newmember.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** newmember.pl        7 Jul 2003 14:53:24 -0000       1.14
--- newmember.pl        10 Aug 2003 00:30:21 -0000      1.15
***************
*** 62,65 ****
--- 62,68 ----
                           });
  
+ #Get the database handle
+ my $dbh = C4::Context->dbh;
+ 
  # Check that all compulsary fields are entered
  # If everything is ok, set $ok = 0
***************
*** 135,140 ****
      }
      if ($data{'expiry'} eq ''){
!       $data{'expiry'}=ParseDate('in 1 year');
!       $data{'expiry'}=format_date($data{'expiry'});
      }
      my $ethnic=$data{'ethnicity'}." ".$data{'ethnicnotes'};
--- 138,154 ----
      }
      if ($data{'expiry'} eq ''){
!       my $get_enrolmentperiod = $dbh->prepare(q{SELECT enrolmentperiod FROM 
categories WHERE categorycode = ?});
!       $get_enrolmentperiod->execute($data{'categorycode'});
!       my ( $period ) = $get_enrolmentperiod->fetchrow;
!       if ( ($period)  && ($period != 1))
!       {
!               $data{'expiry'}=ParseDate("in $period years");
!               $data{'expiry'}=format_date($data{'expiry'});
!       }
!       else
!       {
!               $data{'expiry'}=ParseDate('in 1 year');
!               $data{'expiry'}=format_date($data{'expiry'});
!       }
      }
      my $ethnic=$data{'ethnicity'}." ".$data{'ethnicnotes'};
***************
*** 156,160 ****
  
      #Get the fee
-     my $dbh = C4::Context->dbh;
      my $sth = $dbh->prepare("SELECT enrolmentfee FROM categories WHERE 
categorycode = ?");
      $sth->execute($data{'categorycode'});
--- 170,173 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]