Changeset 433 for trunk


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ů.
Location:
trunk
Files:
3 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}
  • trunk/index.php

    r429 r433  
    1010  $DbResult = $Database->SQLCommand('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    1111  while($DbRow = mysql_fetch_assoc($DbResult))
    12     $Output .= '<div><strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>'; 
     12    $Output .= '<div><strong>'.$DbRow['Name'].' ('.HumanDate($DbRow['Time']).')</strong> <br />'.$DbRow['Text'].'</div>'; 
    1313  $Output .= '<a href="action.php?action=news">Všechny zprávy</a>';
    1414  $Output .= '</div>';
  • trunk/sql/updates/428.sql

    r428 r433  
    44UPDATE `Group` SET  `Name` =  'EventAI' WHERE  `Group`.`Id` =11;
    55UPDATE `Group` SET  `Name` =  'Skripty ScriptDev2' WHERE  `Group`.`Id` =10;
     6
     7UPDATE  `GroupItem` SET  `Name` =  'Podrobnosti' WHERE  `GroupItem`.`Id` =2;
Note: See TracChangeset for help on using the changeset viewer.