Changeset 776 for trunk


Ignore:
Timestamp:
Feb 2, 2014, 8:28:37 PM (11 years ago)
Author:
maron
Message:
  • Added: Export last 2 version in addon
  • Fixed: Export text only once in addon
  • Added: 100% done in progress
Location:
trunk
Files:
3 edited

Legend:

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

    r731 r776  
    133133
    134134        $Buffer = 'CZWOW_'.$Column['AddonFileName'].'_count='.$FileIndex.';CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';
    135    
    136         $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));
     135        $TableTexts = array();
     136   
     137        //old version
     138        //get version before
     139        $BuildNumber = $ExportVersion;
     140        if ($ExportVersion == '') $BuildNumber = $this->ClientVersion['BuildNumber'];
     141        $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '.
     142        ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY  `BuildNumber` DESC LIMIT 1'); 
     143        if($ID->num_rows > 0) {       
     144          $ExportVersionOld = $ID->fetch_assoc();
     145          $ExportVersionOld = $ExportVersionOld['BuildNumber'];
    137146       
     147          echo 'old:'.$ExportVersionOld.' last:'.$ExportVersion;
     148
     149          $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersionOld));       
     150          while($Line = $DbResult2->fetch_assoc())
     151          {
     152            $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 
     153            $cz = $this->ReplaceCzText($Line[$Column['Column']]);
     154            if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     155            {
     156               $TableTexts[$en] = $cz;
     157            }
     158          }
     159        }
     160                //last version
     161       
     162        $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));       
    138163        while($Line = $DbResult2->fetch_assoc())
    139164        {
     
    142167          if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
    143168          {
    144             $Buffer .= "\n".'["'.$en.'"]="'.$cz.'",';
    145             $i++;
     169             $TableTexts[$en] = $cz;
    146170          }
    147171        }
     172       
     173        foreach($TableTexts as $key => $value) {
     174            $Buffer .= "\n".'["'.$key.'"]="'.$value.'",';
     175            $i++;
     176        }
     177       
    148178   
    149179        $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n";
  • trunk/Modules/Export/ProcessTask.php

    r740 r776  
    4141  if (file_exists($dst)) DeleteOldFiles($dst);
    4242  if (is_dir($src)) {
    43     if (!file_exists($dst)) mkdir($dst);
     43    if (!file_exists($dst)) mkdir($dst, 0777, true);
    4444    $files = scandir($src);
    4545    foreach ($files as $file)
     
    133133        echo 'Caught exception: ',  $e->getMessage(), "\n";
    134134      }
     135      SetProgress($Export,100);
    135136    } else
    136137    {
  • trunk/includes/Version.php

    r775 r776  
    66// and system will need database update.
    77
    8 $Revision = 775; // Subversion revision
     8$Revision = 776; // Subversion revision
    99$DatabaseRevision = 748; // Database structure revision
    1010$ReleaseTime = '2014-02-02';
Note: See TracChangeset for help on using the changeset viewer.