Subversion Repositories computer_asset_manager_v1

Rev

Rev 58 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 58 Rev 59
Line 1... Line 1...
1
<?php
1
<?php
2
global $DATABASE_DEFINITION;
2
global $DATABASE_DEFINITION;
3
   $DATABASE_DEFINITION['document'] = array(
3
   $DATABASE_DEFINITION['file'] = array(
4
      'table name' => 'document',
4
      'table name' => 'file',
5
      'key field' => 'document_id',
5
      'key field' => 'file_id',
6
      'display columns' => array('Name','Added','Type','Description'),
6
      'display columns' => array('Name','Added','Type','Description'),
7
      'display query' => 'select document_id,mime_type Type, name Name,added_date Added,description Description from document join document_mime_type using (document_mime_type_id)',
7
      'display query' => 'select file_id,mime_type Type, name Name,added_date Added,description Description from file join file_mime_type using (file_mime_type_id)',
8
      'field info' => array(
8
      'field info' => array(
9
         /* date record was deleted/supserceded */
9
         /* date record was deleted/supserceded */
10
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
10
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
11
         'document_id' => array('display name' => 'document_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
11
         'file_id' => array('display name' => 'file_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
12
         /* either contents of text document or ::filename:: to be a link to a file on the disk */
12
         /* either contents of text file or ::filename:: to be a link to a file on the disk */
13
         'content' => array('display name' => 'content' , 'type' => 'text'),
13
         'content' => array('display name' => 'content' , 'type' => 'text'),
14
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
14
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
15
         /* date record was added */
15
         /* date record was added */
16
         'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
16
         'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
17
         'document_mime_type_id' => array('display name' => 'document_mime_type_id' , 'type' => 'lookup', 'table' => 'document_mime_type', 'keyfield' => 'document_mime_type_id', 'display_field' => 'mime_type'),
17
         'file_mime_type_id' => array('display name' => 'file_mime_type_id' , 'type' => 'lookup', 'table' => 'file_mime_type', 'keyfield' => 'file_mime_type_id', 'display_field' => 'mime_type'),
18
         /* A brief (or long) description of this document */
18
         /* A brief (or long) description of this file */
19
         'description' => array('display name' => 'description' , 'type' => 'text')
19
         'description' => array('display name' => 'description' , 'type' => 'text')
20
      )
20
      )
21
   );
21
   );
22
   $DATABASE_DEFINITION['document_link'] = array(
22
   $DATABASE_DEFINITION['file_link'] = array(
23
      'table name' => 'document_link',
23
      'table name' => 'file_link',
24
      'key field' => 'document_link_id',
24
      'key field' => 'file_link_id',
25
      'display columns' => array('site','document_link_id','owner_type','document_id','site_id','owner_id'),
25
      'display columns' => array('site','file_link_id','owner_type','file_id','site_id','owner_id'),
26
      'display query' => 'select site,document_link_id,owner_type,document_id,site_id,owner_id from document_link',
26
      'display query' => 'select site,file_link_id,owner_type,file_id,site_id,owner_id from file_link',
27
      'field info' => array(
27
      'field info' => array(
28
         'site' => array('display name' => 'site' , 'type' => 'or'),
28
         'site' => array('display name' => 'site' , 'type' => 'or'),
29
         'document_link_id' => array('display name' => 'document_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
29
         'file_link_id' => array('display name' => 'file_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
30
         'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
30
         'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
31
         'document_id' => array('display name' => 'document_id' , 'type' => 'lookup', 'table' => 'document', 'keyfield' => 'document_id', 'display_field' => 'name'),
31
         'file_id' => array('display name' => 'file_id' , 'type' => 'lookup', 'table' => 'file', 'keyfield' => 'file_id', 'display_field' => 'name'),
32
         'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
32
         'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
33
         'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
33
         'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
34
      )
34
      )
35
   );
35
   );
36
   $DATABASE_DEFINITION['document_mime_type'] = array(
36
   $DATABASE_DEFINITION['file_mime_type'] = array(
37
      'table name' => 'document_mime_type',
37
      'table name' => 'file_mime_type',
38
      'key field' => 'document_mime_type_id',
38
      'key field' => 'file_mime_type_id',
39
      'display columns' => array('Extension','Type'),
39
      'display columns' => array('Extension','Type'),
40
      'display query' => 'select extension Extension ,document_mime_type_id,mime_type Type from document_mime_type',
40
      'display query' => 'select extension Extension ,file_mime_type_id,mime_type Type from file_mime_type',
41
      'field info' => array(
41
      'field info' => array(
42
         /* a file name extension commonly associated with this file */
42
         /* a file name extension commonly associated with this file */
43
         'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
43
         'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
44
         'document_mime_type_id' => array('display name' => 'document_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
44
         'file_mime_type_id' => array('display name' => 'file_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
45
         /* The standardized mime type */
45
         /* The standardized mime type */
46
         'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
46
         'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
47
      )
47
      )
48
   )
48
   )
49
?>
49
?>