Online Renewal - Now saving and responding okay
authorTerran McCanna <tmccanna@georgialibraries.org>
Tue, 8 Nov 2022 21:21:06 +0000 (16:21 -0500)
committerJason Stephenson <jstephenson@cwmars.org>
Tue, 29 Nov 2022 19:56:25 +0000 (14:56 -0500)
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm

index 7357e04..175666c 100644 (file)
@@ -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?
index 729e483..300c67c 100644 (file)
@@ -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;