Skip to content

Commit

Permalink
3.0.6.2
Browse files Browse the repository at this point in the history
= 3.0.6.2 (September 5, 2014) =
* Fixed: Issue saving Web-to-Lead settings for Gravity Forms 1.8.10 or
higher. Thanks, [@twiginteractive](https://github.com/twiginteractive)
* Fixed: An issue with the OAuth library clashing if the same library
is used elsewhere. Thanks,
[@JasonTheAdams](https://github.com/JasonTheAdams)
* Confirmed compatibility with WordPress 4.0
  • Loading branch information
zackkatz committed Sep 5, 2014
1 parent 6cbbd17 commit aeedf82
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 41 deletions.
6 changes: 3 additions & 3 deletions trunk/inc/kwsaddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
KWS Gravity Forms Add-On
Version: 2.1.1
Version: 2.2.1
------------------------------------------------------------------------
Expand Down Expand Up @@ -31,7 +31,7 @@
*/
abstract class KWSGFAddOn2_2 extends GFFeedAddOn {

protected $_version = "2.2";
protected $_version = "2.2.1";
protected $_min_gravityforms_version = "1.7";
protected $_slug = "kwsaddon";
protected $_path = "kwsaddon/kwsaddon.php";
Expand Down Expand Up @@ -831,7 +831,7 @@ protected function get_merge_vars_from_entry($feed, $entry, $form) {
* We need to be more vigilant than that, so we check if the current `subview` parameter matches the short title.
*/
protected function is_save_postback(){
return !rgempty("gform-settings-save") && rgget("subview") === $this->get_short_title();
return !rgempty("gform-settings-save") && ( rgget("subview") === $this->get_short_title() || rgget("subview") === $this->get_slug() );
}

/**
Expand Down
42 changes: 27 additions & 15 deletions trunk/inc/salesforce-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,17 @@ private static function include_files() {
require_once(self::get_base_path() . "inc/data.php");
require_once(self::get_base_path() . "inc/edit-form.php");

if ( !class_exists('OAuth\Common\autoloader') )
if ( !class_exists('OAuth\Common\autoloader') ) {
include_once KWS_GF_Salesforce::$plugin_dir_path.'lib/PHPoAuthLib/src/OAuth/bootstrap.php';

if ( !class_exists('OAuth\ServiceFactory') )
}

if ( !class_exists('OAuth\ServiceFactory') ) {
include_once KWS_GF_Salesforce::$plugin_dir_path.'lib/PHPoAuthLib/src/OAuth/ServiceFactory.php';

if ( !class_exists('WordpressMemory') )
}

if ( !class_exists('WordpressMemory') ) {
include_once KWS_GF_Salesforce::$plugin_dir_path.'lib/WordPressMemory.php';
}
}

/**
Expand Down Expand Up @@ -219,7 +222,7 @@ public function processSalesforceResponse() {
self::$settings = $settings;

// Whether the response worked or not
wp_redirect( admin_url('admin.php?page=gf_settings&addon=Salesforce&subview='.urlencode(self::$name)) );
wp_redirect( self::link_to_settings( false ) );

exit();
}
Expand Down Expand Up @@ -454,7 +457,7 @@ public static function settings_link( $links, $file ) {
if ( $file == $this_plugin ) {
$settings_link = '<a href="' . admin_url( 'admin.php?page=gf_salesforce' ) . '" title="' . __('Select the Gravity Form you would like to integrate with Salesforce. Contacts generated by this form will be automatically added to your Salesforce account.', 'gravity-forms-salesforce') . '">' . __('Feeds', 'gravity-forms-salesforce') . '</a>';
array_unshift( $links, $settings_link ); // before other links
$settings_link = '<a href="' . admin_url( 'admin.php?page=gf_settings&addon=Salesforce' ) . '" title="' . __('Configure your Salesforce settings.', 'gravity-forms-salesforce') . '">' . __('Settings', 'gravity-forms-salesforce') . '</a>';
$settings_link = '<a href="' . self::link_to_settings() . '" title="' . __('Configure your Salesforce settings.', 'gravity-forms-salesforce') . '">' . __('Settings', 'gravity-forms-salesforce') . '</a>';
array_unshift( $links, $settings_link ); // before other links
}
return $links;
Expand Down Expand Up @@ -619,7 +622,7 @@ public static function settings_page(){
'response_type' => 'code',
'display' => 'page',
'scope' => 'api refresh_token',
'state' => admin_url('admin.php?page=gf_settings&addon=Salesforce&subview='.urlencode(self::$name))
'state' => self::link_to_settings( false )
));

$auth_button_output .= sprintf("<p><a href='%s' class='button button-primary button-hero'>%s</a></p>", $url, __('Login with Salesforce!', 'gravity-forms-salesforce'));
Expand Down Expand Up @@ -727,7 +730,7 @@ private static function list_page(){
?>
<div class="error" id="message" style="margin-top:20px;">
<h3><?php _e('Salesforce Error', "gravity-forms-salesforce");?></h3>
<p><?php echo empty($api) ? __(sprintf("To get started, please configure your %sSalesforce Settings%s.", '<a href="admin.php?page=gf_settings&amp;addon=Salesforce&amp;subview=Salesforce%3A+API">', "</a>"), "gravity-forms-salesforce") : $api; ?></p>
<p><?php echo empty($api) ? __(sprintf("To get started, please configure your %sSalesforce Settings%s.", '<a href="'.self::link_to_settings().'">', "</a>"), "gravity-forms-salesforce") : $api; ?></p>
</div>
<?php
} else {
Expand All @@ -738,7 +741,7 @@ private static function list_page(){
<?php } ?>
<div class="clear"></div>
<ul class="subsubsub" style="margin-top:0;">
<li><a href="<?php echo admin_url('admin.php?page=gf_settings&amp;addon=Salesforce&amp;subview=Salesforce%3A+API'); ?>">Salesforce Settings</a> |</li>
<li><a href="<?php echo self::link_to_settings(); ?>">Salesforce Settings</a> |</li>
<li><a href="<?php echo admin_url('admin.php?page=gf_salesforce'); ?>" class="current">Salesforce Feeds</a></li>
</ul>

Expand Down Expand Up @@ -831,7 +834,7 @@ private static function list_page(){
?>
<tr>
<td colspan="4" style="padding:20px;">
<?php _e(sprintf("To get started, please configure your %sSalesforce Settings%s.", '<a href="admin.php?page=gf_settings&amp;addon=Salesforce&amp;subview=Salesforce%3A+API">', "</a>"), "gravity-forms-salesforce"); ?>
<?php _e(sprintf("To get started, please configure your %sSalesforce Settings%s.", '<a href="'.self::link_to_settings().'">', "</a>"), "gravity-forms-salesforce"); ?>
</td>
</tr>
<?php
Expand Down Expand Up @@ -1193,6 +1196,13 @@ public static function getObjectTypes() {

}

public static function link_to_settings( $escaped = true ) {

$url = admin_url('admin.php?page=gf_settings&addon=Salesforce&subview=Salesforce%3A+API');

return $escaped ? esc_attr( $url ) : $url;
}

private static function edit_page(){

if(!function_exists('gform_tooltip')) {
Expand Down Expand Up @@ -1223,7 +1233,7 @@ private static function edit_page(){
<img alt="<?php _e("Salesforce Feeds", "gravity-forms-salesforce") ?>" src="<?php echo self::get_base_url()?>/assets/images/salesforce-50x50.png" style="float:left; margin:15px 7px 0 0;"/>
<h2><?php _e("Salesforce Feeds", "gravity-forms-salesforce"); ?></h2>
<ul class="subsubsub">
<li><a href="<?php echo admin_url('admin.php?page=gf_settings&amp;addon=Salesforce&amp;subview=Salesforce%3A+API'); ?>">Salesforce Settings</a> |</li>
<li><a href="<?php echo self::link_to_settings(); ?>">Salesforce Settings</a> |</li>
<li><a href="<?php echo admin_url('admin.php?page=gf_salesforce'); ?>">Salesforce Feeds</a></li>
</ul>
<div class="clear"></div>
Expand All @@ -1235,7 +1245,7 @@ private static function edit_page(){
//ensures valid credentials were entered in the settings page
if(!self::api_is_valid($api)) {
?>
<div class="error" id="message" style="margin-top:20px;"><?php echo wpautop(sprintf(__("We are unable to login to Salesforce with the provided username and API key. Please make sure they are valid in the %sSettings Page%s", "gravity-forms-salesforce"), "<a href='?page=gf_settings&amp;addon=Salesforce'>", "</a>")); ?></div>
<div class="error" id="message" style="margin-top:20px;"><?php echo wpautop(sprintf(__("We are unable to login to Salesforce with the provided username and API key. Please make sure they are valid in the %sSettings Page%s", "gravity-forms-salesforce"), "<a href='".self::link_to_settings()."'>", "</a>")); ?></div>
<?php
return;
}
Expand Down Expand Up @@ -1862,8 +1872,9 @@ public static function get_form_fields($form_id){
if(isset($field["inputs"]) && is_array($field["inputs"]) && $field['type'] !== 'checkbox' && $field['type'] !== 'select'){

//If this is an address field, add full name to the list
if(RGFormsModel::get_input_type($field) == "address")
$fields[] = array($field["id"], GFCommon::get_label($field) . " (" . _x("Full" , 'Full address label', "gravity-forms-salesforce") . ")");
if(RGFormsModel::get_input_type($field) == "address") {
$fields[] = array($field["id"], GFCommon::get_label($field) . " (" . _x("Full" , 'Full field label', "gravity-forms-salesforce") . ")");
}

foreach($field["inputs"] as $input)
$fields[] = array($input["id"], GFCommon::get_label($field, $input["id"]));
Expand Down Expand Up @@ -2047,6 +2058,7 @@ private static function process_merge_vars($entry, $form, $feed) {

$field = RGFormsModel::get_field($form, $field_id);
$input_type = RGFormsModel::get_input_type($field);
var_dump($var_tag);

if($var_tag == 'address_full') {
$merge_vars[$var_tag] = self::get_address($entry, $field_id);
Expand Down
61 changes: 39 additions & 22 deletions trunk/readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== Gravity Forms Salesforce Add-on ===
Tags: gravity forms, forms, gravity, form, crm, gravity form, salesforce, salesforce plugin, form, forms, gravity, gravity form, gravity forms, secure form, simplemodal contact form, wp contact form, widget, sales force, customer, contact, contacts, address, addresses, address book, web to lead, web to case, web-to-lead, web-to-case, cases, leads, lead
Requires at least: 3.3
Tested up to: 3.9.1
Stable tag: 3.0.6.1
Tested up to: 4.0
Stable tag: 3.0.6.2
Contributors: katzwebdesign,katzwebservices
Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zackkatz%40gmail%2ecom&item_name=Gravity%20Forms%20Salesforce%20Addon&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zackkatz%40gmail%2ecom&item_name=Gravity%20Forms%20Salesforce%20Addon&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
License: GPLv2 or later

This is the most powerful Salesforce integration available for WordPress.
Expand All @@ -14,13 +14,13 @@ This is the most powerful Salesforce integration available for WordPress.
### This is *the* best WordPress Salesforce plugin.

### Integrate Your Forms with Salesforce
Add one setting, check a box when configuring your forms, and all your form entries will be added to Salesforce from now on. <strong>Integrating with Salesforce has never been so simple.</strong>
Add one setting, check a box when configuring your forms, and all your form entries will be added to Salesforce from now on. __Integrating with Salesforce has never been so simple.__

###Gravity Forms + Salesforce = A Powerful Combination

This free Salesforce Add-On for Gravity Forms adds contacts into Salesforce automatically, making customer relationship management simple. The setup process takes a few minutes, and your contact form will be linked with Salesforce.

<a href="http://wordpress.org/extend/plugins/gravity-forms-salesforce/faq/">Read the FAQ</a> for information on how to integrate with Custom Fields.
[Read the FAQ](http://wordpress.org/extend/plugins/gravity-forms-salesforce/faq/) for information on how to integrate with Custom Fields.

#### Using the API

Expand All @@ -36,12 +36,17 @@ If you use the following Editions, you will use the included Web-to-Lead Add-on:

- Personal Edition
- Group Edition
- Professional Edition<br />*Note: You can also purchase API access for a Professional Edition.*
- Professional Edition
*Note: You can also purchase API access for a Professional Edition.*

### Web to Case
When using the Web-to-Lead Add-on, you can choose to have form entries sent to Salesforce as Cases (like when using the Web-to-Case form) instead of as Leads.

If you have questions, comments, or issues with this plugin, <strong>please leave your feedback on the <a href="https://github.com/katzwebservices/Gravity-Forms-Salesforce/issues?state=open">Plugin Support Forum</a></strong>.
If you have questions, comments, or issues with this plugin, __please leave your feedback on the [Plugin Support Forum](https://github.com/katzwebservices/Gravity-Forms-Salesforce/issues?state=open)__.

### Want to help translate?

The plugin fully supports multiple languages! [Please help translate the plugin!](https://www.transifex.com/projects/p/gravity-forms-salesforce-add-on/)

== Screenshots ==

Expand Down Expand Up @@ -164,7 +169,7 @@ function change_salesforce_implode_glue($glue, $field) {

* `gf_salesforce_wsdl` - Path to the WSDL (string)
* `gf_salesforce_proxy` - Proxy settings as an object with properties host, port (integer, not a string), login and password (object, ideally a `ProxySettings` object)
* `gf_salesforce_soap_options` Additional options to send to the SoapClient constructor. (array) See <a href="http://php.net/manual/en/soapclient.soapclient.php">http://php.net/manual/en/soapclient.soapclient.php</a>
* `gf_salesforce_soap_options` Additional options to send to the SoapClient constructor. (array) See [http://php.net/manual/en/soapclient.soapclient.php](http://php.net/manual/en/soapclient.soapclient.php)
* `gf_salesforce_connection` - Modify the `SforcePartnerClient` object before it's returned.

See the FAQ item above for an example of using a filter.
Expand All @@ -186,15 +191,6 @@ Add the following to the bottom of your theme's `functions.php` file, before `?>

`add_filter('gf_salesforce_enterprise', '__return_true');`

= How do I configure the API plugin? =

### How to set up integration:

1. In WordPress admin, go to Forms > Salesforce > Salesforce Settings
2. If you don't have your security token, <a href="https://na9.salesforce.com/_ui/system/security/ResetApiTokenEdit">follow this link to Reset Your Security Token</a>
3. Come back to this settings page and enter your Security Token, Salesforce.com Username and Password.
4. Save the settings, and you should be done!

= How do I set a custom Lead Source? (Web-to-Lead) =
This feature support was added in version 1.1.1. `gf_salesforce_lead_source` is the filter.

Expand Down Expand Up @@ -236,7 +232,7 @@ You can. When you are trying to map a custom field, you need to set either the "
You can find your Custom Fields under [Your Name] &rarr; Setup &rarr; Leads &rarr; Fields, then at the bottom of the page, there's a list of "Lead Custom Fields & Relationships". This is where you will find the "API Name" to use in the Admin Label or Parameter Name.

__If that doesn't work__
If the fields are not submitting properly still, you may need to try a different approach: under "Lead Custom Fields & Relationships", click on the name of the field. The URL of the page you go to will be formatted like this: `https://na123.salesforce.com/12AB0000003CDe4?setupid=LeadFields`. You want to copy the part of the URL that looks similar to <strong><code>12AB0000003CDe4</code></strong>. Use that value instead of the API Name.
If the fields are not submitting properly still, you may need to try a different approach: under "Lead Custom Fields & Relationships", click on the name of the field. The URL of the page you go to will be formatted like this: `https://na123.salesforce.com/12AB0000003CDe4?setupid=LeadFields`. You want to copy the part of the URL that looks similar to __`12AB0000003CDe4`__. Use that value instead of the API Name.

= I need to send a "Date/Time" field, not a "Date" field. How do I do that? (Web-to-Lead) =
Salesforce makes this a little difficult, sorry!
Expand All @@ -263,32 +259,44 @@ function filter_the_gf_salesforce_datetime($use_datetime = false, $key = '', $va
}
`

__If that doesn't work__, you can modify the format for the date by using this code:
__If that doesn't work__, you can modify the format for the date by using this code:

`
<pre>
add_filter('gf_salesforce_format_date', 'modify_gf_salesforce_format_date');

/**
* The default is US-style, though Salesforce recommends <code>Y-m-d\'\T\'H:i:s</code>
* The default is US-style, though Salesforce recommends Y-m-d\'\T\'H:i:s
* You can use any date formatting as shown here:
* @link http://php.net/manual/en/function.date.php
*/
function modify_gf_salesforce_format_date($previous = '') {
$date_format = 'Y-m-d\'\T\'H:i:s';
return $date_format;
}
`
</pre>

= I know I have SOAP enabled and the API plugin says I don't. =
Add this to the bottom of your theme's `functions.php` file to force loading even if a `SOAPClient` class does not exist:

`add_filter( 'gf_salesforce_soap_is_available', '__return_true');`

= Checkboxes aren't being passing to Salesforce =
Make the value of checkboxes `1` in Gravity Forms. [See how to do that here](https://github.com/katzwebservices/Gravity-Forms-Salesforce/issues/99).

= What's the license for this plugin? =
This plugin is released under a GPL license.

== Changelog ==

= 3.0.6.2 (September 5, 2014) =
* Fixed: Issue saving Web-to-Lead settings for Gravity Forms 1.8.10 or higher. Thanks, [@twiginteractive](https://github.com/twiginteractive)
* Fixed: An issue with the OAuth library clashing if the same library is used elsewhere. Thanks, [@JasonTheAdams](https://github.com/JasonTheAdams)
* Confirmed compatibility with WordPress 4.0

= 3.0.6.1 (August 18, 2014) =
* If you haven't read the 3.0.5 notes, please do so!
* Fixed: Issue with refreshing Salesforce authorization token

= 3.0.6 (July 19, 2014) =
* If you haven't read the 3.0.5 changelog notes, please do so!
* Added: Enabled Merge Tag field value support ([issue #97](https://github.com/katzwebservices/Gravity-Forms-Salesforce/issues/97))
Expand Down Expand Up @@ -482,6 +490,15 @@ This plugin is released under a GPL license.

== Upgrade Notice ==

= 3.0.6.2 (September 5, 2014) =
* Fixed: Issue saving Web-to-Lead settings for Gravity Forms 1.8.10 or higher. Thanks, [@twiginteractive](https://github.com/twiginteractive)
* Fixed: An issue with the OAuth library clashing if the same library is used elsewhere. Thanks, [@JasonTheAdams](https://github.com/JasonTheAdams)
* Confirmed compatibility with WordPress 4.0

= 3.0.6.1 (August 18, 2014) =
* If you haven't read the 3.0.5 notes, please do so!
* Fixed: Issue with refreshing Salesforce authorization token

= 3.0.6 (July 19, 2014) =
* If you haven't read the 3.0.5 changelog notes, please do so!
* Added: Enabled Merge Tag field value support ([issue #97](https://github.com/katzwebservices/Gravity-Forms-Salesforce/issues/97))
Expand Down
2 changes: 1 addition & 1 deletion trunk/salesforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function load_files() {
function plugin_action_links( $links, $file ) {
if ( $file == plugin_basename(self::$file) ) {
array_unshift( $links, '<a href="https://github.com/katzwebservices/Gravity-Forms-Salesforce/issues?state=open"><span class="dashicons dashicons-sos"></span>' . __('Support', 'idx-plus') . '</a>' );
array_unshift( $links, '<a href="' . admin_url( 'admin.php?page=gf_settings&amp;subview=Salesforce+Add-On' ) . '"><span class="dashicons dashicons-admin-generic"></span>' . __('Settings', 'idx-plus') . '</a>' );
array_unshift( $links, '<a href="' . admin_url( 'admin.php?page=gf_settings&amp;subview=sf-loader' ) . '"><span class="dashicons dashicons-admin-generic"></span>' . __('Settings', 'idx-plus') . '</a>' );
}
return $links;
}
Expand Down

0 comments on commit aeedf82

Please sign in to comment.