Exemplo n.º 1
0
 function install()
 {
     $ok = true;
     $q = new DBQuery();
     $sql = "(\n\t\t\tresource_id integer not null auto_increment,\n\t\t\tresource_name varchar(255) not null default '',\n\t\t\tresource_key varchar(64) not null default '',\n\t\t\tresource_type integer not null default 0,\n\t\t\tresource_note text not null default '',\n\t\t\tresource_max_allocation integer not null default 100,\n\t\t\tprimary key (resource_id),\n\t\t\tkey (resource_name),\n\t\t\tkey (resource_type)\n\t\t)";
     $q->createTable('resources');
     $q->createDefinition($sql);
     $ok = $ok && $q->exec();
     $q->clear();
     $sql = "(\n\t\t\tresource_type_id integer not null auto_increment,\n\t\t\tresource_type_name varchar(255) not null default '',\n\t\t\tresource_type_note text,\n\t\t\tprimary key (resource_type_id)\n\t\t)";
     $q->createTable('resource_types');
     $q->createDefinition($sql);
     $ok = $ok && $q->exec();
     $q->clear();
     $sql = "(\n\t\t\tresource_id integer not null default 0,\n\t\t\ttask_id integer not null default 0,\n\t\t\tpercent_allocated integer not null default 100,\n\t\t\tkey (resource_id),\n\t\t\tkey (task_id, resource_id)\n\t\t)";
     $q->createTable('resource_tasks');
     $q->createDefinition($sql);
     $ok = $ok && $q->exec();
     $q->clear();
     $q->addTable('resource_types');
     $q->addInsert('resource_type_name', 'Equipment');
     $q->exec();
     $q->addInsert('resource_type_name', 'Tool');
     $q->exec();
     $q->addInsert('resource_type_name', 'Venue');
     $ok = $ok && $q->exec();
     if (!$ok) {
         return false;
     }
     return null;
 }
Exemplo n.º 2
0
    function install()
    {
        $q = new DBQuery();
        $q->createTable('risks');
        $sql = '(
			`risk_id` int(10) unsigned NOT NULL auto_increment,
			`risk_name` varchar(50) default NULL,
			`risk_description` text,
			`risk_probability` tinyint(3) default 100,
			`risk_status` text default NULL,
			`risk_owner` int(10) default NULL,
			`risk_project` int(10) default NULL,
			`risk_task` int(10) default NULL,
			`risk_impact` int(10) default NULL,
			`risk_duration_type` tinyint(10) default 1,
			`risk_notes` text,
			PRIMARY KEY  (`risk_id`),
			UNIQUE KEY `risk_id` (`risk_id`),
			KEY `risk_id_2` (`risk_id`))
			TYPE=MyISAM';
        $q->createDefinition($sql);
        $q->exec();
        $q->clear();
        $q->createTable('risk_notes');
        $sql = '(
			`risk_note_id` int(11) NOT NULL auto_increment,
			`risk_note_risk` int(11) NOT NULL default \'0\',
			`risk_note_creator` int(11) NOT NULL default \'0\',
			`risk_note_date` datetime NOT NULL default \'0000-00-00 00:00:00\',
			`risk_note_description` text NOT NULL,
			PRIMARY KEY  (`risk_note_id`)
			) TYPE=MyISAM';
        $q->createDefinition($sql);
        $q->exec();
        $q->clear();
        $q->addTable('sysvals');
        $q->addInsert('sysval_key_id', 1);
        $q->addInsert('sysval_title', 'RiskProbability');
        $q->addInsert('sysval_value', "0|Not Specified\n1|Low\n2|Medium\n3|High");
        $q->exec();
        $q->clear();
        $q->addTable('sysvals');
        $q->addInsert('sysval_key_id', 1);
        $q->addInsert('sysval_title', 'RiskStatus');
        $q->addInsert('sysval_value', "0|Not Specified\n1|Open\n2|Closed\n3|Not Applicable");
        $q->exec();
        $q->clear();
        $q->addTable('sysvals');
        $q->addInsert('sysval_key_id', 1);
        $q->addInsert('sysval_title', 'RiskImpact');
        $q->addInsert('sysval_value', "0|Not Specified\n1|Low\n2|Medium\n3|High\n4|Super High");
        $q->exec();
        $q->clear();
        return true;
    }
Exemplo n.º 3
0
    public function install()
    {
        $ok = true;
        $q = new DBQuery();
        $sql = '(
			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)
		)';
        $q->createTable('resources', $sql);
        $ok = $ok && $q->exec();
        $q->clear();
        $sql = '(
			resource_type_id integer not null auto_increment,
			resource_type_name varchar(255) not null default "",
			resource_type_note text,
			primary key (resource_type_id)
		)';
        $q->createTable('resource_types', $sql);
        $ok = $ok && $q->exec();
        $q->clear();
        $sql = '(
			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)
		)';
        $q->createTable('resource_tasks', $sql);
        $ok = $ok && $q->exec();
        $q->clear();
        $q->addTable('resource_types');
        $q->addInsert('resource_type_name', 'Equipment');
        $q->exec();
        $q->addInsert('resource_type_name', 'Tool');
        $q->exec();
        $q->addInsert('resource_type_name', 'Venue');
        $ok = $ok && $q->exec();
        if (!$ok) {
            return false;
        }
        return null;
    }
Exemplo n.º 4
0
 function install()
 {
     $sql = " ( " . "history_id int(10) unsigned NOT NULL auto_increment," . "history_user int(10) NOT NULL default '0'," . "history_action varchar(10) NOT NULL default 'modify', " . "history_item int(10) NOT NULL," . "history_table varchar(15) NOT NULL default ''," . "history_project int(10) NOT NULL default '0'," . "history_date datetime NOT NULL default '0000-00-00 00:00:00'," . "history_description text," . "PRIMARY KEY  (history_id)," . "UNIQUE KEY history_id (history_id)" . ") TYPE=MyISAM";
     $q = new DBQuery();
     $q->createTable('history');
     $q->createDefinition($sql);
     $q->exec();
     $q->clear();
     return db_error();
 }
Exemplo n.º 5
0
    function install()
    {
        $sql = '(
			timesheet_id INT(11)  NOT NULL AUTO_INCREMENT,
 			user_id INT(11) ,
			timeset DATE ,
			PRIMARY KEY (`timesheet_id`)
		)
		ENGINE = MyISAM';
        $sql2 = '(
			activity_id INT(12)  NOT NULL AUTO_INCREMENT,
			user_id INT(11) ,
			task_id INT(11) ,
			date DATE ,
			duration TINYINT(1) ,
			activity_timesheet INT(11),
			PRIMARY KEY (`activity_id`),
			FOREIGN KEY (`activity_timesheet`) REFERENCES timesheet (`timesheet_id`)
		)
		ENGINE = MyISAM';
        $sql3 = '(
			task_id INT(11)  NOT NULL,
			timesheet_id INT(11)  NOT NULL,
			status TINYINT(1) ,
			PRIMARY KEY (`task_id`, `timesheet_id`)
		)
		ENGINE = MyISAM';
        $q = new DBQuery();
        $q->createTable('timesheet');
        $q->createDefinition($sql);
        $q->exec();
        $q->clear();
        $q->createTable('activity');
        $q->createDefinition($sql2);
        $q->exec();
        $q->clear();
        $q->createTable('task_timesheet');
        $q->createDefinition($sql3);
        $q->exec();
        $q->clear();
        return db_error();
    }
Exemplo n.º 6
0
 function install()
 {
     $q = new DBQuery();
     $q->createTable('links');
     $q->createDefinition("(\n`link_id` int(11) NOT NULL AUTO_INCREMENT ,\n`link_url` varchar(255) NOT NULL default '',\n`link_project` int(11) NOT NULL default '0',\n`link_task` int(11) NOT NULL default '0',\n`link_name` varchar(255) NOT NULL default '',\n`link_parent` int(11) default '0',\n`link_description` text,\n`link_owner` int(11) default '0',\n`link_date` datetime default NULL ,\n`link_icon` varchar(20) default 'obj/',\n`link_category` int(11) NOT NULL default '0',\nPRIMARY KEY (`link_id`) ,\nKEY `idx_link_task` (`link_task`) ,\nKEY `idx_link_project` (`link_project`) ,\nKEY `idx_link_parent` (`link_parent`) \n) DEFAULT CHARSET utf8");
     $q->exec($sql);
     $q->clear();
     $q->addTable('sysvals');
     $q->addInsert('sysval_key_id', 1);
     $q->addInsert('sysval_title', 'LinkType');
     $q->addInsert('sysval_value', "0|Unknown\n1|Document\n2|Application");
     $q->exec();
     return NULL;
 }
Exemplo n.º 7
0
 function install()
 {
     $ok = true;
     $q = new DBQuery();
     $sql = "(\r\n\t\t\tproject_statistics_id integer not null auto_increment,\r\n            project_statistics_project_id integer not null,\r\n            project_statistics_project_version_id integer not null,\r\n            project_statistics_project_finish_date datetime,\r\n            project_statistics_timestamp datetime not null,\r\n            project_statistics_percent_complete float default '0',\r\n            project_statistics_tasks_total integer not null,\r\n            project_statistics_tasks_complete integer not null,\r\n            project_statistics_helpdesk_total integer not null,\r\n            project_statistics_helpdesk_bugs integer not null,\r\n            project_statistics_helpdesk_features integer not null,\r\n            project_statistics_helpdesk_suggestions integer not null,\r\n            project_statistics_helpdesk_issues integer not null,\r\n            project_statistics_helpdesk_total_closed integer not null,\r\n            project_statistics_helpdesk_bugs_closed integer not null,\r\n            project_statistics_helpdesk_features_closed integer not null,\r\n            project_statistics_helpdesk_suggestions_closed integer not null,\r\n            project_statistics_helpdesk_issues_closed integer not null,\r\n            project_statistics_helpdesk_bugs_testing integer not null,\r\n            project_statistics_helpdesk_features_testing integer not null,\r\n            project_statistics_helpdesk_suggestions_testing integer not null,\r\n            project_statistics_helpdesk_issues_testing integer not null,\r\n\t\t\tprimary key (project_statistics_id),\r\n\t\t\tkey (project_statistics_project_id),\r\n\t\t\tkey (project_statistics_timestamp)\r\n\t\t)";
     $q->createTable('projects_statistics');
     $q->createDefinition($sql);
     $ok = $ok && $q->exec();
     $q->clear();
     if (!$ok) {
         return false;
     }
     return null;
 }
Exemplo n.º 8
0
    public function install()
    {
        $q = new DBQuery();
        $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 ) 
) TYPE = MYISAM ');
        $q->exec($sql);
        $q->clear();
        $q->addTable('sysvals');
        $q->addInsert('sysval_key_id', 1);
        $q->addInsert('sysval_title', 'LinkType');
        $q->addInsert('sysval_value', 'Unknown');
        $q->addInsert('sysval_value_id', '0');
        $q->exec();
        $q->clear();
        $q->addTable('sysvals');
        $q->addInsert('sysval_key_id', 1);
        $q->addInsert('sysval_title', 'LinkType');
        $q->addInsert('sysval_value', 'Document');
        $q->addInsert('sysval_value_id', '1');
        $q->exec();
        $q->clear();
        $q->addTable('sysvals');
        $q->addInsert('sysval_key_id', 1);
        $q->addInsert('sysval_title', 'LinkType');
        $q->addInsert('sysval_value', 'Application');
        $q->addInsert('sysval_value_id', '2');
        $q->exec();
        return null;
    }
Exemplo n.º 9
0
    public function install()
    {
        $sql = ' ( 
			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) 
			) TYPE=MyISAM';
        $q = new DBQuery();
        $q->createTable('history', $sql);
        $q->exec();
        $q->clear();
        return db_error() ? false : true;
    }
Exemplo n.º 10
0
    function install()
    {
        $sql = ' (
			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`) 
			) ';
        $q = new DBQuery();
        $q->createTable('history');
        $q->createDefinition($sql);
        $q->exec();
        $q->clear();
        return db_error();
    }