99 |
rodolico |
1 |
<?php
|
103 |
rodolico |
2 |
|
|
|
3 |
global $DATABASE_DEFINITION;
|
|
|
4 |
include_once( '../../includes/database.php' );
|
|
|
5 |
|
101 |
rodolico |
6 |
/* attributes that can be applied to a device */
|
103 |
rodolico |
7 |
$DATABASE_DEFINITION['attrib'] = array(
|
99 |
rodolico |
8 |
'table name' => 'attrib',
|
|
|
9 |
'key field' => 'attrib_id',
|
103 |
rodolico |
10 |
'display columns' => array('name','multiples','attrib_id','added_date','keyname','attrib_category_id','removed_date'),
|
|
|
11 |
'display query' => 'select name,multiples,attrib_id,added_date,keyname,attrib_category_id,removed_date from attrib',
|
99 |
rodolico |
12 |
'field info' => array(
|
103 |
rodolico |
13 |
/* the visible displayed name */
|
|
|
14 |
'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
|
|
|
15 |
/* set to true if ultiple entries are allowed */
|
|
|
16 |
'multiples' => array('display name' => 'multiples' , 'type' => 'string' , 'width' => 1),
|
|
|
17 |
'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
|
99 |
rodolico |
18 |
/* date record was added */
|
101 |
rodolico |
19 |
'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
|
|
|
20 |
/* used for sysinfo really needs to be separate table */
|
|
|
21 |
'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
|
103 |
rodolico |
22 |
'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
|
101 |
rodolico |
23 |
/* date record was deleted or supserceded */
|
103 |
rodolico |
24 |
'removed_date' => array('display name' => 'removed_date' , 'type' => 'date')
|
99 |
rodolico |
25 |
)
|
103 |
rodolico |
26 |
);
|
101 |
rodolico |
27 |
/* just allows us to categorize attributes */
|
103 |
rodolico |
28 |
$DATABASE_DEFINITION['attrib_category'] = array(
|
101 |
rodolico |
29 |
'table name' => 'attrib_category',
|
|
|
30 |
'key field' => 'attrib_category_id',
|
|
|
31 |
'display columns' => array('attrib_category_id','added_date','name'),
|
|
|
32 |
'display query' => 'select attrib_category_id,added_date,name from attrib_category',
|
|
|
33 |
'field info' => array(
|
|
|
34 |
'attrib_category_id' => array('display name' => 'attrib_category_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
|
|
35 |
/* When this category was added */
|
|
|
36 |
'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
|
|
|
37 |
'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64)
|
|
|
38 |
)
|
103 |
rodolico |
39 |
);
|
101 |
rodolico |
40 |
/* links devices and their attributes together */
|
103 |
rodolico |
41 |
$DATABASE_DEFINITION['attrib_device'] = array(
|
99 |
rodolico |
42 |
'table name' => 'attrib_device',
|
|
|
43 |
'key field' => 'attrib_device_id',
|
103 |
rodolico |
44 |
'display name' => 'Device Attributes',
|
|
|
45 |
'display columns' => array('attrib_device_id','device_id','attrib_id','value','added_date','removed_date'),
|
|
|
46 |
'display query' => 'select attrib_device_id,attrib_id,value,device_id,added_date,removed_date from attrib_device',
|
99 |
rodolico |
47 |
'field info' => array(
|
103 |
rodolico |
48 |
'attrib_device_id' => array('display name' => 'attrib_device_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
|
|
49 |
'device_id' => array('display name' => 'Device' , 'type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
|
|
|
50 |
'attrib_id' => array('display name' => 'Attribute' , 'type' => 'lookup', 'table' => 'attrib', 'keyfield' => 'attrib_id', 'display_field' => 'name'),
|
101 |
rodolico |
51 |
/* The actual value of this attribute. */
|
|
|
52 |
'value' => array('display name' => 'value' , 'type' => 'text'),
|
103 |
rodolico |
53 |
/* date record was added */
|
|
|
54 |
'added_date' => array('display name' => 'Added' , 'required' => true , 'type' => 'date'),
|
|
|
55 |
'removed_date' => array('display name' => 'Removed Date' , 'type' => 'date')
|
99 |
rodolico |
56 |
)
|
103 |
rodolico |
57 |
);
|
99 |
rodolico |
58 |
?>
|