[open-ils-commits] r7945 - in trunk/Open-ILS: examples examples/apache src/perlmods/OpenILS/Application/Storage src/perlmods/OpenILS/Application/Storage/CDBI src/perlmods/OpenILS/Application/Storage/Driver/Pg src/perlmods/OpenILS/Application/Storage/Publisher src/perlmods/OpenILS/WWW src/sql/Pg web/opac/common/js xul/staff_client/server/patron

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Oct 30 14:50:25 EDT 2007


Author: miker
Date: 2007-10-30 14:35:45 -0400 (Tue, 30 Oct 2007)
New Revision: 7945

Modified:
   trunk/Open-ILS/examples/apache/eg_vhost.conf
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm
   trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
   trunk/Open-ILS/web/opac/common/js/fm_table_conf.js
   trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul
Log:
adding work_payment type and the /strong/ urging of PINES; extending the auth proxy module

Modified: trunk/Open-ILS/examples/apache/eg_vhost.conf
===================================================================
--- trunk/Open-ILS/examples/apache/eg_vhost.conf	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/examples/apache/eg_vhost.conf	2007-10-30 18:35:45 UTC (rev 7945)
@@ -212,9 +212,9 @@
 # ----------------------------------------------------------------------------------
 <Location /reporter/>
     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

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2007-10-30 18:35:45 UTC (rev 7945)
@@ -10,6 +10,7 @@
 			<field name="forgive_payment" oils_obj:array_position="4" oils_persist:virtual="true" />
 			<field name="work_payment" oils_obj:array_position="5" oils_persist:virtual="true" />
 			<field name="credit_payment" oils_obj:array_position="6" oils_persist:virtual="true" />
+			<field name="goods_payment" oils_obj:array_position="7" oils_persist:virtual="true" />
 		</fields>
 		<links>
 			<link field="usr" reltype="has_a" key="id" map="" class="au"/>
@@ -1647,6 +1648,27 @@
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 		</links>
 	</class>
+	<class id="mgp" controller="open-ils.cstore" oils_obj:fieldmapper="money::goods_payment" oils_persist:tablename="money.goods_payment" reporter:label="Goods Payment">
+		<fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
+			<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+			<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+			<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+			<field reporter:label="Accepting Staff Member" name="accepting_usr" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="link"/>
+			<field reporter:label="Amount" name="amount" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="money" />
+			<field reporter:label="Amount Collected" name="amount_collected" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
+			<field reporter:label="Payment ID" name="id" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="id" />
+			<field reporter:label="Note" name="note" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="text"/>
+			<field reporter:label="Payment Timestamp" name="payment_ts" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+			<field reporter:label="Transaction ID" name="xact" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="link"/>
+			<field reporter:label="Payment link" name="payment" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Payment Type" name="payment_type" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="text"/>
+		</fields>
+		<links>
+			<link field="payment" reltype="might_have" key="id" map="" class="mp"/>
+			<link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
+			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
+		</links>
+	</class>
 	<class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation">
 		<fields oils_persist:primary="id" oils_persist:sequence="">
 			<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
@@ -2009,6 +2031,7 @@
 			<field reporter:label="Check Payment Detail" name="check_payment" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="15" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Goods Payment Detail" name="goods_payment" oils_obj:array_position="16" oils_persist:virtual="true" reporter:datatype="link"/>
 		</fields>
 		<links>
 			<link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
@@ -2017,6 +2040,7 @@
 			<link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
 			<link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
 			<link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
+			<link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 		</links>
 	</class>
@@ -2038,6 +2062,7 @@
 			<field reporter:label="Check Payment Detail" name="check_payment" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="14" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="15" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Goods Payment Detail" name="goods_payment" oils_obj:array_position="16" oils_persist:virtual="true" reporter:datatype="link"/>
 		</fields>
 		<links>
 			<link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
@@ -2046,6 +2071,7 @@
 			<link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
 			<link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
 			<link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
+			<link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 		</links>
 	</class>
@@ -2063,10 +2089,12 @@
 			<field reporter:label="Voided?" name="voided" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="bool"/>
 			<field reporter:label="Work Payment Detail" name="work_payment" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Goods Payment Detail" name="goods_payment" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="link"/>
 		</fields>
 		<links>
 			<link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
 			<link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
+			<link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 		</links>
 	</class>

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm	2007-10-30 18:35:45 UTC (rev 7945)
@@ -132,6 +132,11 @@
 __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');

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm	2007-10-30 18:35:45 UTC (rev 7945)
@@ -664,6 +664,10 @@
 	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' );

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm	2007-10-30 18:35:45 UTC (rev 7945)
@@ -113,6 +113,12 @@
 	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;
 	
 	money::forgive_payment->table( 'money.forgive_payment' );

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm	2007-10-30 18:35:45 UTC (rev 7945)
@@ -475,14 +475,15 @@
        	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 @@
 		$x->forgive_payment($$r[1]);
 		$x->work_payment($$r[2]);
 		$x->credit_payment($$r[3]);
+		$x->goods_payment($$r[4]);
 
 		$client->respond($x);
 	}

Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm	2007-10-30 18:35:45 UTC (rev 7945)
@@ -29,11 +29,14 @@
 
 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 @@
 		if (!$u) {
 
 			print $cgi->header(-type=>'text/html', -expires=>'-1d');
-			print <<"			HTML";
+			if (!$proxyhtml) {
+				$proxyhtml = join '', <DATA>;
+				$proxyhtml =~ s/TITLE/$title/gso;
+				$proxyhtml =~ s/DESCRIPTION/$desc/gso;
+			} else {
+				# XXX template toolkit??
+			}
 
-<html>
-	<head>
-		<title>$title</title>
-	</head>
-	<body>
-		<br/><br/><br/>
-		<center>
-		<form method='POST'>
-			<table style='border-collapse: collapse; border: 1px solid black;'>
-				<tr>
-					<th colspan='2' align='center'><u>$desc</u></th>
-				</tr>
-				<tr>
-					<th align="right">Username or barcode:</th>
-					<td><input type="text" name="user"/></td>
-				</tr>
-				<tr>
-					<th align="right">Password:</th>
-					<td><input type="password" name="passwd"/></td>
-				</tr>
-			</table>
-			<input type="submit" value="Log in"/>
-		</form>
-		</center>
-	</body>
-</html>
-
-			HTML
+			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 @@
 	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 @@
 
 
 1;
+
+__DATA__
+<html>
+	<head>
+		<title>TITLE</title>
+	</head>
+	<body>
+		<br/><br/><br/>
+		<center>
+		<form method='POST'>
+			<table style='border-collapse: collapse; border: 1px solid black;'>
+				<tr>
+					<th colspan='2' align='center'><u>DESCRIPTION</u></th>
+				</tr>
+				<tr>
+					<th align="right">Username or barcode:</th>
+					<td><input type="text" name="user"/></td>
+				</tr>
+				<tr>
+					<th align="right">Password:</th>
+					<td><input type="password" name="passwd"/></td>
+				</tr>
+			</table>
+			<input type="submit" value="Log in"/>
+		</form>
+		</center>
+	</body>
+</html>
+

Modified: trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/080.schema.money.sql	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/src/sql/Pg/080.schema.money.sql	2007-10-30 18:35:45 UTC (rev 7945)
@@ -316,6 +316,13 @@
 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);

Modified: trunk/Open-ILS/web/opac/common/js/fm_table_conf.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/fm_table_conf.js	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/web/opac/common/js/fm_table_conf.js	2007-10-30 18:35:45 UTC (rev 7945)
@@ -73,7 +73,8 @@
 			'usr',
 			'credit_payment',
 			'forgive_payment',
-			'work_payment'
+			'work_payment',
+			'goods_payment'
 		]
 	},
 	'rr' : {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul	2007-10-29 20:00:01 UTC (rev 7944)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bills_overlay.xul	2007-10-30 18:35:45 UTC (rev 7945)
@@ -72,6 +72,7 @@
 								-->
 								<menuitem id="payment_type_menuitem5" label="Work" value="work_payment"/>
 								<menuitem id="payment_type_menuitem6" label="Forgive" value="forgive_payment"/>
+								<menuitem id="payment_type_menuitem7" label="Goods" value="goods_payment"/>
 							</menupopup>
 						</menulist>
 					</row>



More information about the open-ils-commits mailing list