Changeset 743 for trunk/Modules


Ignore:
Timestamp:
Jan 9, 2014, 2:44:51 PM (11 years ago)
Author:
maron
Message:
  • Modify: Progress.php like all list task
  • Modify: Search in form for same text
Location:
trunk/Modules
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/ExportOutput.php

    r740 r743  
    229229    global $System;
    230230    $Output = '';
    231     $DbResult = $System->Database->query('SELECT * FROM `ExportTask`'.
    232     ' LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE  (`Export`.`OutputType` = 9 OR  `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL ORDER BY `Progress` DESC');// `Export`='.$Export->Id
    233231    $Output .= 'Fronta zpracování exportů. Zobrazuje procenta dokončení: <br /><br />';
    234     while($Task = $DbResult->fetch_assoc()) {
     232
     233
    235234        $Output .= '<script src="http://code.jquery.com/jquery-latest.js"></script>'.
    236235               '<script>'.
    237236                  '$(document).ready(function() {'.
    238237                  'var refreshId = setInterval(function() {'.
    239                   '$("#progress'.$Task['Export'].'").load("'.$System->Link('/Modules/Export/Progress.php?RedirectId='.$_GET['ExportId'].'&ExportId='.$Task['Export']).'"); '.
     238                  '$("#progress").load("'.$System->Link('/Modules/Export/Progress.php?RedirectId='.$_GET['ExportId']).'"); '.
    240239                  '}, 1000);'.
    241240                  '});'.
    242241               '</script>';
    243       $Export = '<a href="'.$System->Link('/export/?Action=View&ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>';         
    244       if ($_GET['ExportId'] == $Task['Export'])
    245         $Export = ''.$Export.' (aktuální)';
    246    
    247       $Output .= ' <strong>Export '.$Export.': <div id="progress'.$Task['Export'].'">'.ProgressBar(300, $Task['Progress']).'</div></strong><br />';
    248    // if ($Task['Progress'] == 0) $Output .= '<br/><br/><strong>Soubor čeká na zpracování ve frontě.</strong><br/>';
    249    
    250     }
     242
     243   
     244      $Output .= ' <strong><div id="progress"></div></strong><br />';
     245
    251246    $DbResult = $System->Database->query('SELECT * FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE '.
    252247    ' (`Export`.`OutputType` = 9 OR  `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL AND `TimeStart` < NOW()-10000');
  • trunk/Modules/Export/Progress.php

    r740 r743  
    88   
    99
     10    $Output = '';
     11    $DbResult = $System->Database->query('SELECT * FROM `ExportTask`'.
     12    ' LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE  (`Export`.`OutputType` = 9 OR  `Export`.`OutputType` = 10 ) AND `TimeFinish` IS NULL  OR `Export` ='.$_GET['RedirectId'].' ORDER BY `Progress` DESC');// `Export`='.$Export->Id
     13    while($Task = $DbResult->fetch_assoc()) {
     14      $Export = '<a href="'.$System->Link('/export/?Action=View&ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>';         
     15      if ($_GET['RedirectId'] == $Task['Export'])
     16        $Export = ''.$Export.' (tento)';
     17      $Output .= ' <strong>Export '.$Export.': <div id="progress'.$Task['Export'].'">'.ProgressBar(300, $Task['Progress']).'</div></strong><br />';
     18      if ( $Task['Progress'] > 99 )   echo '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
     19      'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&ExportId='.$_GET['RedirectId']).'\'", 500)'.
     20      '</script>';
     21    }   
    1022
    11     $DbResult = $System->Database->query('SELECT Progress FROM `ExportTask` WHERE `Export`='.$_GET['ExportId']);
    12     $Task = $DbResult->fetch_assoc();
    13    
    14     if ( $Task['Progress'] > 99 )   echo '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    15    'setTimeout("parent.location.href=\''.$System->Link('/export/?Action=View&Tab=7&ExportId='.$_GET['RedirectId']).'\'", 500)'.
    16    '</script>';
     23    echo $Output;
     24    //echo ''.ProgressBar(300, $Task['Progress']).'';
    1725
    18 
    19     echo ''.ProgressBar(300, $Task['Progress']).'';
    20 
  • trunk/Modules/Translation/Form.php

    r736 r743  
    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
     53            //search for same text with other entry
     54                                          foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     55                                                  if($TextItem['Visible'] == 1)
     56                                                  if (($LineAJ[$TextItem['Column']] <> '') and
     57                    ($LineAJ[$TextItem['Column']] == $Line[$TextItem['Column']]) and
     58                    (strlen($LineAJ[$TextItem['Column']]) < 20)
     59                   )
     60                 {       
     61                                $sql = 'SELECT '.$Columns.' Tran.`Entry` FROM `'.$Table.'` as Tran';
     62                    $join = ' JOIN `'.$Table.'` as `Orig` ON `Orig`.`Language` = 0 AND `Tran`.`Entry` = `Orig`.`Entry` AND `Tran`.`VersionEnd` = `Orig`.`VersionEnd` ';
     63                    $where = ' WHERE '.'( `Tran`.'.$Language.' ) AND '.' `Orig`.`'.$TextItem['Column'].'` = "'.$LineAJ[$TextItem['Column']].'" ORDER BY `Tran`.`ModifyTime` DESC LIMIT 1';
     64                    $DbResult = $this->Database->query($sql.$join.$where);
     65                    while ($LineSearch = $DbResult->fetch_assoc()) {
     66                      $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']];
     67                    }
     68                 }     
    5169         
    5270                                $sql = 'SELECT '.$Columns.' Tran.`Entry` FROM `'.$Table.'` as Tran';
     
    6886          }
    6987         
     88                   
    7089        } else {
    7190                                $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
  • trunk/Modules/Translation/LoadNames.php

    r739 r743  
    5858
    5959
    60   //todo:haveto load
    6160  $Text = '';
    6261        function LoadNames() {
     
    7877                                        } else {
    7978                                        if(($GroupId == 13)) {
    80                                                 $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text', 'TextGlobalString' => 'Text', 'TextArea' => 'Name', 'TextCharacterClass' => 'Name','TextCharacterRace' => 'Name1',),false);
     79                                                $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text', 'TextGlobalString' => 'Text', 'TextArea' => 'Name', 'TextItemSublass' => 'Name', 'TextCharacterRace' => 'Name1',),false);
    8180            } else {
    82                                                 $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text'));
     81                                                $names = GetTranslatNames($Text, 0, GetTranslatNamesArray());
    8382                                        }
    8483                                        }
  • trunk/Modules/Translation/Progress.php

    r636 r743  
    112112$Output .= $this->ShowStatTable();
    113113
    114 $Output .= '<div>Počet stáhnutí přeložených textů v SQL souboru: <strong>';   
    115 $ID = $this->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2');
    116 $Line = $ID->fetch_row();
    117 $Output .= $Line[0];
    118 $Output .= '</strong></div>';
    119                
    120 $Output .= '<div>Počet stáhnutí: <strong>';     
    121 $ID = $this->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0');
    122 $Line = $ID->fetch_row();
    123 $Output .= $Line[0];
    124 $Output .= '</strong></div>';
    125114    return($Output);
    126115  }
Note: See TracChangeset for help on using the changeset viewer.