Changeset 880 for trunk/Modules/Translation/Progress.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Progress.php
r847 r880 8 8 9 9 $BuildNumber = GetBuildNumber($_SESSION['StatVersion']); 10 if (is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')';10 if (is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')'; 11 11 else $LanguageFilter = ' AND (`Language`!='.$this->System->Config['OriginalLanguage'].')'; 12 12 … … 14 14 $Query = ''; 15 15 $DbResult = $this->Database->query($GroupListQuery); 16 if ($DbResult->num_rows > 0)16 if ($DbResult->num_rows > 0) 17 17 { 18 while ($DbRow = $DbResult->fetch_assoc())18 while ($DbRow = $DbResult->fetch_assoc()) 19 19 { 20 20 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. … … 50 50 $Total = 0; 51 51 $DbResult = $this->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 52 while ($Group = $DbResult->fetch_assoc())52 while ($Group = $DbResult->fetch_assoc()) 53 53 { 54 54 $Output .= '<tr><td>'.T($Group['Name']).'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'; … … 56 56 $Total += $Group['Total']; 57 57 } 58 if ($Total <> 0) $TotalCount = round($Translated / $Total * 100, 2);58 if ($Total <> 0) $TotalCount = round($Translated / $Total * 100, 2); 59 59 else $TotalCount = 0; 60 60 $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, $TotalCount).'</strong></td></tr>'. 61 61 '</table>'; 62 62 } 63 return ($Output);63 return $Output; 64 64 } 65 65 … … 69 69 $LanguageList = GetLanguageList(); 70 70 71 if (array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];72 if (!array_key_exists('StatVersion', $_SESSION))71 if (array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version']; 72 if (!array_key_exists('StatVersion', $_SESSION)) 73 73 { 74 if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != ''))74 if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != '')) 75 75 { 76 76 $_SESSION['StatVersion'] = $this->System->User->PreferredVersionGame; … … 80 80 } 81 81 82 if (!isset($_SESSION['language']))82 if (!isset($_SESSION['language'])) 83 83 { 84 if ($this->System->User->Licence(LICENCE_USER))84 if ($this->System->User->Licence(LICENCE_USER)) 85 85 { 86 86 $_SESSION['language'] = $this->System->User->Language; … … 89 89 } 90 90 } 91 if (array_key_exists('language', $_GET))91 if (array_key_exists('language', $_GET)) 92 92 { 93 if ($_GET['language'] == '') {93 if ($_GET['language'] == '') { 94 94 $_SESSION['language'] = ''; 95 95 } else { … … 97 97 } 98 98 } 99 if (!array_key_exists($_SESSION['language'], $LanguageList)) $_SESSION['language'] = '';99 if (!array_key_exists($_SESSION['language'], $LanguageList)) $_SESSION['language'] = ''; 100 100 101 101 // Show client version selection 102 102 $Output = T('Client version:').' '; 103 103 $DbResult = $this->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`'); 104 while ($DbRow = $DbResult->fetch_assoc())104 while ($DbRow = $DbResult->fetch_assoc()) 105 105 $Output .= '<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> '; 106 106 $Output .= '<br/>'; … … 109 109 $Output .= T('Language:').' '; 110 110 $Lang = '<a href="?language=">'.T('All').'</a>'; 111 if ($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';111 if ($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> '; 112 112 else $Output .= $Lang; 113 foreach ($LanguageList as $Language)114 if ($Language['Enabled'] == 1)113 foreach ($LanguageList as $Language) 114 if ($Language['Enabled'] == 1) 115 115 { 116 116 $Lang = ' <a href="?language='.$Language['Id'].'">'.T($Language['Name']).'</a>'; 117 if ($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';117 if ($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> '; 118 118 else $Output .= $Lang; 119 119 } 120 120 121 if (is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];121 if (is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name']; 122 122 else $LanguageName = T('All'); 123 123 $Output .= '<br/><br/><h3>'.sprintf(T('Statistics of translation completion of language %s for version %s'), T($LanguageName), $_SESSION['StatVersion']).'</h3><br/>'; 124 124 $Output .= $this->ShowStatTable(); 125 125 126 return ($Output);126 return $Output; 127 127 } 128 128 }
Note:
See TracChangeset
for help on using the changeset viewer.