'calls', 'comment' => 'A Call is an activity representing a phone call', 'unified_search' => true,'fields' => array ( 'name' => array ( 'name' => 'name', 'vname' => 'LBL_SUBJECT', 'dbType' => 'varchar', 'type' => 'name', 'len' => '50', 'comment' => 'Brief description of the call', 'unified_search' => true, 'importable' => 'required', 'required' => true, ), 'who' => array ( 'name' => 'who', 'vname' => 'LBL_WHO', 'dbType' => 'varchar', 'type' => 'name', 'len' => '50', 'comment' => 'Brief description of the call', 'unified_search' => true, 'importable' => 'required', 'required' => true, ), 'number' => array ( 'name' => 'number', 'vname' => 'LBL_NUMBER', 'dbType' => 'varchar', 'type' => 'name', 'len' => '50', 'comment' => 'Brief description of the call', 'unified_search' => true, 'importable' => 'required', 'required' => true, ), 'duration_hours' => array ( 'name' => 'duration_hours', 'vname' => 'LBL_DURATION_HOURS', 'type' => 'int', 'len' => '2', 'comment' => 'Call duration, hours portion' ), 'duration_minutes' => array ( 'name' => 'duration_minutes', 'vname' => 'LBL_DURATION_MINUTES', 'type' => 'int', 'function' => array('name'=>'getDurationMinutesOptions', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'), 'len' => '2', 'group'=>'duration_hours', 'comment' => 'Call duration, minutes portion' ), 'description' => array ( 'type' => 'text', 'name' => 'description', 'vname' => 'LBL_DESCRIPTION', 'comment' => 'Description', 'unified_search' => true, //'required' => true, ), 'date_start' => array ( 'name' => 'date_start', 'vname' => 'LBL_DATE', 'type' => 'datetime', 'comment' => 'Date in which call is schedule to (or did) start', 'importable' => 'required', ), 'date_end' => array ( 'name' => 'date_end', 'vname' => 'LBL_DATE_END', 'type' => 'date', 'massupdate'=>false, 'comment' => 'Date is which call is scheduled to (or did) end' ), 'parent_name' => array ( 'name' => 'parent_name', 'id_name' => 'parent_id', 'vname' => 'LBL_PARENT_NAME', 'type' => 'relate', 'group' => 'parent_name', 'dbtype' => 'varchar', 'len' => '255', 'module' => 'Accounts', 'massupdate' => false, 'required' => false ), 'parent_id' => array ( 'name' => 'parent_id', 'type' => 'id', 'module' => 'Accounts', 'vname' => 'LBL_PARENT_ID', 'group' => 'parent_name', 'massupdate' => false, 'reportable' => false, 'required' => false ), 'status' => array ( 'name' => 'status', 'vname' => 'LBL_STATUS', 'type' => 'enum', 'len' => '25', 'options' => 'activity_status_dom', 'comment' => 'The status of the call (Held, Not Held, etc.)' ), 'date_reminder_flag' => array ( 'name' => 'date_reminder_flag', 'vname' => 'LBL_DATE_REMINDER', 'type' => 'bool', 'group' => 'date_reminder', 'default' => 1 ), 'date_reminder' => array ( 'name' => 'date_reminder', 'vname' => 'LBL_DATE_REMINDER', 'type' => 'datetime', 'group' => 'date_reminder' ), 'date_reminder_field' => array ( 'group' => 'date_reminder', 'name' => 'date_reminder_field', 'vname' => 'LBL_DUE_DATE_AND_TIME', 'type' => 'datetimecombo', 'date' => 'date_reminder', 'time' => 'time_start', 'date_readonly' => 'date_reminder_readonly', 'time_readonly' => 'time_start_readonly', 'noneCheckbox' => true, 'noneCheckboxJavascript' => 'onClick="set_date_reminder_values(this.form);"', 'checkboxId' => 'date_reminder_flag', 'checked' => 'date_reminder_checked', 'meridian' => 'date_reminder_meridian', 'showFormats' => true, 'source' => 'non-db', 'comment' => 'Used for meta-data framework' ), 'notification_send' => array ( 'name' => 'notification_send', 'vname' => 'ZaƂatwione', 'type' => 'bool', ), 'reminder_type' => array ( 'name' => 'reminder_type', 'vname' => 'LBL_REMINDER_TYPE', 'type' => 'enum', 'default'=>'2', #'options' => 'reminder_type_dom', 'len' => 25 ), 'remider_interval' => array ( 'name' => 'remider_interval', 'vname' => 'LBL_REMINDER_TYPE', 'type' => 'enum', 'default'=>'24', #'options' => 'reminder_type_dom', 'len' => 25 ), 'remider_interval_type' => array ( 'name' => 'remider_interval_type', 'vname' => 'LBL_REMINDER_TYPE', 'type' => 'enum', 'default'=>'h', #'options' => 'reminder_type_dom', 'len' => 25 ), 'direction' => array ( 'name' => 'direction', 'vname' => 'LBL_DIRECTION', 'type' => 'enum', 'len' => '25', 'default'=>'Outbound', 'options' => 'call_direction_dom', 'comment' => 'Indicates whether call is inbound or outbound', 'noeditable'=>true ), 'reminder_checked'=>array( 'name' => 'reminder_checked', 'vname' => 'LBL_REMINDER', 'type' => 'bool', 'source' => 'non-db', 'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)', 'massupdate'=>false, ), 'reminder_time'=>array ( 'name' => 'reminder_time', 'vname' => 'LBL_REMINDER_TIME', 'type' => 'int', 'function' => array('name'=>'getReminderTime', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'), 'required' => false, 'reportable' => false, 'default' => -1, 'len' => '4', 'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start' ), 'outlook_id' => array ( 'name' => 'outlook_id', 'vname' => 'LBL_OUTLOOK_ID', 'type' => 'varchar', 'len' => '255', 'reportable' => false, 'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID' ), 'accept_status' => array ( 'name' => 'accept_status', 'vname' => 'LBL_SUBJECT', 'dbType' => 'varchar', 'type' => 'varchar', 'len' => '20', 'source'=>'non-db', ), 'contact_id' => array ( 'name' => 'contact_id', 'type' => 'id', 'module' => 'Contacts', 'vname' => 'LBL_CONTACT_ID', 'group' => 'contact_name', 'massupdate' => false, 'reportable' => false, 'required' => false ), 'contact_name' => array ( 'name' => 'contact_name', 'rname' => 'last_name', 'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'), 'id_name' => 'contact_id', 'massupdate' => false, 'vname' => 'Kto', 'type' => 'relate', 'link'=>'contacts', 'table' => 'contacts', 'isnull' => 'true', 'module' => 'Contacts', 'join_name' => 'contacts', 'dbType' => 'varchar', 'len' => 36, 'importable' => 'false', ), 'account' => array ( 'name' => 'account', 'type' => 'link', 'relationship' => 'account_calls', 'link_type'=>'one', 'source'=>'non-db', 'vname'=>'LBL_OLD_ACCOUNT_LINK', ), 'opportunity' => array ( 'name' => 'opportunity', 'type' => 'link', 'relationship' => 'opportunity_calls', 'source'=>'non-db', 'link_type'=>'one', 'vname'=>'LBL_OPPORTUNITY', ), 'leads' => array ( 'name' => 'leads', 'type' => 'link', 'relationship' => 'calls_leads', 'source'=>'non-db', 'vname'=>'LBL_LEADS', ), 'case' => array ( 'name' => 'case', 'type' => 'link', 'relationship' => 'case_calls', 'source'=>'non-db', 'link_type'=>'one', 'vname'=>'LBL_CASE', ), 'accounts' => array ( 'name' => 'accounts', 'type' => 'link', 'relationship' => 'account_calls', 'module'=>'Accounts', 'bean_name'=>'Account', 'source'=>'non-db', 'vname'=>'LBL_ACCOUNT', ), 'contacts' => array ( 'name' => 'contacts', 'type' => 'link', 'relationship' => 'calls_contacts', 'source'=>'non-db', 'vname'=>'LBL_CONTACTS', ), 'users' => array ( 'name' => 'users', 'type' => 'link', 'relationship' => 'calls_users', 'source'=>'non-db', 'vname'=>'LBL_USERS', ), 'notes' => array ( 'name' => 'notes', 'type' => 'link', 'relationship' => 'calls_notes', 'module'=>'Notes', 'bean_name'=>'Note', 'source'=>'non-db', 'vname'=>'LBL_NOTES', ), 'created_by_link' => array ( 'name' => 'created_by_link', 'type' => 'link', 'relationship' => 'calls_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' => 'calls_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' => 'calls_assigned_user', 'vname' => 'LBL_ASSIGNED_TO_USER', 'link_type' => 'one', 'module'=>'Users', 'bean_name'=>'User', 'source'=>'non-db', ), ), 'indices' => array ( array( 'name' => 'idx_call_name', 'type' => 'index', 'fields'=> array('name'), ), array( 'name' => 'idx_status', 'type' => 'index', 'fields'=> array('status'), ), array( 'name' => 'idx_calls_date_start', 'type' => 'index', 'fields' => array('date_start'), ), ), 'relationships' => array ( 'calls_assigned_user' => array( 'lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id', 'rhs_module' => 'Calls', 'rhs_table' => 'calls', 'rhs_key' => 'assigned_user_id', 'relationship_type' => 'one-to-many' ), 'calls_modified_user' => array( 'lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id', 'rhs_module' => 'Calls', 'rhs_table' => 'calls', 'rhs_key' => 'modified_user_id', 'relationship_type' => 'one-to-many' ), 'calls_created_by' => array( 'lhs_module' => 'Users', 'lhs_table' => 'users', 'lhs_key' => 'id', 'rhs_module' => 'Calls', 'rhs_table' => 'calls', 'rhs_key' => 'created_by', 'relationship_type' => 'one-to-many' ), 'calls_notes' => array( 'lhs_module' => 'Calls', 'lhs_table' => 'calls', 'lhs_key' => 'id', 'rhs_module' => 'Notes', 'rhs_table' => 'notes', 'rhs_key' => 'parent_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('Calls','Call', array('default', 'assignable', )); ?>