Skip to content

Commit 15d3714

Browse files
committed
Merge pull request #63 from katzwebservices/version-2.6.4
Live Remote Field Mapping fixes
2 parents 8dcd8f3 + 91a8d10 commit 15d3714

File tree

6 files changed

+39
-13
lines changed

6 files changed

+39
-13
lines changed

trunk/edit-form.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,19 @@ function select_salesforce_object_type() {
117117
$form = RGFormsModel::get_form_meta($form_id);
118118

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

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

124129
die("EndSelectForm('{$str}');");
125130
}
126131

127-
private function get_picklist_ul($field) {
132+
private static function get_picklist_ul($field) {
128133
if(empty($field['picklistValues'])) { return ''; }
129134
$str = '<ul class="ul-square">';
130135
foreach($field['picklistValues'] as $value) {
@@ -154,6 +159,13 @@ private static function get_field_mapping($form_id, $fields) {
154159
</thead>
155160
<tbody>";
156161

162+
// Don't show fields with empty picklist options
163+
foreach ($fields as $key => $field) {
164+
if(empty($field['picklistValues'])) {
165+
unset($fields[$key]);
166+
}
167+
}
168+
157169
if(!empty($fields)) {
158170
foreach($fields as $field){
159171

trunk/readme.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,15 @@ This plugin is released under a GPL license.
239239

240240
== Changelog ==
241241

242+
= 2.6.4 (February 20, 2014) =
243+
* Fixed (API Version): Live Remote Field Mapping improvements
244+
- Fixed endless spinning
245+
- Empty options are better managed; shows "No Picklist Fields" message
246+
- Now shows an error message if the field cannot be used for Remote Field Mapping
247+
- Static PHP warning fixed when `WP_DEBUG` enabled
248+
242249
= 2.6.3.4 (February 20, 2014) =
243-
* Added: new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox
250+
* Added (API Version): new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox
244251

245252
= 2.6.3 to 2.6.3.3 (February 14, 2014) =
246253
* 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.
@@ -383,8 +390,15 @@ This plugin is released under a GPL license.
383390

384391
== Upgrade Notice ==
385392

393+
= 2.6.4 (February 20, 2014) =
394+
* Fixed (API Version): Live Remote Field Mapping improvements
395+
- Fixed endless spinning
396+
- Empty options are better managed; shows "No Picklist Fields" message
397+
- Now shows an error message if the field cannot be used for Remote Field Mapping
398+
- Static PHP warning fixed when `WP_DEBUG` enabled
399+
386400
= 2.6.3.4 (February 20, 2014) =
387-
* Added: new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox
401+
* Added (API Version): new hook "gf_salesforce_show_manual_export_button" to disable "send to salesforce" button/checkbox
388402

389403
= 2.6.3 to 2.6.3.3 (February 14, 2014) =
390404
* 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.

trunk/salesforce-api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Gravity Forms Salesforce API Add-On
44
Plugin URI: https://katz.co/plugins/gravity-forms-salesforce/
55
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.
6-
Version: 2.6.3.4
6+
Version: 2.6.4
77
Requires at least: 3.3
88
Author: Katz Web Services, Inc.
99
Author URI: http://www.katzwebservices.com
@@ -38,7 +38,7 @@ class GFSalesforce {
3838
private static $path = "gravity-forms-salesforce/salesforce-api.php";
3939
private static $url = "http://formplugin.com";
4040
private static $slug = "gravity-forms-salesforce";
41-
private static $version = "2.6.3.4";
41+
private static $version = "2.6.4";
4242
private static $min_gravityforms_version = "1.3.9";
4343
private static $is_debug = NULL;
4444
private static $cache_time = 86400; // 24 hours
@@ -1942,10 +1942,10 @@ public static function entry_info_send_to_salesforce_checkbox( $form_id, $lead )
19421942

19431943
// If this entry's form isn't connected to salesforce, don't show the checkbox
19441944
if(!self::show_send_to_salesforce_button() ) { return; }
1945-
1945+
19461946
// If this is not the Edit screen, get outta here.
19471947
if(empty($_POST["screen_mode"]) || $_POST["screen_mode"] === 'view') { return; }
1948-
1948+
19491949
if( apply_filters( 'gf_salesforce_show_manual_export_button', true ) ) {
19501950
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'));
19511951
} else {

trunk/salesforce.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
Plugin Name: Gravity Forms Salesforce - Web to Lead (**OLD VERSION**)
44
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.
5-
Version: 2.6.3.4
5+
Version: 2.6.4
66
Requires at least: 3.3
77
Author: Katz Web Services, Inc.
88
Author URI: http://www.katzwebservices.com
@@ -34,7 +34,7 @@ class GFSalesforceWebToLead {
3434
private static $path = "gravity-forms-salesforce/salesforce.php";
3535
private static $url = "http://www.gravityforms.com";
3636
private static $slug = "gravity-forms-salesforce";
37-
private static $version = "2.6.3.4";
37+
private static $version = "2.6.4";
3838
private static $min_gravityforms_version = "1.3.9";
3939

4040
//Plugin starting point. Will load appropriate files

trunk/web-to-lead.addon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if (class_exists("GFForms")) {
2222

2323
class KWSGFWebToLeadAddon extends KWSGFAddOn2_1 {
24-
protected $_version = "2.6.3.4";
24+
protected $_version = "2.6.4";
2525
protected $_min_gravityforms_version = "1.7";
2626
protected $_slug = "sf-web-to-lead";
2727
protected $_path = "gravity-forms-salesforce/web-to-lead.php";

trunk/web-to-lead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Gravity Forms Salesforce - Web-to-Lead Add-On
44
Plugin URI: https://katz.co/plugins/gravity-forms-salesforce/
55
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>.
6-
Version: 2.6.3.4
6+
Version: 2.6.4
77
Requires at least: 3.3
88
Author: Katz Web Services, Inc.
99
Author URI: http://www.katz.co

0 commit comments

Comments
 (0)