Changeset 293 for trunk/export


Ignore:
Timestamp:
Dec 27, 2009, 9:35:07 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Zobrazení potvrzovacího dialogu při mazání exportů.
  • Přidáno: Kontrola výběru verze k formátu výstupu exportu.
Location:
trunk/export
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/export.php

    r292 r293  
    3131    while($Language = $DbResult->fetch_assoc())
    3232      $this->WhereLang .= ' OR (Language = '.$Language['Language'].')';
    33     if($this->WhereLang == '') $WhereLang = 1;
     33    if($this->WhereLang == '') $this->WhereLang = 1;
    3434      else $this->WhereLang = '('.substr($this->WhereLang, 4).')';
    3535
     
    6565      $this->User = $DbResult->fetch_assoc();
    6666    } else $this->User = array('user' => 'Neznámý');
     67
    6768
    6869    $DbResult = $this->Database->query('SELECT * FROM `wow_client_version` WHERE `Id`='.$this->Export['ClientVersion']);
  • trunk/export/index.php

    r291 r293  
    3535    array('Name' => 'UserName', 'Title' => 'Překladatel'),
    3636    array('Name' => 'Title', 'Title' => 'Popis'),
    37     array('Name' => 'UsedCount', 'Title' => 'Počet stažení'),
     37    array('Name' => 'UsedCount', 'Title' => 'Prohlédnutí výstupu'),
    3838    array('Name' => 'UserCount', 'Title' => 'Překladatelů'),
    3939    array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'),
     
    4848  {
    4949    $Action = '<a href="?Action=View&amp;ExportId='.$Export['Id'].'">Zobrazit</a>';
    50     if($Export['User'] == $_SESSION['UserID']) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'"><div onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</div></a>';
     50    if($Export['User'] == $_SESSION['UserID']) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>';
    5151    echo('<tr><td>'.$Export['TimeCreate'].'</td><td>'.$Export['UserName'].'</td><td>'.$Export['Title'].'</td><td>'.$Export['UsedCount'].'</td><td>'.$Export['UserCount'].'</td><td>'.$Export['GroupCount'].'</td><td>'.$Action.'</td></tr>');
    5252  }
     
    9494    if(array_key_exists('ExportId', $_GET))
    9595    {
    96       $Database->SQLCommand('DELETE FROM Export WHERE Id='.$_GET['ExportId']);
    97       echo('Export smazán.<br/><br/>');
    98       $_GET['Filter'] = 'my';
    99       ExportList();
     96      $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId'].' AND User='.$_SESSION['UserID']);
     97      if(mysql_num_rows($DbResult) > 0)
     98      {
     99        $Database->SQLCommand('DELETE FROM Export WHERE Id='.$_GET['ExportId']);
     100        echo('Export smazán.<br/><br/>');
     101        $_GET['Filter'] = 'my';
     102        ExportList();
     103      } else echo('Export '.$_GET['ExportId'].' nelze smazat.<br/>');
    100104    } else echo('Nebylo zadáno Id');
    101105  } else echo('Nemáte oprávnění');
     
    515519  $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
    516520  $Export = mysql_fetch_assoc($DbResult);
    517   ExportOutput($Export['Id'], $Export['OutputType']);
     521  $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType WHERE Id='.$Export['OutputType']);
     522  if(mysql_num_rows($DbResult) > 0)
     523  {
     524    $DbResult = $Database->SQLCommand('SELECT * FROM ExportVersion WHERE ExportType='.$Export[ 'OutputType'].' AND ClientVersion='.$Export['ClientVersion']);
     525    if(mysql_num_rows($DbResult) > 0)
     526    { 
     527      $Database->SQLCommand('UPDATE Export SET UsedCount = UsedCount + 1 WHERE Id='.$Export['Id']);
     528      ExportOutput($Export['Id'], $Export['OutputType']);
     529    } else echo('Nebyla vybrána požadovaná verze klienta');
     530  } else echo('Nebyl vybrán formát výstupu.');
    518531}
    519532
Note: See TracChangeset for help on using the changeset viewer.