public function pushFeed($bean, $event, $arguments) { $text = ''; if (empty($bean->fetched_row)) { $text = 'New Application Uploaded [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . ']'; } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
function pushFeed($bean, $event, $arguments) { $text = ''; if (empty($bean->fetched_row)) { $text = '{SugarFeed.CREATED_CONTACT} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->first_name . ' ' . $bean->last_name . ']'; } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
function pushFeed($bean, $event, $arguments) { global $locale; $text = ''; if (empty($bean->fetched_row)) { $text = '{SugarFeed.CREATED_ACCOUNT} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . ']'; } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
function pushFeed($bean, $event, $arguments) { $text = ''; if (empty($bean->fetched_row)) { $text = '{SugarFeed.CREATED_CASE} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . '] {SugarFeed.FOR} [Accounts:' . $bean->account_id . ':' . $bean->account_name . ']<br>' . $bean->description; } else { if (!empty($bean->fetched_row['status']) && $bean->fetched_row['status'] != $bean->status && $bean->status == 'Closed') { $text = '{SugarFeed.CLOSED_CASE} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . '] {SugarFeed.FOR} [Accounts:' . $bean->account_id . ':' . $bean->account_name . ']'; } } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
public function testpushFeed2() { $lead = new Lead(); $lead->id = 1; $lead->assigned_user_id = 1; SugarFeed::pushFeed2('some text 2', $lead, 'Link', 'some url'); //retrieve newly created bean $sugarFeed = new SugarFeed(); $result = $sugarFeed->retrieve_by_string_fields(array('related_id' => '1', 'related_module' => 'Leads')); //test for record ID to verify that record is saved $this->assertTrue(isset($sugarFeed->id)); $this->assertEquals(36, strlen($sugarFeed->id)); //mark the record as deleted $sugarFeed->mark_deleted($sugarFeed->id); }
function pushFeed($bean, $event, $arguments) { global $locale; $text = ''; if (empty($bean->fetched_row)) { $full_name = $locale->getLocaleFormattedName($bean->first_name, $bean->last_name, ''); $text = '{SugarFeed.CREATED_LEAD} [' . $bean->module_dir . ':' . $bean->id . ':' . $full_name . ']'; } else { if (!empty($bean->fetched_row['status']) && $bean->fetched_row['status'] != $bean->status && $bean->status == 'Converted') { // Repeated here so we don't format the name on "uninteresting" events $full_name = $locale->getLocaleFormattedName($bean->first_name, $bean->last_name, ''); $text = '{SugarFeed.CONVERTED_LEAD} [' . $bean->module_dir . ':' . $bean->id . ':' . $full_name . ']'; } } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
function pushFeed($bean, $event, $arguments) { $text = ''; if (empty($bean->fetched_row)) { $currency = new Currency(); $currency->retrieve($bean->currency_id); $text = '{SugarFeed.CREATED_OPPORTUNITY} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . '] {SugarFeed.WITH} [Accounts:' . $bean->account_id . ':' . $bean->account_name . '] {SugarFeed.FOR} ' . $currency->symbol . format_number($bean->amount); } else { if (!empty($bean->fetched_row['sales_stage']) && $bean->fetched_row['sales_stage'] != $bean->sales_stage && $bean->sales_stage == 'Closed Won') { $currency = new Currency(); $currency->retrieve($bean->currency_id); $text = '{SugarFeed.WON_OPPORTUNITY} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . '] {SugarFeed.WITH} [Accounts:' . $bean->account_id . ':' . $bean->account_name . '] {SugarFeed.FOR} ' . $currency->symbol . format_number($bean->amount); } } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
function pushFeed($bean, $event, $arguments) { $text = ''; if (empty($bean->fetched_row) && $bean->in_save) { $accountName = $bean->account_name; if (empty($accountName) && $bean->account_id) { $acc = BeanFactory::getBean('Accounts', $bean->account_id); $accountName = $acc->name; } $text = '{SugarFeed.CREATED_CASE} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . '] {SugarFeed.FOR} [Accounts:' . $bean->account_id . ':' . $accountName . ']: ' . $bean->description; } else { if (!empty($bean->fetched_row['status']) && $bean->fetched_row['status'] != $bean->status && strpos($bean->status, 'Closed') !== false) { $text = '{SugarFeed.CLOSED_CASE} [' . $bean->module_dir . ':' . $bean->id . ':' . $bean->name . '] {SugarFeed.FOR} [Accounts:' . $bean->account_id . ':' . $bean->account_name . ']'; } } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }
function pushFeed($bean, $event, $arguments) { global $locale; $text = ''; if (empty($bean->fetched_row)) { $text = '{SugarFeed.CREATED_ACTIVITY} [' . $bean->module_dir . ':' . $bean->id . ':' . $locale->getLocaleFormattedName($bean->first_name, $bean->last_name) . ']'; } if (!empty($text)) { SugarFeed::pushFeed2($text, $bean); } }