Changeset 879


Ignore:
Timestamp:
Apr 7, 2020, 9:53:00 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Wrong Setup tables initialization.
  • Fixed: Export SQL query compatible with newer SQL server.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r872 r879  
    29562956}
    29572957
     2958function UpdateTo873($Manager)
     2959{       
     2960  $Manager->Execute('ALTER TABLE `User` CHANGE `XP` `XP` INT(11) NOT NULL DEFAULT "0";');
     2961  $Manager->Execute('ALTER TABLE `User` CHANGE `TranslatedCount` `TranslatedCount` INT(11) NOT NULL DEFAULT "0";');
     2962  $Manager->Execute('ALTER TABLE `User` CHANGE `Redirecting` `Redirecting` INT(11) NOT NULL DEFAULT "0";');
     2963  $Manager->Execute('ALTER TABLE `User` CHANGE `Info` `Info` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;');
     2964  $Manager->Execute('ALTER TABLE `Export` CHANGE `UsedCount` `UsedCount` INT(11) NOT NULL DEFAULT "0";');
     2965  $Manager->Execute('ALTER TABLE `Export` CHANGE `AllUsers` `AllUsers` TINYINT(1) NOT NULL DEFAULT "0";');
     2966  $Manager->Execute('ALTER TABLE `Export` CHANGE `Featured` `Featured` TINYINT(4) NOT NULL DEFAULT "0";');
     2967}
     2968
    29582969class Updates
    29592970{
     
    29612972  {
    29622973    return(array(
    2963   498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
    2964   506 => array('Revision' => 510, 'Function' => 'UpdateTo510'),
    2965   510 => array('Revision' => 524, 'Function' => 'UpdateTo524'),
    2966   524 => array('Revision' => 537, 'Function' => 'UpdateTo537'),
    2967   537 => array('Revision' => 539, 'Function' => 'UpdateTo539'),
    2968   539 => array('Revision' => 543, 'Function' => 'UpdateTo543'),
    2969   543 => array('Revision' => 567, 'Function' => 'UpdateTo567'),
    2970   567 => array('Revision' => 574, 'Function' => 'UpdateTo574'),
    2971   574 => array('Revision' => 585, 'Function' => 'UpdateTo585'),
    2972   585 => array('Revision' => 600, 'Function' => 'UpdateTo600'),
    2973   600 => array('Revision' => 604, 'Function' => 'UpdateTo604'),
    2974   604 => array('Revision' => 609, 'Function' => 'UpdateTo609'),
    2975   609 => array('Revision' => 610, 'Function' => 'UpdateTo610'),
    2976   610 => array('Revision' => 639, 'Function' => 'UpdateTo639'),
    2977   639 => array('Revision' => 646, 'Function' => 'UpdateTo646'),
    2978   646 => array('Revision' => 666, 'Function' => 'UpdateTo666'),
    2979   666 => array('Revision' => 678, 'Function' => 'UpdateTo678'),
    2980   678 => array('Revision' => 695, 'Function' => 'UpdateTo695'),
    2981   695 => array('Revision' => 712, 'Function' => 'UpdateTo712'),
    2982   712 => array('Revision' => 716, 'Function' => 'UpdateTo716'),
    2983   716 => array('Revision' => 725, 'Function' => 'UpdateTo725'),
    2984   725 => array('Revision' => 731, 'Function' => 'UpdateTo731'),
    2985   731 => array('Revision' => 732, 'Function' => 'UpdateTo732'),
    2986   732 => array('Revision' => 748, 'Function' => 'UpdateTo748'),
    2987   748 => array('Revision' => 787, 'Function' => 'UpdateTo787'),
    2988   787 => array('Revision' => 803, 'Function' => 'UpdateTo803'),
    2989   803 => array('Revision' => 811, 'Function' => 'UpdateTo811'),
    2990   811 => array('Revision' => 846, 'Function' => 'UpdateTo846'),
    2991   846 => array('Revision' => 848, 'Function' => 'UpdateTo848'),
    2992   848 => array('Revision' => 849, 'Function' => 'UpdateTo849'),
    2993   849 => array('Revision' => 857, 'Function' => 'UpdateTo857'),
    2994   857 => array('Revision' => 867, 'Function' => 'UpdateTo867'),
    2995   867 => array('Revision' => 872, 'Function' => 'UpdateTo872'),
     2974      498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
     2975      506 => array('Revision' => 510, 'Function' => 'UpdateTo510'),
     2976      510 => array('Revision' => 524, 'Function' => 'UpdateTo524'),
     2977      524 => array('Revision' => 537, 'Function' => 'UpdateTo537'),
     2978      537 => array('Revision' => 539, 'Function' => 'UpdateTo539'),
     2979      539 => array('Revision' => 543, 'Function' => 'UpdateTo543'),
     2980      543 => array('Revision' => 567, 'Function' => 'UpdateTo567'),
     2981      567 => array('Revision' => 574, 'Function' => 'UpdateTo574'),
     2982      574 => array('Revision' => 585, 'Function' => 'UpdateTo585'),
     2983      585 => array('Revision' => 600, 'Function' => 'UpdateTo600'),
     2984      600 => array('Revision' => 604, 'Function' => 'UpdateTo604'),
     2985      604 => array('Revision' => 609, 'Function' => 'UpdateTo609'),
     2986      609 => array('Revision' => 610, 'Function' => 'UpdateTo610'),
     2987      610 => array('Revision' => 639, 'Function' => 'UpdateTo639'),
     2988      639 => array('Revision' => 646, 'Function' => 'UpdateTo646'),
     2989      646 => array('Revision' => 666, 'Function' => 'UpdateTo666'),
     2990      666 => array('Revision' => 678, 'Function' => 'UpdateTo678'),
     2991      678 => array('Revision' => 695, 'Function' => 'UpdateTo695'),
     2992      695 => array('Revision' => 712, 'Function' => 'UpdateTo712'),
     2993      712 => array('Revision' => 716, 'Function' => 'UpdateTo716'),
     2994      716 => array('Revision' => 725, 'Function' => 'UpdateTo725'),
     2995      725 => array('Revision' => 731, 'Function' => 'UpdateTo731'),
     2996      731 => array('Revision' => 732, 'Function' => 'UpdateTo732'),
     2997      732 => array('Revision' => 748, 'Function' => 'UpdateTo748'),
     2998      748 => array('Revision' => 787, 'Function' => 'UpdateTo787'),
     2999      787 => array('Revision' => 803, 'Function' => 'UpdateTo803'),
     3000      803 => array('Revision' => 811, 'Function' => 'UpdateTo811'),
     3001      811 => array('Revision' => 846, 'Function' => 'UpdateTo846'),
     3002      846 => array('Revision' => 848, 'Function' => 'UpdateTo848'),
     3003      848 => array('Revision' => 849, 'Function' => 'UpdateTo849'),
     3004      849 => array('Revision' => 857, 'Function' => 'UpdateTo857'),
     3005      857 => array('Revision' => 867, 'Function' => 'UpdateTo867'),
     3006      867 => array('Revision' => 872, 'Function' => 'UpdateTo872'),
     3007      872 => array('Revision' => 873, 'Function' => 'UpdateTo873'),
    29963008    ));
    29973009  }
  • trunk/Application/Version.php

    r872 r879  
    77
    88$Version = '1.0';
    9 $Revision = 872; // Subversion revision
    10 $DatabaseRevision = 872; // Database structure revision
    11 $ReleaseDate = strtotime('2017-04-09');
     9$Revision = 873; // Subversion revision
     10$DatabaseRevision = 873; // Database structure revision
     11$ReleaseDate = strtotime('2020-04-07');
  • trunk/Modules/Export/Export.php

    r869 r879  
    9494
    9595
    96     $Query = 'SELECT * FROM (SELECT '.$Columns.' T.`ID`,T.`Language`,T.`User`,T.`Entry`,T.`VersionEnd`,T.`VersionStart`, `User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'.
     96    $Query = 'SELECT * FROM (SELECT ANY_VALUE(`TT`.`ID`) AS `TTID` FROM (SELECT '.$Columns.' T.`ID`,T.`Language`,T.`User`,T.`Entry`,T.`VersionEnd`,T.`VersionStart`, `User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'.
    9797    ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$this->Id.') '.
    9898    ' JOIN `User` ON `User`.`ID`=`T`.`User`'.
    9999    ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$this->Id.')'.
    100100    ' WHERE (`Complete` = 1) AND (`VersionStart` <= '.$ExportVersion.') AND (`VersionEnd` >= '.$ExportVersion.')'.
    101     ' ORDER BY `ExportLanguage`.`Sequence`, `ExportUser`.`Sequence`) AS `TT` GROUP BY `TT`.`Entry`';
     101    ' ORDER BY `ExportLanguage`.`Sequence`, `ExportUser`.`Sequence`) AS `TT` GROUP BY `TT`.`Entry`) AS `TK`'.
     102    ' LEFT JOIN `'.$Group['TablePrefix'].'` AS `TJ` ON `TJ`.`ID` = `TK`.`TTID` ';
    102103
    103104    // Build columns for english texts
     
    279280  }
    280281
     282  // Export only if translate have same varible %
    281283  function HaveVarible($String1, $String2, $StartChar = '$')
    282284  {
    283           //Export only if translate have same varible %
    284 
    285285    if (strpos($String1,$StartChar) !== false) {
    286286
  • trunk/Packages/Common/Setup.php

    r862 r879  
    415415  PRIMARY KEY (`Id`)
    416416) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
    417     $this->Database->query("INSERT INTO `'.$this->UpdateManager->VersionTable.'` (`Id`, `Revision`) VALUES
    418       (1, '.$DatabaseRevision.');");
     417    $this->Database->query('INSERT INTO `'.$this->UpdateManager->VersionTable.'` (`Id`, `Revision`) VALUES
     418      (1, '.$DatabaseRevision.');');
    419419    $this->Database->query("CREATE TABLE IF NOT EXISTS `Module` (
    420420  `Id` int(11) NOT NULL AUTO_INCREMENT,
  • trunk/includes/Global.php

    r874 r879  
    588588
    589589    $where = '(`Language` = '.$Config['OriginalLanguage'].') ';
    590     if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.
     590    if ($mode == 1)
     591    {
     592      $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.
    591593      '` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].
    592594      ') AND (`Sub`.`Entry` = `O`.`Entry`))';
    593     if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.
     595    }
     596    if ($mode == 2)
     597    {
     598      $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.
    594599      '` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].
    595600      ') AND (`Sub`.`Entry` = `O`.`Entry`))';
     601    }
    596602    $where .= ' AND (';
    597     if (array_search('the', $ArrStr)) $where .= '(`O`.`'.$Column.'` LIKE "The %") OR ';
     603    if (array_search('the', $ArrStr))
     604    {
     605      $where .= '(`O`.`'.$Column.'` LIKE "The %") OR ';
     606    }
    598607
    599608    $SqlOK = false;
     
    618627        //$sql.$where.$groupby.$orderby
    619628//          $buff[] = array($Line['ID'], GetIDbyName($Table), $Line['Orig'], $Line['Tran']);
    620       if ($sqlall <> '') { $sqlall .= ' UNION ALL ( '.$sql.$where.$groupby.' )';}
    621         else {$sqlall .= ' ( '.$sql.$where.$groupby.' )'; }
     629      if ($sqlall <> '')
     630      {
     631        $sqlall .= ' UNION ALL ( '.$sql.$where.$groupby.' )';     
     632      } else {
     633        $sqlall .= ' ( '.$sql.$where.$groupby.' )';             
     634      }
    622635    }
    623636  }
Note: See TracChangeset for help on using the changeset viewer.