| 1 |
<?php
|
| 2 |
// $Id: project_forecast.install,v 1.2 2008/07/17 18:42:14 jpetso Exp $
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Project Forecast - Estimate completion dates for your project's tasks.
|
| 6 |
*
|
| 7 |
* Copyright 2008 by Jakob Petsovits ("jpetso", http://drupal.org/user/56020)
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_schema().
|
| 12 |
*/
|
| 13 |
function project_forecast_schema() {
|
| 14 |
$schema['project_forecast_tasks'] = array(
|
| 15 |
'description' => t('The table that contains estimated completion dates for all tasks that were found in the "open tasks" view for all users in the "users with assigned tasks" view.'),
|
| 16 |
'fields' => array(
|
| 17 |
'nid' => array(
|
| 18 |
'description' => t('The {node}.nid node identifier of this task.'),
|
| 19 |
'type' => 'int',
|
| 20 |
'unsigned' => TRUE,
|
| 21 |
'not null' => TRUE,
|
| 22 |
'default' => 0,
|
| 23 |
),
|
| 24 |
'uid' => array(
|
| 25 |
'description' => t('The {user}.uid user identifier for the user who is working on this task.'),
|
| 26 |
'type' => 'int',
|
| 27 |
'unsigned' => TRUE,
|
| 28 |
'not null' => TRUE,
|
| 29 |
'default' => 0,
|
| 30 |
),
|
| 31 |
'unit' => array(
|
| 32 |
'description' => t('The start of the time unit (i.e. calendar week) when the task is estimated to be completed by the user. 0 if no estimated completion date could be calculated.'),
|
| 33 |
'type' => 'int',
|
| 34 |
'unsigned' => TRUE,
|
| 35 |
'not null' => TRUE,
|
| 36 |
'default' => 0,
|
| 37 |
),
|
| 38 |
'completed' => array(
|
| 39 |
'description' => t('Tells whether an estimated completion date could be calculated for this task (which is the case as long as the user plans the time budget long enough in advance). 1 if the date could be calculated, or 0 if not.'),
|
| 40 |
'type' => 'int',
|
| 41 |
'size' => 'tiny',
|
| 42 |
'unsigned' => TRUE,
|
| 43 |
'not null' => TRUE,
|
| 44 |
'default' => 0,
|
| 45 |
),
|
| 46 |
),
|
| 47 |
'primary key' => array('nid'),
|
| 48 |
);
|
| 49 |
return $schema;
|
| 50 |
}
|
| 51 |
|
| 52 |
/**
|
| 53 |
* Update to Project Forecast 6.x-1.0:
|
| 54 |
* Rebuild the menu cache, as the "Task filters" tab is no more.
|
| 55 |
*/
|
| 56 |
function project_forecast_update_6100() {
|
| 57 |
$ret = array();
|
| 58 |
menu_rebuild();
|
| 59 |
$ret[] = array(
|
| 60 |
'query' => 'Rebuilt the menu cache.',
|
| 61 |
'success' => TRUE,
|
| 62 |
);
|
| 63 |
return $ret;
|
| 64 |
}
|
| 65 |
|
| 66 |
/**
|
| 67 |
* Implementation of hook_install().
|
| 68 |
*/
|
| 69 |
function project_forecast_install() {
|
| 70 |
drupal_install_schema('project_forecast');
|
| 71 |
}
|
| 72 |
|
| 73 |
/**
|
| 74 |
* Implementation of hook_uninstall().
|
| 75 |
*/
|
| 76 |
function project_forecast_uninstall() {
|
| 77 |
drupal_uninstall_schema('project_forecast');
|
| 78 |
|
| 79 |
$variables = array(
|
| 80 |
'project_forecast_tasks_view',
|
| 81 |
'project_forecast_tasks_view_args',
|
| 82 |
'project_forecast_task_filters_open',
|
| 83 |
'project_forecast_timeneed_provider',
|
| 84 |
'project_forecast_project_nid_provider',
|
| 85 |
'project_forecast_assigned_uid_provider',
|
| 86 |
'project_forecast_update_on_cron',
|
| 87 |
);
|
| 88 |
foreach ($variables as $variable) {
|
| 89 |
variable_del($variable);
|
| 90 |
}
|
| 91 |
}
|