/
Listing 5-6.php
29 lines (23 loc) · 1 KB
/
Listing 5-6.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
class LeadFeed extends FeedLogicBase
{
var $module = 'Leads';
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);
}
}
}