fixes for bug 246 (zipcode), 207 (display of institutional member) and some improvment and other bugfixes
This commit is contained in:
parent
1a3e1c2248
commit
b31ff7ec23
|
|
@ -31,6 +31,7 @@ use C4::Interface::CGI::Output;
|
|||
use C4::Koha;
|
||||
use HTML::Template;
|
||||
use C4::Members;
|
||||
use C4::Date;
|
||||
|
||||
my $input = new CGI;
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ foreach my $branch (keys %$branches) {
|
|||
push @select_branch, $branch;
|
||||
$select_branches{$branch} = $branches->{$branch}->{'branchname'};
|
||||
}
|
||||
my $CGIbranch=CGI::scrolling_list( -name => 'branch',
|
||||
my $CGIbranch=CGI::scrolling_list( -name => 'branchcode',
|
||||
-values => \@select_branch,
|
||||
-default => $data->{'branchcode'},
|
||||
-labels => \%select_branches,
|
||||
|
|
@ -70,7 +71,32 @@ my $CGIbranch=CGI::scrolling_list( -name => 'branch',
|
|||
-multiple => 0 );
|
||||
|
||||
$template->param(member => $member,
|
||||
cardnumber_institution => $cardnumber,
|
||||
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);
|
||||
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ my $dbh = C4::Context->dbh;
|
|||
my $query="Select * from borrowers where borrowernumber=$data{'borrowernumber'}";
|
||||
my $sth=$dbh->prepare($query);
|
||||
$sth->execute;
|
||||
if (my $data=$sth->fetchrow_hashref){
|
||||
if (my $data2=$sth->fetchrow_hashref){
|
||||
$data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
|
||||
$data{'joining'}=format_date_in_iso($data{'joining'});
|
||||
$data{'expiry'}=format_date_in_iso($data{'expiry'});
|
||||
|
|
@ -61,7 +61,9 @@ if (my $data=$sth->fetchrow_hashref){
|
|||
categorycode='$data{'categorycode'}',city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}',
|
||||
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'}'
|
||||
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;
|
||||
|
||||
|
|
@ -72,13 +74,13 @@ if (my $data=$sth->fetchrow_hashref){
|
|||
$query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber,
|
||||
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'}',
|
||||
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'}',
|
||||
'$data{'joining'}','$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}',
|
||||
'$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{'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
|
||||
# so when we update information for an adult we should check for guarantees and update the relevant part
|
||||
|
|
|
|||
|
|
@ -43,25 +43,43 @@ foreach my $key (@names){
|
|||
$data{$key}=$input->param($key);
|
||||
}
|
||||
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'}','','')";
|
||||
|
||||
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;
|
||||
my $sth2=$dbh->prepare($query);
|
||||
$sth2->execute;
|
||||
$sth2->finish;
|
||||
#$sth->finish;
|
||||
|
||||
print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$data{'borrowernumber'}");
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ for (my $i=0;$i<3;$i++){
|
|||
where borrowernumber=$data{'borrowernumber'}";
|
||||
# print $query;
|
||||
}elsif ($data{"cardnumber_child_$i"} ne ''){
|
||||
warn "INSERT";
|
||||
my $dob=$data{"dateofbirth_child_$i"};
|
||||
$dob=ParseDate($dob);
|
||||
$dob=UnixDate($dob,'%Y-%m-%d');
|
||||
|
|
@ -94,7 +93,6 @@ for (my $i=0;$i<3;$i++){
|
|||
}
|
||||
#print $query;
|
||||
my $sth2=$dbh->prepare($query);
|
||||
warn "QQQ = $query";
|
||||
$sth2->execute;
|
||||
$sth2->finish;
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
<TMPL_INCLUDE name="members-top.inc">
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<h1>Add New Institution</h1><br>
|
||||
<TMPL_IF name="surname">
|
||||
<h1>Edit Institution</h1><br>
|
||||
<TMPL_ELSE>
|
||||
<h1>Add new Institution</h1><br>
|
||||
</TMPL_IF>
|
||||
<form action=/cgi-bin/koha/newimember.pl method=post>
|
||||
<input type=hidden name=joining value="">
|
||||
<input type=hidden name=expiry value="">
|
||||
|
|
@ -36,7 +40,7 @@
|
|||
<td><FONT SIZE=2>Institution Name</FONT></td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td colspan=3><input type=text name=institution_name size=50 value=""></td>
|
||||
<td colspan=3><input type=text name=institution_name size=50 value="<TMPL_VAR name="surname">"></td>
|
||||
</tr>
|
||||
<tr><td> </TD></TR>
|
||||
|
||||
|
|
@ -48,12 +52,12 @@
|
|||
|
||||
<tr valign=top bgcolor=white>
|
||||
<td ><FONT SIZE=2>Postal Address*</FONT></td>
|
||||
<td><FONT SIZE=2>Town*</FONT></td>
|
||||
<td><FONT SIZE=2>Zipcode / Town*</FONT></td>
|
||||
<td><FONT SIZE=2>Area</FONT></td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td><input type=text name=address size=40 value=""></td>
|
||||
<td><input type=text name=city size=20 value=""></td>
|
||||
<td><input type=text name=address size=40 value="<TMPL_VAR name="streetaddress">"></td>
|
||||
<td><input type=text name=zipcode size=20 value="<TMPL_VAR name="zipcode">"> <br/><input type=text name=city size=20 value="<TMPL_VAR name="city">"></td>
|
||||
<td>
|
||||
<TMPL_VAR name="CGIbranch">
|
||||
</td>
|
||||
|
|
@ -70,7 +74,7 @@
|
|||
<td COLSPAN=3><FONT SIZE=2>Contact Name*</td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td COLSPAN=3><input type=text name=contactname size=40 value=""></td>
|
||||
<td COLSPAN=3><input type=text name=contactname size=40 value="<TMPL_VAR name="contactname">"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
|
@ -80,9 +84,9 @@
|
|||
<td><FONT SIZE=2>Email</td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td ><input type=text name=phoneday size=20 value=""></td>
|
||||
<td><input type=text name=faxnumber size=20 value=""></td>
|
||||
<td ><input type=text name=emailaddress size=20 value=""></td>
|
||||
<td ><input type=text name=phoneday size=20 value="<TMPL_VAR name="phoneday">"></td>
|
||||
<td><input type=text name=faxnumber size=20 value="<TMPL_VAR name="faxnumber">"></td>
|
||||
<td ><input type=text name=emailaddress size=20 value="<TMPL_VAR name="emailaddress">"></td>
|
||||
</tr>
|
||||
|
||||
<tr><td> </TD></TR>
|
||||
|
|
@ -91,7 +95,7 @@
|
|||
<td><FONT SIZE=2>Notes</font></td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td COLSPAN=4><textarea name=altnotes wrap=physical cols=70 rows=3></textarea></td>
|
||||
<td COLSPAN=4><textarea name=altnotes wrap=physical cols=70 rows=3><TMPL_VAR name="altnotes"></textarea></td>
|
||||
</tr>
|
||||
|
||||
<tr><td> </TD></TR>
|
||||
|
|
@ -104,7 +108,7 @@
|
|||
<td ><FONT SIZE=2>Notes</font></td>
|
||||
</tr>
|
||||
<tr valign=top >
|
||||
<td COLSPAN=5><textarea name=borrowernotes wrap=physical cols=70 rows=3></textarea></td>
|
||||
<td COLSPAN=5><textarea name=borrowernotes wrap=physical cols=70 rows=3><TMPL_VAR name="borrowernotes"></textarea></td>
|
||||
</tr>
|
||||
|
||||
<tr><td> </TD></TR>
|
||||
|
|
|
|||
|
|
@ -88,12 +88,15 @@
|
|||
|
||||
<tr valign=top bgcolor=white>
|
||||
<td COLSPAN=3><FONT SIZE=2><b>Postal Address*</b></FONT></td>
|
||||
<td><FONT SIZE=2><b>Town*</b></FONT></td>
|
||||
<td><FONT SIZE=2><b>Zipcode / Town*</b></FONT></td>
|
||||
<td><FONT SIZE=2>Joining Branch</FONT></td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td COLSPAN=3><input type=text name=address size=40 value="<TMPL_VAR NAME=address>"></td>
|
||||
<td><input type=text name=city size=20 value="<TMPL_VAR NAME=city>"></td>
|
||||
<td>
|
||||
<input type=text name="zipcode" size=20 value="<TMPL_VAR NAME="zipcode">"><br />
|
||||
<input type=text name=city size=20 value="<TMPL_VAR NAME=city>">
|
||||
</td>
|
||||
<td>
|
||||
<TMPL_VAR name="CGIbranch">
|
||||
</td>
|
||||
|
|
@ -102,11 +105,13 @@
|
|||
|
||||
<tr valign=top bgcolor=white>
|
||||
<td COLSPAN=3><FONT SIZE=2>Street Address if different</FONT></td>
|
||||
<td><FONT SIZE=2>Town</FONT></td>
|
||||
<td><FONT SIZE=2>Zipcode / Town</FONT></td>
|
||||
</tr>
|
||||
<tr valign=top bgcolor=white>
|
||||
<td COLSPAN=3><input type=text name=streetaddress size=40 value="<TMPL_VAR NAME=streetaddress>"></td>
|
||||
<td><input type=text name=streetcity size=20 value="<TMPL_VAR NAME=streetcity>"></td>
|
||||
<td>
|
||||
<input type=text name="homezipcode" size=20 value="<TMPL_VAR NAME="homezipcode">"></br/>
|
||||
<input type=text name=streetcity size=20 value="<TMPL_VAR NAME=streetcity>"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
<!-- main site -->
|
||||
|
||||
|
||||
<h1><TMPL_VAR NAME=firstname> <TMPL_VAR NAME=surname></h1><P>
|
||||
<p>
|
||||
|
||||
|
|
@ -24,9 +25,9 @@
|
|||
<br>
|
||||
<FONT SIZE=2 face="arial, helvetica"><TMPL_VAR NAME="title"> <TMPL_VAR NAME="othernames"> <TMPL_VAR NAME="surname"> <TMPL_IF name="IS_ADULT">(<TMPL_VAR NAME="firstname">, <TMPL_VAR NAME="initials">)</TMPL_IF><p>
|
||||
Card Number: <TMPL_VAR NAME="cardnumber"><BR>
|
||||
Postal Address: <TMPL_VAR NAME="streetaddress">, <TMPL_VAR NAME="city"><BR>
|
||||
Home Address: <TMPL_VAR NAME="physstreet">, <TMPL_VAR NAME="streetcity"><BR>
|
||||
Phone (Home): <TMPL_VAR NAME="phone"><BR>
|
||||
Postal Address: <TMPL_VAR NAME="streetaddress">, <TMPL_VAR name="zipcode"> <TMPL_VAR NAME="city"><BR>
|
||||
<TMPL_UNLESS name="I">Home Address: <TMPL_VAR NAME="physstreet">, <TMPL_VAR name="homezipcode"> <TMPL_VAR NAME="streetcity"><BR>
|
||||
Phone (Home): <TMPL_VAR NAME="phone"><BR></TMPL_UNLESS>
|
||||
Phone (Daytime): <TMPL_VAR NAME="phoneday"><BR>
|
||||
Fax: <TMPL_VAR NAME="faxnumber"><BR>
|
||||
E-mail: <a href="mailto:<TMPL_VAR NAME="emailaddress">"><TMPL_VAR NAME="emailaddress"></a><br>
|
||||
|
|
@ -39,31 +40,50 @@
|
|||
<TMPL_IF NAME="printethnicityline">
|
||||
Ethnicity: <TMPL_VAR NAME="ethnicity">, <TMPL_VAR NAME="ethnotes"><br>
|
||||
</TMPL_IF>
|
||||
DoB: <TMPL_VAR NAME="dateofbirth"><BR>
|
||||
Sex: <TMPL_VAR NAME="sex"><P>
|
||||
Alternative Contact: <TMPL_VAR NAME="contactname"><BR>
|
||||
<TMPL_UNLESS name="I">
|
||||
DoB: <TMPL_VAR NAME="dateofbirth"><BR>
|
||||
Sex: <TMPL_VAR NAME="sex"><P>
|
||||
Alternative</TMPL_UNLESS> Contact: <TMPL_VAR NAME="contactname"><BR>
|
||||
Phone: <TMPL_VAR NAME="altphone"><BR>
|
||||
Relationship: <TMPL_VAR NAME="altrelationship"><BR>
|
||||
<TMPL_UNLESS name="I">
|
||||
Relationship: <TMPL_VAR NAME="altrelationship"><BR>
|
||||
</TMPL_UNLESS>
|
||||
Notes: <TMPL_VAR NAME="altnotes"><P>
|
||||
<TMPL_IF NAME="isguarantee">
|
||||
Guarantees:<br><TMPL_LOOP NAME="guaranteeloop"><A HREF="/cgi-bin/koha/moremember.pl?bornum=<TMPL_VAR NAME="borrowernumber">"><TMPL_VAR NAME=name> - <TMPL_VAR NAME="cardnumber"></a><br></TMPL_LOOP>
|
||||
<TMPL_ELSE>
|
||||
Guarantor:
|
||||
<TMPL_IF NAME="guarantorborrowernumber">
|
||||
<A HREF="/cgi-bin/koha/moremember.pl?bornum=<TMPL_VAR NAME="guarantorborrowernumber">"><TMPL_VAR NAME="guarantorcardnumber"></a><br>
|
||||
<TMPL_UNLESS name="I">
|
||||
<TMPL_IF NAME="isguarantee">
|
||||
Guarantees:<br><TMPL_LOOP NAME="guaranteeloop"><A HREF="/cgi-bin/koha/moremember.pl?bornum=<TMPL_VAR NAME="borrowernumber">"><TMPL_VAR NAME=name> - <TMPL_VAR NAME="cardnumber"></a><br></TMPL_LOOP>
|
||||
<TMPL_ELSE>
|
||||
no guarantor<br>
|
||||
Guarantor:
|
||||
<TMPL_IF NAME="guarantorborrowernumber">
|
||||
<A HREF="/cgi-bin/koha/moremember.pl?bornum=<TMPL_VAR NAME="guarantorborrowernumber">"><TMPL_VAR NAME="guarantorcardnumber"></a><br>
|
||||
<TMPL_ELSE>
|
||||
no guarantor<br>
|
||||
</TMPL_IF>
|
||||
</TMPL_IF>
|
||||
</TMPL_IF>
|
||||
</TMPL_UNLESS>
|
||||
<P>
|
||||
General Notes: <!--<A HREF="popbox.html" onclick="messenger(200,250,'Form that lets you add to and delete notes.'); return false">-->
|
||||
<TMPL_VAR NAME="borrowernotes"><!--</a>-->
|
||||
<p align=right>
|
||||
</font>
|
||||
<form action=/cgi-bin/koha/memberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
<TMPL_IF name="A">
|
||||
<form action=/cgi-bin/koha/memberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
<TMPL_IF name="C">
|
||||
<form action=/cgi-bin/koha/memberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
<TMPL_IF name="I">
|
||||
<form action=/cgi-bin/koha/imemberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
<form action=/cgi-bin/koha/deletemem.pl method=post>
|
||||
<input type=hidden name=member value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Delete">
|
||||
|
|
|
|||
|
|
@ -156,16 +156,18 @@ if ($delete){
|
|||
-multiple => 0 );
|
||||
|
||||
$template->param(
|
||||
member => $member,
|
||||
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'},
|
||||
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'},
|
||||
phoneday => $data->{'phoneday'},
|
||||
|
|
@ -185,7 +187,6 @@ if ($delete){
|
|||
dateofbirth => $data->{'dateofbirth'},
|
||||
dateformat => display_date_format(),
|
||||
CGIbranch => $CGIbranch);
|
||||
warn "title ==>".$data->{'title'}."<==";
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
||||
|
||||
|
|
|
|||
147
moremember.pl
147
moremember.pl
|
|
@ -65,6 +65,8 @@ my $bornum=$input->param('bornum');
|
|||
|
||||
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'});
|
||||
$data->{'dateofbirth'} = format_date($data->{'dateofbirth'});
|
||||
|
|
@ -75,13 +77,14 @@ $data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'});
|
|||
$data->{&expand_sex_into_predicate($data->{'sex'})} = 1;
|
||||
|
||||
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'};
|
||||
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'};
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -90,25 +93,25 @@ if ($data->{'ethnicity'} || $data->{'ethnotes'}) {
|
|||
}
|
||||
|
||||
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);
|
||||
$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'});
|
||||
}
|
||||
my ($guarantor)=findguarantor($data->{'borrowernumber'});
|
||||
unless ($guarantor->{'borrowernumber'} == 0){
|
||||
$template->param(guarantorborrowernumber => $guarantor->{'borrowernumber'}, guarantorcardnumber => $guarantor->{'cardnumber'});
|
||||
}
|
||||
}
|
||||
|
||||
my %bor;
|
||||
|
|
@ -125,63 +128,63 @@ my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
|
|||
#}
|
||||
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'});
|
||||
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=
|
||||
}
|
||||
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);
|
||||
# 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);
|
||||
}
|
||||
|
||||
my ($count,$issue)=borrissues($bornum);
|
||||
my $today=ParseDate('today');
|
||||
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;
|
||||
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);
|
||||
#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);
|
||||
}
|
||||
|
||||
my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
|
||||
|
|
|
|||
|
|
@ -169,11 +169,13 @@ if ($ok == 0) {
|
|||
sex => $sex,
|
||||
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'},
|
||||
textmessaging => $data{'textmessaging'},
|
||||
contactname => $data{'contactname'},
|
||||
altphone => $data{'altphone'},
|
||||
altrelationship => $data{'altrelationship'},
|
||||
|
|
|
|||
Loading…
Reference in New Issue