From 4324b8a10772998043c408b159f4859c49a257c2 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 30 Oct 2007 18:35:45 +0000 Subject: [PATCH] adding work_payment type and the /strong/ urging of PINES; extending the auth proxy module git-svn-id: svn://svn.open-ils.org/ILS/trunk@7945 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/apache/eg_vhost.conf | 6 +- Open-ILS/examples/fm_IDL.xml | 28 ++++++ .../OpenILS/Application/Storage/CDBI.pm | 4 + .../OpenILS/Application/Storage/CDBI/money.pm | 5 ++ .../Application/Storage/Driver/Pg/dbi.pm | 6 ++ .../Application/Storage/Publisher/money.pm | 6 +- Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm | 86 ++++++++++--------- Open-ILS/src/sql/Pg/080.schema.money.sql | 7 ++ Open-ILS/web/opac/common/js/fm_table_conf.js | 3 +- .../server/patron/bills_overlay.xul | 1 + 10 files changed, 107 insertions(+), 45 deletions(-) diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf index 1c945bd020..d6838fe3f3 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf +++ b/Open-ILS/examples/apache/eg_vhost.conf @@ -212,9 +212,9 @@ OSRFGatewayConfig /openils/conf/opensrf_core.xml # ---------------------------------------------------------------------------------- SetHandler perl-script - PerlSetVar ProxyTitle "Report Login" - PerlSetVar ProxyDescription "Please log in to view this report" - PerlSetVar ProxyPermissions "VIEW_REPORT_OUTPUT" + PerlSetVar OILSProxyTitle "Report Login" + PerlSetVar OILSProxyDescription "Please log in to view this report" + PerlSetVar OILSProxyPermissions "VIEW_REPORT_OUTPUT" PerlHandler OpenILS::WWW::Proxy Options +ExecCGI PerlSendHeader On diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index dd34678ba3..ac4dfd3e82 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -10,6 +10,7 @@ + @@ -1647,6 +1648,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -2009,6 +2031,7 @@ + @@ -2017,6 +2040,7 @@ + @@ -2038,6 +2062,7 @@ + @@ -2046,6 +2071,7 @@ + @@ -2063,10 +2089,12 @@ + + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm index a3df1aadf8..1388d816c4 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm @@ -664,6 +664,10 @@ sub modify_from_fieldmapper { money::work_payment->has_a( accepting_usr => 'actor::user' ); #money::work_payment->might_have( payment => 'money::payment' ); + money::goods_payment->has_a( xact => 'money::billable_transaction' ); + money::goods_payment->has_a( accepting_usr => 'actor::user' ); + #money::goods_payment->might_have( payment => 'money::payment' ); + money::credit_payment->has_a( xact => 'money::billable_transaction' ); money::credit_payment->has_a( accepting_usr => 'actor::user' ); #money::credit_payment->might_have( payment => 'money::payment' ); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm index 0864ff3bad..af1cb899fe 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm @@ -132,6 +132,11 @@ use base qw/money::forgive_payment/; __PACKAGE__->table('money_work_payment'); #------------------------------------------------------------------------------- +package money::goods_payment; +use base qw/money::forgive_payment/; +__PACKAGE__->table('money_goods_payment'); +#------------------------------------------------------------------------------- + package money::credit_payment; use base qw/money::forgive_payment/; __PACKAGE__->table('money_credit_payment'); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm index fdd10d267b..058fc86a63 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm @@ -112,6 +112,12 @@ money::work_payment->table( 'money.work_payment' ); money::work_payment->sequence( 'money.payment_id_seq' ); + #--------------------------------------------------------------------- + package money::goods_payment; + + money::goods_payment->table( 'money.goods_payment' ); + money::goods_payment->sequence( 'money.payment_id_seq' ); + #--------------------------------------------------------------------- package money::forgive_payment; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm index 3d6ee3f020..4230b2a0aa 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm @@ -475,14 +475,15 @@ sub ou_user_payments { SELECT au.id as usr, SUM( CASE WHEN p.payment_type = 'forgive_payment' THEN p.amount ELSE 0.0 END ) as forgive_payment, SUM( CASE WHEN p.payment_type = 'work_payment' THEN p.amount ELSE 0.0 END ) as work_payment, - SUM( CASE WHEN p.payment_type = 'credit_payment' THEN p.amount ELSE 0.0 END ) as credit_payment + SUM( CASE WHEN p.payment_type = 'credit_payment' THEN p.amount ELSE 0.0 END ) as credit_payment, + SUM( CASE WHEN p.payment_type = 'goods_payment' THEN p.amount ELSE 0.0 END ) as goods_payment FROM money.bnm_payment_view p JOIN actor.usr au ON (au.id = p.accepting_usr) WHERE p.payment_ts >= '$startdate' AND p.payment_ts < '$enddate'::TIMESTAMPTZ + INTERVAL '1 day' AND p.voided IS FALSE AND au.home_ou = $lib - AND p.payment_type IN ('credit_payment','forgive_payment','work_payment') + AND p.payment_type IN ('credit_payment','forgive_payment','work_payment','goods_payment') GROUP BY 1 ORDER BY 1; @@ -496,6 +497,7 @@ sub ou_user_payments { $x->forgive_payment($$r[1]); $x->work_payment($$r[2]); $x->credit_payment($$r[3]); + $x->goods_payment($$r[4]); $client->respond($x); } diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm index 31d7740fb3..8b34856322 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm @@ -29,11 +29,14 @@ sub child_init { sub handler { my $apache = shift; - my $title = $apache->dir_config('ProxyTitle'); - my $desc = $apache->dir_config('ProxyDescription'); - my $perms = [ split ' ', $apache->dir_config('ProxyPermissions') ]; - return Apache2::Const::NOT_FOUND unless ($title); + my $proxyhtml = $apache->dir_config('OILSProxyHTML'); + my $title = $apache->dir_config('OILSProxyTitle'); + my $desc = $apache->dir_config('OILSProxyDescription'); + my $ltype = $apache->dir_config('OILSProxyLoginType'); + my $perms = [ split ' ', $apache->dir_config('OILSProxyPermissions') ]; + + return Apache2::Const::NOT_FOUND unless ($title || $proxyhtml); return Apache2::Const::NOT_FOUND unless (@$perms); my $cgi = new CGI; @@ -56,40 +59,19 @@ sub handler { if (!$u) { print $cgi->header(-type=>'text/html', -expires=>'-1d'); - print <<" HTML"; - - - - $title - - -


-
-
- - - - - - - - - - - - -
$desc
Username or barcode:
Password:
- -
-
- - - - HTML + if (!$proxyhtml) { + $proxyhtml = join '', ; + $proxyhtml =~ s/TITLE/$title/gso; + $proxyhtml =~ s/DESCRIPTION/$desc/gso; + } else { + # XXX template toolkit?? + } + + print $proxyhtml; return Apache2::Const::OK; } - $auth_ses = oils_login($u, $p); + $auth_ses = oils_login($u, $p, $ltype); if ($auth_ses) { print $cgi->redirect( -uri=>$url, @@ -118,10 +100,7 @@ sub handler { return Apache2::Const::FORBIDDEN if (@$failures > 0); # they're good, let 'em through - return Apache2::Const::DECLINED if (-e $apache->filename); - - # oops, file not found - return Apache2::Const::NOT_FOUND; + return Apache2::Const::DECLINED; } # returns the user object if the session is valid, 0 otherwise @@ -172,3 +151,32 @@ sub oils_login { 1; + +__DATA__ + + + TITLE + + +


+
+
+ + + + + + + + + + + + +
DESCRIPTION
Username or barcode:
Password:
+ +
+
+ + + diff --git a/Open-ILS/src/sql/Pg/080.schema.money.sql b/Open-ILS/src/sql/Pg/080.schema.money.sql index 1e6f1e46dc..a6c966ab82 100644 --- a/Open-ILS/src/sql/Pg/080.schema.money.sql +++ b/Open-ILS/src/sql/Pg/080.schema.money.sql @@ -316,6 +316,13 @@ CREATE INDEX money_credit_payment_xact_idx ON money.credit_payment (xact); CREATE INDEX money_credit_payment_payment_ts_idx ON money.credit_payment (payment_ts); CREATE INDEX money_credit_payment_accepting_usr_idx ON money.credit_payment (accepting_usr); +CREATE TABLE money.goods_payment () INHERITS (money.bnm_payment); +ALTER TABLE money.goods_payment ADD PRIMARY KEY (id); +CREATE INDEX money_goods_id_idx ON money.goods_payment (id); +CREATE INDEX money_goods_payment_xact_idx ON money.goods_payment (xact); +CREATE INDEX money_goods_payment_payment_ts_idx ON money.goods_payment (payment_ts); +CREATE INDEX money_goods_payment_accepting_usr_idx ON money.goods_payment (accepting_usr); + CREATE TABLE money.bnm_desk_payment ( cash_drawer INT REFERENCES actor.workstation (id) ) INHERITS (money.bnm_payment); diff --git a/Open-ILS/web/opac/common/js/fm_table_conf.js b/Open-ILS/web/opac/common/js/fm_table_conf.js index e3f728f084..964c3a0700 100644 --- a/Open-ILS/web/opac/common/js/fm_table_conf.js +++ b/Open-ILS/web/opac/common/js/fm_table_conf.js @@ -73,7 +73,8 @@ var FM_TABLE_DISPLAY = { 'usr', 'credit_payment', 'forgive_payment', - 'work_payment' + 'work_payment', + 'goods_payment' ] }, 'rr' : { diff --git a/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul b/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul index 0b9bccec2d..ce6c427b34 100644 --- a/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul @@ -72,6 +72,7 @@ --> + -- 2.43.2