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 Location extends Camp {
5
      protected static $dbStructure = array(
6
         'table' => array( 
7
            'tableName' => 'location',
8
            'primaryKey' => 'location_id',
9
            'selectionDisplay' => 'name',
10
            'fields' => array(
56 rodolico 11
                  'id' => array (
12
                     'fieldname' => 'location_id',
53 rodolico 13
                     'displayName' => 'ID',
14
                     'type' => 'int unsigned',
15
                     'nullable' => false
16
                  ),
17
                  'name' => array (
56 rodolico 18
                     'fieldname' => 'name',
19
                     'displayName' => 'Location',
53 rodolico 20
                     'type' => 'varchar',
21
                     'size' => 64,
22
                     'list' => true
23
                  ),
63 rodolico 24
                  'uuid' => array (
25
                     'fieldname' => 'uuid',
26
                     'displayName' => 'UUID',
27
                     'type' => 'varchar',
28
                     'size' => 36,
29
                     'list' => false
30
                  ),
53 rodolico 31
                  'created' => array (
56 rodolico 32
                     'fieldname' => 'created',
53 rodolico 33
                     'displayName' => 'Created',
34
                     'type' => 'date'
35
                  ),
36
                  'removed' => array(
56 rodolico 37
                     'fieldname' => 'removed',
53 rodolico 38
                     'displayName' => 'Removed',
39
                     'type' => 'date'
59 rodolico 40
                  ),
41
                  'location_owner' => array(
42
                     'fieldname' => 'location_owner',
43
                     'displayName' => 'Owner',
44
                     'type' => 'calculated',
61 rodolico 45
                     'link' => 'location_owner_id'
59 rodolico 46
                  ),
47
                  'location_owner_id' => array(
48
                     'fieldname' => 'location_owner_id',
49
                     'class' => 'Owner',
50
                     'display' => false,
51
                     'type' => 'calculated',
52
                  ),
53 rodolico 53
            ) // fields
56 rodolico 54
         ), // table
55
         'view' => array(
56
            'viewName' => 'view_device_location_owner_type',
57
            'primaryKey' => 'location_id',
58
            'selectionDisplay' => 'location',
59
            'fields' => array(
60
               'removed' => array( 
61
                  'fieldname' => 'location_removed'
62
               )
63
            )
59 rodolico 64
         ), // view
65
         'children' => array(
66
            'Device'
67
         ) // children
53 rodolico 68
      ); // dbStructure
59 rodolico 69
 
60 rodolico 70
/*
59 rodolico 71
      public function __construct( $id ) {
72
         parent::__construct( $id );
73
         print "<pre>" . print_r( $this->data, true ) . '</pre>';
74
      }
60 rodolico 75
*/
59 rodolico 76
   } // Location
53 rodolico 77
 
78
?>