Ignore:
Timestamp:
Aug 24, 2015, 9:57:27 PM (9 years ago)
Author:
chronos
Message:
  • Removed: Do not use fixed number for text group item index. Do not exclude all other groups for mass translation except spell rank.
  • Modified: Translation save page redirection part of code moved to separate method.
  • Fixed: Translation save condition for empty original text items.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Translation/TranslationList.php

    r817 r831  
    184184                              ')';
    185185          }
    186       if($Filter['State'] == CompletionState::All) $Filter['SQL'] .= $UserFilter.$VersionFilter.'';
    187       else if($Filter['State'] == CompletionState::NotTranslated) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].') '.
     186      if($Filter['State'] == CompletionState::All) {
     187        $Filter['SQL'] .= $UserFilter.$VersionFilter;
     188      } else
     189      if($Filter['State'] == CompletionState::NotTranslated) {
     190        $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].') '.
    188191          'AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '.
    189192          '(`Sub`.`Language` <> '.$this->System->Config['OriginalLanguage'].') '.$LanguageFilterSub.$UserFilter.
    190193          ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND '.
    191194          '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))';
    192       else if($Filter['State'] == CompletionState::Translated) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Complete` = 1)';
    193       else if($Filter['State'] == CompletionState::NotFinished) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].
     195      } else
     196      if($Filter['State'] == CompletionState::Translated) {
     197        $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Complete` = 1)';
     198      } else
     199      if($Filter['State'] == CompletionState::NotFinished) {
     200        $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].
    194201      ') AND (`T`.`Complete` = 0)';
    195       else if($Filter['State'] == CompletionState::Original) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].')';
    196       else if($Filter['State'] == CompletionState::NotFinishedNotTranslated) $Filter['SQL'] .= $UserFilter.$VersionFilter.$WithoutAlter.
     202      } else
     203      if($Filter['State'] == CompletionState::Original) {
     204        $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].')';
     205      } else
     206      if($Filter['State'] == CompletionState::NotFinishedNotTranslated) {
     207        $Filter['SQL'] .= $UserFilter.$VersionFilter.$WithoutAlter.
    197208      ' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].
    198       ') AND (`T`.`Complete` = 0)'.
    199           '';
    200       else if($Filter['State'] == CompletionState::Missing1) {
     209      ') AND (`T`.`Complete` = 0)';
     210      } else
     211      if($Filter['State'] == CompletionState::Missing1) {
    201212        $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Complete` = 1) AND `T`.`Language` != '.$this->System->Config['OriginalLanguage'];
    202213        $Filter['SQL'] .= ' AND ('.implode(' OR ', $ItemsVar).') ';
    203       }
    204       else if($Filter['State'] == CompletionState::Missing2) {
     214      } else
     215      if($Filter['State'] == CompletionState::Missing2) {
    205216        $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Complete` = 1) AND `T`.`Language` != '.$this->System->Config['OriginalLanguage'];
    206217        $Filter['SQL'] .= ' '. $WithoutAlter;
Note: See TracChangeset for help on using the changeset viewer.