home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / history / setup.php < prev   
Encoding:
PHP Script  |  2003-02-18  |  1.2 KB  |  55 lines

  1. <?php
  2. /*
  3.  * Name:      History
  4.  * Directory: history
  5.  * Version:   0.1
  6.  * Class:     user
  7.  * UI Name:   History
  8.  * UI Icon:
  9.  */
  10.  
  11. // MODULE CONFIGURATION DEFINITION
  12. $config = array();
  13. $config['mod_name'] = 'History';
  14. $config['mod_version'] = '0.1';
  15. $config['mod_directory'] = 'history';
  16. $config['mod_setup_class'] = 'CSetupHistory';
  17. $config['mod_type'] = 'user';
  18. $config['mod_ui_name'] = 'History';
  19. $config['mod_ui_icon'] = '';
  20. $config['mod_description'] = 'A module for tracking changes';
  21.  
  22. if (@$a == 'setup') {
  23.     echo dPshowModuleConfig( $config );
  24. }
  25.  
  26. class CSetupHistory {   
  27.  
  28.     function install() {
  29.         $sql = "CREATE TABLE history ( " .
  30.           "history_id int(10) unsigned NOT NULL auto_increment," .
  31.           "history_user int(10) NOT NULL default '0'," .
  32.           "history_module int(10) NOT NULL default '0'," .
  33.           "history_project int(10) NOT NULL default '0'," .
  34.           "history_date datetime NOT NULL default '0000-00-00 00:00:00'," .
  35.           "history_description text," .
  36.           "PRIMARY KEY  (history_id)," .
  37.           "UNIQUE KEY history_id (history_id)" .
  38.           ") TYPE=MyISAM;";
  39.         db_exec( $sql );
  40.         return null;
  41.     }
  42.     
  43.     function remove() {
  44.         db_exec( "DROP TABLE history" );
  45.         return null;
  46.     }
  47.     
  48.     function upgrade() {
  49.         return null;
  50.     }
  51. }
  52.  
  53. ?>    
  54.     
  55.