I have the same issue initially with v5 which has now been upgraded to v620. What code from the contacts.php do I need to add in and into which file in my custom module folder?
I have tried to add it into where I think it needs to go but it breaks my module.
Below is the code from the file I am adding the create_export code to:
Code:
require_once('modules/F1000_F1000Contacts/F1000_F1000Contacts_sugar.php');
class F1000_F1000Contacts extends F1000_F1000Contacts_sugar {
function F1000_F1000Contacts(){
parent::F1000_F1000Contacts_sugar();
}
}
?> And this is the code I have extracted from the contacts.php file
Code:
function create_export_query(&$order_by, &$where, $relate_link_join='')
{
$custom_join = $this->custom_fields->getJOIN(true, true,$where);
if($custom_join)
$custom_join['join'] .= $relate_link_join;
$query = "SELECT
contacts.*,email_addresses.email_address email_address,
accounts.name as account_name,
users.user_name as assigned_user_name ";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= " FROM contacts ";
$query .= "LEFT JOIN users
ON contacts.assigned_user_id=users.id ";
$query .= "LEFT JOIN accounts_contacts
ON ( contacts.id=accounts_contacts.contact_id and (accounts_contacts.deleted is null or accounts_contacts.deleted = 0))
LEFT JOIN accounts
ON accounts_contacts.account_id=accounts.id ";
//join email address table too.
$query .= ' LEFT JOIN email_addr_bean_rel on contacts.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Contacts\' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1 ';
$query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ;
if($custom_join){
$query .= $custom_join['join'];
} What else do I need to do?
Bookmarks