Exemplo n.º 1
0
 public function install()
 {
     $q = $this->_getQuery();
     $q->createTable('resources');
     $q->createDefinition('(
         resource_id integer not null auto_increment,
         resource_name varchar(255) not null default "",
         resource_key varchar(64) not null default "",
         resource_type integer not null default 0,
         resource_note text not null default "",
         resource_max_allocation integer not null default 100,
         primary key (resource_id),
         key (resource_name),
         key (resource_type)
         ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ');
     if (!$q->exec()) {
         return false;
     }
     $q->clear();
     $q->createTable('resource_tasks');
     $q->createDefinition('(
         resource_id integer not null default 0,
         task_id integer not null default 0,
         percent_allocated integer not null default 100,
         key (resource_id),
         key (task_id, resource_id)
         ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ');
     if (!$q->exec()) {
         return false;
     }
     $this->addTypes();
     return parent::install();
 }
Exemplo n.º 2
0
 public function install()
 {
     $result = $this->_checkRequirements();
     if (!$result) {
         return false;
     }
     $q = $this->_getQuery();
     $q->createTable('links');
     $q->createDefinition('(
         link_id int( 11 ) NOT NULL AUTO_INCREMENT ,
         link_url varchar( 255 ) NOT NULL default "",
         link_project int( 11 ) NOT NULL default "0",
         link_task int( 11 ) NOT NULL default "0",
         link_name varchar( 255 ) NOT NULL default "",
         link_parent int( 11 ) default "0",
         link_description text,
         link_owner int( 11 ) default "0",
         link_date datetime default NULL ,
         link_icon varchar( 20 ) default "obj/",
         link_category int( 11 ) NOT NULL default "0",
         PRIMARY KEY ( link_id ) ,
         KEY idx_link_task ( link_task ) ,
         KEY idx_link_project ( link_project ) ,
         KEY idx_link_parent ( link_parent )
         ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ');
     if (!$q->exec()) {
         return false;
     }
     $i = 0;
     $linkTypes = array('Unknown', 'Document', 'Application');
     //TODO: refactor as proper sysvals handling
     foreach ($linkTypes as $linkType) {
         $q = $this->_getQuery();
         $q->addTable('sysvals');
         $q->addInsert('sysval_key_id', 1);
         $q->addInsert('sysval_title', 'LinkType');
         $q->addInsert('sysval_value', $linkType);
         $q->addInsert('sysval_value_id', $i);
         $q->exec();
         $i++;
     }
     return parent::install();
 }
Exemplo n.º 3
0
    public function install()
    {
        $q = $this->_getQuery();
        $q->createTable('history');
        $q->createDefinition('(
			history_id int(10) unsigned NOT NULL auto_increment,
			history_date datetime NOT NULL default \'0000-00-00 00:00:00\',		  
			history_user int(10) NOT NULL default \'0\',
			history_action varchar(20) NOT NULL default \'modify\',
			history_item int(10) NOT NULL,
			history_table varchar(20) NOT NULL default \'\',
			history_project int(10) NOT NULL default \'0\',
			history_name varchar(255),
			history_changes text,
			history_description text,
			PRIMARY KEY  (history_id),
			INDEX index_history_module (history_table, history_item),
		  	INDEX index_history_item (history_item) 
            ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ');
        if (!$q->exec()) {
            return false;
        }
        return parent::install();
    }
Exemplo n.º 4
0
 public function install()
 {
     $result = $this->_checkRequirements();
     if (!$result) {
         //$AppUI->setMsg($this->getErrors(), UI_MSG_ERROR);
     }
     $q = $this->_getQuery();
     $q->createTable('project_designer_options');
     $q->createDefinition('(
             pd_option_id INT(11) NOT NULL auto_increment,
             pd_option_user INT(11) NOT NULL default 0 UNIQUE,
             pd_option_view_project INT(1) NOT NULL default 1,
             pd_option_view_gantt INT(1) NOT NULL default 1,
             pd_option_view_tasks INT(1) NOT NULL default 1,
             pd_option_view_actions INT(1) NOT NULL default 1,
             pd_option_view_addtasks INT(1) NOT NULL default 1,
             pd_option_view_files INT(1) NOT NULL default 1,
             PRIMARY KEY (pd_option_id)
         ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ');
     if (!$q->exec()) {
         return false;
     }
     return parent::install();
 }