Is it possible to audit fields defined in vardefs.php as type => link?
Here are selected lines directly from my Contacts module vardefs.php:
Note that auditing is enabled for all three fields and that the first (lead_source) is a data field (type => enum), but the next two are link fields.HTML Code:$dictionary['Contact'] = array('table' => 'contacts', 'audited'=>true, 'unified_search' => true, 'duplicate_merge'=>true, 'fields' => array ( <... snip ...> 'lead_source' => array ( 'name' => 'lead_source', 'vname' => 'LBL_LEAD_SOURCE', 'type' => 'enum', 'options' => 'lead_source_dom', 'len' => '100', 'audited'=>true, 'comment' => 'How did the contact come about', ), 'account_name' => array ( 'name' => 'account_name', 'rname' => 'name', 'id_name' => 'account_id', 'vname' => 'LBL_ACCOUNT_NAME', 'join_name'=>'accounts', 'type' => 'relate', 'link' => 'accounts', 'table' => 'accounts', 'isnull' => 'true', 'module' => 'Accounts', 'dbType' => 'varchar', 'len' => '255', 'audited'=>true, 'source' => 'non-db', 'unified_search' => true, ), <... snip ...> 'email_addresses' => array ( 'name' => 'email_addresses', 'type' => 'link', 'relationship' => 'contacts_email_addresses', 'module' => 'EmailAddress', 'bean_name'=>'EmailAddress', 'source' => 'non-db', 'audited'=>true, 'vname' => 'LBL_EMAIL_ADDRESSES', 'reportable'=>false, ),
Changes to lead_source show up in the change log.
Changes to account_name have the side effect that all linked address information that changes shows up in the change log, but the account_name change does not show up in the change log.
Changes to email_address do not show up in the change log.
The underlying MySQL audit tables show up when you enable auditing, clear the vardefs cache and rebuld vardefs. There is an audit table specific to the modules' underlying table (e.g. contacts_audit), implying that it is there to hold changes to data fields stored in the Contacts module. The results of the account_name audit test are consistent with this showing that only data stored in the contacts table is audited for changes.
This creates the awkward situation where a field like email_address is viewed from Contacts, but apparently can't be audited from there as it has a many-to-one relationship to contact.
Also note that the relationship definition 'relationship' => 'contacts_email_addresses', does not refer to an existing table since email addresses are related to multiple tables using 'email_addr_bean_rel'
I would love to be able to audit data that is (from the user perspective) related to Contacts using the Contacts module. But any audit trail would let me accomplish the purpose.
So the general question is:
How is auditing supposed to work when applied to links?
And the more specific question is:
Is it possible to audit Email Addresses?
I asked the more specific question earlier in http://www.sugarcrm.com/forums/showthread.php?t=31557, but didn't get any answers.
Does anyone have any info for me on this??
Thanks
Phil


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks