source: trunk/form.php@ 365

Last change on this file since 365 was 365, checked in by george, 15 years ago
  • Upraveno: Jména tabulek v databází upraveny na stejná s prvními velkými písmeny.
  • Upraveno: Doplněny SQL uvozovky do mnoha SQL dotazů.
File size: 6.7 KB
Line 
1<?php
2
3include('includes/global.php');
4
5ShowPage();
6
7$GroupId = LoadGroupIdParameter();
8$Table = $TranslationTree[$GroupId]['TablePrefix'];
9if(array_key_exists('action', $_GET)) $Action = $_GET['action']; else $Action = '';
10
11if(array_key_exists('ID', $_GET))
12{
13 $TextID = $_GET['ID'] * 1;
14
15 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
16 $Line = mysql_fetch_assoc($DbResult);
17 if(!$Line) die('Překlad nenalezen.');
18
19 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0 AND `Entry` = '.$Line['Entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1');
20 $LineAJ = mysql_fetch_assoc($DbResult);
21 if(!$Line) die('Anglický originál k překladu nenalezen.');
22
23 $User = @$_SESSION['User'];
24 $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);
25 $LineUser = mysql_fetch_array($IDUser);
26
27 echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />');
28
29 if(($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
30 echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> <br />');
31 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
32 {
33 $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']));
34 // echo $Language['Language'].' '.$Line['Take'];
35 if($Language['Language'] <> 0)
36 echo('Převzato z: <a href="form.php?group='.$GroupId.'&amp;ID='.$Line['Take'].'">'.$Line['Take'].'</a> <br />');
37 }
38 echo('Text: ');
39 if($Line['Language'] <> 0)
40 {
41 if($Line['Complete'] == 1) echo(' <b>Hotov</b>');
42 else echo(' <b> Uložen v rozepsaných</b> ');
43 } else echo(' <b>Anglická, původní verze</b> ');
44
45 echo('<br />');
46 echo('Verze: <b>'.GetVersionWOW($Line['VersionStart']).' - '.GetVersionWOW($Line['VersionEnd'].'</b>'));
47 echo('<br />');
48
49 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `Entry` = '.$Line['Entry'].' AND `Language` <> 0');
50 $Version = mysql_fetch_row($DbResult);
51 $Version = $Version[0];
52 if($Version > 0)
53 {
54 echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['Entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>
55 <input type="hidden" name="group" value="'.$GroupId.'" />
56 <input type="hidden" name="entry" value="'.$Line['Entry'].'" />
57 <input type="hidden" name="ID2" value="'.$TextID.'" />
58 <select onchange="this.form.submit();" name="ID1">
59 <option value="-1">Vyberte text k porovnání</option>
60 <option value="-1">Zobrazit/porovnat všechny</option>');
61 $DataID = $Database->SQLCommand('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].')');
62 while($version = mysql_fetch_array($DataID))
63 {
64 if ($version['ID'] == $Line['Take']) echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' (převzato)</option>');
65 else
66 {
67 if($version['Language'] == 0) $version['UserName'] = 'Předloha';
68 echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['UserName'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
69 }
70 }
71 echo('</select></form>');
72 } else
73 {
74 echo('<a href="TranslationList.php?group='.$GroupId.'&amp;action=searchentry&amp;ID='.$Line['Entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>');
75 }
76
77// Speciální znaky: $B - Odřádkování, $N - Jméno, $C - povolání
78 echo('<form action="save.php?group='.$GroupId.'" method="post"><div>');
79 if(Licence(LICENCE_USER))
80 {
81 if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$GroupId.'&amp;ID='.$LineAJ['ID'].'" target="_blank" title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>');
82 echo(' <input type="submit" value="Uložit do rozepsaných" name="save" title="Klikněte na uložit pro pozdější dokončení překladu" />
83 <input type="submit" value="Dokončeno" name="End" title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat" /> ');
84 FollowingTran($TextID, $Table, $GroupId, true);
85 FollowingTran($TextID, $Table, $GroupId);
86 }
87
88 if($TranslationTree[$GroupId]['WowheadName'] != '')
89 $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>';
90 else $WowheadLink = $LineAJ['Entry'];
91
92 echo('<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />
93 <input type="hidden" name="user" value="'.$User.'" />
94 <input type="hidden" name="ID" value="'.$TextID.'" />
95 <table class="BaseTable">
96 <tr>
97 <th>Číslo textu: '.$WowheadLink.'</th>
98 <th>Nepřeložené</th>
99 <th>Přeložené</th>
100 </tr>
101 <tr>
102 <th>Jazyk</th>
103 <td>Anglický</td>
104 <td>
105 Přeloženo do:');
106 if($Line['Language'] <> 0) $Language = $Line['Language'];
107 else if($_SESSION['UserID'] != '')
108 {
109 $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']);
110 $LineUser = mysql_fetch_array($IDUser);
111 $Language = $LineUser['Language']; // jiný user vyčítám
112 } else $Language = 0;
113 WriteLanguages($Language);
114 echo('</td></tr>');
115 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
116 if($TextItem['Visible'] == 1)
117 {
118 if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> ''))
119 {
120 if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) echo('<tr><th>'.$LineAJ['ShortCut'].'</th>');
121 else echo('<tr><th>'.$TextItem['Name'].'</th>');
122 echo('<td>'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td>
123 <td><textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'.htmlspecialchars($Line[$TextItem['Column']]).'</textarea></td></tr>');
124 }
125 } else
126 {
127 echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />');
128 }
129 echo('</table></div></form>');
130} else
131{
132 // include 'ListQuests.php';
133 echo('Nebylo zadáno ID <a href="index.php">zpět</a>');
134}
135
136ShowFooter();
137
138?>
139
Note: See TracBrowser for help on using the repository browser.