Changeset 303


Ignore:
Timestamp:
Jan 4, 2010, 10:57:57 AM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazování obrázků úrovně překladatelů na stránce Exportu.
  • Opraveno: Výchozí automatické řazení nevybraných položek překladatelů. Nyní se počáteční pořadí vytváří dle zvoleného řazení sloupce tabulky.
  • Opraveno: Zobrazování vedoucího týmu na stránce týmu.
  • Opraveno: Generování výpisu dostupných týmů na stránce registrace překladatele.
Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/index.php

    r299 r303  
    167167  }
    168168
    169   $Columns = '';
    170   $Joins = '';
    171   foreach($TranslationTree as $Group)
    172     if($Group['TablePrefix'] != '')
    173     {
    174       $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + ';
    175       $Joins .= ' LEFT JOIN (SELECT User, COUNT(User) as Count FROM `'.$Group['TablePrefix'].'` WHERE (Complete = 1) AND (Language <> 0) GROUP BY User) as T'.$Group['Id'].' ON user.ID=T'.$Group['Id'].'.User';
    176     }
    177   $Query = 'SELECT (@I := @I + 1) AS Sequence2, ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, ('.substr($Columns, 0, -3).') as TranslatedCount FROM `user`'.$Joins.') AS T';
    178   $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID';
    179   $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(Sequence, 100)';
    180 
    181   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');
    182   $DbRow = mysql_fetch_row($DbResult);
    183   $PageList = GetPageList($DbRow[0]);   
    184  
    185169  $TableColumns = array(
    186170    array('Name' => 'user', 'Title' => 'Jméno'),
     
    191175  ); 
    192176  $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1);
     177
     178  $Columns = '';
     179  $Joins = '';
     180  foreach($TranslationTree as $Group)
     181    if($Group['TablePrefix'] != '')
     182    {
     183      $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + ';
     184      $Joins .= ' LEFT JOIN (SELECT User, COUNT(User) as Count FROM `'.$Group['TablePrefix'].'` WHERE (Complete = 1) AND (Language <> 0) GROUP BY User) as T'.$Group['Id'].' ON user.ID=T'.$Group['Id'].'.User';
     185    }
     186  $Query = 'SELECT (@I := @I + 1) AS Sequence2, TT.* FROM (SELECT ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, ('.substr($Columns, 0, -3).') as TranslatedCount FROM `user`'.$Joins.') AS T';
     187  $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID';
     188  $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(ExportUser.Sequence, 100000000), '.substr($Order['SQL'], 10).') AS TT';
     189
     190  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');
     191  $DbRow = mysql_fetch_row($DbResult);
     192  $PageList = GetPageList($DbRow[0]);   
     193 
    193194  echo('<form action="?Action=View&amp;ExportId='.$_GET['ExportId'].'&amp;Operation=Save" method="post">');
    194195  echo('<h3>Překladatelé</h3>');
     
    212213    <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&amp;action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['user'].'</a></td>
    213214    <td>'.$User['TranslatedCount'].'</td>
    214       <td><img src="'.$Config['Web']['TempFolder'].$User['user'].'/level.png" alt="Úroveň uživatele" /></td>
     215      <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['user'].'/level.png" alt="Úroveň uživatele" /></td>
    215216    <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>');
    216217  }
  • trunk/includes/global.php

    r302 r303  
    323323
    324324    echo('</td></tr>');
    325     if($Config['Web']['ShowRuntimeInfo'] == true) echo('<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s &nbsp;&nbsp; Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B</td></tr>');
     325    if($Config['Web']['ShowRuntimeInfo'] == true) echo('<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s &nbsp;&nbsp; Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B &nbsp;&nbsp; <a href="http://validator.w3.org/check?uri='.htmlentities('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?'.$_SERVER['QUERY_STRING']).'">HTML validator</a></td></tr>');
    326326    echo('</table>'.
    327327      '</body>'.
  • trunk/registrace.php

    r302 r303  
    6868      <td><select name="Team"><option value="0">Žádného</option>
    6969      ');
    70     $ID = $Database->SQLCommand('SELECT `name`, `Id` FROM `Team`');
     70    $ID = $Database->SQLCommand('SELECT `Name`, `Id` FROM `Team`');
    7171    while($Line = mysql_fetch_assoc($ID))
    7272    {
  • trunk/sql/updates/302.sql

    r302 r303  
    11ALTER TABLE `team` ADD `URL` VARCHAR( 255 ) NOT NULL ;
    22ALTER TABLE `team` CHANGE `ID` `Id` INT( 11 ) NOT NULL AUTO_INCREMENT ;
    3 LTER TABLE `team` CHANGE `name` `Name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL;
     3ALTER TABLE `team` CHANGE `name` `Name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL;
    44ALTER TABLE `team` CHANGE `description` `Description` TEXT CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL ;
    55
  • trunk/team.php

    r302 r303  
    185185      $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT count(*) FROM `user` WHERE `team` = `Team`.`Id`) as `NumberUser`, (SELECT SUM('.substr($Columns, 0, -3).') FROM user '.$Joins.' WHERE `team` = `Team`.`Id`) as `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']));
    186186      $DbResult = $Database->SQLCommand('SELECT user FROM user WHERE ID='.$Team['Leader']);
    187       if(mysql_num_rows($DbResult) > 0) $Leader = mysql_fetch_assoc($DbResult);
    188         else $Leader = '';
     187      if(mysql_num_rows($DbResult) > 0)
     188      {
     189        $Leader = mysql_fetch_assoc($DbResult);
     190        $Leader = $Leader['user'];
     191      } else $Leader = '';
    189192   
    190193      echo('<strong>Překladatelský tým '.$Team['Name'].'</strong><br />'.
Note: See TracChangeset for help on using the changeset viewer.