Changeset 311
- Timestamp:
- Jan 31, 2010, 2:40:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TranslationList.php
r309 r311 15 15 $ID = mysql_fetch_row($Database->SQLCommand('SELECT max(VersionEnd) FROM '.$TranslationTree[$GroupId]['TablePrefix'])); 16 16 $BuildNumber_max = $ID[0]; 17 18 if(array_key_exists('order', $_GET))19 {20 $order = $_GET['order'];21 $desc = $_GET['desc'];22 $_SESSION['order'] = $_GET['order'];23 $_SESSION['desc'] = $_GET['desc'];24 } else25 {26 if (isset($_SESSION['order']))27 {28 $order = $_SESSION['order'];29 $desc = $_SESSION['desc'];30 } else31 {32 $order = '';33 $desc = 'desc';34 }35 }36 37 if(array_key_exists('limitx', $_GET))38 {39 $_SESSION['limitx'] = $_GET['limitx'];40 $_SESSION['limity'] = $_GET['limity'];41 } else42 {43 if(isset($_SESSION['limitx']) == false)44 {45 $_SESSION['limitx'] = '0';46 $_SESSION['limity'] = $TranslationItemPerPage;47 }48 }49 17 50 18 if(($Action != 'userall') and ($Action != 'grouplist')) … … 127 95 } 128 96 129 if($Action == 'notran') 130 { 97 function Nontranslated() 98 { 99 global $GroupId, $Table, $BuildNumber_max; 100 131 101 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 132 102 <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">Nepřeložené texty</a> - > … … 138 108 WriteQuests('SELECT * FROM '.$Table.' AS items WHERE (items.Language = 0) AND 139 109 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'")', $_SESSION['limitx'].','.$_SESSION['limity'], 'notran'); 140 } else 141 if($Action == 'connexion') 142 { //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1) 110 } 111 112 function Connexion() 113 { 114 global $GroupId, $Table, $BuildNumber_max, $Database; 115 116 //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1) 143 117 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT Name FROM connexion WHERE `Id` = '.$_SESSION['connexion_id'])); 144 118 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> … … 146 120 <strong>Vypsání souvislostí ze skupiny '.$Line['Name'].'</strong><br /><br />'); 147 121 148 WritePages('?group='.$GroupId.'&action=connexion', ' WHERE Language = 0 AND entry IN(SELECT entry FROM connexion_item WHERE connexion = '.$_SESSION['connexion_id'].') AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'"'); 149 WriteQuests('SELECT *, (SELECT sub.User FROM '.$Table.' as sub WHERE sub.entry = '.$Table.'.entry AND Language <> 0 LIMIT 1) as UserID, (SELECT user.user FROM user WHERE user.id = UserID) as User FROM '.$Table.' WHERE Language = 0 AND entry IN(SELECT entry FROM connexion_item WHERE connexion = '.$_SESSION['connexion_id'].') AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'"', $_SESSION['limitx'].','.$_SESSION['limity'], 'connexion'); 150 151 } else 152 if($Action == 'connexion_list') 153 { //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1) 154 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 155 <a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&action=connexion">Souvislosti</a> - > 156 <strong>Vypsání souvislostí</strong><br /><br />'); 157 echo('<table class="BaseTable"><tr><th>Pořadové číslo</th><th>Název</th>'); 158 echo('</tr>'); 159 $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$GroupId); 160 while($Line = mysql_fetch_assoc($ID)) 161 { 162 echo('<tr><td><a href="?group='.$GroupId.'&action=connexion&connexion_id='.$Line['Id'].'">'.$Line['Id'].'</a></td> 122 WritePages('?group='.$GroupId.'&action=connexion', ' WHERE Language = 0 AND entry IN(SELECT entry FROM connexion_item WHERE connexion = '.$_SESSION['connexion_id'].') AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'"'); 123 WriteQuests('SELECT *, (SELECT sub.User FROM '.$Table.' as sub WHERE sub.entry = '.$Table.'.entry AND Language <> 0 LIMIT 1) as UserID, (SELECT user.user FROM user WHERE user.id = UserID) as User FROM '.$Table.' WHERE Language = 0 AND entry IN(SELECT entry FROM connexion_item WHERE connexion = '.$_SESSION['connexion_id'].') AND VersionEnd = "'.$BuildNumber_max.'" AND VersionEnd = "'.$BuildNumber_max.'"', $_SESSION['limitx'].','.$_SESSION['limity'], 'connexion'); 124 } 125 126 function ConnexionList() 127 { 128 global $GroupId, $Table, $BuildNumber_max, $Database; 129 130 //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1) 131 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> '. 132 '<a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&action=connexion">Souvislosti</a> - > '. 133 '<strong>Vypsání souvislostí</strong><br /><br />'); 134 echo('<table class="BaseTable"><tr><th>Pořadové číslo</th><th>Název</th>'); 135 echo('</tr>'); 136 $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$GroupId); 137 while($Line = mysql_fetch_assoc($ID)) 138 { 139 echo('<tr><td><a href="?group='.$GroupId.'&action=connexion&connexion_id='.$Line['Id'].'">'.$Line['Id'].'</a></td> 163 140 <td>'.$Line['Name'].'</td>'); 164 141 } 165 142 echo ('</table>'); 166 } else 167 if($Action == 'nocomplete') 168 { 143 } 144 145 function Noncomplete() 146 { 147 global $GroupId, $Table, $BuildNumber_max, $Database; 148 169 149 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 170 150 <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">nedokončené texty</a> - > … … 178 158 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND (sub.Complete = 1) AND VersionEnd = "'.$BuildNumber_max.'") AND 179 159 EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND (sub.Complete = 0) AND VersionEnd = "'.$BuildNumber_max.'") AND VersionEnd = "'.$BuildNumber_max.'"', $_SESSION['limitx'].','.$_SESSION['limity'], 'nocomplete'); 180 } else 181 if($Action == 'Translate') 182 { 160 } 161 162 function Translate() 163 { 164 global $GroupId, $Table, $BuildNumber_max, $Database; 165 183 166 echo('<a title="Zobrazit překlady podle vlasního filtru" href="?group='.$GroupId.'&action=filter">Filtr překladů</a> -> 184 167 <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat texty" href="?group='.$GroupId.'&action=Translate">Přeložené texty</a><br /><br />'); … … 187 170 188 171 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM 189 '.$Table.' WHERE '.$Table.'.Language <> 0 AND '.$Table.'.Complete = 1', $_SESSION['limitx'].','.$_SESSION['limity'], 'Translate'); 190 } else 191 if(($Action == 'my') and Licence(LICENCE_USER)) 192 { 172 '.$Table.' WHERE '.$Table.'.Language <> 0 AND '.$Table.'.Complete = 1', $_SESSION['limitx'].','.$_SESSION['limity'], 'Translate');} 173 174 function UserTranslated() 175 { 176 global $GroupId, $Table; 177 193 178 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 194 179 <a title="Přeložené questy přilášeného uživatele" href="?group='.$GroupId.'&action=my">Moje překlady</a><br /><br />'); 195 180 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = '.$Table.'.`user`) AS `User` FROM `'.$Table.'` Where `user` = '.$_SESSION['UserID'], '', 'my'); 196 } else 197 if(($Action == 'mydevelop') and Licence(LICENCE_USER)) 198 { 181 } 182 183 function UserUnfinished() 184 { 185 global $GroupId, $Table; 186 199 187 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 200 188 <a title="Nedokončené texty" href="?group='.$GroupId.'&action=mydevelop">Rozepsané překlady</a><br /><br />'); 201 189 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` Where `user` = '.$_SESSION['UserID'].' AND `Complete` = 0', '', 'mydevelop'); 202 } else 203 if($Action == 'users') 204 { 190 } 191 192 function UserSelected() 193 { 194 global $GroupId, $Table; 195 205 196 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 206 197 <strong>Vypsání textů od určitých uživatelů</strong><br /><br />'); … … 217 208 218 209 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE '.$WhereUsers, '', 'users'); 219 } else 220 if($Action == 'userall') 221 { 210 } 211 212 function UserAll() 213 { 214 global $Database, $Table, $GroupId, $TranslationTree; 215 222 216 $ID = $Database->SQLCommand('SELECT `user` FROM `user` WHERE `id` = '.$_GET['user']); 223 217 $Line = mysql_fetch_row($ID); … … 229 223 foreach($TranslationTree as $Group) 230 224 if($Group['TablePrefix'] != '') 231 { 232 if(array_key_exists('not', $_GET)) { 233 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND `user`='.$_GET['user']; 234 $ID = $Database->SQLCommand($sql); 235 $Line = mysql_fetch_row($ID); 236 $GroupId = $Group['Id']; 237 echo('<tr><td><a href="?group='.$GroupId.'&action=userid&not&user='.$_GET['user'].'">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>'); 238 $Total += $Line[0]; 239 } else { 240 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `user`='.$_GET['user']; 241 $ID = $Database->SQLCommand($sql); 242 $Line = mysql_fetch_row($ID); 243 $GroupId = $Group['Id']; 244 echo('<tr><td><a href="?group='.$GroupId.'&action=userid&user='.$_GET['user'].'">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>'); 245 $Total += $Line[0]; 225 { 226 if(array_key_exists('not', $_GET)) 227 { 228 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND `user`='.$_GET['user']; 229 $ID = $Database->SQLCommand($sql); 230 $Line = mysql_fetch_row($ID); 231 $GroupId = $Group['Id']; 232 echo('<tr><td><a href="?group='.$GroupId.'&action=userid&not&user='.$_GET['user'].'">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>'); 233 $Total += $Line[0]; 234 } else 235 { 236 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `user`='.$_GET['user']; 237 $ID = $Database->SQLCommand($sql); 238 $Line = mysql_fetch_row($ID); 239 $GroupId = $Group['Id']; 240 echo('<tr><td><a href="?group='.$GroupId.'&action=userid&user='.$_GET['user'].'">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>'); 241 $Total += $Line[0]; 242 } 246 243 } 247 }248 244 echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Total.'</strong></td></tr>'); 249 245 echo('</table>'); 250 } else 251 if($Action == 'grouplist') 252 { 246 } 247 248 function GroupList() 249 { 250 global $Database; 251 253 252 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `group`'); 254 253 $DbRow = mysql_fetch_row($DbResult); … … 276 275 } 277 276 echo('</table>'); 278 echo('<br /><a title="Záznam změn po importu" href="log.php?type=11">Záznam změn v textech při importu</a>'); 279 } else 280 if($Action == 'userid') 281 { 277 echo('<br /><a title="Záznam změn po importu" href="log.php?type=11">Záznam změn v textech při importu</a>'); 278 } 279 280 function TranslatedByUserId() 281 { 282 global $Database, $Table, $GroupId; 283 282 284 if(array_key_exists('user', $_GET)) 283 285 { … … 293 295 } else echo('Nebyl nalezen uživatel se zadaným id'); 294 296 } else echo('Je nutno zadat id uživatele.'); 295 } else 296 if($Action == 'search') 297 { 297 } 298 299 function TranslatedSearch() 300 { 301 global $Table, $GroupId, $TranslationTree; 302 298 303 if(array_key_exists('search', $_GET)) $Search = $_GET['search']; 299 304 else if(array_key_exists('search', $_POST)) $Search = $_POST['search']; … … 311 316 312 317 WriteQuests($sql, '', 'search='.$Search); 313 } else 314 if($Action == 'searchentry') 315 { 318 } 319 320 function SearchEntry() 321 { 322 global $Table; 323 316 324 if(array_key_exists('ID', $_GET)) $Search = $_GET['ID']; 317 325 else if(array_key_exists('ID', $_POST)) $Search = $_POST['ID']; … … 321 329 322 330 WriteQuests($sql, '', 'searchentry='.$Search); 323 } else 324 if($Action == 'all') 325 { 326 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 331 } 332 333 function TranslatedAll() 334 { 335 global $GroupId, $Table; 336 337 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 327 338 <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">Nepřeložené texty</a> - > 328 339 <strong>Výpis všech textů s limitem na stránku</strong><br /><br />'); … … 331 342 332 343 WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0)', $_SESSION['limitx'].','.$_SESSION['limity'], 'all'); 333 } else 334 if($Action == 'filter') 335 { 344 } 345 346 function TranslatedFilter() 347 { 348 global $Table, $GroupId, $Database; 349 336 350 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a><br /><br /><br />'. 337 351 '<table class="BaseTable"><tr><th>Odkaz</th><th>Popis</th></tr>'. … … 382 396 // WriteQuests("SELECT * FROM quests Where user = ".$_SESSION['UserID']." AND Complete = '0'", '', 'mydevelop'); 383 397 } 398 399 if($Action == 'notran') Nontranslated(); 400 else if($Action == 'connexion') Connexion(); 401 else if($Action == 'connexion_list') ConnexionList(); 402 else if($Action == 'nocomplete') Noncomplete(); 403 else if($Action == 'Translate') Translate(); 404 else if(($Action == 'my') and Licence(LICENCE_USER)) UserTranslated(); 405 else if(($Action == 'mydevelop') and Licence(LICENCE_USER)) UserUnfinished(); 406 else if($Action == 'users') UserSelected(); 407 else if($Action == 'userall') UserAll(); 408 else if($Action == 'grouplist') GroupList(); 409 else if($Action == 'userid') TranslatedByUserId(); 410 else if($Action == 'search') TranslatedSearch(); 411 else if($Action == 'searchentry') SearchEntry(); 412 else if($Action == 'all') TranslatedAll(); 413 else if($Action == 'filter') TranslatedFilter(); 414 else echo('Neznámá akce'); 384 415 385 416 ShowFooter();
Note:
See TracChangeset
for help on using the changeset viewer.