Subversion Repositories computer_asset_manager_v1

Rev

Rev 1 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
11
         'removed_date' => array('type' => 'datetime', 'required' => false ),
12
         'maintenance_schedule_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
13
         'added_date' => array('type' => 'datetime', 'required' => true),
14
         'login_id' => array('type' => 'lookup', 'table' => 'login', 'keyfield' => 'login_id', 'display_field' => 'email'),
15
         'maintenance_task_id' => array('type' => 'lookup', 'table' => 'maintenance_task', 'keyfield' => 'maintenance_task_id', 'display_field' => 'description'),
16
         /* The number of days between performance of this task */
17
         'schedule' => array('keyfield' => true , 'required' => true , 'type' => 'int' , 'width' => 10)
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
?>