Skip to content

Commit

Permalink
Merge pull request #63 from katzwebservices/version-2.6.4
Browse files Browse the repository at this point in the history
Live Remote Field Mapping fixes
  • Loading branch information
zackkatz committed Feb 20, 2014
2 parents 8dcd8f3 + 91a8d10 commit 15d3714
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 13 deletions.
18 changes: 15 additions & 3 deletions trunk/edit-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,19 @@ function select_salesforce_object_type() {
$form = RGFormsModel::get_form_meta($form_id);

//getting list of all Salesforce merge variables for the selected contact list
$fields = GFSalesforce::getFields(esc_html($_POST['objectType']), array('picklist', 'multipicklist'));

$str = self::get_field_mapping($form_id, $fields);
try {
$fields = GFSalesforce::getFields(esc_html($_POST['objectType']), array('picklist', 'multipicklist'));
$str = self::get_field_mapping($form_id, $fields);
} catch(Exception $e) {
$str = sprintf('<div id="salesforce_field_group"><strong>%s</strong> %s</div>', __('Error:', 'gravity-forms-salesforce'), $e->getMessage());
$str = str_replace(array("\n", "\t", "\r"), '', str_replace("'", "\'", $str));
}

die("EndSelectForm('{$str}');");
}

private function get_picklist_ul($field) {
private static function get_picklist_ul($field) {
if(empty($field['picklistValues'])) { return ''; }
$str = '<ul class="ul-square">';
foreach($field['picklistValues'] as $value) {
Expand Down Expand Up @@ -154,6 +159,13 @@ private static function get_field_mapping($form_id, $fields) {
</thead>
<tbody>";

// Don't show fields with empty picklist options
foreach ($fields as $key => $field) {
if(empty($field['picklistValues'])) {
unset($fields[$key]);
}
}

if(!empty($fields)) {
foreach($fields as $field){

Expand Down
18 changes: 16 additions & 2 deletions trunk/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,15 @@ This plugin is released under a GPL license.

== Changelog ==

= 2.6.4 (February 20, 2014) =
* Fixed (API Version): Live Remote Field Mapping improvements
- Fixed endless spinning
- Empty options are better managed; shows "No Picklist Fields" message
- Now shows an error message if the field cannot be used for Remote Field Mapping
- Static PHP warning fixed when `WP_DEBUG` enabled

= 2.6.3.4 (February 20, 2014) =
* Added: new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox
* Added (API Version): new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox

= 2.6.3 to 2.6.3.3 (February 14, 2014) =
* Web-to-Lead: Re-added the functionality to show the "Salesforce enabled" icon in the forms list that indicate active feeds are enabled for that form.
Expand Down Expand Up @@ -383,8 +390,15 @@ This plugin is released under a GPL license.

== Upgrade Notice ==

= 2.6.4 (February 20, 2014) =
* Fixed (API Version): Live Remote Field Mapping improvements
- Fixed endless spinning
- Empty options are better managed; shows "No Picklist Fields" message
- Now shows an error message if the field cannot be used for Remote Field Mapping
- Static PHP warning fixed when `WP_DEBUG` enabled

= 2.6.3.4 (February 20, 2014) =
* Added: new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox
* Added (API Version): new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox

= 2.6.3 to 2.6.3.3 (February 14, 2014) =
* Web-to-Lead: Re-added the functionality to show the "Salesforce enabled" icon in the forms list that indicate active feeds are enabled for that form.
Expand Down
8 changes: 4 additions & 4 deletions trunk/salesforce-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms Salesforce API Add-On
Plugin URI: https://katz.co/plugins/gravity-forms-salesforce/
Description: Integrates <a href="http://formplugin.com?r=salesforce">Gravity Forms</a> with Salesforce allowing form submissions to be automatically sent to your Salesforce account. Requires Salesforce API access. <strong>If you don't have API access</strong>, use the "Gravity Forms Salesforce - Web-to-Lead Add-On" plugin instead.
Version: 2.6.3.4
Version: 2.6.4
Requires at least: 3.3
Author: Katz Web Services, Inc.
Author URI: http://www.katzwebservices.com
Expand Down Expand Up @@ -38,7 +38,7 @@ class GFSalesforce {
private static $path = "gravity-forms-salesforce/salesforce-api.php";
private static $url = "http://formplugin.com";
private static $slug = "gravity-forms-salesforce";
private static $version = "2.6.3.4";
private static $version = "2.6.4";
private static $min_gravityforms_version = "1.3.9";
private static $is_debug = NULL;
private static $cache_time = 86400; // 24 hours
Expand Down Expand Up @@ -1942,10 +1942,10 @@ public static function entry_info_send_to_salesforce_checkbox( $form_id, $lead )
// If this entry's form isn't connected to salesforce, don't show the checkbox
if(!self::show_send_to_salesforce_button() ) { return; }

// If this is not the Edit screen, get outta here.
if(empty($_POST["screen_mode"]) || $_POST["screen_mode"] === 'view') { return; }

if( apply_filters( 'gf_salesforce_show_manual_export_button', true ) ) {
printf('<input type="checkbox" name="update_to_salesforce" id="update_to_salesforce" value="1" /><label for="update_to_salesforce" title="%s">%s</label><br /><br />', esc_html__('Create or update this entry in Salesforce. The fields will be mapped according to the form feed settings.', 'gravity-forms-salesforce'), esc_html__('Send to Salesforce', 'gravity-forms-salesforce'));
} else {
Expand Down
4 changes: 2 additions & 2 deletions trunk/salesforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Gravity Forms Salesforce - Web to Lead (**OLD VERSION**)
Description: This version is provided for backward compatibility only. Please use the new plugin, named "Gravity Forms Salesforce - Web-to-Lead Add-On". This version will be removed in the future.
Version: 2.6.3.4
Version: 2.6.4
Requires at least: 3.3
Author: Katz Web Services, Inc.
Author URI: http://www.katzwebservices.com
Expand Down Expand Up @@ -34,7 +34,7 @@ class GFSalesforceWebToLead {
private static $path = "gravity-forms-salesforce/salesforce.php";
private static $url = "http://www.gravityforms.com";
private static $slug = "gravity-forms-salesforce";
private static $version = "2.6.3.4";
private static $version = "2.6.4";
private static $min_gravityforms_version = "1.3.9";

//Plugin starting point. Will load appropriate files
Expand Down
2 changes: 1 addition & 1 deletion trunk/web-to-lead.addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if (class_exists("GFForms")) {

class KWSGFWebToLeadAddon extends KWSGFAddOn2_1 {
protected $_version = "2.6.3.4";
protected $_version = "2.6.4";
protected $_min_gravityforms_version = "1.7";
protected $_slug = "sf-web-to-lead";
protected $_path = "gravity-forms-salesforce/web-to-lead.php";
Expand Down
2 changes: 1 addition & 1 deletion trunk/web-to-lead.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms Salesforce - Web-to-Lead Add-On
Plugin URI: https://katz.co/plugins/gravity-forms-salesforce/
Description: Integrate <a href="http://formplugin.com?r=salesforce">Gravity Forms</a> with Salesforce - form submissions are automatically sent to your Salesforce account! <strong>Requires Gravity Forms 1.7+</strong>.
Version: 2.6.3.4
Version: 2.6.4
Requires at least: 3.3
Author: Katz Web Services, Inc.
Author URI: http://www.katz.co
Expand Down

0 comments on commit 15d3714

Please sign in to comment.