You are here

pm.install in Drupal PM (Project Management) 7.2

Same filename and directory in other branches
  1. 8 pm.install
  2. 7.3 pm.install
  3. 7 pm.install

Install, update and uninstall functions for the Project Management module.

File

pm.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Project Management module.
 */

/**
 * Implements hook_update_last_removed().
 */
function pm_update_last_removed() {
  return 6202;
}

/**
 * Enable new module dependencies and create billing status field.
 */
function pm_update_7101() {
}

/**
 * Make date field available to PM content types.
 */
function pm_update_7102() {
  variable_del('pm_yearsrangebegin');
  variable_del('pm_yearsrangeend');
}

/**
 * Migration from 7.x-1.x to 7.x-2.x.
 */
function pm_update_7103(&$sandbox) {
  $module_list = array(
    'pmpermission',
  );

  // Enable new dependencies.
  if (!module_enable($module_list, TRUE)) {
    throw new DrupalUpdateException('This version requires one or more modules that could not be enabled.');
  }
}

/**
 * Removal of legacy attribute table.
 */
function pm_update_7104() {
  db_drop_table('pmattribute');
}

/**
 * Removal of legacy variable.
 */
function pm_update_7105() {
  variable_del('pm_organization_nid');
}

/**
 * Removal of legacy variable related to icons.
 */
function pm_update_7108() {
  variable_del('pm_icons_path');
}

/**
 * Migrate pm_icons_display settings to new pm_icon variable.
 */
function pm_update_7200() {
  $display_icon = variable_get('pm_icons_display', TRUE);
  if ($display_icon) {
    variable_set('pm_icon', PM_ICON_SET_DEFAULT_BEHAVIOUR);
  }
  else {
    variable_set('pm_icon', PM_ICON_SET_NO_ICON);
  }
  variable_del('pm_icons_display');
}

/**
 * Remove legacy variables related to taxation.
 */
function pm_update_7201() {
  variable_del('pm_tax1_app');
  variable_del('pm_tax1_name');
  variable_del('pm_tax1_percent');
  variable_del('pm_tax2_app');
  variable_del('pm_tax2_name');
  variable_del('pm_tax2_percent');
}

Functions

Namesort descending Description
pm_update_7101 Enable new module dependencies and create billing status field.
pm_update_7102 Make date field available to PM content types.
pm_update_7103 Migration from 7.x-1.x to 7.x-2.x.
pm_update_7104 Removal of legacy attribute table.
pm_update_7105 Removal of legacy variable.
pm_update_7108 Removal of legacy variable related to icons.
pm_update_7200 Migrate pm_icons_display settings to new pm_icon variable.
pm_update_7201 Remove legacy variables related to taxation.
pm_update_last_removed Implements hook_update_last_removed().