Changeset 707

Show
Ignore:
Timestamp:
11/10/08 17:29:57 (5 years ago)
Author:
MDMAN
Message:

racing-league modified

Location:
racing.league
Files:
1 added
7 modified

Legend:

Unmodified
Added
Removed
  • racing.league/de.xml

    r699 r707  
    44        <category name="wcf.racing.league"> 
    55                <!-- COPYRIGHT --> 
    6                 <item name="wcf.racing.league.copyright"><![CDATA[<a href="http://www.mdman.de"><strong>Racing-League PlugIn&copy; 1.0.0 beta 2</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&copy; 1.0.0 beta 3</strong>, entwickelt von MDMAN</a> <strong>| Icons by illyaine</strong>]]></item> 
    77                <!-- COPYRIGHT --> 
    88                 
  • racing.league/files/lib/action/RacingLeagueDeleteRaceAction.class.php

    r691 r707  
    3939                        WCF::getDB()->sendQuery($sql); 
    4040                         
     41                        // hier werden auch Strafen fÃŒr das gelöschte Rennen gelöscht                         
     42                        $sql = "DELETE FROM `wcf".WCF_N."_racing_punish` 
     43                                WHERE `raceID` = '".escapeString($this->raceID)."' 
     44                                        ";                       
     45                        WCF::getDB()->sendQuery($sql); 
     46                         
    4147                        if ($row > 0) {                          
    4248                                WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('racingLeagueDeleteSuccess')); 
  • racing.league/files/lib/action/RacingLeagueDeleteResultAction.class.php

    r691 r707  
    3535                        $res = WCF::getDB()->sendQuery($sql); 
    3636                        $row = WCF::getDB()->getAffectedRows($res); 
     37                         
     38                        // Hier werden Strafen fÃŒr das Rennen gelöscht 
     39                        $sql = "DELETE FROM `wcf".WCF_N."_racing_punish` 
     40                                        WHERE `raceID` = '".escapeString($this->raceID)."' 
     41                                        ";                       
     42                        WCF::getDB()->sendQuery($sql); 
    3743 
    3844                        // Hier wird das Rennen wieder aktiviert (drived = 0) 
  • racing.league/files/lib/action/RacingLeagueDeleteSaisonAction.class.php

    r691 r707  
    6363                                        ";                       
    6464                        WCF::getDB()->sendQuery($sql); 
     65                         
     66                        $sql = "DELETE FROM `wcf".WCF_N."_racing_punish` 
     67                                        WHERE `saisonID` = '".escapeString($this->saisonID)."' 
     68                                        ";                       
     69                        WCF::getDB()->sendQuery($sql); 
    6570 
    6671                        if (WCF::getSession()->getVar('activeSaisonID') == $this->saisonID) { 
  • racing.league/files/lib/form/RacingLeaguePunishForm.class.php

    r706 r707  
    2121        public $addPunish = 0; 
    2222        public $raceID = 0; 
    23         public $driver = 0; 
     23        public $driver = ''; 
    2424        public $minusPoints = ''; 
    2525        public $punishReason = ''; 
     
    6262 
    6363                // driver 
    64                 if (empty($this->driver)) { 
     64                if (empty($this->driver) && $this->addPunish == 3) { 
    6565                        throw new UserInputException('driver'); 
    6666                } 
    6767 
    6868                // punishReason 
    69                 if (empty($this->punishReason)) { 
     69                if (empty($this->punishReason) && $this->addPunish == 3) { 
    7070                        throw new UserInputException('punishReason'); 
    7171                }                                
     
    8080                // Hier werden alle Rennen inklusive Strafen geladen 
    8181                if ($this->activeSaisonID != 0) { 
    82                          
     82                        $sql = "SELECT  `a`.*,  
     83                                                        `b`.`username`, 
     84                                                        `b`.`userID`, 
     85                                                        `c`.`raceName`, 
     86                                                        `c`.`raceNo` 
     87                                FROM `wcf".WCF_N."_racing_punish` AS `a` 
     88                                LEFT JOIN `wcf".WCF_N."_user` AS `b` 
     89                                ON (`b`.`userID` = `a`.`userID`) 
     90                                LEFT JOIN `wcf".WCF_N."_racing_races` AS `c` 
     91                                ON (`a`.`raceID` = `c`.`raceID`) 
     92                                WHERE `a`.`saisonID` = '".$this->activeSaisonID."' 
     93                                AND `c`.`saisonID` = '".$this->activeSaisonID."' 
     94                                ORDER BY `raceNo` ASC                            
     95                                "; 
     96                        $res = WCF::getDB()->sendQuery($sql); 
     97 
     98                        while ($row = WCF::getDB()->fetchArray($res)) { 
     99                                $this->punish[] = $row; 
     100                        } 
    83101                } 
    84102 
    85103                if ($this->activeSaisonID != 0 && $this->addPunish == 1) { 
    86104                        // Hier werden alle gefahrenen Rennen geladen (drived = 1) 
    87                         $sql = "SELECT * 
     105                        $sql = "SELECT raceID, raceName 
    88106                                FROM `wcf".WCF_N."_racing_races` 
    89107                                WHERE `saisonID` = '".$this->activeSaisonID."' 
     
    112130                parent::save(); 
    113131 
    114                 if ($this->addPunish == 1 && isset($this->driver) && isset($this->minusPoints) && isset($this->punishReason) && $this->raceID > 0 && $this->activeSaisonID != 0) { 
     132                if ($this->addPunish == 3 && isset($this->driver) && isset($this->minusPoints) && isset($this->punishReason) && $this->raceID > 0 && $this->activeSaisonID != 0) { 
    115133                 
    116134                        $sql = "INSERT INTO `wcf".WCF_N."_racing_punish` 
  • racing.league/package.xml

    r691 r707  
    1111                <packagedescription language="de"><![CDATA[Mit diesem PlugIn werden PunktestÀnde einer laufenden Racing-Liga dargestellt.]]></packagedescription> 
    1212                <packagedescription language="de-informal"><![CDATA[Mit diesem PlugIn werden PunktestÀnde einer laufenden Racing-Liga dargestellt.]]></packagedescription> 
    13                 <version>1.0.0 beta 2</version> 
    14                 <date>2008-10-11</date> 
     13                <version>1.0.0 beta 3</version> 
     14                <date>2008-11-11</date> 
    1515                <plugin>com.woltlab.wcf</plugin> 
    1616                <isunique>1</isunique> 
  • racing.league/templates/racingLeaguePunish.tpl

    r706 r707  
    3838 
    3939        {if $addPunish == 1 && $raceID == 0} 
    40         //hier wird das Rennen ausgewÀhlt, in der die Straftat gefahren wurde 
    41         <form method="post" action="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;addPunish=1"> 
     40         
     41        <form method="post" action="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;addPunish=2"> 
    4242        <div class="border content"> 
    4343                <div class="container-1">                
     
    5050                                </div> 
    5151                                <div class="formField"> 
    52                                  
     52                                                                 
    5353                                <select name='raceID'> 
    5454                                {foreach from=$drivedRaces item=value} 
    55                                         <option value='{$value.raceID}'>{$value.raceName}<option>                                
     55                                        <option value='{$value.raceID}'>{$value.raceName}</option>                               
    5656                                {/foreach} 
    5757                                </select> 
     
    7575        {/if} 
    7676 
    77         {if $addPunish == 1 && $raceID > 0} 
    78         //hier kann man die Strafe einem Fahrer zuordnen und den Grund sowie die Minuspunkte deklarieren. 
    79         <form method="post" action="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;addPunish=1&amp;raceID={$raceID}"> 
     77        {if $addPunish >= 2 && $raceID > 0} 
     78         
     79        <form method="post" action="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;addPunish=3&amp;raceID={$raceID}"> 
    8080        <div class="border content"> 
    8181                <div class="container-1">                
    82                 <h3 class="subHeadline"><img src="{@RELATIVE_WCF_DIR}icon/saisonWarningAddS.png" alt="" /> {lang}wcf.racing.league.punish.addaddPunish{/lang}</h3> 
    83                         <p class="description">{lang}wcf.racing.league.punish.addaddPunish.description{/lang}</p>                                                
     82                <h3 class="subHeadline"><img src="{@RELATIVE_WCF_DIR}icon/saisonWarningAddS.png" alt="" /> {lang}wcf.racing.league.punish.addPunish{/lang}</h3> 
     83                        <p class="description">{lang}wcf.racing.league.punish.addPunish.description{/lang}</p>                                           
    8484                <br /> 
    8585                        <div class="formElement{if $errorField == 'driver'} formError{/if}"> 
     
    9292                                        <option value="">----------</option> 
    9393                                {foreach from=$users item=value} 
    94                                         <option value='{$value.userID}' {if $driver == $value.userID}selected{/if}>{$value.username}<option>                             
     94                                        <option value='{$value.userID}' {if $driver == $value.userID}selected{/if}>{$value.username}</option>                            
    9595                                {/foreach} 
    9696                                </select> 
     
    208208                                                        <col width="320"> 
    209209                                                        <col width="80"> 
     210                                                        <col width="80"> 
    210211                                                        <col width="160"> 
    211212                                                </colgroup> 
     
    213214                                                <thead> 
    214215                                                        <tr class="tableHead"> 
    215                                                                 <td align='center'>{lang}wcf.racing.league.results.raceNo{/lang}</td> 
    216216                                                                <td align='center'>{lang}wcf.racing.league.results.racename{/lang}</td> 
     217                                                                <td align='center'>{lang}wcf.racing.league.results.username{/lang}</td> 
     218                                                                <td align='center'>{lang}wcf.racing.league.results.minuspoints{/lang}</td> 
    217219                                                                <td align='center'>{lang}wcf.racing.league.results.punish{/lang}</td> 
    218220                                                                <td align='center'>{lang}wcf.racing.league.results.action{/lang}</td> 
     
    223225                                                         
    224226                                                        <tr class={cycle}> 
    225                                                         <td align='center'><strong>{$punish.raceNo}</strong></td> 
    226                                                         <td align='center'><a href="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;punishRaceID={$punish.raceID}">{$punish.raceName}</a></td> 
    227                                                         <td align='center'></td> 
    228                                                         <td align='center'><a href="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;punishRaceID={$punish.raceID}"><img src="{@RELATIVE_WCF_DIR}icon/saisonWarningAddS.png" alt="" title="{lang}wcf.racing.league.punish.Add{/lang}" /></a></td> 
     227                                                        <td align='center'><strong>{$punish.raceName}</strong></td> 
     228                                                        <td align='center'><a href="/index.php?page=User{@SID_ARG_2ND}&amp;userID={$punish.userID}">{$punish.username}</a></td> 
     229                                                        <td align='center'><strong>{$punish.minusPoints}</strong></td> 
     230                                                        <td align='center'>{$punish.punishReason}</td> 
     231                                                        <td align='center'> 
     232                                                                <a href="index.php?form=RacingLeaguePunish{@SID_ARG_2ND}&amp;punishRaceID={$punish.punishID}"><img src="{@RELATIVE_WCF_DIR}icon/saisonWarningEditS.png" alt="" title="{lang}wcf.racing.league.punish.edit{/lang}" /></a> 
     233                                                                <a href="index.php?action=RacingLeagueDeletePunish{@SID_ARG_2ND}&amp;punishID={$punish.punishID}" onclick="return confirm('{lang}wcf.racing.league.punish.delete.confirm{/lang}');"><img src="{@RELATIVE_WCF_DIR}icon/deleteS.png" alt="" title="{lang}wcf.racing.league.punish.delete{/lang}" /></a> 
     234                                                        </td> 
    229235                                                        </tr>                                                    
    230236