You are here

function salesforce_help in Salesforce Suite 7.3

Same name and namespace in other branches
  1. 8.4 salesforce.module \salesforce_help()
  2. 8.3 salesforce.module \salesforce_help()
  3. 5.0.x salesforce.module \salesforce_help()

Implements hook_help().

File

./salesforce.module, line 15
API and module for Salesforce integration.

Code

function salesforce_help($path, $arg) {
  switch ($path) {
    case 'admin/structure/salesforce':
      $output = '';
      if (!module_exists('salesforce_mapping')) {
        $output .= '<p>' . t('In order to configure Salesforce Mappings, you must first enable the <a href="/admin/modules">Salesforce Mapping</a> module and at least one sync method (Push or Pull).') . '</p>';
      }
      if (!variable_get('salesforce_consumer_secret', NULL) || !variable_get('salesforce_consumer_key', NULL) || !variable_get('salesforce_refresh_token', NULL)) {
        $output .= '<p>' . t('You must !authorize in order to configure Salesforce Mappings.', array(
          '!authorize' => l(t('authorize your account with Salesforce'), 'admin/config/salesforce/authorize'),
        )) . '</p>';
      }
      return $output;
    case 'admin/help#salesforce':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('This module suite implements a mapping functionality between Salesforce
  objects and Drupal entities. In other words, for each of your supported Drupal
  entities (e.g. node, user, or entities supported by extensions), you can
  assign Salesforce objects that will be created / updated when the entity is
  saved. For each such assignment, you choose which Drupal and Salesforce fields
  should be mapped to one another.') . '</p>';
      $output .= '<p>' . t('This suite also includes an API architecture which allows for additional
  modules to be easily plugged in (e.g. for webforms, contact form submits,
  etc).') . '</p>';
      $output .= '<p>' . t('For a more detailed description of each component module, see below.') . '</p>';
      $output .= '<h3>' . t('Requirements') . '</h3>';
      $output .= '<ol>';
      $output .= '<li>' . t('You need a Salesforce account. Developers can !register_here.', array(
        '!register_here' => l(t('register here'), 'http://www.developerforce.com/events/regular/registration.php'),
      )) . '</li>';
      $output .= '<li>' . t('You will need to create a remote application/connected app for authorization.') . '</li>';
      $output .= '<ul>';
      $output .= '<li>' . t('In Salesforce go to Your Name > Setup > Create > Apps then create a new Connected App. (Depending on your Salesforce instance, you may need to go to Your Name > Setup > Develop > Remote Access.)') . '</li>';
      $output .= '<li>' . t('Set the callback URL to: !url (SSL is required)', array(
        '!url' => '<code>' . url('salesforce/oauth_callback', array(
          'absolute' => TRUE,
          'https' => TRUE,
        )) . '</code>',
      )) . '</li>';
      $output .= '<li>' . t('Select at least "Perform requests on your behalf at any time" for OAuth Scope
  as well as the appropriate other scopes for your application. Note that "Full access" does not include the "Perform requests on your behalf at any time" scope! !info.', array(
        '!info' => l(t('Additional information'), 'https://help.salesforce.com/help/doc/en/remoteaccess_about.htm'),
      )) . '</li>';
      $output .= '<li>' . t('For more help see !salesforce.', array(
        '!salesforce' => l(t('the salesforce.com documentation'), 'https://www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm'),
      )) . '</li>';
      $output .= '</ul>';
      $output .= '<li>' . t('Your site needs to be SSL enabled to authorize the remote application using OAUTH.') . '</li>';
      $output .= '<li>' . t('If using the SOAP API, PHP must be compiled with !SOAP and !SSL.', array(
        '!SOAP' => l(t('SOAP web services'), 'http://php.net/soap'),
        '!SSL' => l(t('OpenSSL support'), 'http://php.net/openssl'),
      )) . '</li>';
      $output .= '</ol>';
      $output .= '<h4>' . t('Required modules') . '</h4>';
      $output .= '<ul>';
      $output .= '<li>' . l(t('Entity API'), 'http://drupal.org/project/entity') . '</li>';
      $output .= '<li>' . l(t('Libraries, only for SOAP API'), 'http://drupal.org/project/libraries') . '</li>';
      $output .= '</ul>';
      $output .= '<h3>' . t('Modules') . '</h3>';
      $output .= '<h4>' . t('Salesforce (salesforce)') . '</h4>';
      $output .= '<p>' . t('OAUTH2 authorization and wrapper around the Salesforce REST API.') . '</p>';
      $output .= '<h4>' . t('Salesforce Mapping (salesforce_mapping)') . '</h4>';
      $output .= '<p>' . t('Map Drupal entities to Salesforce fields, including field level mapping.') . '</p>';
      $output .= '<h4>' . t('Salesforce Push (salesforce_push)') . '</h4>';
      $output .= '<p>' . t('Push Drupal entity updates into Salesforce.') . '</p>';
      $output .= '<h4>' . t('Salesforce Pull (salesforce_pull)') . '</h4>';
      $output .= '<p>' . t('Pull Salesforce object updates into Drupal on cron run. (Salesforce Outbound Notifications are not supported.)') . '</p>';
      $output .= '<h4>' . t('Salesforce Soap (salesforce_soap)') . '</h4>';
      $output .= '<p>' . t('Lightweight wrapper around the SOAP API, using the OAUTH access token, to fill in functional gaps missing in the REST API. Requires the Salesforce PHP Toolkit.') . '</p>';
      $output .= '<p>' . t('Example installation of the Salesforce PHP Toolkit using the provided Drush Make file:') . ' <code>drush make /path/to/salesforce/modules/salesforce_soap/salesforce_soap.make.example --no-core -y</code>' . '</p>';
      return $output;
    case 'admin/config/salesforce':
    case 'admin/config/salesforce/authorize':
      return '<p>' . t('Visit !help if you need help obtaining a consumer key and secret.', array(
        '!help' => l(t('the Salesforce module help page'), 'admin/help/salesforce'),
      )) . '</p>';
  }
}