From 22277bbd6a7d53d4dec2ac90e141e6329f490d32 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 27 Jan 2011 11:45:55 -0500 Subject: [PATCH] some fines display. tweak eg_vhost (IfModule ...) --- Open-ILS/examples/apache/eg_vhost.conf | 8 +- Open-ILS/src/perlmods/OpenILS/WWW/EGCatLoader.pm | 9 ++- .../web/templates/default/opac/myopac/fines.tt2 | 85 ++++++++++++++++++++++ 3 files changed, 97 insertions(+), 5 deletions(-) diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf index e250723f01..46dfebc4ad 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf +++ b/Open-ILS/examples/apache/eg_vhost.conf @@ -568,9 +568,11 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT] PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGCatLoader" # Disable caching for development.. -# Header set Expires "Thu, 19 Nov 1981 08:52:00 GM" -# Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0" -# Header set Pragma "no-cache" + +# Header set Expires "Thu, 19 Nov 1981 08:52:00 GM" +# Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0" +# Header set Pragma "no-cache" + # Note: the template processor will decline handling anything it does not diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/OpenILS/WWW/EGCatLoader.pm index 785cd11204..fe1e0e547f 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/EGCatLoader.pm @@ -680,7 +680,10 @@ sub load_myopac_fines { my $self = shift; my $e = $self->editor; my $ctx = $self->ctx; - $ctx->{transactions} = []; + $ctx->{"fines"} = { + "circulation" => [], + "grocery" => [] + }; my $limit = $self->cgi->param('limit') || 0; my $offset = $self->cgi->param('offset') || 0; @@ -713,6 +716,7 @@ sub load_myopac_fines { } ); + $ctx->{"responses"} = 0; while(my $resp = $req->recv) { my $mobts = $resp->content; my $circ = $mobts->circulation; @@ -723,8 +727,9 @@ sub load_myopac_fines { $last_billing = pop(@billings); } + $ctx->{"responses"}++; push( - @{$ctx->{transactions}}, + @{$ctx->{"fines"}->{$mobts->grocery ? "grocery" : "circulation"}}, { xact => $mobts, last_grocery_billing => $last_billing, diff --git a/Open-ILS/web/templates/default/opac/myopac/fines.tt2 b/Open-ILS/web/templates/default/opac/myopac/fines.tt2 index cf9d23c5c1..49ecf3071b 100644 --- a/Open-ILS/web/templates/default/opac/myopac/fines.tt2 +++ b/Open-ILS/web/templates/default/opac/myopac/fines.tt2 @@ -4,11 +4,16 @@ table { border-collapse: collapse; } table { padding: 3px; border-bottom: 1px solid #ddd; text-align: left;} table tr:nth-child(odd) { background-color:#ded; } + h2 { margin-bottom: 0; } [% END %] +[% USE date %] +[% USE money = format('$%.2f') %] +[% PROCESS "default/opac/common.tt2" %] [% WRAPPER "default/opac/base.tt2" %] [% INCLUDE "default/opac/myopac/_links.tt2" myopac_page = "fines" %] +

Summary

@@ -17,6 +22,86 @@ + + + + + +
Balance Owed
XXX TODO
+ +[% IF ctx.fines.circulation.size > 0 %] +

Overdue materials

+ + + + + + + + + + + + + [% FOR f IN ctx.fines.circulation %] + [% attrs = {marc_xml => f.marc_xml}; %] + [% PROCESS get_marc_attrs args=attrs; %] + + + + + + + + + [% END %] +
TitleAuthorCheckout DateDue DateDate ReturnedBalance Owed
[% attrs.title %][% attrs.author %][% date.format( + ctx.parse_datetime(f.xact.circulation.xact_start), "%Y-%m-%d" + ) %][% date.format( + ctx.parse_datetime(f.xact.circulation.due_date), "%Y-%m-%d" + ) %][% + IF f.xact.circulation.checkin_time; + date.format( + ctx.parse_datetime(f.xact.circulation.checkin_time), + "%Y-%m-%d" + ); + END %][% money(f.xact.balance_owed) %]
+[% END %] + +[% IF ctx.fines.grocery.size > 0 %] +

Other Fees

+ + + + + + + + + + + + + [% FOR f IN ctx.fines.grocery %] + + + + + + + + + [% END %] + +
Transaction Start TimeLast Payment TimeInitial Amount OwedTotal Amount PaidBalance OwedBilling Type
[% + date.format( + ctx.parse_datetime(f.xact.xact_start), "%Y-%m-%d" + ) %][% IF f.xact.last_payment_ts; + date.format( + ctx.parse_datetime(f.xact.last_payment_ts), "%Y-%m-%d" + ); + END %][% money(f.xact.total_owed) %][% money(f.xact.total_paid) %][% money(f.xact.balance_owed) %][% f.xact.last_billing_type %]
+[% END %] [% END %] -- 2.11.0