Changeset 380
- Timestamp:
- Mar 11, 2010, 7:21:43 PM (15 years ago)
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dbc_export/DBCExport.lpi
r370 r380 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <PathDelim Value="/"/>5 4 <Version Value="7"/> 6 5 <General> … … 17 16 <Language Value=""/> 18 17 <CharSet Value=""/> 18 <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion="0.0.0.0"/> 19 19 </VersionInfo> 20 20 <PublishOptions> … … 31 31 </local> 32 32 </RunParams> 33 <Units Count="1 7">33 <Units Count="18"> 34 34 <Unit0> 35 35 <Filename Value="DBCExport.pas"/> 36 36 <IsPartOfProject Value="True"/> 37 37 <UnitName Value="DBCExport"/> 38 <CursorPos X="4 5" Y="168"/>39 <TopLine Value=" 144"/>38 <CursorPos X="49" Y="84"/> 39 <TopLine Value="58"/> 40 40 <EditorIndex Value="0"/> 41 41 <UsageCount Value="80"/> … … 115 115 <IsPartOfProject Value="True"/> 116 116 <UnitName Value="USqlDatabase"/> 117 <CursorPos X="14" Y="53"/> 118 <TopLine Value="10"/> 119 <EditorIndex Value="3"/> 117 <CursorPos X="13" Y="308"/> 118 <TopLine Value="222"/> 120 119 <UsageCount Value="71"/> 121 <Loaded Value="True"/>122 120 <SyntaxHighlighter Value="Delphi"/> 123 121 </Unit11> … … 128 126 <CursorPos X="27" Y="139"/> 129 127 <TopLine Value="89"/> 130 <EditorIndex Value="1"/>131 128 <UsageCount Value="71"/> 132 <Loaded Value="True"/>133 129 <SyntaxHighlighter Value="Delphi"/> 134 130 </Unit12> … … 138 134 <CursorPos X="51" Y="8"/> 139 135 <TopLine Value="1"/> 140 <EditorIndex Value="2"/>141 136 <UsageCount Value="71"/> 142 <Loaded Value="True"/>143 137 <SyntaxHighlighter Value="None"/> 144 138 </Unit13> … … 162 156 <UsageCount Value="10"/> 163 157 </Unit16> 158 <Unit17> 159 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/sysstrh.inc"/> 160 <CursorPos X="28" Y="33"/> 161 <TopLine Value="14"/> 162 <UsageCount Value="10"/> 163 </Unit17> 164 164 </Units> 165 <JumpHistory Count=" 28" HistoryIndex="27">165 <JumpHistory Count="16" HistoryIndex="15"> 166 166 <Position1> 167 167 <Filename Value="DBCExport.pas"/> … … 173 173 </Position2> 174 174 <Position3> 175 <Filename Value=" USqlDatabase.pas"/>176 <Caret Line=" 4" Column="18" TopLine="1"/>175 <Filename Value="DBCExport.pas"/> 176 <Caret Line="212" Column="30" TopLine="190"/> 177 177 </Position3> 178 178 <Position4> 179 <Filename Value=" USqlDatabase.pas"/>180 <Caret Line=" 52" Column="24" TopLine="30"/>179 <Filename Value="DBCExport.pas"/> 180 <Caret Line="197" Column="32" TopLine="191"/> 181 181 </Position4> 182 182 <Position5> 183 <Filename Value=" USqlDatabase.pas"/>184 <Caret Line=" 80" Column="45" TopLine="58"/>183 <Filename Value="DBCExport.pas"/> 184 <Caret Line="195" Column="1" TopLine="173"/> 185 185 </Position5> 186 186 <Position6> 187 <Filename Value=" USqlDatabase.pas"/>188 <Caret Line="1 37" Column="21" TopLine="115"/>187 <Filename Value="DBCExport.pas"/> 188 <Caret Line="196" Column="1" TopLine="174"/> 189 189 </Position6> 190 190 <Position7> 191 191 <Filename Value="DBCExport.pas"/> 192 <Caret Line=" 212" Column="30" TopLine="190"/>192 <Caret Line="196" Column="37" TopLine="174"/> 193 193 </Position7> 194 194 <Position8> 195 195 <Filename Value="DBCExport.pas"/> 196 <Caret Line=" 197" Column="32" TopLine="191"/>196 <Caret Line="29" Column="1" TopLine="10"/> 197 197 </Position8> 198 198 <Position9> 199 199 <Filename Value="DBCExport.pas"/> 200 <Caret Line=" 195" Column="1" TopLine="173"/>200 <Caret Line="82" Column="29" TopLine="61"/> 201 201 </Position9> 202 202 <Position10> 203 <Filename Value=" USqlDatabase.pas"/>204 <Caret Line="1 81" Column="1" TopLine="159"/>203 <Filename Value="DBCExport.pas"/> 204 <Caret Line="194" Column="1" TopLine="176"/> 205 205 </Position10> 206 206 <Position11> 207 <Filename Value=" USqlDatabase.pas"/>208 <Caret Line=" 183" Column="1" TopLine="161"/>207 <Filename Value="DBCExport.pas"/> 208 <Caret Line="206" Column="23" TopLine="185"/> 209 209 </Position11> 210 210 <Position12> 211 <Filename Value=" USqlDatabase.pas"/>212 <Caret Line=" 184" Column="1" TopLine="162"/>211 <Filename Value="DBCExport.pas"/> 212 <Caret Line="234" Column="42" TopLine="217"/> 213 213 </Position12> 214 214 <Position13> 215 <Filename Value=" USqlDatabase.pas"/>216 <Caret Line=" 186" Column="1" TopLine="164"/>215 <Filename Value="DBCExport.pas"/> 216 <Caret Line="238" Column="29" TopLine="219"/> 217 217 </Position13> 218 218 <Position14> 219 <Filename Value=" USqlDatabase.pas"/>220 <Caret Line=" 188" Column="1" TopLine="166"/>219 <Filename Value="DBCExport.pas"/> 220 <Caret Line="6" Column="92" TopLine="1"/> 221 221 </Position14> 222 222 <Position15> 223 <Filename Value=" USqlDatabase.pas"/>224 <Caret Line=" 190" Column="1" TopLine="168"/>223 <Filename Value="DBCExport.pas"/> 224 <Caret Line="53" Column="89" TopLine="19"/> 225 225 </Position15> 226 226 <Position16> 227 <Filename Value=" USqlDatabase.pas"/>228 <Caret Line=" 193" Column="1" TopLine="171"/>227 <Filename Value="DBCExport.pas"/> 228 <Caret Line="83" Column="22" TopLine="59"/> 229 229 </Position16> 230 <Position17>231 <Filename Value="USqlDatabase.pas"/>232 <Caret Line="194" Column="1" TopLine="172"/>233 </Position17>234 <Position18>235 <Filename Value="DBCExport.pas"/>236 <Caret Line="196" Column="1" TopLine="174"/>237 </Position18>238 <Position19>239 <Filename Value="USqlDatabase.pas"/>240 <Caret Line="179" Column="43" TopLine="1"/>241 </Position19>242 <Position20>243 <Filename Value="DBCExport.pas"/>244 <Caret Line="196" Column="37" TopLine="174"/>245 </Position20>246 <Position21>247 <Filename Value="DBCExport.pas"/>248 <Caret Line="29" Column="1" TopLine="10"/>249 </Position21>250 <Position22>251 <Filename Value="DBCExport.pas"/>252 <Caret Line="82" Column="29" TopLine="61"/>253 </Position22>254 <Position23>255 <Filename Value="DBCExport.pas"/>256 <Caret Line="194" Column="1" TopLine="176"/>257 </Position23>258 <Position24>259 <Filename Value="DBCExport.pas"/>260 <Caret Line="206" Column="23" TopLine="185"/>261 </Position24>262 <Position25>263 <Filename Value="DBCExport.pas"/>264 <Caret Line="234" Column="42" TopLine="217"/>265 </Position25>266 <Position26>267 <Filename Value="DBCExport.pas"/>268 <Caret Line="238" Column="29" TopLine="219"/>269 </Position26>270 <Position27>271 <Filename Value="DBCExport.pas"/>272 <Caret Line="6" Column="92" TopLine="1"/>273 </Position27>274 <Position28>275 <Filename Value="DBCExport.pas"/>276 <Caret Line="53" Column="89" TopLine="19"/>277 </Position28>278 230 </JumpHistory> 279 231 </ProjectOptions> -
tools/dbc_export/DBCExport.pas
r370 r380 81 81 if HasOption('q', 'sql_query') then begin 82 82 SQLquery := GetOptionValue('q', 'sql_query'); 83 SQLquery := StringReplace(SQLquery, '\ ', ' ', [rfReplaceAll]); 84 SQLquery := StringReplace(SQLquery, '\`', '`', [rfReplaceAll]); 85 WriteLn(SQLquery); 83 86 end; 84 87 end; … … 197 200 for X := 1 to Length(ColumnTypeDefinition) do begin 198 201 if ColumnTypeDefinition[X] = 's' then begin 199 Text := DBRows.Data[IndexRowData - 1].Values[' text' + IntToStr(I)];202 Text := DBRows.Data[IndexRowData - 1].Values['Text' + IntToStr(I)]; 200 203 SetString(Y, X - 1, Text); 201 204 I := I + 1; … … 219 222 Count := DBRows.Count; 220 223 for I := 1 to Count do begin 221 Entry := StrToInt(DBRows.Data[ i - 1].Values['entry']);224 Entry := StrToInt(DBRows.Data[I - 1].Values['Entry']); 222 225 223 226 if (I = 127) then SetLength(IndexTable, Entry + 1); … … 238 241 try 239 242 for I := 0 to DBRows.Count - 1 do begin 240 if (StrToInt(DBRows.Data[i].Values[' entry']) = Entry) then begin243 if (StrToInt(DBRows.Data[i].Values['Entry']) = Entry) then begin 241 244 Result := I; 242 245 Exit; -
tools/dbc_export/USqlDatabase.pas
r359 r380 306 306 begin 307 307 Table := ATable; 308 DbResult = Query('DELETE FROM `' + Table + '` WHERE ' + Condition);308 DbResult := Query('DELETE FROM `' + Table + '` WHERE ' + Condition); 309 309 DbResult.Free; 310 310 end; -
trunk/export/export.php
r377 r380 25 25 if($DbResult->num_rows == 0) die('Export '.$this->Id.' neexistuje'); 26 26 $this->Export = $DbResult->fetch_assoc(); 27 27 28 28 // Filter selected languages 29 29 $this->WhereLang = ''; 30 30 $DbResult = $this->Database->query('SELECT * FROM `ExportLanguage` WHERE `Export`='.$this->Id.' ORDER BY `Sequence`'); 31 echo($this->Database->error); 31 32 while($Language = $DbResult->fetch_assoc()) 32 $this->WhereLang .= ' OR ( Language= '.$Language['Language'].')';33 $this->WhereLang .= ' OR (`Language` = '.$Language['Language'].')'; 33 34 if($this->WhereLang == '') $this->WhereLang = 1; 34 35 else $this->WhereLang = '('.substr($this->WhereLang, 4).')'; … … 52 53 } else 53 54 { 54 $this->WhereUsers = '( UserIN ('.$this->SelectedUsers.'))';55 $this->OrderByUserList = ' ORDER BY FIELD( User, '.$this->SelectedUsers.')';55 $this->WhereUsers = '(`User` IN ('.$this->SelectedUsers.'))'; 56 $this->OrderByUserList = ' ORDER BY FIELD(`User`, '.$this->SelectedUsers.')'; 56 57 } 57 58 … … 221 222 function ExportToDBC() 222 223 { 223 global $TranslationTree, $LanguageList, $Config;224 global $TranslationTree, $LanguageList, $Config; 224 225 225 226 $this->LoadFilters(); 226 227 227 228 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`DBCFileName` != ""'); 228 while($Group = $DbResult->fetch_assoc()) 229 { 230 echo($Group['Name'].'... '); 231 if(file_exists('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) { 232 233 $i = 1; 234 $columns = ''; 235 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 236 $columns .= ' `T`.`'.$Column['Column'].'` AS `Text`'.$i.','; 237 $i = $i+1; 238 } 239 240 $querty = '"SELECT '.$columns.' `T`.`Entry` AS `Entry` FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')) AS `T` GROUP BY `T`.`Entry`"'; 229 echo('Počet generovaných skupin: '.$DbResult->num_rows.'<br/>'."\n"); 230 while($Group = $DbResult->fetch_assoc()) 231 { 232 echo($Group['Name'].', '); 233 if(file_exists('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) 234 { 235 $i = 1; 236 $columns = ''; 237 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) 238 { 239 $columns .= ' `T`.`'.$Column['Column'].'` AS `Text'.$i.'`,'; 240 $i = $i + 1; 241 } 242 $Query = 'SELECT '.$columns.' `T`.`Entry` AS `Entry` FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')) AS `T` GROUP BY `T`.`Entry`'; 243 $Query = str_replace('`', '\`', $Query); 244 $Query = '"'.str_replace(' ', '\ ', $Query).'"'; 241 245 242 $params = '-u '.$Config['Database']['User'].' -p '.$Config['Database']['Password'].' -f ../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc -n '.$this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc -c '.GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName']).' -q '.$querty;246 $params = '-u '.$Config['Database']['User'].' -p '.$Config['Database']['Password'].' -f ../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc -n '.$this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc -c '.GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName']).' -q '.$Query; 243 247 244 // echo('./DBCExport '.$params); 248 //echo('./DBCExport '.$params); 249 exec('./DBCExport '.$params); 245 250 246 exec('./DBCExport '.$params);247 248 echo('Hotovo <br />249 ');250 251 } else echo('Zdrojový soubor '.'../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n"); 251 252 } 253 echo('Hotovo <br />'); 252 254 } 253 255 -
trunk/includes/global_function.php
r376 r380 138 138 } 139 139 return(array( 140 'SQL' => ' ORDER BY '.$_SESSION['OrderCol'].''.$OrderDirSQL[$_SESSION['OrderDir']],140 'SQL' => ' ORDER BY `'.$_SESSION['OrderCol'].'` '.$OrderDirSQL[$_SESSION['OrderDir']], 141 141 'Output' => '<tr>'.$Result.'</tr>', 142 142 'Column' => $_SESSION['OrderCol'], -
trunk/save.php
r376 r380 16 16 $Language = $_POST['Language'] * 1; 17 17 if(array_key_exists('End', $_POST)) $Complete = 1; 18 else $ complete = 0;18 else $Complete = 0; 19 19 20 20 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Entry.')');
Note:
See TracChangeset
for help on using the changeset viewer.