Changeset 554 for trunk


Ignore:
Timestamp:
Jul 29, 2013, 9:25:33 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Error in user profile page if user id is not given.
  • Fixed: Error in translation list view if translation group item filter is empty.
  • Fixed: SQL constraint error in case of export deletion which have records in related tables.
  • Fixed: Error when table ordering parameter contain invalid value.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Translation/Save.php

    r550 r554  
    4545          if(($GroupItem['Visible'] == 1) and ($EnglishText[$GroupItem['Column']] != ''))
    4646            $Filter .= ' OR (`'.$GroupItem['Column'].'` = "'.addslashes($EnglishText[$GroupItem['Column']]).'")';
    47         $Filter = ' AND ('.substr($Filter, 3).')';
     47        if(substr($Filter, 0, 3) == ' OR') $Filter = ' AND ('.substr($Filter, 3).')';
    4848       
    4949        $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].')'.$Filter);
  • trunk/Modules/User/Profile.php

    r547 r554  
    4141                                'LEFT JOIN `Team` ON `Team`.`Id` = `User`.`Team` '.
    4242                                'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `User`.`PreferredVersion` '.
    43                                 'WHERE `User`.`Id` = '.$_GET['user'];
     43                                'WHERE `User`.`Id` = '.($_GET['user'] * 1);
    4444                $DbResult = $this->Database->query($Query);
     45                if($DbResult->num_rows > 0)
     46                {
    4547                $UserLine = $DbResult->fetch_array();
    4648                 
     
    7678                                        '</div></form></fieldset>';
    7779                }
     80                } else $Output .= ShowMessage('Uživatel nenalezen', MESSAGE_CRITICAL);
    7881                return($Output);
    7982        }
  • trunk/export/index.php

    r553 r554  
    116116  if($User->Licence(LICENCE_USER))
    117117  {   
    118     $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId'].' AND `User`='.$User->Id);
    119     $System->Database->query('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    120     DeleteDirectory('../tmp/Export/'.$_GET['ExportId'].'/');
    121     $Output = ShowMessage('Export smazán.');
    122     $_GET['Filter'] = 'my';
    123     WriteLog('Smazán export '.$_GET['ExportId'], LOG_TYPE_EXPORT);
    124     $Output .= ExportList();
     118    $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$User->Id.')');
     119    if($DbResult->num_rows > 0)
     120    {
     121      $System->Database->query('DELETE FROM `ExportGroup` WHERE `Export`='.$_GET['ExportId']);
     122      $System->Database->query('DELETE FROM `ExportLanguage` WHERE `Export`='.$_GET['ExportId']);
     123      $System->Database->query('DELETE FROM `ExportTask` WHERE `Export`='.$_GET['ExportId']);
     124      $System->Database->query('DELETE FROM `ExportUser` WHERE `Export`='.$_GET['ExportId']);
     125      $System->Database->query('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']);
     126      DeleteDirectory('../tmp/Export/'.$_GET['ExportId'].'/');
     127      $Output = ShowMessage('Export smazán.');
     128      $_GET['Filter'] = 'my';
     129      WriteLog('Smazán export '.$_GET['ExportId'], LOG_TYPE_EXPORT);
     130      $Output .= ExportList();
     131    } else $Output = ShowMessage('Export nenalezen.', MESSAGE_CRITICAL);
    125132  } else $Output = ShowMessage('Nemáte oprávnění.', MESSAGE_CRITICAL);
    126133  return($Output);
  • trunk/includes/Version.php

    r553 r554  
    11<?php
    22
    3 $Revision = 553; // Subversion revision
     3$Revision = 554; // Subversion revision
    44$DatabaseRevision = 543; // Database structure revision
    5 $ReleaseTime = '2013-07-18';
     5$ReleaseTime = '2013-07-29';
  • trunk/includes/global.php

    r552 r554  
    232232 
    233233  if(array_key_exists('OrderCol', $_GET)) $_SESSION['OrderCol'] = $_GET['OrderCol'];
    234   if(array_key_exists('OrderDir', $_GET)) $_SESSION['OrderDir'] = $_GET['OrderDir'];
     234  if(array_key_exists('OrderDir', $_GET) and (array_key_exists($_GET['OrderDir'], $OrderArrowImage)))
     235        $_SESSION['OrderDir'] = $_GET['OrderDir'];
    235236  if(!array_key_exists('OrderCol', $_SESSION)) $_SESSION['OrderCol'] = $DefaultColumn;
    236   if(!array_key_exists('OrderDir', $_SESSION)) $_SESSION['OrderDir'] = $DefaultOrder;
     237  if(!array_key_exists('OrderDir', $_SESSION)) $_SESSION['OrderDir'] = $DefaultOrder; 
    237238 
    238239  // Check OrderCol
     
    260261    $QueryItems['OrderCol'] = $Column['Name'];
    261262    $QueryItems['OrderDir'] = 1 - $_SESSION['OrderDir'];
    262     if($Column['Name'] == $_SESSION['OrderCol']) $ArrowImage = '<img  style="vertical-align: middle; border: 0px;" src="'.$System->Link('/images/'.$OrderArrowImage[$_SESSION['OrderDir']]).'" alt="order arrow">';
     263    if($Column['Name'] == $_SESSION['OrderCol']) $ArrowImage = '<img  style="vertical-align: middle; border: 0px;" src="'.
     264      $System->Link('/images/'.$OrderArrowImage[$_SESSION['OrderDir']]).'" alt="order arrow">';
    263265      else $ArrowImage = '';
    264266    if($Column['Name'] == '') $Result .= '<th>'.$Column['Title'].'</th>';
Note: See TracChangeset for help on using the changeset viewer.