From: Steve Sutton Date: Tue, 25 Sep 2018 19:21:39 +0000 (-0400) Subject: Update select level text and update add registrant X-Git-Tag: v1.0.22^2~7 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=3f6f068b7ebbcdecfccf53337b743e1284074035;p=WP-Plugins%2Fglm-member-db-registrations.git Update select level text and update add registrant checking registrant cart before update add delete --- diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php index 3365491..57388f2 100644 --- a/models/admin/ajax/regFront/registrant.php +++ b/models/admin/ajax/regFront/registrant.php @@ -116,6 +116,19 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations break; case 'delete': + // Check for valid cart + $cartStatus = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT status + FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request + WHERE id = %d", + $modelData['reg_request'] + ) + ); + + if ( $cartStatus != '0' ) { + return false; + } // TODO: Should we now check to see if this is the last registrant for this reg_request_event,class,rate // Then delete those? $this->wpdb->delete( @@ -152,6 +165,20 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations { // trigger_error( print_r($modelData, true) ); + // Check for valid cart + $cartStatus = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT status + FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request + WHERE id = %d", + $modelData['reg_request'] + ) + ); + + if ( $cartStatus != '0' ) { + return false; + } + $validated = false; if ( $action == 'add' ) { diff --git a/views/front/registrations/list.html b/views/front/registrations/list.html index 2339cbb..85cb7af 100644 --- a/views/front/registrations/list.html +++ b/views/front/registrations/list.html @@ -137,6 +137,10 @@ {/if} +
+ {$terms.reg_term_register_cap} for this {$terms.reg_term_event_cap} +
+ {/foreach}