Ignore:
Timestamp:
Mar 1, 2015, 3:38:19 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Removed generation of user level to images as files. Level images ware replaced by HTML progress bar.
  • Modified: User XP level and translated count is now calculated during every translation save operation rather then calculated in user list and group view page show.
  • Fixed: Wrong indentation in some files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Translation/Progress.php

    r816 r826  
    1919      {
    2020        $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    21             'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '.
    22             'WHERE (`Complete` = 1) '.$LanguageFilter.' '.
    23             'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    24             ') AS `C1`) AS `Translated`, '.
    25             '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    26             'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '.
    27             'WHERE (`Language` = '.$this->System->Config['OriginalLanguage'].') '.
    28             'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    29             ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
     21          'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '.
     22          'WHERE (`Complete` = 1) '.$LanguageFilter.' '.
     23          'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
     24          ') AS `C1`) AS `Translated`, '.
     25          '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
     26          'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '.
     27          'WHERE (`Language` = '.$this->System->Config['OriginalLanguage'].') '.
     28          'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
     29          ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
    3030      }
    3131      $Query = substr($Query, 0, - 6);
     
    3838      $Output .= '<table class="BaseTable">';
    3939      $TableColumns = array(
    40           array('Name' => 'Name', 'Title' => 'Jméno'),
    41           array('Name' => 'Translated', 'Title' => 'Přeložených'),
    42           array('Name' => 'Total', 'Title' => 'Anglických'),
    43           array('Name' => 'Percent', 'Title' => 'Procenta'),
     40        array('Name' => 'Name', 'Title' => 'Jméno'),
     41        array('Name' => 'Translated', 'Title' => 'Přeložených'),
     42        array('Name' => 'Total', 'Title' => 'Anglických'),
     43        array('Name' => 'Percent', 'Title' => 'Procenta'),
    4444      );
    4545
     
    6767  {
    6868    $this->Title = T('Progress');
    69 $LanguageList = GetLanguageList();
     69    $LanguageList = GetLanguageList();
    7070
    71 if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
    72 if(!array_key_exists('StatVersion', $_SESSION))
    73 {
    74   if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != ''))
    75   {
    76     $_SESSION['StatVersion'] = $this->System->User->PreferredVersionGame;
    77   } else
    78     $_SESSION['StatVersion'] = $this->System->Config['Web']['GameVersion'];
    79 }
     71    if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
     72    if(!array_key_exists('StatVersion', $_SESSION))
     73    {
     74      if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != ''))
     75      {
     76        $_SESSION['StatVersion'] = $this->System->User->PreferredVersionGame;
     77      } else {
     78        $_SESSION['StatVersion'] = $this->System->Config['Web']['GameVersion'];
     79      }
     80    }
    8081
    81 if(!isset($_SESSION['language']))
    82 {
    83   if($this->System->User->Licence(LICENCE_USER))
    84   {
    85     $_SESSION['language'] = $this->System->User->Language;
    86   } else $_SESSION['language'] = '';
    87 }
    88 if(array_key_exists('language', $_GET)) {
    89   if($_GET['language'] == '') $_SESSION['language'] = '';
    90     else {
    91       $_SESSION['language'] = $_GET['language'] * 1;
     82    if(!isset($_SESSION['language']))
     83    {
     84      if($this->System->User->Licence(LICENCE_USER))
     85      {
     86        $_SESSION['language'] = $this->System->User->Language;
     87      } else {
     88        $_SESSION['language'] = '';
     89      }
    9290    }
    93 }
    94 if(!array_key_exists($_SESSION['language'], $LanguageList)) $_SESSION['language'] = '';
     91    if(array_key_exists('language', $_GET))
     92    {
     93      if($_GET['language'] == '') {
     94        $_SESSION['language'] = '';
     95      } else {
     96        $_SESSION['language'] = $_GET['language'] * 1;
     97      }
     98    }
     99    if(!array_key_exists($_SESSION['language'], $LanguageList)) $_SESSION['language'] = '';
    95100
    96 // Show client version selection
    97 $Output = 'Verze klienta: ';
    98 $DbResult = $this->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`');
    99 while($DbRow = $DbResult->fetch_assoc())
    100   $Output .= '<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ';
    101 $Output .= '<br/>';
     101    // Show client version selection
     102    $Output = 'Verze klienta: ';
     103    $DbResult = $this->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`');
     104    while($DbRow = $DbResult->fetch_assoc())
     105      $Output .= '<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ';
     106    $Output .= '<br/>';
    102107
    103 // Show language selection
    104 $Output .= 'Jazyk: ';
    105 $Lang = '<a href="?language=">Všechny</a>';
    106 if($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';
    107   else $Output .= $Lang;
    108 foreach($LanguageList as $Language)
    109 if($Language['Enabled'] == 1)
    110 {
    111   $Lang = ' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>';
    112   if($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
    113     else $Output .= $Lang;
    114 }
     108    // Show language selection
     109    $Output .= 'Jazyk: ';
     110    $Lang = '<a href="?language=">Všechny</a>';
     111    if($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';
     112      else $Output .= $Lang;
     113    foreach($LanguageList as $Language)
     114    if($Language['Enabled'] == 1)
     115    {
     116      $Lang = ' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>';
     117      if($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
     118        else $Output .= $Lang;
     119    }
    115120
    116 if(is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
    117   else $LanguageName = 'Všechny';
    118 $Output .= '<br/><br /><h3>Statistika dokončení překladů jazyka '.$LanguageName.' pro verzi '.$_SESSION['StatVersion'].'</h3><br/>';
    119 $Output .= $this->ShowStatTable();
     121    if(is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
     122      else $LanguageName = 'Všechny';
     123    $Output .= '<br/><br /><h3>Statistika dokončení překladů jazyka '.$LanguageName.' pro verzi '.$_SESSION['StatVersion'].'</h3><br/>';
     124    $Output .= $this->ShowStatTable();
    120125
    121126    return($Output);
Note: See TracChangeset for help on using the changeset viewer.