Changeset 655


Ignore:
Timestamp:
Dec 16, 2013, 11:42:02 AM (11 years ago)
Author:
maron
Message:
  • Fixed: load suggestions text only if is translated
Location:
trunk
Files:
2 edited

Legend:

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

    r654 r655  
    8888                          if ($this->System->Config['OriginalLanguage'] == $Line['Language']){
    8989          $LineAJ = $Line;
    90                                 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
    91                                         '(`Language` != '.$this->System->Config['OriginalLanguage'].') AND '.
    92                                         '(`Entry` = '.$Line['Entry'].') ORDER BY `ModifyTime` DESC LIMIT 1');
    93                                 $LineSearch = $DbResult->fetch_assoc();
    94                                         foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    95                                                 if($TextItem['Visible'] == 1)
    96                                                 if (($LineAJ[$TextItem['Column']] <> '') and ($LineSearch[$TextItem['Column']] <> '')) $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']];
    97 
     90         
     91          if ($this->System->User->Language <> '') $Language = '`Language` = '.$this->System->User->Language;
     92          else $Language = '`Language` != '.$this->System->Config['OriginalLanguage'];
     93          $Columns = '';
     94          foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     95            $Columns .= ' `Orig`.`'.$TextItem['Column'].'` as `Orig_'.$TextItem['Column'].'`, `Tran`.`'.$TextItem['Column'].'` as `'.$TextItem['Column'].'`,';
     96         
     97                                $sql = 'SELECT '.$Columns.' Tran.`Entry` FROM `'.$Table.'` as Tran';
     98          $join = ' JOIN `'.$Table.'` as `Orig` ON `Orig`.`Language` = 0 AND `Tran`.`Entry` = `Orig`.`Entry` AND `Tran`.`VersionEnd` = `Orig`.`VersionEnd` ';
     99          $where = ' WHERE '.'( `Tran`.'.$Language.' ) AND '.'(`Tran`.`Entry` = '.$Line['Entry'].') ORDER BY `Tran`.`ModifyTime` DESC';
     100                                $DbResult = $this->Database->query($sql.$join.$where);
     101          while ($LineSearch = $DbResult->fetch_assoc()) {
     102                                          foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     103                                                  if($TextItem['Visible'] == 1)
     104                                                  if (($LineAJ[$TextItem['Column']] <> '') and
     105                    ($LineSearch[$TextItem['Column']] <> '') and
     106                    ($LineSearch['Orig_'.$TextItem['Column']] <> $LineSearch[$TextItem['Column']]) and
     107                    ($LineAJ[$TextItem['Column']] == $Line[$TextItem['Column']])
     108                   )
     109                 {
     110                   $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']];
     111                                                  //   echo $Line[$TextItem['Column']].'<br />';
     112                 }     
     113          }
     114         
    98115        } else {
    99116                                $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
  • trunk/includes/Version.php

    r654 r655  
    66// and system will need database update.
    77
    8 $Revision = 654; // Subversion revision
     8$Revision = 655; // Subversion revision
    99$DatabaseRevision = 646; // Database structure revision
    10 $ReleaseTime = '2013-12-14';
     10$ReleaseTime = '2013-12-16';
Note: See TracChangeset for help on using the changeset viewer.