Subversion Repositories computer_asset_manager_v1

Rev

Rev 99 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 99 Rev 101
Line 1... Line 1...
1
<?php
1
<?php
2
global $DATABASE_DEFINITION;
2
global $DATABASE_DEFINITION;
-
 
3
define ( MAX_INPUT_FIELD_DISPLAY, 40 ); // this is the maximum input field size
-
 
4
define ( IMAGE_DIRECTORY, '/pictures/' );  // relative URL where pictures are stored
-
 
5
define ( EDIT_IMAGE_HEIGHT, 100 );         // height for thumbnail of pictuers
-
 
6
define ( MAX_UPLOAD_FILE_SIZE, 1024*1024*10 ); // 10 meg
-
 
7
define (DEFAULT_TEXTAREA_HEIGHT, 5 );
-
 
8
define ( DEFAULT_TABLE, 'attrib');
-
 
9
   
3
   $DATABASE_DEFINITION['attrib'] = array(
10
   $DATABASE_DEFINITION = array(
-
 
11
   /* attributes that can be applied to a device */
-
 
12
   'attrib' => array( 
4
      'table name' => 'attrib',
13
      'table name' => 'attrib',
5
      'key field' => 'attrib_id',
14
      'key field' => 'attrib_id',
6
      'display columns' => array('Name','KeyName','Added'),
15
      'display columns' => array('attrib_category_id','added_date','name','keyname','removed_date','attrib_id'),
7
      'display query' => 'select attrib_id,name Name,keyname KeyName,added_date Added from attrib',
16
      'display query' => 'select attrib_category_id,added_date,name,keyname,removed_date,attrib_id from attrib',
8
      'field info' => array(
17
      'field info' => array(
9
         /* date record was deleted/supserceded */
-
 
10
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
-
 
11
         'attrib_id' => array('display name' => 'file_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
18
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
12
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
-
 
13
         /* date record was added */
19
         /* date record was added */
14
         'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
20
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
-
 
21
         /* the visible displayed name */
-
 
22
         'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
15
         /* A brief (or long) description of this file */
23
         /* used for sysinfo really needs to be separate table */
16
         'keyname' => array('display name' => 'Key Name', 'type' => 'string' , 'width' => 32),
24
         'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
-
 
25
         /* date record was deleted or supserceded */
-
 
26
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
-
 
27
         'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10)
17
      )
28
      )
18
   );
29
   ),
19
   /* FIX THIS
30
   /* just allows us to categorize attributes */
20
   $DATABASE_DEFINITION['attrib_device'] = array(
31
   'attrib_category' => array( 
21
      'table name' => 'attrib_device',
32
      'table name' => 'attrib_category',
22
      'key field' => 'attrib_device_id',
33
      'key field' => 'attrib_category_id',
23
      'display columns' => array('site','file_link_id','owner_type','file_id','site_id','owner_id'),
34
      'display columns' => array('attrib_category_id','added_date','name'),
24
      'display query' => 'select site,file_link_id,owner_type,file_id,site_id,owner_id from file_link',
35
      'display query' => 'select attrib_category_id,added_date,name from attrib_category',
25
      'field info' => array(
36
      'field info' => array(
26
         'site' => array('display name' => 'site' , 'type' => 'or'),
-
 
27
         'file_link_id' => array('display name' => 'file_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
37
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
28
         'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
38
         /* When this category was added */
29
         'file_id' => array('display name' => 'file_id' , 'type' => 'lookup', 'table' => 'file', 'keyfield' => 'file_id', 'display_field' => 'name'),
-
 
30
         'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
39
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
31
         'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
40
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64)
32
      )
41
      )
33
   );
42
   ),
-
 
43
   /* links devices and their attributes together */
34
   $DATABASE_DEFINITION['file_mime_type'] = array(
44
   'attrib_device' => array( 
35
      'table name' => 'file_mime_type',
45
      'table name' => 'attrib_device',
36
      'key field' => 'file_mime_type_id',
46
      'key field' => 'attrib_device_id',
37
      'display columns' => array('Extension','Type'),
47
      'display columns' => array('added_date','device_id','attrib_id','value','removed_date','attrib_device_id'),
38
      'display query' => 'select extension Extension ,file_mime_type_id,mime_type Type from file_mime_type',
48
      'display query' => 'select added_date,device_id,attrib_id,value,removed_date,attrib_device_id from attrib_device',
39
      'field info' => array(
49
      'field info' => array(
40
         // a file name extension commonly associated with this file
50
         /* date record was added */
41
         'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
51
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
42
         'file_mime_type_id' => array('display name' => 'file_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
52
         'device_id' => array('display name' => 'device_id' , 'type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
-
 
53
         'attrib_id' => array('display name' => 'attrib_id' , 'type' => 'lookup', 'table' => 'attrib', 'keyfield' => 'attrib_id', 'display_field' => 'name'),
43
         // The standardized mime type
54
         /* The actual value of this attribute. */
-
 
55
         'value' => array('display name' => 'value' , 'type' => 'text'),
-
 
56
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
44
         'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
57
         'attrib_device_id' => array('display name' => 'ID' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int')
45
      )
58
      )
46
   );
59
   )
47
   */
60
);
48
?>
61
?>