Changeset 682


Ignore:
Timestamp:
Jan 1, 2014, 11:28:39 PM (11 years ago)
Author:
maron
Message:
  • fixed: import
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/Page.php

    r646 r682  
    606606                                if($DbResult->num_rows > 0)
    607607                                {
     608                                  //TODO: don't count on dbc or exe
    608609                                        $this->System->Database->query('UPDATE `Export` SET `UsedCount` = `UsedCount` + 1 WHERE `Id`='.$Export['Id']);
    609610                                        $Output = ExportOutput($Export['Id'], $Export['OutputType']);
  • trunk/Modules/Import/Import.php

    r681 r682  
    7272      if($this->HaveSameText($this->Group, $DbRowBefore, $Value) and ($DbResultBefore->num_rows > 0) )
    7373      {
    74         $insert = false;
    75           //echo ();
    76           $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionEnd` = "'.$this->Version['BuildNumber'].'" WHERE `ID`='.$DbRowBefore['ID']);
     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']);
    7779          echo('b ');
    78          
     80          
    7981      } else
    8082      if($this->HaveSameText($this->Group, $DbRowAfter, $Value) and ($DbResultAfter->num_rows > 0))
    8183      {
    82         $insert = false;
    83           $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionStart` = "'.$this->Version['BuildNumber'].'" WHERE `ID`='.$DbRowAfter['ID']);
     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']);
    8489          echo('a ');
    8590         
     91          if ( ($Value['EndText'] <> $DbRowAfter['EndText'])
     92           or ($Value['ObjectiveText1'] <> $DbRowAfter['ObjectiveText1'])
     93           or ($Value['ObjectiveText2'] <> $DbRowAfter['ObjectiveText2'])
     94           or ($Value['ObjectiveText3'] <> $DbRowAfter['ObjectiveText3'])
     95           or ($Value['ObjectiveText4'] <> $DbRowAfter['ObjectiveText4']) )
     96           echo $Value['Entry'].'='.$set.' '; 
    8697      } else
    8798      {
     
    102113            //if [DEPRECATED] do not import
    103114        foreach($this->Group['Items'] as $GroupItem) {
    104           if (false !== strpos($Value[$GroupItem['Column']],'[DEPRECATED'))   
     115          if (false !== strpos($Value[$GroupItem['Column']],'[DEPRECATED')) {
     116            echo('d '.$DbRowBefore['Entry'].' ');
    105117            $insert = false;
     118          }   
    106119        }   
    107120
     
    273286      $old = strtolower($old);
    274287      $old = str_replace('$b', '', $old);
    275  
     288     
     289      while ($part = substr($old, strpos($old, '<'), strpos($old, '>')-strpos($old, '<')))
     290        if ($part <> '') {
     291          $old = str_replace($part.'>', '', $old);
     292        }
    276293 
    277294      if (($GroupItem['MangosColumn'] <> '') and ($Group['MangosDatabase'] == 'mangos'))
     
    294311      $new = strtolower($new);
    295312      $new = str_replace('$b', '', $new);
     313
     314      while ($part = substr($new, strpos($new, '<'), strpos($new, '>')-strpos($new, '<')))
     315        if ($part <> '') {
     316          $new = str_replace($part.'>', '', $new);
     317        }
    296318     
    297319      if(($old == 'null') or ($old == 'NULL')) $old = '';
     
    301323      {
    302324        //  echo $old.'X'.$new;
    303         $result = false;
     325        if ( ($GroupItem['Column'] <> 'EndText')
     326        and ($GroupItem['Column'] <> 'ObjectiveText1')
     327        and ($GroupItem['Column'] <> 'ObjectiveText2')
     328        and ($GroupItem['Column'] <> 'ObjectiveText3')
     329        and ($GroupItem['Column'] <> 'ObjectiveText4') )
     330          $result = false;
    304331      }
    305332    }
  • trunk/includes/Version.php

    r681 r682  
    66// and system will need database update.
    77
    8 $Revision = 681; // Subversion revision
     8$Revision = 682; // Subversion revision
    99$DatabaseRevision = 678; // Database structure revision
    1010$ReleaseTime = '2014-01-01';
Note: See TracChangeset for help on using the changeset viewer.