Changeset 720 for trunk/Modules/Import
- Timestamp:
- Jan 5, 2014, 11:39:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Import/Import.php
r688 r720 113 113 } 114 114 115 if ($insert) { 116 $insert = false; 117 foreach($this->Group['Items'] as $GroupItem) 118 { 119 if ($Value[$GroupItem['Column']] <> '') $insert = true; 120 } 121 } 115 122 116 123 if (isset($DbRowMiddle['Entry'])) $insert = false; … … 130 137 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 131 138 132 echo '133 '.$Value['Entry'].' = '.$DbRowBefore['VersionStart'].'.'.$DbRowBefore['VersionEnd'].'< '.$this->Version['BuildNumber'].' <'.$DbRowAfter['VersionStart'].'.'.$DbRowAfter['VersionEnd'].'... '.$DbRowMiddle['VersionStart'].' '.$DbRowMiddle['VersionEnd'].'134 ';139 echo ' 140 '.$Value['Entry'].' = '.$DbRowBefore['VersionStart'].'.'.$DbRowBefore['VersionEnd'].'< '.$this->Version['BuildNumber'].' <'.$DbRowAfter['VersionStart'].'.'.$DbRowAfter['VersionEnd'].'... '.$DbRowMiddle['VersionStart'].' '.$DbRowMiddle['VersionEnd'].' 141 '; 135 142 136 if (false !== strpos($Values,'[DEPRECATED'))137 echo $Values;143 if (false !== strpos($Values,'[DEPRECATED')) 144 echo $Values; 138 145 139 146 echo('# '); … … 159 166 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 160 167 $Values = $Value['Entry'].', 0, '.$this->Version['BuildNumber'].', '.$this->Version['BuildNumber']; 168 $insert = false; 161 169 foreach($this->Group['Items'] as $GroupItem) 162 170 { 163 171 $Columns .= ', `'.$GroupItem['Column'].'`'; 164 172 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 165 } 166 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 167 $InsertId = $this->System->Database->insert_id; 168 echo('+ '); 169 $this->NewItemCount++; 170 $this->System->ModuleManager->Modules['Log']->WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&ID='.$InsertId.'">'.$InsertId.'</a> ('.$Value['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' přidán.', LOG_TYPE_IMPORT); 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'].'&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 } 171 182 } 172 183 } … … 436 447 if((strpos($Line, 'INSERT INTO `'.$this->Group['MangosTable'].'`') !== false) and (isset($structure))) 437 448 { 449 while ((strpos($Line, ');') === false) or ($File->EOF())) 450 $Line = $Line.$File->ReadLine(); 451 $Line = str_replace("),\n(", '),(', $Line); 452 438 453 $Line = substr($Line, strpos($Line, '(') + 1); 439 454 $Line = substr($Line, 0, strpos($Line, ');')); 440 455 $LineParts = explode('),(', $Line); 456 441 457 unset($Line); 442 458 443 459 foreach($LineParts as $LinePart) 444 460 { 461 445 462 unset($Value, $value_buff); 446 463 foreach($structure as $i => $column)
Note:
See TracChangeset
for help on using the changeset viewer.