From 24682d67b39dd4f2f3cfcd8bd5838275620bc127 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 20 Jul 2016 09:27:34 -0400 Subject: [PATCH] WIP for import of gravity forms Adding tab in the management section for the leads. Gravity Form. This will give stats on form entries and give choices of which form to import into our leads table. --- models/admin/management/leads.php | 20 ++- models/admin/settings/leads.php | 8 +- views/admin/management/leads.html | 41 ++++- views/admin/settings/leads.html | 258 +++++++++++++++--------------- 4 files changed, 190 insertions(+), 137 deletions(-) diff --git a/models/admin/management/leads.php b/models/admin/management/leads.php index d0cdea7..0a67547 100644 --- a/models/admin/management/leads.php +++ b/models/admin/management/leads.php @@ -122,9 +122,27 @@ class GlmMembersAdmin_management_leads // extends GlmDataLeadsManagement ARRAY_A ); + if ( isset( $_REQUEST['option'] ) ) { + $option = $_REQUEST['option']; + } + + if ( isset( $_REQUEST['option2'] ) ) { + $option2 = $_REQUEST['option2']; + } + + switch( $option ) { + case 'import': + $result = '
$_REQUEST: ' . print_r($_REQUEST, true) . '
'; + break; + default: + break; + } + // Compile template data $templateData = array( - 'sources' => $sources + 'sources' => $sources, + 'option2' => $option2, + 'result' => $result, ); // Return status, suggested view, and data to controller diff --git a/models/admin/settings/leads.php b/models/admin/settings/leads.php index 30efa3c..8d1de44 100644 --- a/models/admin/settings/leads.php +++ b/models/admin/settings/leads.php @@ -114,11 +114,15 @@ class GlmMembersAdmin_settings_leads extends GlmDataInterests $id = $_REQUEST['id'] - 0; } + if ( isset( $_REQUEST['option'] ) ) { + $option = $_REQUEST['option']; + } + $groupData = new GlmDataInterestGroups( $this->wpdb, $this->config ); // If there's an action option - if ( isset( $_REQUEST['option'] ) ) { - switch( $_REQUEST['option'] ) { + if ( isset( $option ) ) { + switch( $option ) { case 'addNew': $return = $this->insertEntry(); $id = $return['fieldData']['id']; diff --git a/views/admin/management/leads.html b/views/admin/management/leads.html index f322ffa..aae776c 100644 --- a/views/admin/management/leads.html +++ b/views/admin/management/leads.html @@ -1,8 +1,13 @@ {include file='admin/management/header.html'} -

This requires Gravity Forms to be Installed and active

+

This requires Gravity Forms to be Installed and active

- + + +
@@ -16,3 +21,35 @@ {/foreach}
Form Id Source Name
+ + + + + + {if $result} + + + + {/if} +
Import Gravity Form
{$result}
+ + diff --git a/views/admin/settings/leads.html b/views/admin/settings/leads.html index 8994e99..07dbde6 100644 --- a/views/admin/settings/leads.html +++ b/views/admin/settings/leads.html @@ -151,95 +151,89 @@ - @@ -358,62 +352,62 @@
- -- 2.17.1