Changeset 601


Ignore:
Timestamp:
Dec 7, 2013, 10:54:21 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Tabulka pro evidenci bezdrátovách rozhraní.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r599 r601  
    11<?php
    22
    3 $Revision = 599; // Subversion revision
    4 $DatabaseRevision = 597; // SQL structure revision
    5 $ReleaseTime = '2013-12-06';
     3$Revision = 601; // Subversion revision
     4$DatabaseRevision = 601; // SQL structure revision
     5$ReleaseTime = '2013-12-07';
  • trunk/Common/Form/Types/Base.php

    r581 r601  
    4747  function OnFilterName($Item)
    4848  {
    49     if($Item['SQL'] != '') $SQL = '('.$Item['SQL'].') AS ';
     49    if(array_key_exists('SQL', $Item) and ($Item['SQL'] != ''))
     50      $SQL = '('.$Item['SQL'].') AS ';
    5051      else $SQL = '';
    5152    return($SQL.'`'.$Item['Name'].'`');
     
    5455  function OnFilterNameQuery($Item)
    5556  {
    56     if($Item['SQL'] != '')
     57    if(array_key_exists('SQL', $Item) and ($Item['SQL'] != ''))
    5758      $Output = '('.$Item['SQL'].') AS `'.$Item['Name'].'`, ('.$Item['SQL'].') AS `'.$Item['Name'].'_Filter`';
    5859      else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`';
  • trunk/Common/Setup/Updates.php

    r597 r601  
    463463}
    464464
     465function UpdateTo601($Manager)
     466{
     467  $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkInterfaceWireless` (
     468  `Id` int(11) NOT NULL AUTO_INCREMENT,
     469  `NetworkInterface` int(11) NOT NULL,
     470  `TxPower` int(11) NOT NULL,
     471  `CableAttenuation` int(11) NOT NULL,
     472  `AntenaGain` int(11) NOT NULL,
     473  `Frequency` float NOT NULL,
     474  `ChannelWidth` int(11) NOT NULL,
     475  `SSID` varchar(255) NOT NULL,
     476  PRIMARY KEY (`Id`),
     477  KEY `NetworkInterface` (`NetworkInterface`)
     478) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     479
     480  $Manager->Execute('ALTER TABLE `NetworkInterfaceWireless`
     481  ADD CONSTRAINT `NetworkInterfaceWireless_ibfk_1` FOREIGN KEY (`NetworkInterface`) REFERENCES `NetworkInterface` (`Id`);');
     482  $Manager->Execute("INSERT INTO `centrala_big`.`Action` (
     483`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     484`Enable`) VALUES (NULL , '', 'Wifi rozhraní', '1', '/is/?t=NetworkInterfaceWireless&a=list', NULL , NULL , NULL , '1'
     485);");
     486  $ActionId = $Manager->Database->insert_id;
     487  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     488    "VALUES (NULL , 'Bezdrátové rozhraní', '1', '".$ActionId."', '1');");
     489}
     490
    465491class Updates
    466492{
     
    492518      584 => array('Revision' => 591, 'Function' => 'UpdateTo591'),
    493519      591 => array('Revision' => 597, 'Function' => 'UpdateTo597'),
     520      597 => array('Revision' => 601, 'Function' => 'UpdateTo601'),
    494521    ));
    495522  }
  • trunk/Modules/Network/Network.php

    r586 r601  
    275275      ),
    276276    ));
    277    
    278    
     277    $this->System->FormManager->RegisterClass('NetworkInterfaceWireless', array(
     278      'Title' => 'Bezdrátová rozhraní',
     279      'Table' => 'NetworkInterfaceWireless',
     280      'Items' => array(
     281        'SSID' => array('Type' => 'String', 'Caption' => 'SSID', 'Default' => ''),
     282        'NetworkInterface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => ''),
     283        'TxPower' => array('Type' => 'Integer', 'Caption' => 'Výstupní výkon', 'Default' => '18', 'Suffix' => 'dBm'),
     284        'CableAttenuation' => array('Type' => 'Integer', 'Caption' => 'Útlum vedení', 'Default' => '0', 'Suffix' => 'dB'),
     285        'AntenaGain' => array('Type' => 'Integer', 'Caption' => 'Zisk antény', 'Default' => '', 'Suffix' => 'dBi'),
     286        'Frequency' => array('Type' => 'Float', 'Caption' => 'Frekvence', 'Default' => '5600', 'Suffix' => 'MHz'),
     287        'ChannelWidth' => array('Type' => 'Integer', 'Caption' => 'Šírka kanálu', 'Default' => '20', 'Suffix' => 'MHz'),
     288        'TotalPower' => array('Type' => 'Integer', 'Caption' => 'Celkový výkon', 'Default' => '20', 'Suffix' => 'dBm',
     289          'SQL' => '(`TxPower` - `CableAttenuation` + `AntenaGain`)', 'ReadOnly' => true),
     290        'LimitPower' => array('Type' => 'Integer', 'Caption' => 'Max. limit', 'Default' => '', 'Suffix' => 'dBm',
     291          'ReadOnly' => true, 'SQL' => '(CASE WHEN `Frequency` >= 5450 AND `Frequency` <= 5725 THEN 27 ELSE 20 END)'),
     292        'UnderLimit' => array('Type' => 'Boolean', 'Caption' => 'V limitu', 'Default' => '', 'Suffix' => '',
     293          'ReadOnly' => true, 'SQL' => '((`TxPower` - `CableAttenuation` + `AntenaGain`) <= (CASE WHEN `Frequency` >= 5450 AND `Frequency` <= 5725 THEN 27 ELSE 20 END))'),
     294      ),
     295    ));
    279296  } 
    280297 
Note: See TracChangeset for help on using the changeset viewer.