[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha overdue.pl,1.2,1.3 moremember.pl,1.16,1.17
From: |
Dorian Meid |
Subject: |
[Koha-cvs] CVS: koha overdue.pl,1.2,1.3 moremember.pl,1.16,1.17 |
Date: |
Mon, 30 Sep 2002 07:16:36 -0700 |
Update of /cvsroot/koha/koha
In directory usw-pr-cvs1:/tmp/cvs-serv16037
Modified Files:
overdue.pl moremember.pl
Log Message:
templatified
Index: overdue.pl
===================================================================
RCS file: /cvsroot/koha/koha/overdue.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** overdue.pl 14 Aug 2002 18:12:51 -0000 1.2
--- overdue.pl 30 Sep 2002 14:16:34 -0000 1.3
***************
*** 23,33 ****
use CGI;
use C4::Database;
my $input = new CGI;
- print $input->header;
my $type=$input->param('type');
- print startpage();
- print startmenu('report');
my $duedate;
my $bornum;
--- 23,35 ----
use CGI;
use C4::Database;
+ use HTML::Template;
my $input = new CGI;
my $type=$input->param('type');
+ my $theme = $input->param('theme'); # only used if allowthemeoverride is set
+ my %tmpldata = pathtotemplate ( template => 'overdue.tmpl', theme => $theme);
+ my $template = HTML::Template->new( filename => $tmpldata{'path'},
+ die_on_bad_params => 0);
my $duedate;
my $bornum;
***************
*** 45,61 ****
my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d",
($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
- print "<FONT SIZE=6><em>Items Overdue as of $todaysdate</em></FONT><br><P>";
-
- print << "EOF";
- <TABLE cellspacing=0 cellpadding=5 border=0 align=center>
- <TR VALIGN=TOP>
- <TD bgcolor="99cc33" background="/koha/images/background-mem.gif" colspan
><b>Due Date</b></td>
- <TD bgcolor="99cc33" background="/koha/images/background-mem.gif" colspan
><b>Patron</b></td>
- <TD bgcolor="99cc33"
background="/koha/images/background-mem.gif"><b>Phone</b></td>
- <TD bgcolor="99cc33"
background="/koha/images/background-mem.gif"><b>Title</b></td>
- <TD bgcolor="99cc33"
background="/koha/images/background-mem.gif"><b>Author</b></td>
- </tr>
- EOF
-
my $dbh=C4Connect;
--- 47,50 ----
***************
*** 63,66 ****
--- 52,57 ----
my $sth=$dbh->prepare($query);
$sth->execute;
+
+ my @overduedata;
while (my $data=$sth->fetchrow_hashref) {
$duedate=$data->{'date_due'};
***************
*** 91,100 ****
$author=$data3->{'author'};
$sth3->finish;
- if (!$email){
- print
"<tr><td>$duedate</td><td>$name</td><td>$phone</td><td>$title</td><td>$author</td></tr>";
- } else {
- print "<tr><td>$duedate</td><td><a href=\"mailto:$email?subject=Overdue:
$title\">$name</a></td><td>$phone</td><td>$title</td><td>$author</td></tr>";
- }
}
--- 82,95 ----
$author=$data3->{'author'};
$sth3->finish;
+ push (@overduedata, { duedate => $duedate,
+ bornum => $bornum,
+ itemnum => $itemnum,
+ name => $name,
+ phone => $phone,
+ email => $email,
+ biblionumber => $biblionumber,
+ title => $title,
+ author => $author });
}
***************
*** 102,107 ****
$dbh->disconnect;
! print "</table>";
!
! print endmenu('report');
! print endpage();
--- 97,104 ----
$dbh->disconnect;
! $template->param( startmenureport => join ('', startmenu('report')),
! endmenureport => join ('', endmenu('report')),
! todaysdate => $todaysdate,
! overdueloop => address@hidden );
!
! print "Content-Type: text/html\n\n", $template->output;
Index: moremember.pl
===================================================================
RCS file: /cvsroot/koha/koha/moremember.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** moremember.pl 30 Sep 2002 00:53:27 -0000 1.16
--- moremember.pl 30 Sep 2002 14:16:34 -0000 1.17
***************
*** 39,56 ****
use C4::Koha;
use C4::Database;
my $dbh=C4Connect;
my $input = new CGI;
- my $bornum=$input->param('bornum');
! print $input->header;
#start the page and read in includes
- print startpage();
- print startmenu('member');
- my $data=borrdata('',$bornum);
$data->{'dateenrolled'} = slashifyDate($data->{'dateenrolled'});
--- 39,57 ----
use C4::Koha;
use C4::Database;
+ use HTML::Template;
my $dbh=C4Connect;
my $input = new CGI;
+ my $theme = $input->param('theme'); # only used if allowthemeoverride is set
+ my %tmpldata = pathtotemplate ( template => 'moremember.tmpl', theme =>
$theme );
+ my $template = HTML::Template->new(filename => $tmpldata{'path'},
die_on_bad_params => 0);
! my $bornum=$input->param('bornum');
#start the page and read in includes
+ my $data=borrdata('',$bornum);
$data->{'dateenrolled'} = slashifyDate($data->{'dateenrolled'});
***************
*** 60,82 ****
$data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'});
- print <<printend
- <FONT SIZE=6><em>$data->{'firstname'} $data->{'surname'}</em></FONT><P>
- <p>
- <form action=/cgi-bin/koha/jmemberentry.pl method=post>
- <TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width=270>
- <TR VALIGN=TOP>
- <td bgcolor="99cc33" background="/images/background-mem.gif"><B>MEMBERSHIP
RECORD</TD></TR>
- <tr VALIGN=TOP >
- <TD>
- <p align=right><INPUT TYPE="image" name="submit" VALUE="add-child" height=42
WIDTH=120 BORDER=0 src="/images/add-child.gif">
- <input type=hidden name=type value=Add>
- <input type=hidden name=bornum value=$data->{'borrowernumber'}>
- </form>
- </P><br>
- <FONT SIZE=2 face="arial, helvetica">$data->{'title'} $data->{'othernames'}
$data->{'surname'} ($data->{'firstname'}, $data->{'initials'})<p>
-
- Card Number: $data->{'cardnumber'}<BR>
- printend
- ;
if ($data->{'categorycode'} eq 'C'){
my $data2=borrdata('',$data->{'guarantor'});
--- 61,64 ----
***************
*** 88,122 ****
$data->{'phoneday'}=$data2->{'phoneday'};
}
! my $ethnicityline='';
if ($data->{'ethnicity'} || $data->{'ethnotes'}) {
! $ethnicityline="Ethnicity: $data->{'ethnicity'},
$data->{'ethnotes'}<br>";
}
- print <<printend
- Postal Address: $data->{'streetaddress'}, $data->{'city'}<BR>
- Home Address: $data->{'physstreet'}, $data->{'streetcity'}<BR>
- Phone (Home): $data->{'phone'}<BR>
- Phone (Daytime): $data->{'phoneday'}<BR>
- Fax: $data->{'faxnumber'}<BR>
- E-mail: <a
href="mailto:$data->{'emailaddress'}">$data->{'emailaddress'}</a><br>
- Textmessaging:$data->{'textmessaging'}<p>
- Membership Number: $data->{'borrowernumber'}<BR>
- Membership: $data->{'categorycode'}<BR>
- Area: $data->{'area'}<BR>
- Fee:$30/year, Paid<BR>
- Joined: $data->{'dateenrolled'}, Expires: $data->{'expiry'} <BR>
- Joining Branch: $data->{'homebranch'}<P>
- $ethnicityline
- DoB: $data->{'dateofbirth'}<BR>
- Sex: $data->{'sex'}<P>
-
- Alternative Contact:$data->{'contactname'}<BR>
- Phone: $data->{'altphone'}<BR>
- Relationship: $data->{'altrelationship'}<BR>
- Notes: $data->{'altnotes'}<P>
- printend
- ;
if ($data->{'categorycode'} ne 'C'){
! print " Guarantees:";
# FIXME
# It looks like the $i is only being returned to handle walking through
--- 70,81 ----
$data->{'phoneday'}=$data2->{'phoneday'};
}
!
!
if ($data->{'ethnicity'} || $data->{'ethnotes'}) {
! $template->param(printethnicityline => 1);
}
if ($data->{'categorycode'} ne 'C'){
! $template->param(isguarantee => 1);
# FIXME
# It looks like the $i is only being returned to handle walking through
***************
*** 124,164 ****
#
my ($count,$guarantees)=findguarantees($data->{'borrowernumber'});
for (my $i=0;$i<$count;$i++){
! print "<A
HREF=\"/cgi-bin/koha/moremember.pl?bornum=$guarantees->[$i]->{'borrowernumber'}\">$guarantees->[$i]->{'cardnumber'}</a><br>";
}
} else {
- print "Guarantor:";
my ($guarantor)=findguarantor($data->{'borrowernumber'});
! if ($guarantor->{'borrowernumber'} == 0){
! print "no guarantor<br>";
! } else {
! print "<A
HREF=\"/cgi-bin/koha/moremember.pl?bornum=$guarantor->{'borrowernumber'}\">$guarantor->{'cardnumber'}</a><br>";
}
}
- print <<printend
-
- <P>
-
- General Notes: <!--<A HREF="popbox.html" onclick="messenger(200,250,'Form
that lets you add to and delete notes.'); return false">-->
- $data->{'borrowernotes'}<!--</a>-->
- <p align=right>
- <form action=/cgi-bin/koha/memberentry.pl method=post>
- <input type=hidden name=bornum value=$bornum>
- <INPUT TYPE="image" name="modify" VALUE="modify" height=42 WIDTH=93
BORDER=0 src="/images/modify-mem.gif">
-
- <INPUT TYPE="image" name="delete" VALUE="delete" height=42 WIDTH=93
BORDER=0 src="/images/delete-mem.gif">
- </p>
-
- </TD>
- </TR>
- </TABLE>
- </FORM>
- <img src="/images/holder.gif" width=16 height=800 align=left>
- <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
- <TR VALIGN=TOP>
- <td bgcolor="99cc33" background="/images/background-mem.gif"
colspan=4><B>FINES & CHARGES</TD></TR>
- printend
- ;
my %bor;
$bor{'borrowernumber'}=$bornum;
--- 83,100 ----
#
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'}});
}
+ $template->param(guaranteeloop => address@hidden);
+
} else {
my ($guarantor)=findguarantor($data->{'borrowernumber'});
! unless ($guarantor->{'borrowernumber'} == 0){
! $template->param(guarantorborrowernumber =>
$guarantor->{'borrowernumber'}, guarantorcardnumber =>
$guarantor->{'cardnumber'});
}
}
my %bor;
$bor{'borrowernumber'}=$bornum;
***************
*** 173,193 ****
# $numaccts=10;
#}
for (my$i=0;$i<$numaccts;$i++){
- #if ($accts->[$i]{'accounttype'} ne 'Pay'){
my $amount= $accts->[$i]{'amount'} + 0.00;
! my $amount2= $accts->[$i]{'amountoutstanding'} + 0.00;
if ($amount2 != 0){
! print "<tr VALIGN=TOP >";
! my $item=" ";
!
! $accts->[$i]{'date'} = slashifyDate($accts->[$i]{'date'});
if ($accts->[$i]{'accounttype'} ne 'Res'){
! #get item data
! #$item=
}
- print "<td>$accts->[$i]{'date'}</td>";
- # print "<TD>$accts->[$i]{'accounttype'}</td>";
- print "<TD>";
# FIXME
--- 109,125 ----
# $numaccts=10;
#}
+ 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'} = slashifyDate($accts->[$i]{'date'});
if ($accts->[$i]{'accounttype'} ne 'Res'){
! #get item data
! #$item=
}
# FIXME
***************
*** 197,266 ****
if ($accts->[$i]{'accounttype'} ne 'Res'){
my
$iteminfo=C4::Circulation::Circ2::getiteminformation($env,$accts->[$i]->{'itemnumber'},'');
! print "<a
href=/cgi-bin/koha/moredetail.pl?itemnumber=$accts->[$i]->{'itemnumber'}&bib=$iteminfo->{'biblionumber'}&bi=$iteminfo->{'biblioitemnumber'}>$accts->[$i]->{'description'}
$accts->[$i]{'title'}</a>";
}
- print "</td>
- <TD>$amount</td><td>$amount2</td>
- </tr>";
}
}
- print <<printend
- <tr VALIGN=TOP >
- <TD colspan=3 align=right>
- <nobr>
- <a href=/cgi-bin/koha/boraccount.pl?bornum=$bornum><img height=42 WIDTH=187
BORDER=0 src="/images/view-account.gif"></a>
- <a href=/cgi-bin/koha/pay.pl?bornum=$bornum><img height=42 WIDTH=187
BORDER=0 src="/images/pay-fines.gif"></a></nobr>
- </td>
-
- </tr>
-
-
- </table>
-
- <p>
- <form action="renewscript.pl" method=post>
- <input type=hidden name=bornum value=$bornum>
- <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
-
- <TR VALIGN=TOP>
-
- <td bgcolor="99cc33" background="/images/background-mem.gif"
colspan=6><B>ITEMS CURRENTLY ON ISSUE</b></TD>
- </TR>
-
- <TR VALIGN=TOP>
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Title</b></TD>
- <td bgcolor="99cc33" background="/images/background-mem.gif"><B>Due</b></TD>
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Itemtype</b></TD>
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Charge</b></TD>
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Renew</b></TD>
- </TR>
- printend
- ;
my ($count,$issue)=borrissues($bornum);
my $today=ParseDate('today');
for (my $i=0;$i<$count;$i++){
! print "<tr VALIGN=TOP >
! <TD>";
! my $datedue=ParseDate($issue->[$i]{'date_due'});
!
$issue->[$i]{'date_due'} = slashifyDate($issue->[$i]{'date_due'});
!
if ($datedue < $today){
! print "<font color=red>";
}
- print "$issue->[$i]{'title'}
- <a
href=/cgi-bin/koha/moredetail.pl?item=$issue->[$i]->{'itemnumber'}&bib=$issue->[$i]->{'biblionumber'}&bi=$issue->[$i]->{'biblioitemnumber'}>
- $issue->[$i]{'barcode'}</a></td>
- <TD>$issue->[$i]{'date_due'}</td>";
#find the charge for an item
my
($charge,$itemtype)=calc_charges(undef,$dbh,$issue->[$i]{'itemnumber'},$bornum);
! print "<TD>$itemtype</td>";
! print "<TD>$charge</td>";
- # if ($datedue < $today){
- # print "<td>Overdue</td>";
- # } else {
- # print "<td> </td>";
- # }
#check item is not reserved
my ($restype,$reserves)=CheckReserves($issue->[$i]{'itemnumber'});
--- 129,154 ----
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'} = slashifyDate($issue->[$i]{'date_due'});
! my %row = %$issue->[$i];
if ($datedue < $today){
! $row{'red'}=1; #print "<font color=red>";
}
#find the charge for an item
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'});
***************
*** 270,317 ****
# print "<TD>Previously Renewed - no renewals</td></tr>";
} else {
! print "<TD>";
!
! print "<input type=radio name=\"renew_item_$issue->[$i]{'itemnumber'}\"
value=y>Y
! <input type=radio name=\"renew_item_$issue->[$i]{'itemnumber'}\"
value=n>N</td>
! </tr>
! ";
}
}
- print <<printend
-
- <tr VALIGN=TOP >
- <TD colspan=5 align=right>
- <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187
BORDER=0 src="/images/update-renewals.gif">
- </td>
- </form>
- </tr>
-
-
- </table>
-
-
- <P>
-
- <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
-
- <TR VALIGN=TOP>
-
- <td bgcolor="99cc33" background="/images/background-mem.gif"
colspan=5><B>ITEMS REQUESTED</b></TD>
- </TR>
-
- <TR VALIGN=TOP>
-
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Title</b></TD>
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Requested</b></TD>
-
-
-
-
- <td bgcolor="99cc33"
background="/images/background-mem.gif"><B>Remove</b></TD>
- </TR>
- <form action=/cgi-bin/koha/modrequest.pl method=post>
- <input type=hidden name=from value=borrower>
- printend
- ;
my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
--- 158,165 ----
# print "<TD>Previously Renewed - no renewals</td></tr>";
} else {
! $row{'norenew'}=0;
}
+ push (@issuedata, \%row);
}
my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
***************
*** 321,361 ****
# kind of loop?
#
for (my $i=0;$i<$rescount;$i++){
$reserves->[$i]{'reservedate2'} =
slashifyDate($reserves->[$i]{'reservedate'});
my $restitle;
if ($reserves->[$i]{'constrainttype'} eq 'o'){
!
$restitle=getreservetitle($reserves->[$i]{'biblionumber'},$reserves->[$i]{'borrowernumber'},$reserves->[$i]{'reservedate'},$reserves->[$i]{'timestamp'});
! }
! print "<tr VALIGN=TOP >
! <TD><a
href=\"/cgi-bin/koha/request.pl?bib=$reserves->[$i]{'biblionumber'}\">$reserves->[$i]{'btitle'}</a>
$restitle->{'volumeddesc'} $restitle->{'itemtype'}</td>
! <TD>$reserves->[$i]{'reservedate2'}</td>
! <input type=hidden name=biblio value=$reserves->[$i]{'biblionumber'}>
! <input type=hidden name=borrower value=$bornum>
!
! <TD><select name=\"rank-request\">
! <option value=n>No
! <option value=del>Yes
! </select>
! </tr>
! ";
}
- print <<printend
! <tr VALIGN=TOP >
! <TD colspan=5 align=right>
! <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187
BORDER=0 src="/images/cancel-requests.gif"></td>
! </tr>
! </table>
! </form>
! <p align=right>
! <a href=/cgi-bin/koha/readingrec.pl?bornum=$bornum><img height=42 WIDTH=187
BORDER=0 src="/images/reading-record.gif"></a>
! </p>
! printend
! ;
!
!
! print endmenu('member');
! print endpage();
! $dbh->disconnect;
--- 169,193 ----
# kind of loop?
#
+ my @reservedata;
for (my $i=0;$i<$rescount;$i++){
$reserves->[$i]{'reservedate2'} =
slashifyDate($reserves->[$i]{'reservedate'});
my $restitle;
+ my %row = %$reserves->[$i];
if ($reserves->[$i]{'constrainttype'} eq 'o'){
!
$restitle=getreservetitle($reserves->[$i]{'biblionumber'},$reserves->[$i]{'borrowernumber'},$reserves->[$i]{'reservedate'},$reserves->[$i]{'timestamp'});
! %row = (%row , %$restitle);
! }
! push (@reservedata, \%row);
}
! $dbh->disconnect;
+ $template->param($data);
+ $template->param(startmenumember => join('', startmenu('member')),
+ endmenumember => join('', endmenu('member')),
+ bornum => $bornum,
+ accountloop => address@hidden,
+ issueloop => address@hidden,
+ reserveloop => address@hidden);
! print "Content-Type: text/html\n\n", $template->output;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha overdue.pl,1.2,1.3 moremember.pl,1.16,1.17,
Dorian Meid <=
- Prev by Date:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en overdue.tmpl,NONE,1.1 moremember.tmpl,NONE,1.1
- Next by Date:
[Koha-cvs] CVS: koha installer-lite.pl,1.2,1.3
- Previous by thread:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en overdue.tmpl,NONE,1.1 moremember.tmpl,NONE,1.1
- Next by thread:
[Koha-cvs] CVS: koha installer-lite.pl,1.2,1.3
- Index(es):