Changeset 749
- Timestamp:
- 12/25/08 13:42:21 (4 years ago)
- Location:
- de.mdman.racing.league
- Files:
-
- 11 modified
-
de.xml (modified) (1 diff)
-
files/lib/action/RacingLeagueDeletePunishAction.class.php (modified) (1 diff)
-
files/lib/action/RacingLeagueDeleteRaceAction.class.php (modified) (1 diff)
-
files/lib/action/RacingLeagueDeleteResultAction.class.php (modified) (1 diff)
-
files/lib/action/RacingLeagueDeleteSaisonAction.class.php (modified) (1 diff)
-
files/lib/action/RacingLeagueDeleteTeamAction.class.php (modified) (1 diff)
-
files/lib/form/RacingLeaguePunishForm.class.php (modified) (5 diffs)
-
files/lib/form/RacingLeagueResultsForm.class.php (modified) (9 diffs)
-
install.sql (modified) (2 diffs)
-
package.xml (modified) (1 diff)
-
templates/racingLeaguePunish.tpl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
de.mdman.racing.league/de.xml
r713 r749 4 4 <category name="wcf.racing.league"> 5 5 <!-- COPYRIGHT --> 6 <item name="wcf.racing.league.copyright"><![CDATA[<a href="http://www.mdman.de"><strong>Racing-League PlugIn© 1.0.0 beta 3</strong>, entwickelt von MDMAN</a> <strong>| Icons by illyaine</strong>]]></item>6 <item name="wcf.racing.league.copyright"><![CDATA[<a href="http://www.mdman.de"><strong>Racing-League PlugIn© 1.0.0 beta 4</strong>, entwickelt von MDMAN</a> <strong>| Icons by illyaine</strong>]]></item> 7 7 <!-- COPYRIGHT --> 8 8 -
de.mdman.racing.league/files/lib/action/RacingLeagueDeletePunishAction.class.php
r709 r749 27 27 $res = WCF::getDB()->sendQuery($sql); 28 28 $row = WCF::getDB()->getAffectedRows($res); 29 30 $sql = "DELETE FROM `wcf".WCF_N."_racing_punish_to_team` 31 WHERE `punishID` = '".escapeString($this->punishID)."' 32 "; 33 $res = WCF::getDB()->sendQuery($sql); 29 34 30 35 if ($row > 0) { -
de.mdman.racing.league/files/lib/action/RacingLeagueDeleteRaceAction.class.php
r707 r749 45 45 WCF::getDB()->sendQuery($sql); 46 46 47 $sql = "DELETE FROM `wcf".WCF_N."_racing_punish_to_team` 48 WHERE `raceID` = '".escapeString($this->raceID)."' 49 "; 50 WCF::getDB()->sendQuery($sql); 51 47 52 if ($row > 0) { 48 53 WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueDeleteSuccess')); -
de.mdman.racing.league/files/lib/action/RacingLeagueDeleteResultAction.class.php
r707 r749 41 41 "; 42 42 WCF::getDB()->sendQuery($sql); 43 44 $sql = "DELETE FROM `wcf".WCF_N."_racing_punish_to_team` 45 WHERE `raceID` = '".escapeString($this->raceID)."' 46 "; 47 WCF::getDB()->sendQuery($sql); 43 48 44 49 // Hier wird das Rennen wieder aktiviert (drived = 0) -
de.mdman.racing.league/files/lib/action/RacingLeagueDeleteSaisonAction.class.php
r707 r749 68 68 "; 69 69 WCF::getDB()->sendQuery($sql); 70 71 $sql = "DELETE FROM `wcf".WCF_N."_racing_punish_to_team` 72 WHERE `saisonID` = '".escapeString($this->saisonID)."' 73 "; 74 WCF::getDB()->sendQuery($sql); 70 75 71 76 if (WCF::getSession()->getVar('activeSaisonID') == $this->saisonID) { -
de.mdman.racing.league/files/lib/action/RacingLeagueDeleteTeamAction.class.php
r691 r749 40 40 "; 41 41 WCF::getDB()->sendQuery($sql); 42 43 // Hier werden auch die Strafen des Teams gelöscht. 44 $sql = "DELETE FROM `wcf".WCF_N."_punish_to_team` 45 WHERE `teamID` = '".escapeString($this->teamID)."' 46 "; 47 WCF::getDB()->sendQuery($sql); 42 48 43 49 if ($row > 0) { -
de.mdman.racing.league/files/lib/form/RacingLeaguePunishForm.class.php
r713 r749 159 159 parent::save(); 160 160 161 // Hier wird eine neue Strafe gespeichert 161 162 if ($this->addPunish == 3 && isset($this->driver) && isset($this->minusPoints) && isset($this->punishReason) && $this->raceID > 0 && $this->activeSaisonID != 0) { 162 163 163 // Hier wird vom jeweiligen Fahrer (=userID) das dazugeh örige Team ermittelt164 // Hier wird vom jeweiligen Fahrer (=userID) das dazugehoerige Team ermittelt 164 165 $sql = "SELECT `teamID` 165 166 FROM `wcf".WCF_N."_racing_user_to_team` … … 177 178 $teamID = implode($teamIDArray); 178 179 179 // Hier wird die Strafe in die DB gespeichert 180 // Hier wird die Strafe in die DB gespeichert fuer den Fahrer 180 181 $sql = "INSERT INTO `wcf".WCF_N."_racing_punish` 181 (`saisonID`, `raceID`, `userID`, `teamID`, `minusPoints`, `punishReason`) 182 VALUES ('".escapeString($this->activeSaisonID)."', '".escapeString($this->raceID)."', '".escapeString($this->driver)."', '".escapeString($teamID)."', '".escapeString($this->minusPoints)."', '".escapeString($this->punishReason)."') 183 "; 184 185 $res = WCF::getDB()->sendQuery($sql); 186 182 (`saisonID`, `raceID`, `userID`, `minusPoints`, `punishReason`) 183 VALUES ('".escapeString($this->activeSaisonID)."', '".escapeString($this->raceID)."', '".escapeString($this->driver)."', '".escapeString($this->minusPoints)."', '".escapeString($this->punishReason)."') 184 "; 185 186 $res = WCF::getDB()->sendQuery($sql); 187 188 // Hier wird die punishID ausgelesen der letzten gespeicherten Strafe 189 190 $punishID = 0; 191 $punishID = mysql_insert_id(); 192 193 187 194 $row = 0; 188 195 $row = WCF::getDB()->getAffectedRows($res); 196 197 // Hier wird die Strafe in die DB gespeichert fuer das Team 198 if ($teamID > 0) { 199 $sql = "INSERT INTO `wcf".WCF_N."_racing_punish_to_team` 200 (`saisonID`, `punishID`, `raceID`, `userID`, teamID, `minusPoints`, `punishReason`) 201 VALUES ('".escapeString($this->activeSaisonID)."', '".escapeString($punishID)."', '".escapeString($this->raceID)."', '".escapeString($this->driver)."', '".escapeString($teamID)."', '".escapeString($this->minusPoints)."', '".escapeString($this->punishReason)."') 202 "; 203 204 $res = WCF::getDB()->sendQuery($sql); 205 } 189 206 190 207 $this->addPunish = ''; … … 201 218 } 202 219 220 // Hier wird eine Strafe bearbeitet, editiert 203 221 if ($this->editPunishID > 0 && isset($this->driver) && isset($this->minusPoints) && isset($this->punishReason) && $this->raceID > 0 && $this->activeSaisonID != 0) { 204 222 205 // Hier wird vom jeweiligen Fahrer (=userID) das dazugehà ¶rige Team ermittelt223 // Hier wird vom jeweiligen Fahrer (=userID) das dazugehörige Team ermittelt 206 224 $sql = "SELECT `teamID` 207 225 FROM `wcf".WCF_N."_racing_user_to_team` … … 221 239 // Hier wird die Strafe nun Bearbeitet und gespeichert. 222 240 $sql = "UPDATE `wcf".WCF_N."_racing_punish` 223 SET `saisonID` = '".escapeString($this->activeSaisonID)."', 224 `raceID` = '".escapeString($this->raceID)."', 241 SET `raceID` = '".escapeString($this->raceID)."', 225 242 `userID` = '".escapeString($this->driver)."', 226 `teamID`= '".escapeString($teamID)."',227 243 `minusPoints` = '".escapeString($this->minusPoints)."', 228 244 `punishReason` = '".escapeString($this->punishReason)."' 229 245 WHERE `punishID` = '".escapeString($this->editPunishID)."' 246 AND `saisonID` = '".escapeString($this->activeSaisonID)."' 230 247 "; 231 248 … … 234 251 $row = 0; 235 252 $row = WCF::getDB()->getAffectedRows($res); 253 254 // Hier wird auch die Starfe fÃÂŒr die Team-Tabelle bearbeitet 255 $sql = "UPDATE `wcf".WCF_N."_racing_punish_to_team` 256 SET `raceID` = '".escapeString($this->raceID)."', 257 `userID` = '".escapeString($this->driver)."', 258 `teamID` = '".escapeString($teamID)."', 259 `minusPoints` = '".escapeString($this->minusPoints)."', 260 `punishReason` = '".escapeString($this->punishReason)."' 261 WHERE `punishID` = '".escapeString($this->editPunishID)."' 262 AND `saisonID` = '".escapeString($this->activeSaisonID)."' 263 "; 264 265 WCF::getDB()->sendQuery($sql); 236 266 237 267 $this->editPunishID = 0; -
de.mdman.racing.league/files/lib/form/RacingLeagueResultsForm.class.php
r685 r749 109 109 if ($this->newResults == 1 && $this->activeSaisonID != 0 && $this->groupID != 0) { 110 110 111 // Hier werden alle verfà Œgbaren PlÀtze ermittelt111 // Hier werden alle verfÃÂŒgbaren PlÀtze ermittelt 112 112 $sql = "SELECT `place`, `points` 113 113 FROM `wcf".WCF_N."_racing_points` … … 142 142 } 143 143 144 // Hier werden alle verf ÃŒgbaren PlÀtze ermittelt144 // Hier werden alle verfuegbaren Plaetze ermittelt 145 145 $sql = "SELECT `place`, `points` 146 146 FROM `wcf".WCF_N."_racing_points` … … 195 195 // Hier wird ein neues Ergebnis gespeichert 196 196 if ($this->result && $this->activeSaisonID != 0 && $this->newResults == 1 && $this->raceID > 0) { 197 // Hier werden alle verf ÃŒgbaren PlÀtze ermittelt197 // Hier werden alle verfuegbaren Plaetze ermittelt 198 198 $sql = "SELECT `place`, `points` 199 199 FROM `wcf".WCF_N."_racing_points` … … 212 212 $i = 0; 213 213 foreach($this->places as $place) { 214 $i++;214 $i++; 215 215 $values .= (empty($values) ? "" : "," ). 216 216 "('".escapeString($this->activeSaisonID)."', … … 241 241 } 242 242 243 // Hier werden alle Daten f ÃŒr das Teamergebnis generiert und gespeichert.243 // Hier werden alle Daten fuer das Teamergebnis generiert und gespeichert. 244 244 $sql = "SELECT `a`.`saisonID`, 245 245 `a`.`resultID`, … … 286 286 if ($this->result && $this->activeSaisonID != 0 && $this->editRaceID > 0) { 287 287 288 // Hier werden alle verf ÃŒgbaren PlÀtze ermittelt288 // Hier werden alle verfuegbaren Plaetze ermittelt 289 289 $sql = "SELECT `place`, `points` 290 290 FROM `wcf".WCF_N."_racing_points` … … 298 298 } 299 299 300 // Hier werden die Ergebnisse ge Àndert.300 // Hier werden die Ergebnisse geaendert. 301 301 if(count($this->places)) { 302 302 $values = ''; … … 317 317 } 318 318 319 // Hier werden nun die Teamergebnisse erstmal gel öscht.319 // Hier werden nun die Teamergebnisse erstmal geloescht. 320 320 $sql = "DELETE FROM `wcf".WCF_N."_racing_results_team` 321 321 WHERE `raceID` = ".$this->editRaceID." … … 325 325 $res = WCF::getDB()->sendQuery($sql); 326 326 327 $del = WCF::getDB()->getAffectedRows($res);328 329 327 // Nun werden die Teamergebnisse neu gespeichert. 330 if ($del > 0) { 331 $sql = "SELECT `a`.`saisonID`, 332 `a`.`resultID`, 333 `a`.`raceID`, 334 `a`.`userID`, 335 `a`.`place`, 336 `a`.`points`, 337 `b`.`userID`, 338 `b`.`teamID` 339 FROM `wcf".WCF_N."_racing_results` AS `a` 340 LEFT JOIN `wcf".WCF_N."_racing_user_to_team` AS `b` 341 ON (`b`.`userID` = `a`.`userID`) 342 AND (`b`.saisonID = '".$this->activeSaisonID."') 343 WHERE `a`.`raceID` = '".$this->editRaceID."' 344 AND `a`.saisonID = '".$this->activeSaisonID."' 345 AND `b`.saisonID = '".$this->activeSaisonID."' 346 ORDER BY `a`.`resultID` DESC"; 347 348 $res = WCF::getDB()->sendQuery($sql); 349 while ($row = WCF::getDB()->fetchArray($res)) { 350 $this->resultsTeam[] = $row; 328 $sql = "SELECT `a`.`saisonID`, 329 `a`.`resultID`, 330 `a`.`raceID`, 331 `a`.`userID`, 332 `a`.`place`, 333 `a`.`points`, 334 `b`.`userID`, 335 `b`.`teamID` 336 FROM `wcf".WCF_N."_racing_results` AS `a` 337 LEFT JOIN `wcf".WCF_N."_racing_user_to_team` AS `b` 338 ON (`b`.`userID` = `a`.`userID`) 339 AND (`b`.saisonID = '".$this->activeSaisonID."') 340 WHERE `a`.`raceID` = '".$this->editRaceID."' 341 AND `a`.saisonID = '".$this->activeSaisonID."' 342 AND `b`.saisonID = '".$this->activeSaisonID."' 343 ORDER BY `a`.`resultID` DESC"; 344 345 $res = WCF::getDB()->sendQuery($sql); 346 while ($row = WCF::getDB()->fetchArray($res)) { 347 $this->resultsTeam[] = $row; 348 } 349 350 if(count($this->resultsTeam)) { 351 $sql = "INSERT INTO wcf".WCF_N."_racing_results_team (saisonID, resultID, raceID, userID, teamID, points) VALUES "; 352 $values = ''; 353 354 foreach($this->resultsTeam as $resultTeam) { 355 356 $values .= (empty($values) ? "" : "," ). 357 "('".escapeString($this->activeSaisonID)."', 358 '".escapeString($resultTeam["resultID"])."', 359 '".escapeString($this->editRaceID)."', 360 '".escapeString($resultTeam["userID"])."', 361 '".escapeString($resultTeam["teamID"])."', 362 '".escapeString($resultTeam['points'])."')"; 351 363 } 352 353 if(count($this->resultsTeam)) { 354 $sql = "INSERT INTO wcf".WCF_N."_racing_results_team (saisonID, resultID, raceID, userID, teamID, points) VALUES "; 355 $values = ''; 356 357 foreach($this->resultsTeam as $resultTeam) { 358 359 $values .= (empty($values) ? "" : "," ). 360 "('".escapeString($this->activeSaisonID)."', 361 '".escapeString($resultTeam["resultID"])."', 362 '".escapeString($this->editRaceID)."', 363 '".escapeString($resultTeam["userID"])."', 364 '".escapeString($resultTeam["teamID"])."', 365 '".escapeString($resultTeam['points'])."')"; 366 } 367 368 WCF::getDB()->sendQuery($sql.$values); 369 } 370 } 371 364 365 WCF::getDB()->sendQuery($sql.$values); 366 } 367 372 368 $this->editRaceID = 0; 373 369 -
de.mdman.racing.league/install.sql
r713 r749 84 84 raceID int(10) unsigned NOT NULL COMMENT 'ID des Rennens', 85 85 userID int(10) unsigned NOT NULL COMMENT 'ID des Fahrers', 86 teamID int(10) unsigned NOT NULL COMMENT 'ID des Teams des Fahrers',87 86 minusPoints int(10) unsigned NOT NULL COMMENT 'Punkte die abgezogen werden sollen', 88 87 punishReason varchar(255) NOT NULL COMMENT 'Grund fuer die Strafe', … … 90 89 INDEX (`punishID`) 91 90 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 91 92 DROP TABLE IF EXISTS wcf1_racing_punish_to_team; 93 CREATE TABLE wcf1_racing_punish_to_team ( 94 saisonID int(10) unsigned NOT NULL COMMENT 'ID der Saison', 95 punishToTeamID int(10) unsigned NOT NULL auto_increment COMMENT 'ID der Strafe', 96 punishID int(10) unsigned NOT NULL COMMENT 'ID der Strafe', 97 raceID int(10) unsigned NOT NULL COMMENT 'ID des Rennens', 98 userID int(10) unsigned NOT NULL COMMENT 'ID des Fahrers', 99 teamID int(10) unsigned NOT NULL COMMENT 'ID des Teams des Fahrers', 100 minusPoints int(10) unsigned NOT NULL COMMENT 'Punkte die abgezogen werden sollen', 101 punishReason varchar(255) NOT NULL COMMENT 'Grund fuer die Strafe', 102 PRIMARY KEY(`punishToTeamID`), 103 INDEX (`punishToTeamID`) 104 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -
de.mdman.racing.league/package.xml
r713 r749 11 11 <packagedescription language="de"><![CDATA[Mit diesem PlugIn werden PunktestÀnde einer laufenden Racing-Liga dargestellt.]]></packagedescription> 12 12 <packagedescription language="de-informal"><![CDATA[Mit diesem PlugIn werden PunktestÀnde einer laufenden Racing-Liga dargestellt.]]></packagedescription> 13 <version>1.0.0 beta 3</version>14 <date>2008-1 1-14</date>13 <version>1.0.0 beta 4</version> 14 <date>2008-12-25</date> 15 15 <plugin>com.woltlab.wcf</plugin> 16 16 <isunique>1</isunique> -
de.mdman.racing.league/templates/racingLeaguePunish.tpl
r713 r749 144 144 145 145 {if $editPunishID > 0} 146 147 <form method="post" action="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&editPunishID={$editPunishID}"> 146 <form method="post" action="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&editPunishID={$editPunishID}&edit=1"> 148 147 <div class="border content"> 149 148 <div class="container-1"> 150 <h3 class="subHeadline"><img src="{@RELATIVE_WCF_DIR}icon/saison WarningEditS.png" alt="" /> {lang}wcf.racing.league.punish.editPunish{/lang}</h3>149 <h3 class="subHeadline"><img src="{@RELATIVE_WCF_DIR}icon/saisonwEditS.png" alt="" /> {lang}wcf.racing.league.punish.editPunish{/lang}</h3> 151 150 <p class="description">{lang}wcf.racing.league.punish.editPunish.description{/lang}</p> 151 {$editRaceName} 152 152 <br /> 153 <div class="formElement{if $errorField == 'driver'} formError{/if}"> 154 <div class="formFieldLabel"> 155 <label for="driver">{lang}wcf.racing.league.punish.addPunish.driver{/lang}</label> 156 </div> 157 158 <div class="formField"> 159 <select name='driver'> 160 <option value="">----------</option> 161 {foreach from=$users item=value} 162 <option value='{$value.userID}' {if $driver == $value.userID}selected{/if}>{$value.username}</option> 163 {/foreach} 164 </select> 165 <br /> 166 167 {if $errorField == 'driver'} 168 <p class="innerError"> 169 {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if} 170 </p> 171 {/if} 172 </div> 173 </div> 153 174 154 <div class="formElement{if $errorField == 'punishRace'} formError{/if}">155 <div class="formFieldLabel">156 <label for="punishRace">{lang}wcf.racing.league.punish.addPunish.racename{/lang}</label>157 </div>158 <div class="formField">159 160 <select name='raceID'>161 {foreach from=$drivedRaces item=value}162 <option value='{$value.raceID}' {if $raceID == $value.raceID}selected{/if}>{$value.raceName}</option>163 {/foreach}164 </select>165 166 {if $errorField == 'punishRace'}167 <p class="innerError">168 {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if}169 </p>170 {/if}171 </div>172 </div>173 174 <div class="formElement{if $errorField == 'driver'} formError{/if}">175 <div class="formFieldLabel">176 <label for="driver">{lang}wcf.racing.league.punish.addPunish.driver{/lang}</label>177 </div>178 <div class="formField">179 180 <select name='driver'>181 {foreach from=$users item=value}182 <option value='{$value.userID}' {if $driver == $value.userID}selected{/if}>{$value.username}</option>183 {/foreach}184 </select>185 <br />186 187 {if $errorField == 'driver'}188 <p class="innerError">189 {if $errorType == 'empty'}{lang}wcf.global.error.empty{/lang}{/if}190 </p>191 {/if}192 </div>193 </div>194 195 175 <div class="formElement{if $errorField == 'minusPoints'} formError{/if}"> 196 176 <div class="formFieldLabel"> … … 221 201 </div> 222 202 </div> 223 </div> 203 </div> 224 204 </div> 225 205 <div class="formSubmit"> … … 298 278 {else} 299 279 300 <div class="formField">301 <p class="info" id="results.noPunish">302 {lang}wcf.racing.league.punish.noPunish{/lang}303 </p>304 </div>280 <div class="formField"> 281 <p class="info" id="results.noPunish"> 282 {lang}wcf.racing.league.punish.noPunish{/lang} 283 </p> 284 </div> 305 285 {/if} 306 286 307 287 {if $saisons|count} 308 <div class="largeButtons">309 <ul>310 {if $this->user->getPermission('admin.racing.league.caneditresults')}<li><a href="index.php?form=RacingLeagueResults{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/saisonwM.png" alt="" /> <span>{lang}wcf.racing.league.button.editSaisons.backToResult{/lang}</span></a></li>{/if}311 {if $this->user->getPermission('admin.racing.league.caneditresults')}<li><a href="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&addPunish=1"><img src="{@RELATIVE_WCF_DIR}icon/saisonWarningAddM.png" alt="" /> <span>{lang}wcf.racing.league.button.editSaisons.addPunish{/lang}</span></a></li>{/if}312 </ul>313 </div>288 <div class="largeButtons"> 289 <ul> 290 {if $this->user->getPermission('admin.racing.league.caneditresults')}<li><a href="index.php?form=RacingLeagueResults{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/saisonwM.png" alt="" /> <span>{lang}wcf.racing.league.button.editSaisons.backToResult{/lang}</span></a></li>{/if} 291 {if $this->user->getPermission('admin.racing.league.caneditresults')}<li><a href="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&addPunish=1"><img src="{@RELATIVE_WCF_DIR}icon/saisonWarningAddM.png" alt="" /> <span>{lang}wcf.racing.league.button.editSaisons.addPunish{/lang}</span></a></li>{/if} 292 </ul> 293 </div> 314 294 <br /> 315 295 <br />
