Changeset 433 for trunk/export/index.php


Ignore:
Timestamp:
Apr 8, 2010, 10:43:50 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Správné zobrazení statistiky dokončení skupin u exportů při nevybraných skupinách a při nevybrané verzi.
  • Upraveno: U zobrazení překladatelů u exportu také ukazovat úroveň a zkušenosti dle HTML procent namísto obrázků.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/index.php

    r417 r433  
    162162    array('Name' => 'TranslatedCount', 'Title' => 'Překladů'),
    163163    array('Name' => 'XP', 'Title' => 'Úroveň'),
     164    array('Name' => 'XP', 'Title' => 'Zkušenost'),
    164165    array('Name' => '', 'Title' => 'Výběr'),
    165166    array('Name' => 'Sequence2', 'Title' => 'Pořadí'),
     
    197198  while($UserLine = mysql_fetch_assoc($DbResult))
    198199  {
     200    $XP = GetLevelMinMax($UserLine['XP']);
    199201    $Checked = $UserLine['Sequence'] != '';
    200202    $Selection = CheckBox('sel'.$UserLine['ID'], $Checked, '', 'CheckBox', !$Editable);
    201203    $Sequence = '<input type="text" name="seq'.$UserLine['ID'].'" style="text-align: center; width: 40px;" value="'.$UserLine['Sequence2'].'"'.$DisabledInput[$Editable].'/>';
    202     echo('<tr>
    203     <td><a href="'.$System->Link('/TranslationList.php?user='.$UserLine['ID'].'&amp;action=userall').'" title="Zobrazit všechny jeho přeložené texty">'.$UserLine['Name'].'</a></td>
    204     <td>'.$UserLine['TranslatedCount'].'</td>
    205       <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$UserLine['Name'].'/level.png" alt="Úroveň uživatele" /></td>
    206     <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>');
     204    echo('<tr>'.
     205    '<td><a href="'.$System->Link('/TranslationList.php?user='.$UserLine['ID'].'&amp;action=userall').'" title="Zobrazit všechny jeho přeložené texty">'.$UserLine['Name'].'</a></td>'.
     206    '<td>'.$UserLine['TranslatedCount'].'</td>'.
     207    '<td>'.$XP['Level'].'</td>'.
     208    '<td>'.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'</td>'.
     209    '<td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>');
    207210  }
    208211  echo('</table>');
     
    539542  $Export->LoadFilters();
    540543 
     544  if($Export->ClientVersion['BuildNumber'] == '') ErrorMessage('Nebyla vybrána verze klienta');
    541545  $GroupListQuery = 'SELECT `Group`.* FROM `Group` '.
    542546  ' JOIN `ExportGroup` ON (`ExportGroup`.`Export`='.$Export->Id.') AND (`ExportGroup`.`Group`=`Group`.`Id`)';
    543547  $Query = '';
     548  $UnionItems = array();
    544549  $DbResult = $Database->SQLCommand($GroupListQuery);
    545550  while($DbRow = mysql_fetch_assoc($DbResult))
    546551  {
    547     $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
     552    $UnionItems[] = 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    548553    ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    549554    ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$Export->Id.') '.
     
    554559    ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    555560    ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'.
    556     ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
     561    ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name`';
    557562  }
    558563  $Query = substr($Query, 0, - 6);
     
    577582  $Translated = 0;
    578583  $Total = 0;
    579   $ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);
    580   while($Group = mysql_fetch_assoc($ID))
    581   {
    582     echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>');
    583     $Translated += $Group['Translated'];
    584     $Total += $Group['Total'];
    585   }
    586   echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, round($Translated / $Total * 100, 2)).'</strong></td></tr>');
     584  if(count($UnionItems) > 0)
     585  {
     586    $ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.implode(' UNION ALL ', $UnionItems).') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);
     587    while($Group = mysql_fetch_assoc($ID))
     588    {
     589      echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>');
     590      $Translated += $Group['Translated'];
     591      $Total += $Group['Total'];
     592    }
     593  }
     594  if($Total > 0) $Percent = $Translated / $Total * 100;
     595    else $Percent = 100;
     596 
     597  echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, round($Percent, 2)).'</strong></td></tr>');
    587598  echo('</table>');
    588599}
Note: See TracChangeset for help on using the changeset viewer.