Changeset 727


Ignore:
Timestamp:
Jan 7, 2014, 9:54:21 PM (11 years ago)
Author:
chronos
Message:
  • Added: Each client version as separated web page.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/ClientVersion/ClientVersion.php

    r637 r727  
    3030{
    3131        function Show()
     32        {
     33                if(array_key_exists('action', $_GET))
     34                {
     35                        if($_GET['action'] == 'item') $Output = $this->ShowItem();
     36                        else $Output = $this->ShowList();
     37                } else $Output = $this->ShowList();
     38                return($Output);
     39        }
     40       
     41        function ShowItem()
     42        {
     43     $YesNo = array('Ne', 'Ano');
     44     $DbResult = $this->System->Database->query('SELECT * FROM ClientVersion WHERE Id='.$_GET['id']);
     45     if($DbResult->num_rows > 0)
     46     {
     47         $Version = $DbResult->fetch_assoc();
     48   
     49     $Output = '<h3>'.T('Client version').'</h3>';
     50     $Output .= '<table class="BaseTable">'.
     51        '<tr><td>'.T('Version').'</td><td>'.$Version['Version'].'</td></tr>'.
     52        '<tr><td>'.T('More information').'</td><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">wowwiki.com'.
     53        '</a></td></tr>'.
     54        '<tr><td>'.T('Build number').'</td><td>'.$Version['BuildNumber'].'</td></tr>'.
     55        '<tr><td>'.T('Release date').'</td><td>'.HumanDate($Version['ReleaseDate']).'</td></tr>'.
     56        '<tr><td>'.T('Title').'</td><td>'.$Version['Title'].'</td></tr>'.
     57        '<tr><td>'.T('Imported').'</td><td>'.$YesNo[$Version['Imported']].'</td></tr>'.
     58        '</table>';
     59        $Output .= '<div><a href="?">'.T('All versions list').'</a></div>';
     60        if($Version['Imported'])
     61          $Output .= '<div><a href="'.$this->System->Link('/progress/?Version='.$Version['Version']).'">'.T('Progress').'</a></div>';
     62     } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
     63                return($Output);
     64        }
     65       
     66        function ShowList()
    3267        {               
    3368                $this->Title = T('Game version');
     
    5590    while($Version = $DbResult->fetch_assoc())
    5691    {
    57       $Output .= '<tr><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">'.
     92      $Output .= '<tr><td><a href="?action=item&amp;id='.$Version['Id'].'">'.
    5893        $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'.
    5994        HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td>'.
  • trunk/Modules/Export/Export.php

    r721 r727  
    273273    return($Buffer);
    274274  } 
    275  
    276  
    277275 
    278276  function HaveVarible($String1, $String2, $StartChar = '$')
  • trunk/Modules/Export/Page.php

    r716 r727  
    5555                                $Order['Output'];
    5656       
    57                 $DbResult = $this->System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion`,(SELECT Name FROM `ExportOutputType` WHERE `ExportOutputType`.`Id`=`Export`.`OutputType`) AS `OutputType`, (SELECT COUNT(*) FROM `ExportGroup` WHERE `ExportGroup`.`Export`=`Export`.`Id`) AS `GroupCount`, (SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
     57                $DbResult = $this->System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, '.
     58      '(SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion`, '.
     59      '(SELECT Id FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersionId`, '.
     60      '(SELECT Name FROM `ExportOutputType` WHERE `ExportOutputType`.`Id`=`Export`.`OutputType`) AS `OutputType`, '.
     61      '(SELECT COUNT(*) FROM `ExportGroup` WHERE `ExportGroup`.`Export`=`Export`.`Id`) AS `GroupCount`, '.
     62      '(SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` '.
     63      'LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
    5864                while($Export = $DbResult->fetch_assoc())
    5965                {
     
    6672                                        '<td>'.$Export['Title'].'</td>'.
    6773                                        '<td>'.$Export['OutputType'].'</td>'.
    68                                         '<td>'.$Export['ClientVersion'].'</td>'.
     74                                        '<td><a href="'.$this->System->Link('/client-version/?action=item&amp;id='.$Export['ClientVersionId']).'">'.$Export['ClientVersion'].'</a></td>'.
    6975                                        '<td>'.$Export['UsedCount'].'</td>'.
    7076                                        '<td>'.$Action.'</td></tr>';
  • trunk/Modules/Import/Import.php

    r723 r727  
    457457        unset($Line);
    458458       
     459        $value_buff = '';
     460        $Value = '';
    459461        foreach($LineParts as $LinePart)
    460462        {
     
    523525    return($Output);
    524526  }
     527 
    525528  function UpdateLastVersion() {
    526529    $DbResult = $this->System->Database->query('SELECT * FROM `Group` WHERE `Id`='.$this->Group['Id']);
  • trunk/Modules/Import/cmd.php

    r718 r727  
    77include_once('../../includes/global.php');
    88include_once('../../includes/dbc.php');
    9 include_once('import.php');
     9include_once('Import.php');
    1010
    1111  $System = new System();
  • trunk/Modules/Translation/Form.php

    r710 r727  
    5858               
    5959    if($Action == 'delete') $Output = $this->Delete();
    60                 else $Output = $this->ShowForm();
     60                  else $Output = $this->ShowForm();
    6161                return($Output);
    6262        }
     
    290290        function Delete()
    291291        {
     292                global $TranslationTree;
     293               
    292294                if($this->System->User->Licence(LICENCE_MODERATOR))
    293295                {
     296                        $GroupId = LoadGroupIdParameter();
     297                  $this->GroupId = $GroupId;
     298                  $Table = $TranslationTree[$GroupId]['TablePrefix'];
    294299                        $TextID = $_GET['ID'];
    295300                        $this->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> '.$this->System->Config['OriginalLanguage']);
    296301                        $Output = ShowMessage('Překlad byl smazán.');
    297                         $this->System->ModuleManager->Modules['Log']->WriteLog('Překlad byl smazán! <a href="'.$this->System->Link('/form.php?group='.$GroupID.'&amp;ID='.$TextID).'">'.$TextID.'</a>', LOG_TYPE_MODERATOR);
     302                        $this->System->ModuleManager->Modules['Log']->WriteLog('Překlad byl smazán! <a href="'.$this->System->Link('/form.php?group='.$this->GroupId.'&amp;ID='.$TextID).'">'.$TextID.'</a>', LOG_TYPE_MODERATOR);
    298303                } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    299304                return($Output);
  • trunk/Modules/Translation/Save.php

    r724 r727  
    55  function Show()
    66  {
    7         global $TranslationTree;
     7        global $TranslationTree, $Message, $MessageType;
    88       
    99        $Output = '';
  • trunk/Modules/Translation/TranslationList.php

    r661 r727  
    311311                        if($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua ';
    312312                        $Output .= '</td><td><a title="Změny po posledním importu u vybrané překladové skupiny" href="log.php?group='.
    313                                 $Group['Id'].'&amp;type=11">'.HumanDate($Group['LastImport']).'</a></td><td>'.GetVersionWOW($Group['LastVersion']).'</td>';
     313                                $Group['Id'].'&amp;type=11">'.HumanDate($Group['LastImport']).'</a></td><td><a href="'.$this->System->Link('/client-version/?action=item&amp;id='.GetVersionWOWId($Group['LastVersion'])).'">'.GetVersionWOW($Group['LastVersion']).'</a></td>';
    314314                  if($this->System->User->Licence(LICENCE_ADMIN))
    315315                    $Output .= '<td><a href="?action=groupdelete&amp;id='.$Group['Id'].'">Smazat</a></td>';
  • trunk/admin/UpdateTrace.php

    r725 r727  
    26692669function UpdateTo646($Manager)
    26702670{
    2671         $Manager->Execute('ALTER TABLE  `Export` ADD  `AllUsers` TINYINT( 1 ) NOT NULL ;');
     2671        $Manager->Execute('ALTER TABLE `Export` ADD  `AllUsers` TINYINT( 1 ) NOT NULL ;');
    26722672
    26732673}
     
    26752675function UpdateTo666($Manager)
    26762676{
    2677         $Manager->Execute('INSERT INTO  `ExportOutputType` (`Id` ,`Name`)VALUES (\'10\' ,  \'Instalace - Instala�n� soubor pro klienta\');');   
    2678         $Manager->Execute('INSERT INTO  `ExportVersion` (`Id` ,`ExportType` ,`ClientVersion`)VALUES (NULL ,  \'10\',  \'84\');');   
     2677        $Manager->Execute('INSERT INTO `ExportOutputType` (`Id` ,`Name`) VALUES (\'10\' ,  \'Instalace - Instalační soubor pro klienta\');');   
     2678        $Manager->Execute('INSERT INTO `ExportVersion` (`Id` ,`ExportType` ,`ClientVersion`)VALUES (NULL ,  \'10\',  \'84\');');   
    26792679}
    26802680
    26812681function UpdateTo678($Manager)
    26822682{
    2683         $Manager->Execute('INSERT INTO  `ExportVersion` (`Id` ,`ExportType` ,`ClientVersion`)VALUES (NULL ,  \'10\',  \'11\');');   
     2683        $Manager->Execute('INSERT INTO `ExportVersion` (`Id` ,`ExportType` ,`ClientVersion`)VALUES (NULL ,  \'10\',  \'11\');');   
    26842684}
    26852685
  • trunk/includes/global.php

    r712 r727  
    373373}
    374374
     375// TODO: Client version build number should not be used in internal references
    375376function GetVersionWOW($BuildNumber)
    376377{
     
    385386  }
    386387  return($VersionsWOW[$BuildNumber]);
     388}
     389
     390// TODO: Client version build number should not be used in internal references
     391function GetVersionWOWId($BuildNumber)
     392{
     393  global $System, $VersionsWOWId;
     394 
     395  if(isset($VersionsWOWId[$BuildNumber]) == false)
     396  {
     397    $sql = 'SELECT `Id` FROM `ClientVersion` WHERE `BuildNumber` = "'.$BuildNumber.'"';
     398    $DbResult = $System->Database->query($sql);
     399    $Version = $DbResult->fetch_assoc();
     400    $VersionsWOWId[$BuildNumber] = $Version['Id'];
     401  }
     402  return($VersionsWOWId[$BuildNumber]);
    387403}
    388404
Note: See TracChangeset for help on using the changeset viewer.