Subversion Repositories computer_asset_manager_v1

Rev

Rev 58 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php
global $DATABASE_DEFINITION;
   $DATABASE_DEFINITION['document'] = array(
      'table name' => 'document',
      'key field' => 'document_id',
      'display columns' => array('Name','Added','Type','Description'),
      '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)',
      'field info' => array(
         /* date record was deleted/supserceded */
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
         'document_id' => array('display name' => 'document_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
         /* either contents of text document or ::filename:: to be a link to a file on the disk */
         'content' => array('display name' => 'content' , 'type' => 'text'),
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
         /* date record was added */
         'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
         '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'),
         /* A brief (or long) description of this document */
         'description' => array('display name' => 'description' , 'type' => 'text')
      )
   );
   $DATABASE_DEFINITION['document_link'] = array(
      'table name' => 'document_link',
      'key field' => 'document_link_id',
      'display columns' => array('site','document_link_id','owner_type','document_id','site_id','owner_id'),
      'display query' => 'select site,document_link_id,owner_type,document_id,site_id,owner_id from document_link',
      'field info' => array(
         'site' => array('display name' => 'site' , 'type' => 'or'),
         'document_link_id' => array('display name' => 'document_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
         'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
         'document_id' => array('display name' => 'document_id' , 'type' => 'lookup', 'table' => 'document', 'keyfield' => 'document_id', 'display_field' => 'name'),
         'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
         'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
      )
   );
   $DATABASE_DEFINITION['document_mime_type'] = array(
      'table name' => 'document_mime_type',
      'key field' => 'document_mime_type_id',
      'display columns' => array('Extension','Type'),
      'display query' => 'select extension Extension ,document_mime_type_id,mime_type Type from document_mime_type',
      'field info' => array(
         /* a file name extension commonly associated with this file */
         'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
         'document_mime_type_id' => array('display name' => 'document_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
         /* The standardized mime type */
         'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
      )
   )
?>