You are here

function pm_install in Drupal PM (Project Management) 7

Implements hook_install().

File

./pm.install, line 10
Install, update and uninstall functions for the Project Management module.

Code

function pm_install() {
  variable_set('pm_icons_path', drupal_get_path('module', 'pm') . '/icons');
  variable_set('pm_organization_nid', 0);

  // Set up billing status field.
  field_create_field(array(
    'field_name' => 'pm_billing_status',
    'type' => 'list_text',
    'settings' => array(
      'allowed_values' => array(
        'Not billable' => 'Not billable',
        'Billable' => 'Billable',
        'Billed' => 'Billed',
      ),
    ),
  ));

  // Set up date field.
  field_create_field(array(
    'type' => 'datetime',
    'field_name' => 'pm_date',
    'settings' => array(
      'granularity' => array(
        'year' => 'year',
        'month' => 'month',
        'day' => 'day',
        'hour' => 'hour',
        'minute' => 'minute',
        'second' => 0,
      ),
      'tz_handling' => 'none',
      'timezone_db' => '',
      'todate' => 'optional',
    ),
    'cardinality' => '1',
  ));
}