source: trunk/Modules/Import/Import.php@ 720

Last change on this file since 720 was 720, checked in by maron, 11 years ago
  • Fixed: insert values separate by \n in sql import
File size: 21.8 KB
Line 
1<?php
2
3include_once(dirname(__FILE__).'/../../includes/dbc.php');
4include_once(dirname(__FILE__).'/Manage.php');
5
6
7class ModuleImport extends AppModule
8{
9 function __construct($System)
10 {
11 parent::__construct($System);
12 $this->Name = 'Import';
13 $this->Version = '1.0';
14 $this->Creator = 'Chronos';
15 $this->License = 'GNU/GPL';
16 $this->Description = 'Support for import of data.';
17 $this->Dependencies = array();
18 }
19
20 function Start()
21 {
22 $this->System->RegisterPage('import', 'PageImport');
23 }
24}
25
26class Import
27{
28 var $Version;
29 var $Group;
30 var $NewItemCount;
31 var $System;
32
33 function __construct($System)
34 {
35 $this->System = &$System;
36 }
37
38 function SetVersion($Version)
39 {
40 global $System;
41
42 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$Version.'"');
43 $this->Version = $DbResult->fetch_assoc();
44 }
45
46 function InsertItem($Value)
47 {
48 $insert = true;
49 $Columns = '';
50 //$Values = '';
51 foreach($this->Group['Items'] as $GroupItem)
52 {
53 $Columns .= ', `'.$GroupItem['Column'].'` ';
54 // $Values .= ', "'.$Value[$GroupItem['Column']].'"';
55 }
56 // echo $Values;
57 $Columns = substr($Columns, 1);
58 $Where = ' (`'.$this->Group['PrimaryKeyItem'].'` = "'.$Value[$this->Group['PrimaryKeyItem']].'") AND (`Language`=0) ' ;
59 //print_r($Value);
60
61 $DbResultMiddle = $this->System->Database->query('SELECT `VersionEnd`,`VersionStart`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND `VersionStart` <= '.$this->Version['BuildNumber'].' AND `VersionEnd` >= '.$this->Version['BuildNumber'].' ORDER BY `VersionEnd` DESC LIMIT 1');
62 $DbResultBefore = $this->System->Database->query('SELECT `VersionEnd`,`VersionStart`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND `VersionEnd` <= '.$this->Version['BuildNumber'].' ORDER BY `VersionEnd` DESC LIMIT 1');
63 $DbResultAfter = $this->System->Database->query('SELECT `VersionEnd`,`VersionStart`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND `VersionStart` >= '.$this->Version['BuildNumber'].' ORDER BY `VersionStart` LIMIT 1');
64 //echo('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1');
65 if(($DbResultMiddle->num_rows > 0) or ($DbResultBefore->num_rows > 0) or ($DbResultAfter->num_rows > 0))
66 {
67 // Update existed text
68 $DbRowMiddle = $DbResultMiddle->fetch_assoc();
69 $DbRowAfter = $DbResultAfter->fetch_assoc();
70 $DbRowBefore = $DbResultBefore->fetch_assoc();
71
72 if($this->HaveSameText($this->Group, $DbRowBefore, $Value) and ($DbResultBefore->num_rows > 0) )
73 {
74 $insert = false;
75 if ($this->Group['Id'] == 1) {
76 $set = ' , EndText = "'.$Value['EndText'].'" , ObjectiveText1 = "'.$Value['ObjectiveText1'].'"'.' , ObjectiveText2 = "'.$Value['ObjectiveText2'].'"'.' , ObjectiveText3 = "'.$Value['ObjectiveText3'].'"'.' , ObjectiveText4 = "'.$Value['ObjectiveText4'].'"';
77 } else $set = '';
78 $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionEnd` = "'.$this->Version['BuildNumber'].'" '.$set.' WHERE `ID`='.$DbRowBefore['ID']);
79 echo('b ');
80
81 } else
82 if($this->HaveSameText($this->Group, $DbRowAfter, $Value) and ($DbResultAfter->num_rows > 0))
83 {
84 $insert = false;
85 if ($this->Group['Id'] == 1) {
86 $set = ' , EndText = "'.$Value['EndText'].'" , ObjectiveText1 = "'.$Value['ObjectiveText1'].'"'.' , ObjectiveText2 = "'.$Value['ObjectiveText2'].'"'.' , ObjectiveText3 = "'.$Value['ObjectiveText3'].'"'.' , ObjectiveText4 = "'.$Value['ObjectiveText4'].'"';
87 } else $set = '';
88 $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionStart` = "'.$this->Version['BuildNumber'].'" '.$set.' WHERE `ID`='.$DbRowAfter['ID']);
89 echo('a ');
90
91 } else
92 {
93
94 if (isset($DbRowAfter['VersionStart'])) {
95 if ($DbRowAfter['VersionStart'] <= $this->Version['BuildNumber']) {
96 echo('Allready imported '.$DbRowBefore['Entry'].' ');
97 $insert = false;
98 }
99 }
100 if (isset($DbRowBefore['VersionEnd'])) {
101 if ($DbRowBefore['VersionEnd'] >= $this->Version['BuildNumber']) {
102 echo('Allready imported '.$DbRowBefore['Entry'].' ');
103 $inserted = false;
104 }
105 }
106
107 //if [DEPRECATED] do not import
108 foreach($this->Group['Items'] as $GroupItem) {
109 if (false !== strpos($Value[$GroupItem['Column']],'[DEPRECATED')) {
110 echo('d '.$DbRowBefore['Entry'].' ');
111 $insert = false;
112 }
113 }
114
115 if ($insert) {
116 $insert = false;
117 foreach($this->Group['Items'] as $GroupItem)
118 {
119 if ($Value[$GroupItem['Column']] <> '') $insert = true;
120 }
121 }
122
123 if (isset($DbRowMiddle['Entry'])) $insert = false;
124 if (isset($DbRowAfter['Entry'])) $Value['Entry'] = $DbRowAfter['Entry'];
125 if (isset($DbRowBefore['Entry'])) $Value['Entry'] = $DbRowBefore['Entry'];
126
127 if ($insert)
128 {
129
130 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`';
131 $Values = $Value['Entry'].', 0, '.$this->Version['BuildNumber'].', '.$this->Version['BuildNumber'];
132 foreach($this->Group['Items'] as $GroupItem)
133 {
134 $Columns .= ', `'.$GroupItem['Column'].'`';
135 $Values .= ', "'.$Value[$GroupItem['Column']].'"';
136 }
137 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');
138
139 echo '
140 '.$Value['Entry'].' = '.$DbRowBefore['VersionStart'].'.'.$DbRowBefore['VersionEnd'].'< '.$this->Version['BuildNumber'].' <'.$DbRowAfter['VersionStart'].'.'.$DbRowAfter['VersionEnd'].'... '.$DbRowMiddle['VersionStart'].' '.$DbRowMiddle['VersionEnd'].'
141 ';
142
143 if (false !== strpos($Values,'[DEPRECATED'))
144 echo $Values;
145
146 echo('# ');
147 $InsertId = $this->System->Database->insert_id;
148 $this->System->ModuleManager->Modules['Log']->WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&amp;ID='.$InsertId.'">'.$InsertId.'</a> ('.$Value['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' změněn.', LOG_TYPE_IMPORT);
149 }
150 }
151 } else
152 {
153 // Insert new text
154 if(is_numeric($Value[$this->Group['PrimaryKeyItem']])) $Value['Entry'] = $Value[$this->Group['PrimaryKeyItem']];
155 else
156 {
157 // Get new unused Entry for tables without numeric id
158 $Value['Entry'] = 1;
159 $DbResult = $this->System->Database->query('SELECT MAX(`Entry`) FROM `'.$this->Group['TablePrefix'].'`');
160 if($DbResult->num_rows > 0)
161 {
162 $DbRow = $DbResult->fetch_row();
163 $Value['Entry'] += $DbRow[0];
164 }
165 }
166 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`';
167 $Values = $Value['Entry'].', 0, '.$this->Version['BuildNumber'].', '.$this->Version['BuildNumber'];
168 $insert = false;
169 foreach($this->Group['Items'] as $GroupItem)
170 {
171 $Columns .= ', `'.$GroupItem['Column'].'`';
172 $Values .= ', "'.$Value[$GroupItem['Column']].'"';
173 if ($Value[$GroupItem['Column']] <> '') $insert = true;
174 }
175 if ($insert) {
176 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');
177 $InsertId = $this->System->Database->insert_id;
178 echo('+ ');
179 $this->NewItemCount++;
180 $this->System->ModuleManager->Modules['Log']->WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&amp;ID='.$InsertId.'">'.$InsertId.'</a> ('.$Value['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' přidán.', LOG_TYPE_IMPORT);
181 }
182 }
183 }
184
185 function ImportLUA()
186 {
187 global $TranslationTree, $PatchVersion;
188 $Output = 'Načítání textů z LUA souboru...';
189
190 if(($this->Group['LuaFileName'] != '') and ($this->Group['TablePrefix'] != ''))
191 {
192
193 $Output .= '<br />'.$this->Group['Name'].'<br />';
194 // if($this->Group['LastVersion'] < $this->Version['BuildNumber'] + 1)
195 {
196 $File = new FileStream();
197
198 $File->OpenFile(dirname(__FILE__).'/../../source/'.$this->Version['Version'].'/lua/'.$this->Group['LuaFileName'].'.lua');
199 $this->NewItemCount = 0;
200 $Count = 0;
201 while(!$File->EOF())
202 {
203 $Line = $File->ReadLine();
204 if(strpos($Line, '=') !== false)
205 {
206 $LineParts = explode('=', $Line, 2);
207 $Value['ShortCut'] = trim($LineParts[0]);
208 $Line = trim($LineParts[1]);
209 if($Line[0] == '"')
210 {
211 // Quoted string value
212 $Line = substr($Line, 1); // Skip start qoute
213 $TempLine = str_replace('\"', ' ', $Line); // Temporary remove slashed quotes
214 $Value['Text'] = substr($Line, 0, strpos($TempLine, '"'));
215 $Value['Text'] = str_replace('\n', "\n", $Value['Text']);
216 $Value['Text'] = addslashes(stripslashes($Value['Text']));
217 $Line = trim(substr($Line, strpos($TempLine, '"') + 1)); // Skip closing quote and semicolon
218 } else
219 {
220 // Nonstring value
221 $Value['Text'] = substr($Line, 0, strpos($Line, ';'));
222 }
223 $Line = substr($Line, strpos($Line, ';') + 1);
224 $Value['Comment'] = addslashes(stripslashes(substr($Line, 3))); // Skip " --"
225 //print_r($Value);
226
227 $this->InsertItem($Value);
228 };
229 $Count++;
230 }
231 $Output .= '<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />';
232 $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
233 }
234 // else $Output .= ShowMessage('Již importován pro verzi '.$this->Version['Version'], MESSAGE_CRITICAL);
235 } else $Output .= ShowMessage('Není definováno jméno zdrojového souboru', MESSAGE_CRITICAL);
236 $Output .= ShowMessage('Dokončeno.');
237 return ($Output);
238 }
239
240 function UpdateTranslated()
241 {
242 global $TranslationTree, $PatchVersion, $Config;
243
244 $Output = '<br /><br />Začínám se synchronizací VersionEnd u přeložených textů<br />';
245 foreach($TranslationTree as $Group)
246 {
247 $Output .= '<br />'.$Group['Name'].' ';
248 $do = true;
249 while($do)
250 {
251 $DbResult = $this->System->Database->query('SELECT `gs_tran`.`ID`, '.
252 '`gs_tran`.`VersionEnd` AS `VersionEnd_tran`, '.
253 '`gs_tran`.`VersionStart` AS `VersionStart_tran`, '.
254 '`gs_orig`.`VersionEnd` AS `VersionEnd_orig`, '.
255 '`gs_orig`.`VersionStart` AS `VersionStart_orig` FROM `'.
256 $Group['TablePrefix'].'` AS `gs_tran` JOIN `'.$Group['TablePrefix'].
257 '` AS `gs_orig` ON `gs_orig`.`ID` = `gs_tran`.`Take` WHERE '.
258 '`gs_tran`.`VersionEnd` <> `gs_orig`.`VersionEnd` OR `gs_tran`.`VersionStart` <> `gs_orig`.`VersionStart`');
259 $do = ($DbResult->num_rows > 0);
260 while($DbRow = $DbResult->fetch_assoc())
261 {
262 echo '`';
263 $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$DbRow['VersionEnd_orig'].', `VersionStart` = '.$DbRow['VersionStart_orig'].' WHERE `ID` = '.$DbRow['ID']);
264 $Output .= '. ';
265 }
266 }
267 $Output .= '<strong>Dokončeno.</strong>';
268 }
269 return($Output);
270 }
271
272 function HaveSameText($Group, $DbRow2, $Value)
273 {
274 $result = true;
275 foreach($Group['Items'] as $GroupItem)
276 {
277 $old = $DbRow2[$GroupItem['Column']];
278 $old = str_replace(chr(10), '', $old);
279 $old = str_replace(chr(13), '', $old);
280 $old = str_replace('\n', '', $old);
281 $old = str_replace('\r', '', $old);
282 $old = str_replace('\"', '"', $old);
283 $old = str_replace('\\\\', '\\', $old);
284 $old = str_replace('\32', '32', $old);
285 $old = str_replace('\124', '124', $old);
286 $old = str_replace("\'", "'", $old);
287 $old = str_replace("Â", "", $old);
288 $old = str_replace("�", "", $old);
289 $old = str_replace('-', '', $old);
290 $old = str_replace(' ', '', $old);
291 $old = strtolower($old);
292 $old = str_replace('$b', '', $old);
293
294 if ($this->Group['Id'] == 1)
295 while ($part = substr($old, strpos($old, '<'), strpos($old, '>')-strpos($old, '<')))
296 if ($part <> '') {
297 $old = str_replace($part.'>', '', $old);
298 }
299
300 if (($GroupItem['MangosColumn'] <> '') and ($Group['MangosDatabase'] == 'mangos'))
301 $new = $Value[$GroupItem['MangosColumn']];
302 else $new = $Value[$GroupItem['Column']];
303
304 $new = str_replace(chr(10), '', $new);
305 $new = str_replace(chr(13), '', $new);
306 $new = str_replace('\n', '', $new);
307 $new = str_replace('\r', '', $new);
308 $new = str_replace('\"', '"', $new);
309 $new = str_replace('\\\\', '\\', $new);
310 $new = str_replace('\32', '32', $new);
311 $new = str_replace('\124', '124', $new);
312 $new = str_replace("\'", "'", $new);
313 $new = str_replace("Â", "", $new);
314 $new = str_replace("�", "", $new);
315 $new = str_replace('-', '', $new);
316 $new = str_replace(' ', '', $new);
317 $new = strtolower($new);
318 $new = str_replace('$b', '', $new);
319
320 if ($this->Group['Id'] == 1)
321 while ($part = substr($new, strpos($new, '<'), strpos($new, '>')-strpos($new, '<')))
322 if ($part <> '') {
323 $new = str_replace($part.'>', '', $new);
324 }
325
326 if(($old == 'null') or ($old == 'NULL')) $old = '';
327 if(($new == 'null') or ($new == 'NULL')) $new = '';
328
329 if(($new <> '') and ($old <> $new) and ($GroupItem['Column'] <> 'Comment'))
330 {
331 // echo $old.'X'.$new;
332 if ( ($GroupItem['Column'] <> 'EndText')
333 and ($GroupItem['Column'] <> 'ObjectiveText1')
334 and ($GroupItem['Column'] <> 'ObjectiveText2')
335 and ($GroupItem['Column'] <> 'ObjectiveText3')
336 and ($GroupItem['Column'] <> 'ObjectiveText4') )
337 $result = false;
338 }
339 }
340
341 return($result);
342 }
343
344 function ImportDBC()
345 {
346 global $System, $TranslationTree, $Config;
347
348 $Output = 'Načítání textů z DBC souboru...';
349 if(($this->Group['DBCFileName'] != '') and ($this->Group['TablePrefix'] != ''))
350 {
351 $Output .= '<br />'.$this->Group['Name'].'<br />';
352
353 // Load string column index list
354 $DbResult = $System->Database->query('SELECT * FROM `GroupItem` JOIN `GroupItemDBC` ON `GroupItem`.`Id` = `GroupItemDBC`.`GroupItem` AND `GroupItemDBC`.`ClientVersion` = '.$this->Version['Id'].' WHERE `GroupItem`.`Group` = '.$this->Group['Id']);
355
356 $ColumnIndexes = array();
357 $ColumnFormat = array();
358 while($DbRow = $DbResult->fetch_assoc())
359 {
360 $ColumnFormat[$DbRow['ColumnIndex']] = FORMAT_STRING;
361 $ColumnIndexes[$DbRow['GroupItem']] = $DbRow['ColumnIndex'];
362 }
363
364 $DBCFile = new DBCFile();
365 $DBCFile->OpenFile(dirname(__FILE__).'/../../source/'.$this->Version['Version'].'/dbc/'.$this->Group['DBCFileName'].'.dbc', $ColumnFormat);
366 $ItemCount = $DBCFile->GetRecordCount();
367 $this->NewItemCount = 0;
368 $Count = 0;
369
370 for($I = 0; $I < $ItemCount; $I++)
371 {
372 foreach($this->Group['Items'] as $GroupItem)
373 if(array_key_exists($GroupItem['Id'], $ColumnIndexes))
374 {
375 $Value[$GroupItem['Column']] = addslashes($DBCFile->GetString($I, $ColumnIndexes[$GroupItem['Id']]));
376 }
377
378 // Get multicolumn value
379 $Columns = explode(',', $this->Group['DBCIndex']);
380 $ColumnValue = '';
381 foreach($Columns as $Column)
382 $ColumnValue .= '_'.$DBCFile->GetUint($I, $Column);
383 $ColumnValue = substr($ColumnValue, 1);
384 $Value[$this->Group['PrimaryKeyItem']] = $ColumnValue;
385 $this->InsertItem($Value);
386 $Count++;
387 }
388 $Output .= '<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />';
389 $System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
390 }
391 $Output .= '<strong>Dokončeno.</strong>';
392 return($Output);
393 }
394
395 function ImportGroup($GroupId)
396 {
397 global $TranslationTree;
398
399 $this->Group = $TranslationTree[$GroupId];
400
401 if($this->Group['SourceType'] == 'dbc') $Output = $this->ImportDBC();
402 else if($this->Group['SourceType'] == 'sql') $Output = $this->ImportSQL();
403 else if($this->Group['SourceType'] == 'lua') $Output = $this->ImportLUA();
404 else $Output = ShowMessage('Neznámý typ zdroje pro import', MESSAGE_CRITICAL);
405 $Output .= $this->UpdateTranslated();
406 return($Output);
407 }
408
409 function ImportSQL()
410 {
411 global $TranslationTree, $PatchVersion;
412
413 $Output= '';
414 $File = new FileStream();
415 $File->OpenFile(dirname(__FILE__).'/../../source/'.$this->Version['Version'].'/sql/'.$this->Group['MangosTable'].'.sql');
416 $this->NewItemCount = 0;
417 $Count = 0;
418 $folow_structure = false;
419 $i = 0;
420 while((!$File->EOF()))
421 {
422 $Line = $File->ReadLine();
423 // Struktura
424 if(strpos($Line, 'CREATE TABLE `'.$this->Group['MangosTable'].'`') !== false)
425 {
426 $Line = '';
427 $folow_structure = true;
428 $i = 0;
429 }
430 if((strpos($Line, ';') !== false) and ($folow_structure == true))
431 {
432 $folow_structure = false;
433 // echo ('Struktura: <br />');
434 // print_r($structure);
435 // echo ('<br /><br />');
436 }
437 if(($folow_structure == true) and ($Line != ''))
438 {
439 $str = substr($Line, 0, strpos($Line, '`'));
440 $Line = substr($Line, strpos($Line, '`') + 1);
441 $Line = substr($Line, 0, strpos($Line, '`'));
442 if(strlen($str) < 3) $structure[$i] = $Line;
443 $i++;
444 }
445
446 //data
447 if((strpos($Line, 'INSERT INTO `'.$this->Group['MangosTable'].'`') !== false) and (isset($structure)))
448 {
449 while ((strpos($Line, ');') === false) or ($File->EOF()))
450 $Line = $Line.$File->ReadLine();
451 $Line = str_replace("),\n(", '),(', $Line);
452
453 $Line = substr($Line, strpos($Line, '(') + 1);
454 $Line = substr($Line, 0, strpos($Line, ');'));
455 $LineParts = explode('),(', $Line);
456
457 unset($Line);
458
459 foreach($LineParts as $LinePart)
460 {
461
462 unset($Value, $value_buff);
463 foreach($structure as $i => $column)
464 {
465 if (substr($LinePart, 0, 1) != "'")
466 {
467 $value_buff = substr($LinePart, 0, strpos($LinePart, ','));
468 $LinePart = substr($LinePart, strlen($value_buff) + 1);
469 } else
470 {
471 $LinePart = substr($LinePart, 1);
472 $value_buff = substr($LinePart, 0, strpos($LinePart, "'"));
473 while(substr($value_buff, strlen($value_buff) - 1, 1) == "\\")
474 {
475 $str = substr($LinePart, strlen($value_buff));
476 $str2 = substr($str, 0, strpos($str, "'", 1));
477 $value_buff = $value_buff.$str2;
478 $str = substr($str, strlen($str2));
479 }
480 $LinePart = substr($LinePart, strlen($value_buff) + 2);
481 }
482 if(($value_buff != 'null') and ($value_buff != 'NULL'))
483 {
484 $str = '';
485 while(substr($value_buff, strlen($value_buff) - 1,1) == " ")
486 {
487 $value_buff = substr($value_buff, 0, strlen($value_buff) - 1);
488 $str .= ' ';
489 }
490 $str2 = '';
491 while(substr($value_buff, 0, 1) == ' ')
492 {
493 $value_buff = substr($value_buff, 1, strlen($value_buff) - 1);
494 $str2 .= ' ';
495 }
496 $Value[$column] = $str2.trim($value_buff).$str;
497 } else
498 {
499 $Value[$column] = '';
500 }
501 // echo ($column.'-"'.$Value[$column].'"<br>');
502 }
503 foreach($this->Group['Items'] as $GroupItem)
504 {
505 if($GroupItem['MangosColumn'] != '')
506 $Value[$GroupItem['Column']] = $Value[$GroupItem['MangosColumn']];
507 }
508
509 // Get multicolumn value
510 $Columns = explode(',', $this->Group['MangosTableIndex']);
511 $ColumnValue = '';
512 foreach($Columns as $Column)
513 $ColumnValue .= '_'.$Value[$Column];
514 $ColumnValue = substr($ColumnValue, 1);
515 $Value[$this->Group['PrimaryKeyItem']] = $ColumnValue;
516 $this->InsertItem($Value);
517 $Count++;
518 }
519 }
520 }
521 $Output = '<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />';
522 $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
523 return($Output);
524 }
525}
Note: See TracBrowser for help on using the repository browser.