1 |
rodolico |
1 |
<?php
|
|
|
2 |
global $DATABASE_DEFINITION;
|
|
|
3 |
$DATABASE_DEFINITION['maintenance_schedule'] = array(
|
|
|
4 |
'display name' => 'Maintenance Schedule',
|
|
|
5 |
'table name' => 'maintenance_schedule',
|
|
|
6 |
'key field' => 'maintenance_schedule_id',
|
|
|
7 |
'display columns' => array('Device','Task', 'Schedule'),
|
|
|
8 |
'display query' => 'select device.name Device, maintenance_task.description Task, schedule Schedule from maintenance_schedule join device using (device_id) join maintenance_task using (maintenance_task_id) order by device.name, maintenance_task.description',
|
|
|
9 |
'field info' => array(
|
|
|
10 |
'maintenance_schedule_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
|
52 |
rodolico |
11 |
'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name', 'display name' => 'Device'),
|
|
|
12 |
'maintenance_task_id' => array('type' => 'lookup', 'table' => 'maintenance_task', 'keyfield' => 'maintenance_task_id', 'display_field' => 'description', 'display name' => 'Maintenance Task'),
|
|
|
13 |
'schedule' => array('keyfield' => true , 'required' => true , 'type' => 'int' , 'width' => 10, 'display name' => 'Schedule (days)'),
|
|
|
14 |
'login_id' => array('type' => 'lookup', 'table' => 'login', 'keyfield' => 'login_id', 'display_field' => 'email', 'display name' => 'Technician'),
|
1 |
rodolico |
15 |
/* The number of days between performance of this task */
|
52 |
rodolico |
16 |
'added_date' => array('type' => 'datetime', 'required' => true, 'display name' => 'Date Added'),
|
|
|
17 |
'removed_date' => array('type' => 'datetime', 'required' => false, 'display name' => 'Date Removed' )
|
1 |
rodolico |
18 |
)
|
|
|
19 |
);
|
|
|
20 |
$DATABASE_DEFINITION['maintenance_performed'] = array(
|
|
|
21 |
'table name' => 'maintenance_performed',
|
|
|
22 |
'display name' => 'Maintenance Performed',
|
|
|
23 |
'key field' => 'maintenance_performed_id',
|
|
|
24 |
'display columns' => array('Performed','Device','Task'),
|
|
|
25 |
'display query' => 'select device.name Device, maintenance_task.description Task, maintenance_date Performed from maintenance_performed join device using (device_id) join maintenance_task using (maintenance_task_id)',
|
|
|
26 |
'field info' => array(
|
|
|
27 |
/* Date and Time maintenance was performed */
|
|
|
28 |
'maintenance_date' => array('required' => true , 'type' => 'datetime'),
|
|
|
29 |
'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
|
|
|
30 |
'maintenance_performed_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
|
|
|
31 |
/* Any comments/notes the maintainer wants to put in */
|
|
|
32 |
'notes' => array('type' => 'text'),
|
|
|
33 |
/* login id of the person performing the maintenance */
|
|
|
34 |
'login_id' => array('required' => true , 'type' => 'int' , 'width' => 10),
|
|
|
35 |
'maintenance_task_id' => array('type' => 'lookup', 'table' => 'maintenance_task', 'keyfield' => 'maintenance_task_id', 'display_field' => 'name')
|
|
|
36 |
)
|
|
|
37 |
);
|
|
|
38 |
$DATABASE_DEFINITION['maintenance_task'] = array(
|
|
|
39 |
'display name' => 'Maintenance Tasks',
|
|
|
40 |
'table name' => 'maintenance_task',
|
|
|
41 |
'key field' => 'maintenance_task_id',
|
|
|
42 |
'display columns' => array('Days','Description'),
|
|
|
43 |
'display query' => 'select maintenance_task_id,default_period Days,description Description from maintenance_task',
|
|
|
44 |
'field info' => array(
|
|
|
45 |
'removed_date' => array('type' => 'datetime', 'required' => false ),
|
|
|
46 |
/* The default number of days between maintenance */
|
|
|
47 |
'default_period' => array('type' => 'int' , 'width' => 11),
|
|
|
48 |
/* Detailed instructions on completing task */
|
|
|
49 |
'notes' => array('type' => 'text'),
|
|
|
50 |
'added_date' => array('type' => 'datetime'),
|
|
|
51 |
'maintenance_task_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
|
|
|
52 |
/* A description of the task */
|
|
|
53 |
'description' => array('type' => 'string' , 'width' => 64)
|
|
|
54 |
)
|
49 |
rodolico |
55 |
);
|
1 |
rodolico |
56 |
?>
|