You are here

sf_notifications.install in Salesforce Suite 7.2

Same filename and directory in other branches
  1. 6.2 sf_notifications/sf_notifications.install

File

sf_notifications/sf_notifications.install
View source
<?php

// $Id$

/**
 * @file
 */

/**
 * @todo Please document this function.
 * @see http://drupal.org/node/1354
 */
function sf_notifications_enable() {
  global $base_url;
  $sfuser = variable_get('salesforce_api_username', 'user@example.com');
  $formula = '<code>NOT($User.Username = \'' . $sfuser . '\')</code>';

  // @todo: Find a way to link to outbound messages and workflow rules without hard-coded URLs
  //  since these vary per Salesforce org.
  $args = array(
    '!base_url' => $base_url,
    '!formula' => $formula,
  );
  drupal_set_message(t('You have successfully enabled Salesforce Notifications. To make use
    of this module, you will probably want to head over to salesforce.com and
    set up some outbound messages and
    associate them with workflow rules. Point the outbound message(s) to
    !base_url and set up the workflow rules to fire when the user is NOT your
    SFDC API user. Use the following formula if you are unsure: !formula.', $args), 'warning');
}

/**
 * @todo Please document this function.
 * @see http://drupal.org/node/1354
 */
function sf_notifications_disable() {
  drupal_set_message(t('You have successfully disabled Salesforce Notifications. You may
    want to deactivate any workflow rules associated
    with this site.'));
}

/**
 * Implements hook_install().
 */
function sf_notifications_install() {

  // Create our incoming notification queue.
  $queue = DrupalQueue::get('sf_notifications_queue');
  $queue
    ->createQueue();
}

/**
 * Implements hook_uninstall().
 */
function sf_notifications_uninstall() {

  // Delete our queues.
  $queue = DrupalQueue::get('sf_notifications_queue');
  $queue
    ->deleteQueue();

  // Delete our variables.
  db_delete('variable')
    ->condition('name', 'sf_notifications_%', 'LIKE')
    ->execute();
}

Functions

Namesort descending Description
sf_notifications_disable @todo Please document this function.
sf_notifications_enable @todo Please document this function.
sf_notifications_install Implements hook_install().
sf_notifications_uninstall Implements hook_uninstall().