From: Steve Sutton Below is the list of businesses you have added to your Trip Planner. The
-form below will be sent to each individual business listing that has an email
-address listed with their business listing. For those businesses with no
-email address, we have included their phone numbers for you to call directly
-and request additional information. These business listings have no current email address on file. To receive
-additional information please call the phone numbers listed next to each
-business name. Below is the list of businesses you have added to your Trip Planner. The
+ form below will be sent to each individual business listing that has an email
+ address listed with their business listing. For those businesses with no
+ email address, we have included their phone numbers for you to call directly
+ and request additional information. These business listings have no current email address on file. To receive
+ additional information please call the phone numbers listed next to each
+ business name. These business listings have no current email address on file. To receive
additional information please call the phone numbers listed next to each
@@ -32,7 +34,7 @@ business name. This list of businesses will receive the following information form directly
to their email account.$_SESSION: ' . print_r( $_SESSION, true ) . '
';
+ // echo '$_REQUEST: ' . print_r( $_REQUEST, true ) . '
';
// Need to create two list one with emails and one without.
- foreach ( $members as $member ) {
- if ( $member['email'] && filter_var( $member['email'], FILTER_VALIDATE_EMAIL ) ) {
- $membersWithEmails[] = $member;
- $memberEmwails[] = $member['email'];
- } else if ( $member['phone'] ) {
- $membersNoEmails[] = $member;
+ if ( is_array( $members ) && !empty( $members ) ) {
+ foreach ( $members as $member ) {
+ if ( $member['email'] && filter_var( $member['email'], FILTER_VALIDATE_EMAIL ) ) {
+ $membersWithEmails[] = $member;
+ $memberEmails[] = $member['email'];
+ } else if ( $member['phone'] ) {
+ $membersNoEmails[] = $member;
+ }
}
}
- if ( count( $membersNoEmails ) == 0 && count( $membersWithEmails ) == 0 ) {
+ if ( isset( $_REQUEST['send_form_submit'] ) && $sendFormSubmit = filter_var( $_REQUEST['send_form_submit'], FILTER_VALIDATE_BOOLEAN ) ) {
+ $view = 'moreinfo.html';
+ } else if ( count( $membersNoEmails ) == 0 && count( $membersWithEmails ) == 0 ) {
$view = 'list.html';
} else {
$view = 'moreinfo.html';
}
- if ( count( $membersWithEmails ) > 0 ) {
- $_GET['member_emails'] = implode( ',', $memberEmwails );
+ if ( count( $membersWithEmails ) > 0 || $sendFormSubmit ) {
+ if ( isset( $memberEmails ) && is_array( $memberEmails ) ) {
+ $_GET['member_emails'] = implode( ',', $memberEmails );
+ }
$form_id = $this->config['settings']['send_itinerary_form_id'];
if ( isset( $form_id ) && filter_var( $form_id, FILTER_VALIDATE_INT ) ) {
$formContents = do_shortcode( '[gravityform id="' . $form_id . '" title="false" description="false"]' );
@@ -375,6 +384,7 @@ class GlmMembersFront_itinerary_list // extends GlmMembersFront_events_baseActio
'email' => $email,
'token' => $token,
'helpUrl' => GLM_MEMBERS_ITINERARY_PLUGIN_URL . 'templates/helpme.html',
+ 'sendFormSubmit' => $sendFormSubmit,
);
error_reporting(E_ALL ^ E_NOTICE);
diff --git a/setup/frontHooks.php b/setup/frontHooks.php
index de2ac60..12afb34 100644
--- a/setup/frontHooks.php
+++ b/setup/frontHooks.php
@@ -77,6 +77,7 @@ $form_id = ( isset( $config['settings']['send_itinerary_form_id'] ) ) ? $config[
if ( isset( $form_id ) && filter_var( $form_id, FILTER_VALIDATE_INT ) ) {
// Send Trip Planner Form action after submission
add_action( 'gform_after_submission_' . $form_id, function(){
+ $_REQUEST['send_form_submit'] = true;
unset( $_SESSION['travel-list'] );
}, 10, 2);
}
diff --git a/views/front/itinerary/moreinfo.html b/views/front/itinerary/moreinfo.html
index bebad0f..8fa0e91 100644
--- a/views/front/itinerary/moreinfo.html
+++ b/views/front/itinerary/moreinfo.html
@@ -1,15 +1,17 @@
Your Trip Planner List
-Request Information by Phone From:
Request Information by Email From: