Changeset 571
- Timestamp:
- Aug 26, 2013, 9:49:06 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r564 r571 11 11 var $ClientVersion; 12 12 var $OrderByUserList; 13 var $TempDir; 14 var $SourceDir; 13 15 14 16 function Init() 15 17 { 16 18 $this->TempDir = dirname(__FILE__).'/../../'.$this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'; 19 if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); 17 20 $this->TempDirRelative = $this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'; 18 if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); 21 $this->SourceDir = dirname(__FILE__).'/../../'.$this->Config['Web']['SourceFolder']; 22 $this->SourceDirRelative = $this->Config['Web']['SourceFolder']; 23 if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true); 19 24 } 20 25 … … 27 32 // Filter selected users 28 33 $this->UserNames = ''; 29 $DbResult = $this->Database->query('SELECT `ExportUser`.*, `User`.`Name`, `User`.`ID` FROM `ExportUser` LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`'); 34 $DbResult = $this->Database->query('SELECT `ExportUser`.*, `User`.`Name`, `User`.`ID` FROM `ExportUser` '. 35 'LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` '. 36 'WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`'); 30 37 while($UserLine = $DbResult->fetch_assoc()) 31 38 { … … 90 97 "-- Generované tabulky: "; 91 98 92 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 99 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. 100 'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 93 101 while($Group = $DbResult->fetch_assoc()) 94 102 { … … 97 105 $Buffer .= "\n\n"; 98 106 99 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 107 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. 108 'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 100 109 while($Group = $DbResult->fetch_assoc()) 101 110 { … … 215 224 " <translation>\n"; 216 225 217 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 226 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. 227 'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 218 228 while($Group = $DbResult->fetch_assoc()) 219 229 { … … 233 243 if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column']; 234 244 if($Line[$GroupItem['Column']] != '') 235 $Buffer .= ' <text index="'.$GroupItem['Id'].'" name="'.$GroupItem['Column'].'">'.addslashes($Line[$GroupItem['Column']]).'</text>'."\n"; 245 $Buffer .= ' <text index="'.$GroupItem['Id'].'" name="'. 246 $GroupItem['Column'].'">'.addslashes($Line[$GroupItem['Column']]).'</text>'."\n"; 236 247 } 237 248 $Buffer .= " </item>\n"; … … 251 262 $this->LoadFilters(); 252 263 253 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`DBCFileName` != ""'); 264 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. 265 'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` '. 266 'WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`DBCFileName` != ""'); 254 267 $Output = 'Počet generovaných skupin: '.$DbResult->num_rows."\n"; 255 268 while($Group = $DbResult->fetch_assoc()) 256 269 { 257 270 $Output .= $Group['Name'].', '; 258 if(file_exists( '../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'))271 if(file_exists($this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) 259 272 { 260 273 // Load string column index list 261 $DbResult2 = $this->Database->query('SELECT * FROM `GroupItem` JOIN `GroupItemDBC` ON `GroupItem`.`Id` = `GroupItemDBC`.`GroupItem` AND `GroupItemDBC`.`ClientVersion` = '.$this->ClientVersion['Id'].' WHERE `GroupItem`.`Group` = '.$Group['Id']); 274 $DbResult2 = $this->Database->query('SELECT * FROM `GroupItem` '. 275 'JOIN `GroupItemDBC` ON `GroupItem`.`Id` = `GroupItemDBC`.`GroupItem` AND `GroupItemDBC`.`ClientVersion` = '.$this->ClientVersion['Id'].' WHERE `GroupItem`.`Group` = '.$Group['Id']); 262 276 $ColumnIndexes = array(); 263 277 $ColumnFormat = array(); … … 276 290 // Open original DBC file 277 291 $SourceDBCFile = new DBCFile(); 278 $SourceDBCFile->OpenFile( '../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat);292 $SourceDBCFile->OpenFile($this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat); 279 293 280 294 // Create new DBC file … … 322 336 { 323 337 $Output .= $Progress."%\r"; 324 echo($Output);325 $Output = '';338 echo($Output); 339 $Output = ''; 326 340 $OldProgress = $Progress; 327 341 } 328 342 } 329 343 $NewDBCFile->Commit(); 330 } else $Output .= ShowMessage('Zdrojový soubor '. '../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n", MESSAGE_CRITICAL);344 } else $Output .= ShowMessage('Zdrojový soubor '.$this->SourceDirRelative.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n", MESSAGE_CRITICAL); 331 345 } 332 346 $Output .= 'Hotovo <br />'; … … 347 361 $Output .= $Group['Name'].'... '; 348 362 $File = new FileStream(); 349 $File->OpenFile( '../source/'.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua');363 $File->OpenFile($this->SourceDir.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua'); 350 364 $File2 = new FileStream(); 351 365 $File2->CreateFile($this->TempDir.'lua/'.$Group['LuaFileName'].'.lua'); … … 355 369 while($DbRow = $DbResult2->fetch_assoc()) 356 370 $LookupTable[$DbRow['ShortCut']] = $DbRow; 357 //print_r($LookupTable);358 371 359 372 while(!$File->EOF()) … … 419 432 $this->Creator = 'Chronos'; 420 433 $this->License = 'GNU/GPL'; 421 $this->Description = 'Allow parametric export translated texts to various supported output formats';434 $this->Description = 'Allow parametric export of translated texts to various supported output formats'; 422 435 $this->Dependencies = array(); 423 436 } -
trunk/Modules/Export/Page.php
r570 r571 51 51 while($Export = $DbResult->fetch_assoc()) 52 52 { 53 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=0">Zobrazit</a> <a href="?Action=View&ExportId='.$Export['Id'].'&Tab=7">Exportovat</a>'; 53 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=0">Zobrazit</a> '. 54 '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=7">Exportovat</a>'; 54 55 if($Export['User'] == $User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'; 55 56 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. -
trunk/Modules/Import/Import.php
r551 r571 39 39 { 40 40 global $System; 41 42 41 43 42 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'); -
trunk/Modules/User/Profile.php
r569 r571 46 46 array('Name' => 'ClientVersion', 'Title' => 'Verze klienta'), 47 47 array('Name' => 'UsedCount', 'Title' => 'Prohlédnutí výstupu'), 48 array('Name' => '', 'Title' => 'Akce'), 48 49 ); 49 50 $Order = GetOrderTableHeader($TableColumns, 'TimeCreate', 1); … … 54 55 while($Export = $DbResult->fetch_assoc()) 55 56 { 57 $Action = '<a href="'.$this->System->Link('/export/?Action=View&ExportId='.$Export['Id'].'&Tab=0').'">Zobrazit</a> '. 58 '<a href="'.$this->System->Link('/export/?Action=View&ExportId='.$Export['Id'].'&Tab=7').'">Exportovat</a>'; 59 if($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>'; 56 60 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 57 61 '<td>'.$Export['Title'].'</td>'. 58 62 '<td>'.$Export['OutputType'].'</td>'. 59 63 '<td>'.$Export['ClientVersion'].'</td>'. 60 '<td>'.$Export['UsedCount'].'</td>'; 64 '<td>'.$Export['UsedCount'].'</td>'. 65 '<td>'.$Action.'</td></tr>'; 61 66 } 62 67 $Output .= '</table>'. -
trunk/admin/DefaultConfig.php
r553 r571 29 29 'FormatOutput' => $IsDeveloper, 30 30 'ItemsPerPage' => 40, 31 'TempFolder' => '../tmp/', 32 'GameVersion' => '3.3.5a', 31 'TempFolder' => 'tmp/', 32 'SourceFolder' => 'source/', 33 'GameVersion' => '3.3.5a', 33 34 'VisiblePagingItems' => 20, 34 35 'Timezone' => 'Europe/Prague', -
trunk/includes/Version.php
r570 r571 1 1 <?php 2 2 3 $Revision = 57 0; // Subversion revision3 $Revision = 571; // Subversion revision 4 4 $DatabaseRevision = 567; // Database structure revision 5 $ReleaseTime = '2013-08-2 1';5 $ReleaseTime = '2013-08-26';
Note:
See TracChangeset
for help on using the changeset viewer.