[Koha-cvs] CVS: koha imemberentry.pl,1.7,1.8 insertdata.pl,1.18,1.19 insertidata.pl,1.3,1.4 insertjdata.pl,1.4,1.5 memberentry.pl,1.31,1.32 moremember.pl,1.30,1.31 newmember.pl,1.11,1.12
Paul POULAIN
tipaul at users.sourceforge.net
Thu May 15 14:25:07 CEST 2003
Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1:/tmp/cvs-serv18947
Modified Files:
imemberentry.pl insertdata.pl insertidata.pl insertjdata.pl
memberentry.pl moremember.pl newmember.pl
Log Message:
fixes for bug 246 (zipcode), 207 (display of institutional member) and some improvment and other bugfixes
Index: imemberentry.pl
===================================================================
RCS file: /cvsroot/koha/koha/imemberentry.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** imemberentry.pl 8 May 2003 13:36:14 -0000 1.7
--- imemberentry.pl 15 May 2003 12:25:04 -0000 1.8
***************
*** 32,35 ****
--- 32,36 ----
use HTML::Template;
use C4::Members;
+ use C4::Date;
my $input = new CGI;
***************
*** 63,67 ****
$select_branches{$branch} = $branches->{$branch}->{'branchname'};
}
! my $CGIbranch=CGI::scrolling_list( -name => 'branch',
-values => \@select_branch,
-default => $data->{'branchcode'},
--- 64,68 ----
$select_branches{$branch} = $branches->{$branch}->{'branchname'};
}
! my $CGIbranch=CGI::scrolling_list( -name => 'branchcode',
-values => \@select_branch,
-default => $data->{'branchcode'},
***************
*** 71,75 ****
$template->param(member => $member,
! cardnumber_institution => $cardnumber,
CGIbranch => $CGIbranch);
--- 72,101 ----
$template->param(member => $member,
! member => $member,
! address => $data->{'streetaddress'},
! firstname => $data->{'firstname'},
! surname => $data->{'surname'},
! othernames => $data->{'othernames'},
! streetaddress => $data->{'streetaddress'},
! streetcity => $data->{'streetcity'},
! zipcode => $data->{'zipcode'},
! homezipcode => $data->{'homezipcode'},
! city => $data->{'city'},
! phone => $data->{'phone'},
! phoneday => $data->{'phoneday'},
! faxnumber => $data->{'faxnumber'},
! emailaddress => $data->{'emailaddress'},
! textmessaging => $data->{'textmessaging'},
! contactname => $data->{'contactname'},
! altphone => $data->{'altphone'},
! altnotes => $data->{'altnotes'},
! borrowernotes => $data->{'borrowernotes'},
! "title_".$data->{'title'} => " SELECTED ",
! dateenrolled => $data->{'dateenrolled'},
! expiry => $data->{'expiry'},
! cardnumber => $cardnumber,
! dateofbirth => $data->{'dateofbirth'},
! dateformat => display_date_format(),
! cardnumber_institution => $cardnumber,
CGIbranch => $CGIbranch);
Index: insertdata.pl
===================================================================
RCS file: /cvsroot/koha/koha/insertdata.pl,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** insertdata.pl 9 Apr 2003 00:33:01 -0000 1.18
--- insertdata.pl 15 May 2003 12:25:04 -0000 1.19
***************
*** 49,53 ****
my $sth=$dbh->prepare($query);
$sth->execute;
! if (my $data=$sth->fetchrow_hashref){
$data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
$data{'joining'}=format_date_in_iso($data{'joining'});
--- 49,53 ----
my $sth=$dbh->prepare($query);
$sth->execute;
! if (my $data2=$sth->fetchrow_hashref){
$data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
$data{'joining'}=format_date_in_iso($data{'joining'});
***************
*** 62,66 ****
borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'surname'}',
initials='$data{'initials'}',physstreet='$data{'streetaddress'}',ethnicity='$data{'ethnicity'}',
! gonenoaddress='$data{'gna'}',lost='$data{'lost'}',debarred='$data{'debarred'}',textmessaging='$data{'textmessaging'}', branchcode = '$data{'branchcode'}'
where borrowernumber=$data{'borrowernumber'}";
# print $query;
--- 62,68 ----
borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'surname'}',
initials='$data{'initials'}',physstreet='$data{'streetaddress'}',ethnicity='$data{'ethnicity'}',
! gonenoaddress='$data{'gna'}',lost='$data{'lost'}',debarred='$data{'debarred'}',
! textmessaging='$data{'textmessaging'}', branchcode = '$data{'branchcode'}',
! zipcode = '$data{'zipcode'}',homezipcode='$data{'homezipcode'}'
where borrowernumber=$data{'borrowernumber'}";
# print $query;
***************
*** 73,77 ****
firstname,altnotes,dateofbirth,contactname,emailaddress,textmessaging,dateenrolled,streetcity,
altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
! initials,ethnicity,borrowernumber,physstreet,branchcode) values ('$data{'title'}','$data{'expiry'}','$data{'cardnumber'}',
'$data{'sex'}','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
'$data{'firstname'}','$data{'altnotes'}','$data{'dateofbirth'}','$data{'contactname'}','$data{'emailaddress'}','$data{'textmessaging'}',
--- 75,79 ----
firstname,altnotes,dateofbirth,contactname,emailaddress,textmessaging,dateenrolled,streetcity,
altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
! initials,ethnicity,borrowernumber,physstreet,branchcode,zipcode,homezipcode) values ('$data{'title'}','$data{'expiry'}','$data{'cardnumber'}',
'$data{'sex'}','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
'$data{'firstname'}','$data{'altnotes'}','$data{'dateofbirth'}','$data{'contactname'}','$data{'emailaddress'}','$data{'textmessaging'}',
***************
*** 79,83 ****
'$data{'phoneday'}','$data{'categorycode'}','$data{'city'}','$data{'area'}','$data{'phone'}',
'$data{'borrowernotes'}','$data{'altphone'}','$data{'surname'}','$data{'initials'}',
! '$data{'ethnicity'}','$data{'borrowernumber'}','$data{'streetaddress'}','$data{'branchcode'}')";
}
# ok if its an adult (type) it may have borrowers that depend on it as a guarantor
--- 81,85 ----
'$data{'phoneday'}','$data{'categorycode'}','$data{'city'}','$data{'area'}','$data{'phone'}',
'$data{'borrowernotes'}','$data{'altphone'}','$data{'surname'}','$data{'initials'}',
! '$data{'ethnicity'}','$data{'borrowernumber'}','$data{'streetaddress'}','$data{'branchcode'}',$data{'zipcode'},$data{'homezipcode'})";
}
# ok if its an adult (type) it may have borrowers that depend on it as a guarantor
Index: insertidata.pl
===================================================================
RCS file: /cvsroot/koha/koha/insertidata.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** insertidata.pl 5 Oct 2002 09:45:24 -0000 1.3
--- insertidata.pl 15 May 2003 12:25:04 -0000 1.4
***************
*** 44,66 ****
}
my $dbh = C4::Context->dbh;
! my $surname=$data{'institution_name'};
! my $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
! firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity,
! altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
! initials,ethnicity,borrowernumber,guarantor,school)
! values ('','$data{'expiry'}','$data{'cardnumber_institution'}',
! '','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
! '$data{'firstname'}','$data{'altnotes'}','','$data{'contactname'}',
! '$data{'emailaddress'}',
! now(),'$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
! '$data{'phoneday'}','I','$data{'city'}','$data{'area'}','$data{'phone'}',
! '$data{'borrowernotes'}','$data{'altphone'}','$surname','$data{'initials'}',
! '$data{'ethnicity'}','$data{'borrowernumber'}','','')";
!
#print $query;
! my $sth2=$dbh->prepare($query);
! $sth2->execute;
! $sth2->finish;
#$sth->finish;
--- 44,84 ----
}
my $dbh = C4::Context->dbh;
! my $query="Select * from borrowers where borrowernumber=$data{'borrowernumber'}";
! my $sth=$dbh->prepare($query);
! $sth->execute;
! if (my $data2=$sth->fetchrow_hashref){
! $query="update borrowers set title='$data{'title'}',expiry='$data{'expiry'}',
! cardnumber='$data{'cardnumber_institution'}',sex='$data{'sex'}',ethnotes='$data{'ethnicnotes'}',
! streetaddress='$data{'address'}',faxnumber='$data{'faxnumber'}',firstname='$data{'firstname'}',
! altnotes='$data{'altnotes'}',dateofbirth='$data{'dateofbirth'}',contactname='$data{'contactname'}',
! emailaddress='$data{'emailaddress'}',dateenrolled='$data{'joining'}',streetcity='$data{'streetcity'}',
! altrelationship='$data{'altrelationship'}',othernames='$data{'othernames'}',phoneday='$data{'phoneday'}',
! city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}',
! borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'institution_name'}',
! initials='$data{'initials'}',physstreet='$data{'streetaddress'}',ethnicity='$data{'ethnicity'}',
! gonenoaddress='$data{'gna'}',lost='$data{'lost'}',debarred='$data{'debarred'}',
! textmessaging='$data{'textmessaging'}', branchcode = '$data{'branchcode'}',
! zipcode = '$data{'zipcode'}',homezipcode='$data{'homezipcode'}'
! where borrowernumber=$data{'borrowernumber'}";
! } else {
! my $surname=$data{'institution_name'};
! $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
! firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity,
! altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname,
! initials,ethnicity,borrowernumber,guarantor,school,branchcode,zipcode,homezipcode)
! values ('','$data{'expiry'}','$data{'cardnumber_institution'}',
! '','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}',
! '$data{'firstname'}','$data{'altnotes'}','','$data{'contactname'}',
! '$data{'emailaddress'}',
! now(),'$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
! '$data{'phoneday'}','I','$data{'city'}','$data{'area'}','$data{'phone'}',
! '$data{'borrowernotes'}','$data{'altphone'}','$surname','$data{'initials'}',
! '$data{'ethnicity'}','$data{'borrowernumber'}','','',$data{'branchcode'},$data{'zipcode'},$data{'homezipcode'})";
! }
#print $query;
! my $sth2=$dbh->prepare($query);
! $sth2->execute;
! $sth2->finish;
#$sth->finish;
Index: insertjdata.pl
===================================================================
RCS file: /cvsroot/koha/koha/insertjdata.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** insertjdata.pl 5 May 2003 13:26:00 -0000 1.4
--- insertjdata.pl 15 May 2003 12:25:04 -0000 1.5
***************
*** 62,66 ****
# print $query;
}elsif ($data{"cardnumber_child_$i"} ne ''){
- warn "INSERT";
my $dob=$data{"dateofbirth_child_$i"};
$dob=ParseDate($dob);
--- 62,65 ----
***************
*** 95,99 ****
#print $query;
my $sth2=$dbh->prepare($query);
- warn "QQQ = $query";
$sth2->execute;
$sth2->finish;
--- 94,97 ----
Index: memberentry.pl
===================================================================
RCS file: /cvsroot/koha/koha/memberentry.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** memberentry.pl 8 Apr 2003 12:34:14 -0000 1.31
--- memberentry.pl 15 May 2003 12:25:04 -0000 1.32
***************
*** 157,170 ****
$template->param(
! member => $member,
address => $data->{'streetaddress'},
! firstname => $data->{'firstname'},
! surname => $data->{'surname'},
! othernames => $data->{'othernames'},
! initials => $data->{'initials'},
! ethcatpopup => $ethcatpopup,
! catcodepopup => $catcodepopup,
! streetaddress => $data->{'physstreet'},
! streetcity => $data->{'streetcity'},
city => $data->{'city'},
phone => $data->{'phone'},
--- 157,172 ----
$template->param(
! member => $member,
address => $data->{'streetaddress'},
! firstname => $data->{'firstname'},
! surname => $data->{'surname'},
! othernames => $data->{'othernames'},
! initials => $data->{'initials'},
! ethcatpopup => $ethcatpopup,
! catcodepopup => $catcodepopup,
! streetaddress => $data->{'physstreet'},
! zipcode => $data->{'zipcode'},
! streetcity => $data->{'streetcity'},
! homezipcode => $data->{'homezipcode'},
city => $data->{'city'},
phone => $data->{'phone'},
***************
*** 186,190 ****
dateformat => display_date_format(),
CGIbranch => $CGIbranch);
- warn "title ==>".$data->{'title'}."<==";
output_html_with_http_headers $input, $cookie, $template->output;
--- 188,191 ----
Index: moremember.pl
===================================================================
RCS file: /cvsroot/koha/koha/moremember.pl,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** moremember.pl 8 May 2003 14:12:29 -0000 1.30
--- moremember.pl 15 May 2003 12:25:05 -0000 1.31
***************
*** 66,69 ****
--- 66,71 ----
my $data=borrdata('',$bornum);
+ $template->param($data->{'categorycode'} => 1); # in template <TMPL_IF name="I"> => instutitional (A for Adult & C for children)
+
$data->{'dateenrolled'} = format_date($data->{'dateenrolled'});
$data->{'expiry'} = format_date($data->{'expiry'});
***************
*** 76,86 ****
if ($data->{'categorycode'} eq 'C'){
! my $data2=borrdata('',$data->{'guarantor'});
! $data->{'streetaddress'}=$data2->{'streetaddress'};
! $data->{'city'}=$data2->{'city'};
! $data->{'physstreet'}=$data2->{'physstreet'};
! $data->{'streetcity'}=$data2->{'streetcity'};
! $data->{'phone'}=$data2->{'phone'};
! $data->{'phoneday'}=$data2->{'phoneday'};
}
--- 78,89 ----
if ($data->{'categorycode'} eq 'C'){
! my $data2=borrdata('',$data->{'guarantor'});
! $data->{'streetaddress'}=$data2->{'streetaddress'};
! $data->{'city'}=$data2->{'city'};
! $data->{'physstreet'}=$data2->{'physstreet'};
! $data->{'streetcity'}=$data2->{'streetcity'};
! $data->{'phone'}=$data2->{'phone'};
! $data->{'phoneday'}=$data2->{'phoneday'};
! $data->{'zipcode'} = $data2->{'zipcode'};
}
***************
*** 91,113 ****
if ($data->{'categorycode'} ne 'C'){
! $template->param(isguarantee => 1);
! # FIXME
! # It looks like the $i is only being returned to handle walking through
! # the array, which is probably better done as a foreach loop.
! #
! my ($count,$guarantees)=findguarantees($data->{'borrowernumber'});
! my @guaranteedata;
! for (my $i=0;$i<$count;$i++){
! push (@guaranteedata, {borrowernumber => $guarantees->[$i]->{'borrowernumber'},
! cardnumber => $guarantees->[$i]->{'cardnumber'},
! name => $guarantees->[$i]->{'firstname'} . " " . $guarantees->[$i]->{'surname'}});
! }
! $template->param(guaranteeloop => \@guaranteedata);
} else {
! my ($guarantor)=findguarantor($data->{'borrowernumber'});
! unless ($guarantor->{'borrowernumber'} == 0){
! $template->param(guarantorborrowernumber => $guarantor->{'borrowernumber'}, guarantorcardnumber => $guarantor->{'cardnumber'});
! }
}
--- 94,116 ----
if ($data->{'categorycode'} ne 'C'){
! $template->param(isguarantee => 1);
! # FIXME
! # It looks like the $i is only being returned to handle walking through
! # the array, which is probably better done as a foreach loop.
! #
! my ($count,$guarantees)=findguarantees($data->{'borrowernumber'});
! my @guaranteedata;
! for (my $i=0;$i<$count;$i++){
! push (@guaranteedata, {borrowernumber => $guarantees->[$i]->{'borrowernumber'},
! cardnumber => $guarantees->[$i]->{'cardnumber'},
! name => $guarantees->[$i]->{'firstname'} . " " . $guarantees->[$i]->{'surname'}});
! }
! $template->param(guaranteeloop => \@guaranteedata);
} else {
! my ($guarantor)=findguarantor($data->{'borrowernumber'});
! unless ($guarantor->{'borrowernumber'} == 0){
! $template->param(guarantorborrowernumber => $guarantor->{'borrowernumber'}, guarantorcardnumber => $guarantor->{'cardnumber'});
! }
}
***************
*** 126,152 ****
my @accountdata;
for (my$i=0;$i<$numaccts;$i++){
! my $amount= $accts->[$i]{'amount'} + 0.00;
! my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00;
! my %row = %$accts->[$i];
! if ($amount2 != 0){
! my $item=" ";
! $row{'date'} = format_date($accts->[$i]{'date'});
!
! if ($accts->[$i]{'accounttype'} ne 'Res'){
! #get item data
! #$item=
! }
!
! # FIXME
! # why set this variable if it's not going to be used?
! #
! my $env;
! if ($accts->[$i]{'accounttype'} ne 'Res'){
! my $iteminfo=C4::Circulation::Circ2::getiteminformation($env,$accts->[$i]->{'itemnumber'},'');
! # FIXME, seems to me $iteminfo gets not defined
! %row = (%row , %$iteminfo) if $iteminfo;
! }
! }
! push (@accountdata, \%row);
}
--- 129,155 ----
my @accountdata;
for (my$i=0;$i<$numaccts;$i++){
! my $amount= $accts->[$i]{'amount'} + 0.00;
! my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00;
! my %row = %$accts->[$i];
! if ($amount2 != 0){
! my $item=" ";
! $row{'date'} = format_date($accts->[$i]{'date'});
!
! if ($accts->[$i]{'accounttype'} ne 'Res'){
! #get item data
! #$item=
! }
!
! # FIXME
! # why set this variable if it's not going to be used?
! #
! my $env;
! if ($accts->[$i]{'accounttype'} ne 'Res'){
! my $iteminfo=C4::Circulation::Circ2::getiteminformation($env,$accts->[$i]->{'itemnumber'},'');
! # FIXME, seems to me $iteminfo gets not defined
! %row = (%row , %$iteminfo) if $iteminfo;
! }
! }
! push (@accountdata, \%row);
}
***************
*** 155,186 ****
my @issuedata;
for (my $i=0;$i<$count;$i++){
! my $datedue=ParseDate($issue->[$i]{'date_due'});
! $issue->[$i]{'date_due'} = format_date($issue->[$i]{'date_due'});
! my %row = %{$issue->[$i]};
! if ($datedue < $today){
! $row{'red'}=1; #print "<font color=red>";
! }
! #find the charge for an item
! # FIXME - This is expecting
! # &C4::Circulation::Renewals2::calc_charges, but it's getting
! # &C4::Circulation::Circ2::calc_charges, which only returns one
! # element, so itemtype isn't being set.
! # But &C4::Circulation::Renewals2::calc_charges doesn't appear to
! # return the correct item type either (or a properly-formatted
! # charge, for that matter).
! my ($charge,$itemtype)=calc_charges(undef,$dbh,$issue->[$i]{'itemnumber'},$bornum);
! $row{'itemtype'}=$itemtype;
! $row{'charge'}=$charge;
!
! #check item is not reserved
! my ($restype,$reserves)=CheckReserves($issue->[$i]{'itemnumber'});
! if ($restype){
! print "<TD><a href=/cgi-bin/koha/request.pl?bib=$issue->[$i]{'biblionumber'}>On Request - no renewals</a></td></tr>";
! # } elsif ($issue->[$i]->{'renewals'} > 0) {
! # print "<TD>Previously Renewed - no renewals</td></tr>";
! } else {
! $row{'norenew'}=0;
! }
! push (@issuedata, \%row);
}
--- 158,189 ----
my @issuedata;
for (my $i=0;$i<$count;$i++){
! my $datedue=ParseDate($issue->[$i]{'date_due'});
! $issue->[$i]{'date_due'} = format_date($issue->[$i]{'date_due'});
! my %row = %{$issue->[$i]};
! if ($datedue < $today){
! $row{'red'}=1; #print "<font color=red>";
! }
! #find the charge for an item
! # FIXME - This is expecting
! # &C4::Circulation::Renewals2::calc_charges, but it's getting
! # &C4::Circulation::Circ2::calc_charges, which only returns one
! # element, so itemtype isn't being set.
! # But &C4::Circulation::Renewals2::calc_charges doesn't appear to
! # return the correct item type either (or a properly-formatted
! # charge, for that matter).
! my ($charge,$itemtype)=calc_charges(undef,$dbh,$issue->[$i]{'itemnumber'},$bornum);
! $row{'itemtype'}=$itemtype;
! $row{'charge'}=$charge;
!
! #check item is not reserved
! my ($restype,$reserves)=CheckReserves($issue->[$i]{'itemnumber'});
! if ($restype){
! print "<TD><a href=/cgi-bin/koha/request.pl?bib=$issue->[$i]{'biblionumber'}>On Request - no renewals</a></td></tr>";
! # } elsif ($issue->[$i]->{'renewals'} > 0) {
! # print "<TD>Previously Renewed - no renewals</td></tr>";
! } else {
! $row{'norenew'}=0;
! }
! push (@issuedata, \%row);
}
Index: newmember.pl
===================================================================
RCS file: /cvsroot/koha/koha/newmember.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** newmember.pl 13 Apr 2003 03:47:45 -0000 1.11
--- newmember.pl 15 May 2003 12:25:05 -0000 1.12
***************
*** 170,178 ****
postal => $postal,
home => $home,
phone => $data{'phone'},
phoneday => $data{'phoneday'},
faxnumber => $data{'faxnumber'},
emailaddress => $data{'emailaddress'},
! textmessaging => $data{'textmessaging'},
contactname => $data{'contactname'},
altphone => $data{'altphone'},
--- 170,180 ----
postal => $postal,
home => $home,
+ zipcode => $data{'zipcode'},
+ homezipcode => $data{'homezipcode'},
phone => $data{'phone'},
phoneday => $data{'phoneday'},
faxnumber => $data{'faxnumber'},
emailaddress => $data{'emailaddress'},
! textmessaging => $data{'textmessaging'},
contactname => $data{'contactname'},
altphone => $data{'altphone'},
More information about the Koha-cvs
mailing list