Subversion Repositories computer_asset_manager_v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
53 rodolico 1
<?php
2
   require_once( 'camp.class.php' );
3
 
4
   class Device extends Camp {
5
      protected static $dbStructure = array(
6
         'table' => array(
7
            'tableName' => 'device',
8
            'primaryKey' => 'device_id',
9
            'selectionDisplay' => 'name',
10
            'fields' => array(
56 rodolico 11
                  'id' => array (
12
                     'fieldname' => 'device_id',
53 rodolico 13
                     'displayName' => 'ID',
14
                     'type' => 'int unsigned',
15
                     'nullable' => false
16
                  ),
17
                  'name' => array (
56 rodolico 18
                     'fieldname' => 'name',
19
                     'displayName' => 'Name',
53 rodolico 20
                     'type' => 'varchar',
21
                     'size' => 64,
22
                     'list' => true
23
                  ),
24
                  'uuid' => array (
56 rodolico 25
                     'fieldname' => 'uuid',
53 rodolico 26
                     'displayName' => 'UUID',
27
                     'type' => 'varchar',
28
                     'size' => 36,
29
                     'list' => false
30
                  ),
31
                  'serial' => array (
56 rodolico 32
                     'fieldname' => 'serial',
33
                     'displayName' => 'Serial',
53 rodolico 34
                     'type' => 'varchar',
35
                     'size' => 36,
36
                     'list' => false
37
                  ),
38
                  'created' => array (
56 rodolico 39
                     'fieldname' => 'created',
53 rodolico 40
                     'displayName' => 'Created',
41
                     'type' => 'date'
42
                  ),
43
                  'removed' => array(
56 rodolico 44
                     'fieldname' => 'removed',
53 rodolico 45
                     'displayName' => 'Removed',
46
                     'type' => 'date'
59 rodolico 47
                  ),
48
                  'device_types' => array(
49
                     'fieldname' => 'device_types',
50
                     'displayName' => 'Device Type',
51
                     'type' => 'calculated',
52
                  ),
53
                  'parent' => array(
54
                     'fieldname' => 'parent',
55
                     'displayName' => 'Parent',
56
                     'type' => 'calculated',
57
                     'link' => 'parent_id'
58
                  ),
59
                  'parent_id' => array(
60
                     'fieldname' => 'parent_id',
61
                     'class' => 'Device',
62
                     'display' => false,
63
                     'type' => 'calculated',
64
                  ),
65
                  'owner' => array(
66
                     'fieldname' => 'owner',
67
                     'displayName' => 'Owner',
68
                     'type' => 'calculated',
69
                     'link' => 'owner_id'
70
                  ),
71
                  'owner_id' => array(
72
                     'fieldname' => 'owner_id',
73
                     'class' => 'Owner',
74
                     'display' => false,
75
                     'type' => 'calculated',
76
                  ),
77
                  'location' => array(
78
                     'fieldname' => 'location',
79
                     'displayName' => 'Location',
80
                     'type' => 'calculated',
81
                     'link' => 'location_id'
82
                  ),
83
                  'location_id' => array(
84
                     'fieldname' => 'location_id',
85
                     'class' => 'Location',
86
                     'display' => false,
87
                     'type' => 'calculated',
53 rodolico 88
                  )
89
               ) // fields
56 rodolico 90
            ), // table
91
            'view' => array(
92
               'viewName' => 'view_device_location_owner_type',
93
               'primaryKey' => 'device_id',
94
               'selectionDisplay' => 'device',
95
               'fields' => array(
96
                  'removed' => array( 
97
                     'fieldname' => 'device_removed'
98
                  )
99
               )
59 rodolico 100
            ), // view
101
            'children' => array(
102
            ) // children
53 rodolico 103
         ); // dbStructure
104
 
59 rodolico 105
   } // class Device
53 rodolico 106
?>