[open-ils-commits] r308 - grpl/trunk/var (dkyle)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 8 17:22:37 EDT 2009
Author: dkyle
Date: 2009-04-08 17:22:32 -0400 (Wed, 08 Apr 2009)
New Revision: 308
Removed:
grpl/trunk/var/cgi-bin
Log:
delete mistake
Deleted: grpl/trunk/var/cgi-bin
===================================================================
--- grpl/trunk/var/cgi-bin 2009-04-08 21:14:48 UTC (rev 307)
+++ grpl/trunk/var/cgi-bin 2009-04-08 21:22:32 UTC (rev 308)
@@ -1,63 +0,0 @@
-#!/usr/bin/perl -w
-# deliver some patron data in xml
-
-use XML::Simple;
-use Date::Calc;
-use CGI qw(:standard);
-require '/openils/src/evergreen/Open-ILS/src/support-scripts/oils_header.pl';
-
-my $conf = '/openils/conf/opensrf_core.xml';
-my $bcode = param('barcode') || '0';
-print header;
-
-our %grpl_config;
-do '/openils/conf/grpl-egauth-setup.pl';
-
-osrf_connect($conf);
-my $authtok = oils_login($grpl_config{usr},$grpl_config{pw});
-$u = simplereq( ACTOR(), 'open-ils.actor.user.fleshed.retrieve_by_barcode', $authtok, $bcode);
-my $papi = wrap_perl($u);
-my $b = simplereq( STORAGE(), 'open-ils.storage.money.open_user_summary.search', $papi->{id});
-my $bills = wrap_perl($b);
-$papi->{money_owed} = $bills->{balance_owed};
-($dob,undef) = split('T', $papi->{dob});
-($by,$bm,$bd) = split('-', $dob);
-($dy,$dm,$dd) = Date::Calc::Delta_YMD($by,$bm,$bd,Date::Calc::Today());
-$dy-- unless sprintf("%02d%02d", $cm, $cd) >= sprintf("%02d%02d", $bm, $bd);
-if ($dy > 17) {
- $papi->{Juvenile} = 'no'
-} else {
- $papi->{Juvenile} = 'yes'
-}
-if ( ($papi->{card}->{barcode} eq $bcode) && ($papi->{card}->{active} eq 't') ) { # Inactive card check
- $papi->{name} = $papi->{first_given_name} . " " . $papi->{family_name};
-}
-$xs = XML::Simple->new();
-print $xs->XMLout($papi, noattr => 1);
-
-sub wrap_perl {
- my $obj = shift;
- my $ref = ref($obj);
-
- if ($ref =~ /^Fieldmapper/o) {
- $ref = $obj->json_hint;
- $obj = $obj->to_bare_hash;
- }
-
- if( $ref eq 'HASH' ) {
- $obj->{$_} = wrap_perl( $obj->{$_} ) for (keys %$obj);
- } elsif( $ref eq 'ARRAY' ) {
- $obj->[$_] = wrap_perl( $obj->[$_] ) for(0..scalar(@$obj) - 1 );
- } elsif( $ref ) {
- if(UNIVERSAL::isa($obj, 'HASH')) {
- $obj->{$_} = wrap_perl( $obj->{$_} ) for (keys %$obj);
- bless($obj, 'HASH'); # so our parser won't add the hints
- } elsif(UNIVERSAL::isa($obj, 'ARRAY')) {
- $obj->[$_] = wrap_perl( $obj->[$_] ) for(0..scalar(@$obj) - 1);
- bless($obj, 'ARRAY'); # so our parser won't add the hints
- }
-# $obj = { $CLASS_KEY => $ref, $PAYLOAD_KEY => $obj };
- }
- return $obj;
-}
-
More information about the open-ils-commits
mailing list