'pcontacts', 'audited'=>true, 'unified_search' => true, 'duplicate_merge'=>true, 'fields' => array ( 'email_and_name1' => array ( 'name' => 'email_and_name1', 'rname' => 'email_and_name1', 'vname' => 'LBL_NAME', 'type' => 'varchar', 'source' => 'non-db', 'len' => '510', 'importable' => 'false', ), 'lead_source' => array ( 'name' => 'lead_source', 'vname' => 'LBL_LEAD_SOURCE', 'type' => 'enum', 'options' => 'lead_source_dom', 'len' => '100', 'comment' => 'How did the pcontact come about', ), 'lead_name' => array ( 'name' => 'lead_name', 'rname' => 'name', 'id_name' => 'lead_id', 'vname' => 'Nazwa Potencjalnego Klienta', 'join_name'=>'leads', 'type' => 'relate', 'link' => 'leads', 'table' => 'leads', 'isnull' => 'true', 'module' => 'Leads', 'dbType' => 'varchar', 'len' => '255', 'source' => 'non-db', 'unified_search' => true, ), 'lead_id' => array ( 'name' => 'lead_id', 'rname' => 'id', 'id_name' => 'lead_id', 'vname' => 'LBL_ACCOUNT_ID', 'type' => 'relate', 'table' => 'leads', 'isnull' => 'true', 'module' => 'Leads', 'dbType' => 'id', 'reportable'=>false, 'source' => 'non-db', 'massupdate' => false, 'duplicate_merge'=> 'disabled', 'hideacl'=>true, ), 'opportunity_role_fields' => array ( 'name' => 'opportunity_role_fields', 'rname' => 'id', 'relationship_fields'=>array('id' => 'opportunity_role_id', 'pcontact_role' => 'opportunity_role'), 'vname' => 'LBL_ACCOUNT_NAME', 'type' => 'relate', 'link' => 'opportunities', 'link_type' => 'relationship_info', 'join_link_name' => 'opportunities_pcontacts', 'source' => 'non-db', 'importable' => 'false', 'duplicate_merge'=> 'disabled', ), 'opportunity_role_id' => array( 'name' => 'opportunity_role_id', 'type' => 'varchar', 'source' => 'non-db', 'vname' => 'LBL_OPPORTUNITY_ROLE_ID', ), 'opportunity_role' => array( 'name' => 'opportunity_role', 'type' => 'enum', 'source' => 'non-db', 'vname' => 'LBL_OPPORTUNITY_ROLE', 'options' => 'opportunity_relationship_type_dom', ), 'reports_to_id'=> array( 'name' => 'reports_to_id', 'vname' => 'LBL_REPORTS_TO_ID', 'type' => 'id', 'required'=>false, 'reportable'=>false, 'comment' => 'The pcontact this contact reports to' ), 'report_to_name' => array ( 'name' => 'report_to_name', 'rname' => 'last_name', 'id_name' => 'reports_to_id', 'vname' => 'LBL_REPORTS_TO', 'type' => 'relate', 'link' => 'reports_to_link', 'table' => 'pcontacts', 'isnull' => 'true', 'module' => 'PContacts', 'dbType' => 'varchar', 'len' => 'id', 'reportable'=>false, 'source' => 'non-db', ), 'birthdate' => array ( 'name' => 'birthdate', 'vname' => 'LBL_BIRTHDATE', 'massupdate' => false, 'type' => 'date', 'comment' => 'The birthdate of the pcontact' ), 'portal_name' => array ( 'name' => 'portal_name', 'vname' => 'LBL_PORTAL_NAME', 'type' => 'varchar', 'len' => '255', 'group'=>'portal', 'comment' => 'Name as it appears in the portal' ), 'portal_active' => array ( 'name' => 'portal_active', 'vname' => 'LBL_PORTAL_ACTIVE', 'type' => 'bool', 'required' => true, 'default' => '0', 'group'=>'portal', 'comment' => 'Indicator whether this pcontact is a portal user' ), 'mailing_tag' => array ( 'name' => 'mailing_tag', 'vname' => 'LBL_MAILING_TAG', 'type' => 'bool', 'default' => '0', ), 'foreign_pcontact' => array ( 'name' => 'foreign_pcontact', 'vname' => 'LBL_FOREIGN_PCONTACT', 'type' => 'bool', 'default' => '0', ), 'portal_app' => array ( 'name' => 'portal_app', 'vname' => 'LBL_PORTAL_APP', 'type' => 'varchar', 'group'=>'portal', 'len' => '255', 'comment' => 'Reference to the portal' ), 'reports_to_link' => array ( 'name' => 'reports_to_link', 'type' => 'link', 'relationship' => 'pcontact_direct_reports', 'link_type' => 'one', 'side' => 'right', 'source' => 'non-db', 'vname' => 'LBL_REPORTS_TO', ), 'opportunities' => array ( 'name' => 'opportunities', 'type' => 'link', 'relationship' => 'opportunities_pcontacts', 'source' => 'non-db', 'module' => 'Opportunities', 'bean_name' => 'Opportunity', 'vname' => 'LBL_OPPORTUNITIES', ), 'email_addresses' => array ( 'name' => 'email_addresses', 'type' => 'link', 'relationship' => 'pcontacts_email_addresses', 'module' => 'EmailAddress', 'bean_name'=>'EmailAddress', 'source' => 'non-db', 'vname' => 'LBL_EMAIL_ADDRESSES', 'reportable'=>false, ), 'email_addresses_primary' => array ( 'name' => 'email_addresses_primary', 'type' => 'link', 'relationship' => 'pcontacts_email_addresses_primary', 'source' => 'non-db', 'vname' => 'LBL_EMAIL_ADDRESS_PRIMARY', 'duplicate_merge'=> 'disabled', ), 'bugs' => array ( 'name' => 'bugs', 'type' => 'link', 'relationship' => 'pcontacts_bugs', 'source' => 'non-db', 'vname' => 'LBL_BUGS', ), 'calls' => array ( 'name' => 'calls', 'type' => 'link', 'relationship' => 'calls_pcontacts', 'source' => 'non-db', 'vname' => 'LBL_CALLS', ), 'cases' => array ( 'name' => 'cases', 'type' => 'link', 'relationship' => 'pcontacts_cases', 'source' => 'non-db', 'vname' => 'LBL_CASES', ), 'direct_reports'=> array ( 'name' => 'direct_reports', 'type' => 'link', 'relationship' => 'pcontact_direct_reports', 'source' => 'non-db', 'vname' => 'LBL_DIRECT_REPORTS', ), 'emails'=> array ( 'name' => 'emails', 'type' => 'link', 'relationship' => 'emails_pcontacts_rel', 'source' => 'non-db', 'vname' => 'LBL_EMAILS', ), 'leads' => array ( 'name' => 'leads', 'type' => 'link', 'relationship' => 'leads_pcontacts', 'link_type' => 'one', 'source' => 'non-db', 'vname' => 'LBL_ACCOUNT', 'duplicate_merge'=> 'disabled', ), 'meetings'=> array ( 'name' => 'meetings', 'type' => 'link', 'relationship' => 'meetings_pcontacts', 'source' => 'non-db', 'vname' => 'LBL_MEETINGS', ), 'notes'=> array ( 'name' => 'notes', 'type' => 'link', 'relationship' => 'pcontact_notes', 'source' => 'non-db', 'vname' => 'LBL_NOTES', ), 'project'=> array ( 'name' => 'project', 'type' => 'link', 'relationship' => 'projects_pcontacts', 'source' => 'non-db', 'vname' => 'LBL_PROJECTS', ), 'tasks'=> array ( 'name' => 'tasks', 'type' => 'link', 'relationship' => 'pcontact_tasks', 'source' => 'non-db', 'vname' => 'LBL_TASKS', ), 'user_sync'=> array ( 'name' => 'users', 'type' => 'link', 'relationship' => 'pcontacts_users', 'source' => 'non-db', 'vname' => 'LBL_USER_SYNC', ), 'created_by_link' => array ( 'name' => 'created_by_link', 'type' => 'link', 'relationship' => 'pcontacts_created_by', 'vname' => 'LBL_CREATED_BY_USER', 'link_type' => 'one', 'module' => 'Users', 'bean_name' => 'User', 'source' => 'non-db', ), 'modified_user_link' => array ( 'name' => 'modified_user_link', 'type' => 'link', 'relationship' => 'pcontacts_modified_user', 'vname' => 'LBL_MODIFIED_BY_USER', 'link_type' => 'one', 'module' => 'Users', 'bean_name' => 'User', 'source' => 'non-db', ), 'assigned_user_link' => array ( 'name' => 'assigned_user_link', 'type' => 'link', 'relationship' => 'pcontacts_assigned_user', 'vname' => 'LBL_ASSIGNED_TO_USER', 'link_type' => 'one', 'module' => 'Users', 'bean_name' => 'User', 'source' => 'non-db', 'rname' => 'user_name', 'id_name' => 'assigned_user_id', 'table' => 'users', 'duplicate_merge'=>'enabled' ), 'campaign_id' => array ( 'name' => 'campaign_id', 'comment' => 'Campaign that generated lead', 'vname'=>'LBL_CAMPAIGN_ID', 'rname' => 'id', 'id_name' => 'campaign_id', 'type' => 'id', //'dbType' => 'char', 'table' => 'campaigns', 'isnull' => 'true', 'module' => 'Campaigns', 'reportable'=>false, 'massupdate' => false, 'duplicate_merge'=> 'disabled', ), 'campaign_name' => array ( 'name' => 'campaign_name', 'vname' => 'LBL_CAMPAIGN', 'type' => 'relate', 'reportable'=>false, 'source'=>'non-db', 'table' => 'campaigns', 'id_name' => 'campaign_id', 'module'=>'Campaigns', 'duplicate_merge'=>'disabled', 'comment' => 'The first campaign name for PContact (Meta-data only)', ), 'campaigns' => array ( 'name' => 'campaigns', 'type' => 'link', 'relationship' => 'pcontact_campaign_log', 'module'=>'CampaignLog', 'bean_name'=>'CampaignLog', 'source'=>'non-db', 'vname'=>'LBL_CAMPAIGNS', ), 'c_accept_status_fields' => array ( 'name' => 'c_accept_status_fields', 'rname' => 'id', 'relationship_fields'=>array('id' => 'accept_status_id', 'accept_status' => 'accept_status_name'), 'vname' => 'LBL_LIST_ACCEPT_STATUS', 'type' => 'relate', 'link' => 'calls', 'link_type' => 'relationship_info', 'source' => 'non-db', 'importable' => 'false', 'duplicate_merge'=> 'disabled', ), 'm_accept_status_fields' => array ( 'name' => 'm_accept_status_fields', 'rname' => 'id', 'relationship_fields'=>array('id' => 'accept_status_id', 'accept_status' => 'accept_status_name'), 'vname' => 'LBL_LIST_ACCEPT_STATUS', 'type' => 'relate', 'link' => 'meetings', 'link_type' => 'relationship_info', 'source' => 'non-db', 'importable' => 'false', 'hideacl'=>true, 'duplicate_merge'=> 'disabled', ), 'accept_status_id' => array( 'name' => 'accept_status_id', 'type' => 'varchar', 'source' => 'non-db', 'vname' => 'LBL_LIST_ACCEPT_STATUS', ), 'accept_status_name' => array( 'massupdate' => false, 'name' => 'accept_status_name', 'type' => 'enum', 'source' => 'non-db', 'vname' => 'LBL_LIST_ACCEPT_STATUS', 'options' => 'dom_meeting_accept_status', 'importable' => 'false', ), 'prospect_lists' => array ( 'name' => 'prospect_lists', 'type' => 'link', 'relationship' => 'prospect_list_pcontacts', 'module'=>'ProspectLists', 'source'=>'non-db', 'vname'=>'LBL_PROSPECT_LIST', ), 'sync_pcontact' => array ( 'massupdate' => false, 'name' => 'sync_pcontact', 'vname' => 'LBL_SYNC_PCONTACT', 'type' => 'bool', 'source' => 'non-db', 'comment' => 'Synch to outlook? (Meta-Data only)', ), ), 'indices' => array ( array( 'name' => 'idx_cont_last_first', 'type' => 'index', 'fields' => array('last_name', 'first_name', 'deleted') ), array( 'name' => 'idx_pcontacts_del_last', 'type' => 'index', 'fields' => array('deleted', 'last_name'), ), array( 'name' => 'idx_cont_del_reports', 'type' => 'index', 'fields'=>array('deleted', 'reports_to_id', 'last_name') ), array( 'name' => 'idx_reports_to_id', 'type' => 'index', 'fields'=> array('reports_to_id'), ), array( 'name' => 'idx_del_id_user', 'type' => 'index', 'fields'=> array('deleted', 'id', 'assigned_user_id'), ), array( 'name' => 'idx_cont_assigned', 'type' => 'index', 'fields' => array('assigned_user_id') ), // array( // 'name' => 'idx_cont_email1', // 'type' => 'index', // 'fields' => array('email1') // ), // array( // 'name' => 'idx_cont_email2', // 'type' => 'index', // 'fields' => array('email2') // ), ) , 'relationships' => array ( 'pcontact_direct_reports' => array('lhs_module' => 'PContacts', 'lhs_table' => 'contacts', 'lhs_key' => 'id', 'rhs_module' => 'PContacts', 'rhs_table' => 'pcontacts', 'rhs_key' => 'reports_to_id', 'relationship_type' => 'one-to-many'), 'pcontact_leads' => array('lhs_module' => 'PContacts', 'lhs_table' => 'contacts', 'lhs_key' => 'id', 'rhs_module' => 'Leads', 'rhs_table' => 'leads', 'rhs_key' => 'pcontact_id', 'relationship_type' => 'one-to-many') ,'pcontact_notes' => array('lhs_module' => 'PContacts', 'lhs_table' => 'contacts', 'lhs_key' => 'id', 'rhs_module' => 'Notes', 'rhs_table' => 'notes', 'rhs_key' => 'pcontact_id', 'relationship_type' => 'one-to-many') ,'pcontact_tasks' => array('lhs_module' => 'PContacts', 'lhs_table' => 'contacts', 'lhs_key' => 'id', 'rhs_module' => 'Tasks', 'rhs_table' => 'tasks', 'rhs_key' => 'pcontact_id', 'relationship_type' => 'one-to-many') ,'pcontacts_assigned_user' => array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id', 'rhs_module' => 'PContacts', 'rhs_table' => 'pcontacts', 'rhs_key' => 'assigned_user_id', 'relationship_type' => 'one-to-many') ,'pcontacts_modified_user' => array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id', 'rhs_module' => 'PContacts', 'rhs_table' => 'pcontacts', 'rhs_key' => 'modified_user_id', 'relationship_type' => 'one-to-many') ,'pcontacts_created_by' => array('lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id', 'rhs_module' => 'PContacts', 'rhs_table' => 'pcontacts', 'rhs_key' => 'created_by', 'relationship_type' => 'one-to-many'), 'pcontact_campaign_log' => array( 'lhs_module' => 'PContacts', 'lhs_table' => 'pcontacts', 'lhs_key' => 'id', 'rhs_module' => 'CampaignLog', 'rhs_table' => 'campaign_log', 'rhs_key' => 'target_id', 'relationship_type' =>'one-to-many' ), ), //This enables optimistic locking for Saves From EditView 'optimistic_locking'=>true, ); require_once('include/SugarObjects/VardefManager.php'); VardefManager::createVardef('PContacts','Contact', array('default', 'assignable', 'person')); ?>