public function install(CAppUI $AppUI = null) { global $AppUI; $q = new w2p_Database_Query(); $q->createTable('history'); $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->createDefinition($sql); $q->exec(); $perms = $AppUI->acl(); return $perms->registerModule('History', 'history'); }
public function install() { global $AppUI; $q = new w2p_Database_Query(); $q->createTable('planner'); $sql = '( planner_id int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (planner_id)) ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci'; $q->createDefinition($sql); $q->exec(); /* $q->clear(); $q->addTable('planner','dw'); $q->addInsert('dokuwiki_URL_use','dokuwiki_base_URL'); $q->addInsert('dokuwiki_URL','http://localhost/dokuwiki/'); $q->exec(); $q->clear(); $q->addTable('dokuwiki','dw'); $q->addInsert('dokuwiki_URL','http://localhost/dwiki/doku.php?id=projects'); $q->addInsert('dokuwiki_URL_use','dokuwiki_projects_namespace'); $q->exec(); $q->clear(); $q->addTable('dokuwiki','dw'); $q->addInsert('dokuwiki_URL',''); $q->addInsert('dokuwiki_URL_use','dokuwiki_tasks_sub_namespace'); $q->exec(); $q->clear(); $q->addTable('dokuwiki','dw'); $q->addInsert('dokuwiki_URL','http://localhost/dwiki/doku.php?id=contacts'); $q->addInsert('dokuwiki_URL_use','dokuwiki_contacs_namespace'); $q->exec(); $f['dokuwiki_URL']=''; // $f['dw.dokuwiki_id']=1; $f['dokuwiki_URL_use']='dokuwiki_base_URL'; $q->clear(); $q->addTable('dokuwiki','dw'); // $f['dw.dokuwiki_id']=2; $f['dw.dokuwiki_URL_use']='dokuwiki_projects_namespace'; $q->addInsert($f); $q->exec(); $q->clear(); $q->addTable('dokuwiki','dw'); // $f['dw.dokuwiki_id']=3; $f['dw.dokuwiki_URL_use']='dokuwiki_tasks_namespace'; $q->addInsert($f); $q->exec(); */ $perms = $AppUI->acl(); return $perms->registerModule('Planner', 'planner'); }
public function install() { global $AppUI; $q = new w2p_Database_Query(); $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 '); $q->exec($sql); $i = 0; $linkTypes = array('Unknown', 'Document', 'Application'); foreach ($linkTypes as $linkType) { $q->clear(); $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++; } $perms = $AppUI->acl(); return $perms->registerModule('Links', 'links'); }
public function upgrade($old_version) { switch ($old_version) { case '0.1': // There is no way to change the name of database field with w2p_Database_Query(). db_exec("ALTER TABLE holiday CHANGE holiday_white holiday_type int(10) NOT NULL DEFAULT '0'"); if (db_error()) { return false; } $q = new w2p_Database_Query(); $q->alterTable('holiday'); $q->createDefinition('index holiday_start_end_date (holiday_start_date, holiday_end_date)'); $q->exec(); $q->clear(); $q->alterTable('holiday'); $q->createDefinition('index holiday_start_end_date (holiday_start_date, holiday_end_date)'); $q->exec(); $q->clear(); $q->alterTable('holiday'); $q->createDefinition('index holiday_user (holiday_user)'); $q->exec(); $q->clear(); $q->alterTable('holiday'); $q->createDefinition('index holiday_type (holiday_type)'); $q->exec(); $q->clear(); default: } return true; }