Changeset 813


Ignore:
Timestamp:
Jun 3, 2014, 9:40:12 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: There was wrong language displayed for translation items.
Location:
trunk
Files:
2 edited

Legend:

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

    r806 r813  
    1111                $Action = '';
    1212    if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
    13                
     13
    1414    if($Action == 'delete') $Output = $this->Delete();
    1515                  else $Output = $this->ShowForm();
    1616                return($Output);
    1717        }
    18        
     18
    1919        function ShowForm()
    2020        {
    2121                global $TranslationTree;
    22                
     22
    2323                $Output = '';
    24        
     24
    2525                $GroupId = LoadGroupIdParameter();
    2626                $this->GroupId = $GroupId;
     
    2828                if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
    2929                else $Action = '';
    30        
     30
    3131                if(array_key_exists('ID', $_GET))
    3232                {
    3333                        $TextID = $_GET['ID'] * 1;
    3434                  $this->ID = $TextID;
    35        
     35
    3636                        $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
    3737                        $Line = $DbResult->fetch_assoc();
     
    4040                                $Output .= ShowMessage('Překlad nenalezen.', MESSAGE_CRITICAL);
    4141                        } else
    42                         {       
     42                        {
    4343                          if ($this->System->Config['OriginalLanguage'] == $Line['Language']){
    4444          $LineAJ = $Line;
    45          
     45
    4646          if ($this->System->User->Language <> '') $Language = '`Language` = '.$this->System->User->Language;
    4747          else $Language = '`Language` != '.$this->System->Config['OriginalLanguage'];
     
    4949          foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    5050            $Columns .= ' `Orig`.`'.$TextItem['Column'].'` as `Orig_'.$TextItem['Column'].'`, `Tran`.`'.$TextItem['Column'].'` as `'.$TextItem['Column'].'`,';
    51  
    52          
     51
     52
    5353                                $sql = 'SELECT '.$Columns.' Tran.`Entry` FROM `'.$Table.'` as Tran';
    5454          $join = ' JOIN `'.$Table.'` as `Orig` ON `Orig`.`Language` = 0 AND `Tran`.`Entry` = `Orig`.`Entry` AND `Tran`.`VersionEnd` = `Orig`.`VersionEnd` ';
     
    5858                                          foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    5959                                                  if($TextItem['Visible'] == 1)
    60                                                   if (($LineAJ[$TextItem['Column']] <> '') and 
     60                                                  if (($LineAJ[$TextItem['Column']] <> '') and
    6161                    ($LineSearch[$TextItem['Column']] <> '') and
    6262                    ($LineSearch['Orig_'.$TextItem['Column']] <> $LineSearch[$TextItem['Column']]) and
     
    6666                   $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']];
    6767                                                  //   echo $Line[$TextItem['Column']].'<br />';
    68                  }     
     68                 }
    6969          }
    70                    
     70
    7171        } else {
    7272                                $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
     
    8080                                } else
    8181                                {
    82        
     82
    8383                                        if($Line['User'] != '')
    8484                                        {
     
    8787                                        } else
    8888                                                $LineUser = array('Name' => '');
    89        
     89
    9090                                        $Output .= 'Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />';
    91        
     91
    9292                                        if(($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
    9393                                                $Output .= 'Přeložil: <strong>'.$LineUser['Name'].'</strong> dne '.HumanDate($Line['ModifyTime']).'<br />';
     
    9797                                                $Language = $DbResult->fetch_assoc();
    9898                                                // echo $Language['Language'].'  '.$Line['Take'];
    99        
     99
    100100                                                $DbResult = $this->Database->query('SELECT `Name` FROM `Language` WHERE `Id` ='.$Language['Language']);
    101101                                                $Lang = $DbResult->fetch_assoc();
    102        
     102
    103103                                                $Output .= 'Původní text: <strong>'.
    104104                                                        ' ID <a href="form.php?group='.$GroupId.'&amp;ID='.$Line['Take'].'">'.$Line['Take'].'</a></strong>'.
     
    112112                                                else $Output .= ' <b> Uložen v rozepsaných</b> ';
    113113                                        } else $Output .= ' <b>Anglická, původní verze</b> ';
    114        
     114
    115115                                        $Output .= '<br />'.
    116116                                                'Verze: <b><a href="'.$this->System->Link('/client-version/?action=item&amp;id='.GetVersionWOWId($Line['VersionStart'])).'">'.GetVersionWOW($Line['VersionStart']).
    117117            '</a> - <a href="'.$this->System->Link('/client-version/?action=item&amp;id='.GetVersionWOWId($Line['VersionEnd'])).'">'.GetVersionWOW($Line['VersionEnd']).'</a></b>'.
    118118                                                '<br />';
    119                                          
     119
    120120                                        $DbResult = $this->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE '.
    121121                                                '(`Entry` = '.$Line['Entry'].')');
     
    129129                                                <input type="hidden" name="entry" value="'.$Line['Entry'].'" />
    130130                                                <input type="hidden" name="ID2" value="'.$TextID.'" />';
    131                                                
     131
    132132            if($this->System->User->Licence(LICENCE_USER)) { //allow to compare only to user
    133133              $Output .= '<select onchange="this.form.submit();" name="ID1">
     
    155155                                                  $Line['Entry'].'&amp;text=">Počet verzí: <strong>'.$Version.'</strong></a>';
    156156                                        }
    157        
    158                                         // Special characters: $B - New line, $N - Name, $C - profession                                       
     157
     158                                        // Special characters: $B - New line, $N - Name, $C - profession
    159159                                        if($this->System->User->Licence(LICENCE_USER))
    160160                                        {
     
    168168                                                FollowingTran($TextID, $Table, $GroupId);
    169169                                        }
    170        
     170
    171171                                        if($TranslationTree[$GroupId]['WowheadName'] != '')
    172172                                                $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>';
    173173                                        else $WowheadLink = $LineAJ['Entry'];
    174        
     174
    175175                                        $Output .= '<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />
    176176                                        <input type="hidden" name="user" value="'.$this->System->User->Id.'" />
     
    192192                                        } else $Language = 0;
    193193                                        if($this->System->User->Licence(LICENCE_USER)) $Output .= WriteLanguages($Language);
    194                                           else {                                       
    195                   $DbResult3 = $this->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');
    196                   if($DbResult3->num_rows > 0) 
    197                   { 
     194                                          else {
     195                  $DbResult3 = $this->Database->select('Language', '`Id`, `Name`', '(`Enabled` = 1) AND (`Id`='.$Language.')');
     196                  if($DbResult3->num_rows > 0)
     197                  {
    198198                        $Language = $DbResult3->fetch_assoc();
    199199                        $Output .= $Language['Name'];
    200200                  }
    201201                                          }
    202                                        
     202
    203203                                        $Output .= '</td></tr>';
    204        
     204
    205205          //todo javascript
    206        
     206
    207207            $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'.
    208208               '<script>';
     
    210210                                        foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    211211            $Output .=   '$("#'.$TextItem['Column'].'").load("'.$this->System->Link('/LoadNames.php?ID='.$LineAJ['ID'].'&Column='.$TextItem['Column'].'&GroupId='.$GroupId).'");';
    212          
     212
    213213          $Output .= '});'.
    214214               '</script>';
     
    224224                                                                $Output .= '<td id="'.$TextItem['Column'].'">'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td>
    225225                                                                <td>';
    226                                                                 if($this->System->User->Licence(LICENCE_USER)) 
     226                                                                if($this->System->User->Licence(LICENCE_USER))
    227227                                                                        $Output .= '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">';
    228228                                                                $Output .=  htmlspecialchars($Line[$TextItem['Column']]);
     
    236236                                                if($this->System->User->Licence(LICENCE_USER)) {
    237237              $Output .= '</form>';
    238              
     238
    239239              $Output .= '<table class="BaseTable">'.
    240240                                            '<tr><th>Překladač:</th><th>Nepřeložené</th><th>Přeložené</th>';
     
    243243                                                  if ($LineAJ[$TextItem['Column']] <> '')
    244244                    $Output .= '<tr><td>'.$TextItem['Column'].'</td><td>'.$LineAJ[$TextItem['Column']].'</td><td>'.GetTranslateGoogle($LineAJ[$TextItem['Column']]).'</td></tr>';
    245              
    246              
     245
     246
    247247              $Output .= '</table>';
    248248            }
     
    256256        {
    257257                global $TranslationTree;
    258                
     258
    259259                if($this->System->User->Licence(LICENCE_MODERATOR))
    260260                {
     
    268268                } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    269269                return($Output);
    270         }       
     270        }
    271271}
  • trunk/includes/Version.php

    r812 r813  
    66// and system will need database update.
    77
    8 $Revision = 812; // Subversion revision
     8$Revision = 813; // Subversion revision
    99$DatabaseRevision = 811; // Database structure revision
    10 $ReleaseTime = '2014-05-31';
     10$ReleaseTime = '2014-06-03';
Note: See TracChangeset for help on using the changeset viewer.