sf_notifications.install in Salesforce Suite 7.2
File
sf_notifications/sf_notifications.install
View source
<?php
function sf_notifications_enable() {
global $base_url;
$sfuser = variable_get('salesforce_api_username', 'user@example.com');
$formula = '<code>NOT($User.Username = \'' . $sfuser . '\')</code>';
$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');
}
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.'));
}
function sf_notifications_install() {
$queue = DrupalQueue::get('sf_notifications_queue');
$queue
->createQueue();
}
function sf_notifications_uninstall() {
$queue = DrupalQueue::get('sf_notifications_queue');
$queue
->deleteQueue();
db_delete('variable')
->condition('name', 'sf_notifications_%', 'LIKE')
->execute();
}