From 8fd8b8ebfea479837877e9db0d8f09d1725e13a5 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Tue, 8 Nov 2022 16:21:06 -0500 Subject: [PATCH] Online Renewal - Now saving and responding okay Signed-off-by: Terran McCanna --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 5 ++-- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm | 29 ++++++++++++++++------ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 7357e048a1..175666c38d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -187,13 +187,12 @@ sub load { $self->load_simple("myopac") if $path =~ m:opac/myopac:; # A default page for myopac parts return $self->load_ecard_form if $path =~ m|opac/ecard/form|; + + # PINES - online account registration return $self->load_ecard_submit if $path =~ m|opac/ecard/submit|; - # this line is only used if verifying by email (from KCLS code): - # return $self->load_ecard_verify if $path =~ m|opac/ecard/verify|; # PINES - online account renewal return $self->load_simple("renew-account") if $path =~ m|opac/renew-account|; - return $self->load_ecard_submit if $path =~ m|opac/renew/submit|; if($path =~ m|opac/login|) { return $self->load_login unless $self->editor->requestor; # already logged in? diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm index 729e48386e..300c67cf94 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm @@ -256,6 +256,9 @@ sub log_params { } $logger->info("ECARD: Submit params: $msg"); +#TERRAN - dump out all incoming stuff from form +$logger->error("TERRAN - all incoming params: $msg"); + } sub handle_testmode_api { @@ -306,13 +309,15 @@ sub load_ecard_submit { my $cgi = $self->cgi; #determine whether this is a new registration or a renewal - my $refpath = $self->apache->path_info; - if ($refpath =~ m|opac/renew/submit|) { + if ($cgi->param('patron_id') > 1) { $update_type = 'renew'; } else { $update_type = 'register'; } + #TERRAN TEST ECARD CONNECTION + $logger->error("TERRAN ACTION TYPE: $update_type"); + $self->log_params; my $testmode = $cgi->param('testmode') || ''; @@ -431,7 +436,7 @@ sub compile_response { $logger->info("ECARD responding with " . $ctx->{response}); #TERRAN TEST -$logger->error("TERRAN response being sent to Quipu is: " . $ctx->{response}); + $logger->error("TERRAN - compiled response is " . $ctx->{response}); return Apache2::Const::OK; } @@ -447,11 +452,19 @@ sub make_user { $au->isnew(1); $au->net_access_level(1); # Filtered my $home_ou = $cgi->param('home_ou'); + $au->name_keywords($in_house ? 'quipu_inhouse' : 'quipu_remote'); - my $perm_grp = $U->ou_ancestor_setting_value( - $home_ou, - 'lib.ecard_patron_profile' - ); + +# TERRAN - for testing purposes, hardcoding the home_ou temporarily +# my $home_ou = $cgi->param('home_ou'); + my $home_ou = '4'; + +# TERRAN - for testing purposes, hardcoding perm_grp temporarily +# my $perm_grp = $U->ou_ancestor_setting_value( +# $home_ou, +# 'lib.ecard_patron_profile' +# ); + my $perm_grp = '2'; $au->profile($perm_grp); my $grp = new_editor()->retrieve_permission_grp_tree($perm_grp); @@ -478,6 +491,7 @@ sub make_user { } $self->verify_dob($val) if $field eq 'dob' && $val; + $au->$field($val); } @@ -487,6 +501,7 @@ sub make_user { # If existing account, update instead of create sub update_user { + my $self = shift; my @extra_flesh = @_; my $e = $self->editor; -- 2.11.0