View source
<?php
function pmperson_install() {
variable_set('node_options_pmperson', array(
'status',
));
variable_set('node_permissions_pmperson', 0);
node_types_rebuild();
$types = node_type_get_types();
node_add_body_field($types['pmperson'], 'Description');
}
function pmperson_enable() {
node_access_needs_rebuild(TRUE);
}
function pmperson_disable() {
node_access_needs_rebuild(TRUE);
drupal_set_message(t('Nodes of type "Person" have not been deleted on disabling Project Management Person. Please note that they will now have reduced functionality, and will not be protected by Project Management Person access controls.'), 'warning');
}
function pmperson_uninstall() {
drupal_uninstall_schema('pmperson');
}
function pmperson_schema() {
$schema['pmperson'] = array(
'fields' => array(
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'organization_nid' => array(
'type' => 'int',
),
'organization_title' => array(
'type' => 'varchar',
'length' => 150,
),
'prefix' => array(
'type' => 'varchar',
'length' => 100,
),
'email' => array(
'type' => 'varchar',
'length' => 50,
),
'www' => array(
'type' => 'varchar',
'length' => 100,
),
'phone' => array(
'type' => 'varchar',
'length' => 100,
),
'im' => array(
'type' => 'varchar',
'length' => 100,
),
'user_uid' => array(
'type' => 'int',
),
),
'primary key' => array(
'vid',
),
'indexes' => array(
'nid' => array(
'nid',
),
'organization_nid' => array(
'organization_nid',
),
'user_uid' => array(
'user_uid',
),
),
);
return $schema;
}
function pmperson_update_last_removed() {
return 6201;
}
function pmperson_update_7100() {
node_types_rebuild();
$types = node_type_get_types();
node_add_body_field($types['pmperson'], 'Description');
return 'Added D7 style body field to pm person nodes';
}
function pmperson_update_7101() {
db_drop_field('pmperson', 'fullname');
}
function pmperson_update_7102() {
variable_set('node_permissions_pmperson', 0);
return 'PM Person permissions overridden';
}
function pmperson_update_7103() {
node_access_needs_rebuild(TRUE);
}