Changeset 900 for trunk/Modules/Translation/TranslationList.php
- Timestamp:
- Apr 10, 2024, 11:49:39 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/TranslationList.php
r893 r900 257 257 258 258 $Query = 'SELECT `T`.`ModifyTime`, `T`.`ID`, `T`.`Entry`, `T`.`VersionStart`, `T`.`VersionEnd`, '. 259 260 261 262 263 264 265 266 267 259 '`T`.`'.$TranslationTree[$Filter['Group']]['Items'][0]['Column'].'`, '. 260 '`User`.`Name` AS `UserName`, `User`.`ID` AS `UserId`, '. 261 '`Language`.`Name` AS `LanguageName`, `TS`.`Version` AS `VersionStartText`, `TE`.`Version` AS `VersionEndText` '. 262 'FROM `'.$Table.'` AS `T` '. 263 'LEFT JOIN `User` ON `User`.`ID` = `T`.`User` '. 264 'LEFT JOIN `Language` ON `Language`.`ID` = `T`.`Language` '. 265 'LEFT JOIN `ClientVersion` AS `TS` ON `TS`.`BuildNumber` = `T`.`VersionStart` '. 266 'LEFT JOIN `ClientVersion` AS `TE` ON `TE`.`BuildNumber` = `T`.`VersionEnd` '. 267 'WHERE 1 '.$Filter['SQL']; 268 268 269 269 // Get total item count 270 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `TT`'); 270 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `TT`'); 271 271 $DbRow = $DbResult->fetch_row(); 272 272 $PageList = GetPageList($DbRow[0]); … … 274 274 $Output .= $PageList['Output']; 275 275 $TableColumns = array( 276 277 278 279 280 281 282 283 276 array('Name' => 'ID', 'Title' => T('Number')), 277 array('Name' => 'Entry', 'Title' => T('Item')), 278 array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => T('Name')), 279 array('Name' => 'VersionStart', 'Title' => T('From version')), 280 array('Name' => 'VersionEnd', 'Title' => T('To version')), 281 array('Name' => 'LanguageName', 'Title' => T('Language')), 282 array('Name' => 'UserName', 'Title' => T('Translator')), 283 array('Name' => 'ModifyTime', 'Title' => T('Date')), 284 284 ); 285 285 286 286 $Order = GetOrderTableHeader($TableColumns, 'VersionStart', 1); 287 287 $Output .= '<table class="BaseTable">'. 288 288 $Order['Output']; 289 289 290 290 $DbResult = $this->Database->query($Query.' '.$Order['SQL'].' '.$PageList['SQLLimit']); 291 291 while ($Line = $DbResult->fetch_assoc()) 292 292 { 293 $Text = $Line[$TranslationTree[$Filter['Group']]['Items'][0]['Column']]; 294 if ($Text != null) $Text = htmlspecialchars($Text); 295 293 296 $Output .= '<tr><td><a href="'.$this->System->Link('/form.php?group='.$Filter['Group'].'&ID='.$Line['ID']).'">'.$Line['ID'].'</a></td>'. 294 297 '<td>'.$Line['Entry'].'</td>'. 295 '<td>'. htmlspecialchars($Line[$TranslationTree[$Filter['Group']]['Items'][0]['Column']]).'</td>'.298 '<td>'.$Text.'</td>'. 296 299 '<td><a href="'.$this->System->Link('/client-version/?action=item&id='. 297 300 GetVersionWOWId($Line['VersionStart'])).'">'.GetVersionWOW($Line['VersionStart']).'</a></td>'. … … 317 320 $Total = 0; 318 321 foreach ($TranslationTree as $Group) 322 { 319 323 if ($Group['TablePrefix'] != '') 320 324 { … … 326 330 $Total += $Line[0]; 327 331 } 328 $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Total.'</strong></td></tr>'. 329 '</table>'; 330 return $Output; 332 } 333 $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Total.'</strong></td></tr>'. 334 '</table>'; 335 return $Output; 331 336 } 332 337 … … 338 343 $GroupId = GetParameter('group', 0, true); 339 344 if ($GroupId == 0) $Output = ShowMessage('Skupina nenalezena', MESSAGE_CRITICAL); 340 else { 345 else 346 { 341 347 $Table = $TranslationTree[$GroupId]['TablePrefix']; 342 348 343 349 $Output = '<h3>'.T('Basic text filtering').'</h3><br/>'. 344 345 346 347 348 349 350 351 352 350 '<table class="BaseTable"><tr><th>'.T('Link').'</th><th>'.T('Description').'</th></tr>'. 351 '<tr><td><a title="'.T('All texts available in group').'" href="?group='.$GroupId.'&state=4">'.T('All').'</a></td>'. 352 '<td>'.T('Show all available original texts in group').'</td></tr>'. 353 '<tr><td><a title="'.T('Translated texts, you can modify them here').'" href="?group='.$GroupId.'&state=2">'.T('Translated').'</a></td>'. 354 '<td>'.T('Show only translated texts').'</td></tr>'. 355 '<tr><td><a title="'.T('Untranslated texts').'" href="?group='.$GroupId.'&state=1">'.T('Untranslated').'</a></td>'. 356 '<td>'.T('Not yet translated texts which need to be translated').'</td></tr>'. 357 '<tr><td><a title="'.T('Unfinished texts').'" href="?group='.$GroupId.'&state=3">'.T('Unfinished').'</a></td>'. 358 '<td>'.T('Texts marked as unfinished').'</td></tr>'; 353 359 354 360 if ($User->Licence(LICENCE_USER)) … … 361 367 362 368 $Output .= '<tr><td><form action="?group='.$GroupId.'&entry=" method="post"><div>'. 363 364 365 366 369 '<input type="text" name="text" size="8" />'. 370 '<input type="submit" value="'.T('Search').'" />'. 371 '</div></form>'. 372 '</td><td>'.T('Search using text').'</td></tr>'; 367 373 368 374 $Output .= '<tr><td><form action="?group='.$GroupId.'&text=" method="post"><div>'. 369 370 371 372 375 '<input type="text" name="entry" size="8" />'. 376 '<input type="submit" value="'.T('Search').'" />'. 377 '</div></form>'. 378 '</td><td>'.T('Show by datbase text ID').'</td></tr>'; 373 379 374 380 $Output .= '</table>'; … … 396 402 function ShowList() 397 403 { 398 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 404 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 399 405 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Group`'); 400 406 $DbRow = $DbResult->fetch_row(); … … 448 454 { 449 455 $Output = '<h3>Vložení nové překladové skupiny</h3>'. 450 451 452 453 454 455 456 '<form action="?action=groupaddfinish" method="post">'. 457 '<table>'. 458 '<tr><td>Název:</td><td><input type="text" name="Name"/></td></tr>'. 459 '<tr><td>Název tabulky v databázi:</td><td>Text<input type="text" name="TablePrefix"/></td></tr>'. 460 '<tr><td colspan="2"><input type="submit" name="add" value="Přidat"/></td></tr>'. 461 '</table></form>'; 456 462 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 457 463 return $Output;
Note:
See TracChangeset
for help on using the changeset viewer.