Changeset 745
- Timestamp:
- Sep 10, 2015, 9:51:23 PM (9 years ago)
- Location:
- trunk/Modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Map/Map.php
r738 r745 231 231 'Filter' => '1', 232 232 )); 233 234 } 235 } 233 } 234 235 function DoInstall() 236 { 237 $this->System->Database->query("CREATE TABLE IF NOT EXISTS `MapPosition` ( 238 `Id` int(11) NOT NULL AUTO_INCREMENT, 239 `Name` varchar(255) NOT NULL, 240 `Pos` varchar(255) NOT NULL, 241 PRIMARY KEY (`Id`) 242 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"); 243 } 244 245 function DoUninstall() 246 { 247 $this->Database->query('DROP TABLE `MapPosition`'); 248 } 249 } -
trunk/Modules/Subject/Subject.php
r740 r745 11 11 $this->License = 'GNU/GPL'; 12 12 $this->Description = 'Subject management'; 13 $this->Dependencies = array('User' );13 $this->Dependencies = array('User', 'Map'); 14 14 } 15 15 … … 116 116 )); 117 117 } 118 119 function DoInstall() 120 { 121 $this->Database->query("CREATE TABLE IF NOT EXISTS `Subject` ( 122 `Id` int(11) NOT NULL AUTO_INCREMENT, 123 `Name` varchar(64) NOT NULL DEFAULT '', 124 `AddressStreet` varchar(64) NOT NULL DEFAULT '', 125 `AddressTown` varchar(64) NOT NULL DEFAULT '', 126 `AddressPSC` int(11) NOT NULL DEFAULT '0', 127 `AddressCountry` int(11) NOT NULL, 128 `IC` varchar(32) NOT NULL, 129 `DIC` varchar(32) NOT NULL DEFAULT '', 130 `PayVAT` int(11) NOT NULL, 131 `MapPosition` int(11) DEFAULT NULL, 132 `WWW` varchar(255) NOT NULL, 133 `Note` varchar(255) NOT NULL, 134 PRIMARY KEY (`Id`) 135 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"); 136 $this->Database->query("CREATE TABLE IF NOT EXISTS `Contact` ( 137 `Id` int(11) NOT NULL AUTO_INCREMENT, 138 `Category` int(11) NOT NULL, 139 `Value` varchar(255) NOT NULL, 140 `Subject` int(11) DEFAULT NULL, 141 `User` int(11) DEFAULT NULL, 142 `Description` varchar(255) NOT NULL, 143 `Receive` tinyint(1) NOT NULL, 144 PRIMARY KEY (`Id`) 145 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"); 146 $this->System->Database->query("CREATE TABLE IF NOT EXISTS `ContactCategory` ( 147 `Id` int(11) NOT NULL AUTO_INCREMENT, 148 `Name` varchar(255) NOT NULL, 149 PRIMARY KEY (`Id`) 150 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"); 151 152 $this->Database->query("ALTER TABLE `Subject` 153 ADD CONSTRAINT `Subject_ibfk_1` FOREIGN KEY (`AddressCountry`) REFERENCES `Country` (`Id`), 154 ADD CONSTRAINT `Subject_ibfk_2` FOREIGN KEY (`MapPosition`) REFERENCES `MapPosition` (`Id`);"); 155 $this->Database->query("ALTER TABLE `Contact` 156 ADD CONSTRAINT `Contact_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `ContactCategory` (`Id`), 157 ADD CONSTRAINT `Contact_ibfk_2` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`), 158 ADD CONSTRAINT `Contact_ibfk_3` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);"); 159 } 160 161 function DoUninstall() 162 { 163 $this->Database->query('DROP TABLE `Contact`'); 164 $this->Database->query('DROP TABLE `ContactCategory`'); 165 $this->Database->query('DROP TABLE `Subject`'); 166 } 118 167 } -
trunk/Modules/Wiki/Wiki.php
r738 r745 18 18 { 19 19 parent::Install(); 20 $this->Database->Query( "'CREATE TABLE IF NOT EXISTS `WikiPage` (20 $this->Database->Query('CREATE TABLE IF NOT EXISTS `WikiPage` ( 21 21 `Id` int(11) NOT NULL AUTO_INCREMENT, 22 22 `Name` varchar(255) NOT NULL, … … 26 26 UNIQUE KEY `Name` (`Name`), 27 27 KEY `VisibleInMenu` (`VisibleInMenu`) 28 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 29 CREATE TABLE IF NOT EXISTS `WikiPageContent` (28 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1'); 29 $this->Database->Query('CREATE TABLE IF NOT EXISTS `WikiPageContent` ( 30 30 `Id` int(11) NOT NULL AUTO_INCREMENT, 31 31 `Page` int(11) NOT NULL, … … 36 36 KEY `User` (`User`), 37 37 KEY `Page` (`Page`) 38 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 39 ALTER TABLE `WikiPageContent`38 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1'); 39 $this->Database->Query('ALTER TABLE `WikiPageContent` 40 40 ADD CONSTRAINT `WikiPageContent_ibfk_2` FOREIGN KEY (`Page`) REFERENCES `WikiPage` (`Id`), 41 ADD CONSTRAINT `WikiPageContent_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`ID`) ;'");41 ADD CONSTRAINT `WikiPageContent_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`ID`)'); 42 42 } 43 43 44 44 function DoUnInstall() 45 45 { 46 $this->Database->query("DELETE TABLE `WikiPageContent`; '. 47 'DELETE TABLE `WikiPage`;"); 48 parent::UnInstall(); 46 $this->Database->query('DELETE TABLE `WikiPageContent`'); 47 $this->Database->query('DELETE TABLE `WikiPage`;'); 49 48 } 50 49 … … 65 64 $this->System->RegisterPage($DbRow['NormalizedName'], 'PageWiki'); 66 65 $this->System->RegisterMenuItem(array( 67 68 69 70 71 66 'Title' => $DbRow['Name'], 67 'Hint' => '', 68 'Link' => $this->System->Link('/'.$DbRow['NormalizedName'].'/'), 69 'Permission' => LICENCE_ANONYMOUS, 70 'Icon' => '', 72 71 ), 2); 73 72 }
Note:
See TracChangeset
for help on using the changeset viewer.