Changeset 615


Ignore:
Timestamp:
Nov 28, 2013, 7:49:39 PM (11 years ago)
Author:
maron
Message:
  • Fixed: Some colored bug, Select as 1 query
Location:
trunk
Files:
3 edited

Legend:

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

    r614 r615  
    66         $tran_replace = str_replace(' ',' ',$tran);
    77         $orig_replace = str_replace(' ',' ',$orig);
    8                                   $Text = str_replace(' '.$orig,' <span Title="Přelož jako: '.$tran_replace.'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&amp;ID='.$ID).'">'.$orig_replace.'</a></span>',$Text);
     8                                  $Text = str_replace(' '.$orig,' <span Title="Přelož jako:&nbsp;'.$tran_replace.'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&amp;ID='.$ID).'">'.$orig_replace.'</a></span>',$Text);
    99                                 return ($Text);
    1010  }
  • trunk/includes/Version.php

    r614 r615  
    66// and system will need database update.
    77
    8 $Revision = 614; // Subversion revision
     8$Revision = 615; // Subversion revision
    99$DatabaseRevision = 610; // Database structure revision
    1010$ReleaseTime = '2013-11-27';
  • trunk/includes/global.php

    r614 r615  
    538538    $Text = str_replace('>',' ',$Text);
    539539    $ArrStr = explode(' ', $Text);
    540      
     540    $sqlall = ''; 
    541541  foreach($TablesColumn as $Table => $Column)
    542542  { 
    543     $sql = 'SELECT `ID`,`'.$Column.'`, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '.
     543    $sql = 'SELECT `ID`,`'.$Column.'` AS Orig, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '.
    544544      '(`O`.`Entry` = `T`.`Entry`) AND (`Language` <> '.$Config['OriginalLanguage'].') LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE ';
    545     $groupby = ' GROUP BY `'.$Column.'`';
    546  
     545    $groupby = ' GROUP BY `'.$Column.'` ';
     546                                       // ORDER BY LENGTH('.$Column.') DESC
    547547
    548548    $where = '(`Language` = '.$Config['OriginalLanguage'].') ';
     
    565565      $where = substr($where, 0, strlen($where) - 4);
    566566      $where .= ')';
     567    }
     568    if ($sqlall <> '') { $sqlall .= ' UNION ALL ( '.$sql.$where.$groupby.' )';}
     569    else {$sqlall .= ' ( '.$sql.$where.$groupby.' )'; }
     570  }
    567571      if ($SqlOK) {
    568         $DbResult = $System->Database->query($sql.$where.$groupby);
     572        $DbResult = $System->Database->query($sqlall.'  ORDER BY LENGTH(Orig) DESC');
    569573    //  echo ($sql.'|'.$where.'|'.$groupby);
    570574        while($Line = $DbResult->fetch_assoc())
    571575        {
    572           $buff[] = array($Line['ID'], GetIDbyName($Table), $Line[$Column], $Line['Tran']);
     576          $buff[] = array($Line['ID'], GetIDbyName($Table), $Line['Orig'], $Line['Tran']);
    573577        }
    574578      }
    575     }
    576   }
    577579    return $buff;
    578580}
Note: See TracChangeset for help on using the changeset viewer.