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

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