function pmexpense_default_field_instances in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmexpense/includes/pmexpense.field_instance.inc \pmexpense_default_field_instances()
- 7.2 pmexpense/includes/pmexpense.field_instance.inc \pmexpense_default_field_instances()
Field instance definitions for PM Expense.
2 calls to pmexpense_default_field_instances()
- pmexpense_migrate_create_fields in pmexpense/
includes/ pmexpense.migrate.inc - Creates and attaches fields to Drupal user.
- pmexpense_update_7300 in pmexpense/
pmexpense.install - Add entityreference_prepopulate behaviour to pmexpense_parent.
File
- pmexpense/
includes/ pmexpense.field_instance.inc, line 10 - Field instance definitions for the PM Expense module.
Code
function pmexpense_default_field_instances() {
$field_instances = array();
// Exported field_instance: 'node-pmexpense-pm_amount'
$field_instances['node-pmexpense-pm_amount'] = array(
'bundle' => 'pmexpense',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'number',
'settings' => array(
'decimal_separator' => '.',
'prefix_suffix' => TRUE,
'scale' => 2,
'thousand_separator' => ' ',
),
'type' => 'number_decimal',
'weight' => 5,
),
'teaser' => array(
'label' => 'inline',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'pm_amount',
'label' => 'Amount',
'required' => 0,
'settings' => array(
'max' => '',
'min' => '',
'prefix' => '',
'suffix' => '',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'number',
'settings' => array(),
'type' => 'number',
'weight' => 6,
),
);
// Exported field_instance: 'node-pmexpense-pm_provider'
$field_instances['node-pmexpense-pm_provider'] = array(
'bundle' => 'pmexpense',
'default_value' => NULL,
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
),
'type' => 'entityreference_label',
'weight' => 3,
),
'teaser' => array(
'label' => 'inline',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'pm_provider',
'label' => 'Provider',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 3,
),
);
// Exported field_instance: 'node-pmexpense-pmexpense_parent'.
$field_instances['node-pmexpense-pmexpense_parent'] = array(
'bundle' => 'pmexpense',
'default_value' => NULL,
'default_value_function' => 'entityreference_prepopulate_field_default_value',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'entityreference',
'settings' => array(
'link' => FALSE,
),
'type' => 'entityreference_label',
'weight' => 2,
),
'teaser' => array(
'label' => 'inline',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'pmexpense_parent',
'label' => 'Organization/Project/Task',
'required' => 0,
'settings' => array(
'behaviors' => array(
'prepopulate' => array(
'action' => 'disable',
'action_on_edit' => 0,
'fallback' => 'none',
'providers' => array(
'og_context' => FALSE,
'url' => 1,
),
'skip_perm' => 0,
'status' => 1,
),
),
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'entityreference',
'settings' => array(
'match_operator' => 'CONTAINS',
'path' => '',
'size' => 60,
),
'type' => 'entityreference_autocomplete',
'weight' => 1,
),
);
// Exported field_instance: 'node-pmexpense-pm_billing_status'
$field_instances['node-pmexpense-pm_billing_status'] = array(
'bundle' => 'pmexpense',
'default_value' => array(
0 => array(
'value' => 'Not billable',
),
),
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'list',
'settings' => array(),
'type' => 'list_default',
'weight' => 1,
),
'teaser' => array(
'label' => 'inline',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'pm_billing_status',
'label' => 'Billing status',
'required' => 1,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'options',
'settings' => array(),
'type' => 'options_select',
'weight' => 5,
),
);
// Exported field_instance: 'node-pmexpense-pmexpense_date'
$field_instances['node-pmexpense-pmexpense_date'] = array(
'bundle' => 'pmexpense',
'deleted' => 0,
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'date',
'settings' => array(
'format_type' => 'long',
'fromto' => 'both',
'multiple_from' => '',
'multiple_number' => '',
'multiple_to' => '',
),
'type' => 'date_default',
'weight' => 0,
),
'teaser' => array(
'label' => 'inline',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'pmexpense_date',
'label' => 'Expense Date',
'required' => 1,
'settings' => array(
'default_value' => 'now',
'default_value2' => 'same',
'default_value_code' => '',
'default_value_code2' => '',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'date',
'settings' => array(
'increment' => 15,
'input_format' => 'm/d/Y - H:i:s',
'input_format_custom' => '',
'label_position' => 'above',
'text_parts' => array(),
'year_range' => '-3:+3',
),
'type' => 'date_text',
'weight' => 2,
),
);
// Translatables
// Included for use with string extractors like potx.
t('Amount');
t('Billing status');
t('Expense Date');
t('Organization/Project/Task');
t('Provider');
return $field_instances;
}