Changeset 660


Ignore:
Timestamp:
May 31, 2014, 12:08:52 AM (10 years ago)
Author:
chronos
Message:
  • Přidáno: Nyní lze v definici formulářových struktůr vybrat výchozí směr řazení.
  • Opraveno: V typu TimeDiff nezobrazovat nulový údaj pokud je hodnota null.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r659 r660  
    11<?php
    22
    3 $Revision = 659; // Subversion revision
     3$Revision = 660; // Subversion revision
    44$DatabaseRevision = 657; // SQL structure revision
    5 $ReleaseTime = strtotime('2014-05-25');
     5$ReleaseTime = strtotime('2014-05-29');
  • trunk/Common/Form/Types/TimeDiff.php

    r659 r660  
    77  function OnView($Item)
    88  {
    9     $Output = sprintf('%02d', floor($Item['Value'] / 3600 % 24)).':'.
    10       sprintf('%02d', floor($Item['Value'] / 60 % 60)).':'.
    11       sprintf('%02d', floor($Item['Value'] % 60));
    12     $Days = floor($Item['Value'] / (60 * 60 * 24));
    13     if($Days > 0) $Output = $Days.' dnů '.$Output;
     9    if($Item['Value'] == null) $Output = '';
     10    else {
     11      $Output = sprintf('%02d', floor($Item['Value'] / 3600 % 24)).':'.
     12        sprintf('%02d', floor($Item['Value'] / 60 % 60)).':'.
     13        sprintf('%02d', floor($Item['Value'] % 60));
     14      $Days = floor($Item['Value'] / (60 * 60 * 24));
     15      if($Days > 0) $Output = $Days.' dnů '.$Output;
     16    }
    1417    return($Output);
    1518  }
  • trunk/Modules/Finance/Finance.php

    r652 r660  
    293293    return($Output);
    294294  }
    295  
     295
    296296  function GetVATByType($TypeId)
    297297  {
     
    345345      'Table' => 'FinanceOperation',
    346346      'DefaultSortColumn' => 'Time',
     347      'DefaultSortOrder' => 1,
    347348      'Items' => array(
    348349        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''),
     
    367368      'Table' => 'FinanceInvoice',
    368369      'DefaultSortColumn' => 'Time',
     370      'DefaultSortOrder' => 1,
    369371      'Items' => array(
    370372        'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''),
     
    378380        'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''),
    379381        'PeriodFrom' => array('Type' => 'Date', 'Caption' => 'Období od', 'Default' => '', 'Null' => true),
    380         'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true),       
     382        'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true),
    381383        'Items' => array('Type' => 'TFinanceInvoiceItemListInvoice', 'Caption' => 'Položky', 'Default' => ''),
    382384        'OperationRel' => array('Type' => 'TFinanceInvoiceOperationRelListInvoice', 'Caption' => 'Platba', 'Default' => ''),
    383         'OperationRelCount' => array('Type' => 'Integer', 'Caption' => 'Plateb', 
     385        'OperationRelCount' => array('Type' => 'Integer', 'Caption' => 'Plateb',
    384386          'ReadOnly' => true, 'SQL' => '(SELECT COUNT(`FinanceInvoiceOperationRel`.`Id`) FROM `FinanceInvoiceOperationRel` '.
    385387          'WHERE `FinanceInvoiceOperationRel`.`Invoice`=#Id)'),
     
    396398        'Quantity' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'),
    397399        'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'),
    398         'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 
     400        'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč',
    399401          'ReadOnly' => true, 'SQL' => '`Price` * `Quantity`'),
    400402      ),
  • trunk/Modules/IS/IS.php

    r654 r660  
    400400    if(!array_key_exists('DefaultSortColumn', $FormClass))
    401401      $FormClass['DefaultSortColumn'] = 'Id';
    402     $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], 0);
     402    if(!array_key_exists('DefaultSortOrder', $FormClass))
     403      $FormClass['DefaultSortOrder'] = 0;
     404    $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], $FormClass['DefaultSortOrder']);
    403405    $Output .= $Order['Output'];
    404406
  • trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php

    r659 r660  
    3030      'Title' => 'Změny stavu rozhraní',
    3131      'Table' => 'NetworkInterfaceUpDown',
     32      'DefaultSortColumn' => 'Time',
     33      'DefaultSortOrder' => 1,
    3234      'Items' => array(
    3335        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => '', 'ReadOnly' => true),
  • trunk/Modules/News/News.php

    r614 r660  
    33include_once(dirname(__FILE__).'/NewsPage.php');
    44
    5 function CategoryItemCompare($Item1, $Item2) 
     5function CategoryItemCompare($Item1, $Item2)
    66{
    77  if ($Item1['Index'] == $Item2['Index']) return(0);
     
    2525    $this->SupportedModules = array('Search');
    2626  }
    27  
     27
    2828  function DoInstall()
    2929  {
     
    3232  function DoUnInstall()
    3333  {
    34   } 
    35  
     34  }
     35
    3636  function DoStart()
    3737  {
     
    4040      'Title' => 'Aktualita',
    4141      'Table' => 'News',
     42      'DefaultSortColumn' => 'Date',
     43      'DefaultSortOrder' => 1,
    4244      'Items' => array(
    4345        'Category' => array('Type' => 'TNewsCategory', 'Caption' => 'Kategorie', 'Default' => 0),
     
    6769    {
    6870      $this->System->ModuleManager->Modules['Search']->RegisterSearch('Novinky', 'News', array('Title', 'Content'));
    69     } 
    70   }
    71  
     71    }
     72  }
     73
    7274  function ShowNews($Category, $ItemCount, $DaysAgo)
    7375  {
     
    7678    $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$Category);
    7779    $Row = $DbResult->fetch_array();
    78     $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption'];     
     80    $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption'];
    7981    $Output .= '<div class="Action"><a href="aktuality/?category='.$Category.'">Zobrazit</a>';
    8082    if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category))
     
    100102
    101103        if($Row['Enclosure'] != '')
    102         { 
     104        {
    103105          $Output .= '<br />Přílohy: ';
    104106          $Enclosures = explode(';', $Row['Enclosure']);
    105107          foreach($Enclosures as $Enclosure)
    106108          {
    107             if(file_exists($this->UploadedFilesFolder.$Enclosure)) 
     109            if(file_exists($this->UploadedFilesFolder.$Enclosure))
    108110              $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>';
    109111          }
    110112        }
    111113        $Output .= '</div></td></tr>';
    112         $Index = $Index + 1;   
     114        $Index = $Index + 1;
    113115        $FontSize = $FontSize - 1;
    114116      }
     
    127129    while($NewsCategory = $DbResult->fetch_array())
    128130    {
    129       $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 
     131      $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1,
    130132        'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo'], 'Group' => $NewsCategory['Group']);
    131133      $I++;
     
    166168      $Output .= '<td style="vertical-align: top; width: '.round(100 / $ColumnCount).'%;">';
    167169      foreach($this->NewsSetting as $SettingItem)
    168         if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column)) 
     170        if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column))
    169171          $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']);
    170172      $Output .= '</td>';
     
    175177    $Output .= '</div>';
    176178    return($Output);
    177   } 
     179  }
    178180
    179181  function ShowCustomizeMenu()
     
    188190      $NewsCategory = $DbResult->fetch_array();
    189191      $Output .= '<tr><td>'.$NewsCategory['Caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"';
    190       if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"'; 
     192      if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"';
    191193      $Output .= ' /></td>'.
    192194      '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'.
     
    224226    setcookie('NewsSetting', $_COOKIE['NewsSetting'], time() + 60 * 60 * 24 * 365);
    225227  }
    226  
     228
    227229  function ModifyContent($Content)
    228230  {
    229231    $Result = '';
    230  
     232
    231233    // Make HTML link from URL
    232234    $I = 0;
     
    251253    $Result .= $Content;
    252254    return($Result);
    253   } 
     255  }
    254256}
  • trunk/Modules/Task/Task.php

    r586 r660  
    1313    $this->Dependencies = array('User');
    1414  }
    15  
     15
    1616  function DoStart()
    1717  {
     
    1919      'Title' => 'Úkoly',
    2020      'Table' => 'Task',
    21       'DefaultSortColumn' => 'Name',
     21      'DefaultSortColumn' => 'TimeCreate',
     22      'DefaultSortOrder' => 1,
    2223      'Items' => array(
    2324        'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => '', 'Required' => true),
     
    2829        'Priority' => array('Type' => 'TPriority', 'Caption' => 'Důležitost', 'Default' => 1),
    2930        'Conclusion' => array('Type' => 'Text', 'Caption' => 'Vyhodnocení', 'Default' => ''),
    30         'Public' => array('Type' => 'Boolean', 'Caption' => 'Veřejné', 'Default' => '0'), 
     31        'Public' => array('Type' => 'Boolean', 'Caption' => 'Veřejné', 'Default' => '0'),
    3132        'Progress' => array('Type' => 'Integer', 'Caption' => 'Průběh', 'Default' => '0', 'Suffix' => '%'),
    3233        'Group' => array('Type' => 'TTaskGroup', 'Caption' => 'Kategorie', 'Default' => '', 'Null' => true),
     
    5960      ),
    6061    ));
    61    
    62   } 
     62
     63  }
    6364}
  • trunk/Modules/TimeMeasure/Measurement/System.php

    r548 r660  
    2424
    2525  function Ping($Host = 'nix.cz')
    26   { 
     26  {
     27    $Row = array();
    2728    exec('ping '.$Host.' -c 1 -W 1|grep time=', $Row);
    2829    // W - timeout in seconds
     
    5556    $LastCpuUsage = unserialize(file_get_contents($CpuStateFileName));
    5657    //$cpuIDLEprev, $cpuSYSTprev, $cpuUSERprev;
    57  
     58
    5859    // get processor usage seconds for pct stats ###
    5960    $File = fopen('/proc/stat', 'r');
     
    6970    $CpuUsageDiffTotal = (($CpuUsageDiff['User'] + $CpuUsageDiff['System']) + $CpuUsageDiff['Idle']);
    7071    if ($CpuUsageDiffTotal > 0)
    71     { 
     72    {
    7273      $CpuUsagePercent['User'] = ($CpuUsageDiff['User'] / $CpuUsageDiffTotal) * 100;
    7374      $CpuUsagePercent['System'] = ($CpuUsageDiff['System'] / $CpuUsageDiffTotal) * 100;
     
    9394    array_shift($Output); // Skip header
    9495    foreach($Output as $Item)
    95     { 
     96    {
    9697      while(strpos($Item, '  ') !== false) $Item = str_replace('  ', ' ', $Item);  // Rrmove multiple spaces
    9798      $Item = explode(':', $Item);
     
    108109        $NetworkState[$Interface]['DownAverage'] = 0;
    109110        $NetworkState[$Interface]['UpAverage'] = 0;
    110       } 
     111      }
    111112      if($NetworkState[$Interface]['DownAverage'] < 0) $NetworkState[$Interface]['DownAverage'] = 0;
    112113      if($NetworkState[$Interface]['UpAverage'] < 0) $NetworkState[$Interface]['UpAverage'] = 0;
     
    121122    return($NetworkState['Interface']['DownAverage']);
    122123  }
    123  
     124
    124125  function NetworkSpeedUpload($Interface)
    125126  {
Note: See TracChangeset for help on using the changeset viewer.