Subversion Repositories computer_asset_manager_v1

Rev

Rev 49 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php
global $DATABASE_DEFINITION;
   $DATABASE_DEFINITION['maintenance_schedule'] = array(
      'display name' => 'Maintenance Schedule',
      'table name' => 'maintenance_schedule',
      'key field' => 'maintenance_schedule_id',
      'display columns' => array('Device','Task', 'Schedule'),
      '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',
      'field info' => array(
         'maintenance_schedule_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name', 'display name' => 'Device'),
         'maintenance_task_id' => array('type' => 'lookup', 'table' => 'maintenance_task', 'keyfield' => 'maintenance_task_id', 'display_field' => 'description', 'display name' => 'Maintenance Task'),
         'schedule' => array('keyfield' => true , 'required' => true , 'type' => 'int' , 'width' => 10, 'display name' => 'Schedule (days)'),
         'login_id' => array('type' => 'lookup', 'table' => 'login', 'keyfield' => 'login_id', 'display_field' => 'email', 'display name' => 'Technician'),
         /* The number of days between performance of this task */
         'added_date' => array('type' => 'datetime', 'required' => true, 'display name' => 'Date Added'),
         'removed_date' => array('type' => 'datetime', 'required' => false, 'display name' => 'Date Removed' )
      )
   );
   $DATABASE_DEFINITION['maintenance_performed'] = array(
      'table name' => 'maintenance_performed',
      'display name' => 'Maintenance Performed',
      'key field' => 'maintenance_performed_id',
      'display columns' => array('Performed','Device','Task'),
      '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)',
      'field info' => array(
         /* Date and Time maintenance was performed */
         'maintenance_date' => array('required' => true , 'type' => 'datetime'),
         'device_id' => array('type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
         'maintenance_performed_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
         /* Any comments/notes the maintainer wants to put in */
         'notes' => array('type' => 'text'),
         /* login id of the person performing the maintenance */
         'login_id' => array('required' => true , 'type' => 'int' , 'width' => 10),
         'maintenance_task_id' => array('type' => 'lookup', 'table' => 'maintenance_task', 'keyfield' => 'maintenance_task_id', 'display_field' => 'name')
      )
   );
   $DATABASE_DEFINITION['maintenance_task'] = array(
      'display name' => 'Maintenance Tasks',
      'table name' => 'maintenance_task',
      'key field' => 'maintenance_task_id',
      'display columns' => array('Days','Description'),
      'display query' => 'select maintenance_task_id,default_period Days,description Description from maintenance_task',
      'field info' => array(
         'removed_date' => array('type' => 'datetime', 'required' => false ),
         /* The default number of days between maintenance */
         'default_period' => array('type' => 'int' , 'width' => 11),
         /* Detailed instructions on completing task */
         'notes' => array('type' => 'text'),
         'added_date' => array('type' => 'datetime'),
         'maintenance_task_id' => array('keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
         /* A description of the task */
         'description' => array('type' => 'string' , 'width' => 64)
      )
   );
?>