Changeset 661


Ignore:
Timestamp:
May 31, 2014, 1:07:01 AM (10 years ago)
Author:
chronos
Message:
  • Upraveno: Definice třídy Subject přesunuta do samostatného modulu Subject.
  • Přidáno: K Subjektům přidána definice Kontaktů a druhů kontaktů.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/FormClasses.php

    r657 r661  
    8080    'Table' => 'FinanceYear',
    8181    'DefaultSortColumn' => 'Year',
     82    'DefaultSortOrder' => 1,
    8283    'Items' => array(
    8384      'Year' => array('Type' => 'Integer', 'Caption' => 'Rok', 'Default' => ''),
     
    9596    'DefaultSortColumn' => 'Id',
    9697    'Items' => array(
    97       'Id' => array('Type' => 'TFinanceYear', 'Caption' => 'Rok', 'Default' => '', 
     98      'Id' => array('Type' => 'TFinanceYear', 'Caption' => 'Rok', 'Default' => '',
    9899        'ReadOnly' => true),
    99100      'Income' => array('Type' => 'Integer', 'Caption' => 'Příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
  • trunk/Application/Version.php

    r660 r661  
    11<?php
    22
    3 $Revision = 660; // Subversion revision
    4 $DatabaseRevision = 657; // SQL structure revision
    5 $ReleaseTime = strtotime('2014-05-29');
     3$Revision = 661; // Subversion revision
     4$DatabaseRevision = 661; // SQL structure revision
     5$ReleaseTime = strtotime('2014-05-31');
  • trunk/Common/Setup/Updates.php

    r657 r661  
    727727}
    728728
     729function UpdateTo661($Manager)
     730{
     731  $Manager->Execute('CREATE TABLE IF NOT EXISTS `Contact` (
     732    `Id` int(11) NOT NULL AUTO_INCREMENT,
     733    `Category` int(11) NOT NULL,
     734    `Value` varchar(255) NOT NULL,
     735    `Subject` int(11) DEFAULT NULL,
     736    `User` int(11) DEFAULT NULL,
     737    PRIMARY KEY (`Id`),
     738    KEY `Category` (`Category`),
     739    KEY `User` (`User`),
     740    KEY `Subject` (`Subject`)
     741  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     742
     743  $Manager->Execute('CREATE TABLE IF NOT EXISTS `ContactCategory` (
     744    `Id` int(11) NOT NULL AUTO_INCREMENT,
     745    `Name` varchar(255) NOT NULL,
     746    PRIMARY KEY (`Id`)
     747  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;');
     748
     749  $Manager->Execute('ALTER TABLE `Contact`
     750    ADD CONSTRAINT `Contact_ibfk_3` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
     751    ADD CONSTRAINT `Contact_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `ContactCategory` (`Id`),
     752    ADD CONSTRAINT `Contact_ibfk_2` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);');
     753
     754  $Manager->Execute("INSERT INTO `Action` (
     755`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     756`Enable`) VALUES (NULL , '', 'Kontakty', '1', '/is/?t=Contact&a=list', NULL , NULL , NULL , '1'
     757);");
     758  $ActionId = $Manager->Database->insert_id;
     759  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     760    "VALUES (NULL , 'Kontakty', '12', '".$ActionId."', '1');");
     761  $ConatctMenuId = $Manager->Database->insert_id;
     762
     763  $Manager->Execute("INSERT INTO `Action` (
     764`Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` ,
     765`Enable`) VALUES (NULL , '', 'Druhy kontakty', '1', '/is/?t=ContactCategory&a=list', NULL , NULL , NULL , '1'
     766);");
     767  $ActionId = $Manager->Database->insert_id;
     768  $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ".
     769    "VALUES (NULL , 'Druhy kontaktů', ".$ConatctMenuId.", '".$ActionId."', '1');");
     770
     771  $Manager->Execute("INSERT INTO `ContactCategory` (`Id` ,`Name`)
     772VALUES (NULL , 'Telefón'), (NULL , 'ICQ'), (NULL , 'Jabber'), (NULL , 'Email'), (NULL , 'Skype');");
     773}
     774
    729775class Updates
    730776{
     
    767813      646 => array('Revision' => 647, 'Function' => 'UpdateTo647'),
    768814      647 => array('Revision' => 657, 'Function' => 'UpdateTo657'),
     815      657 => array('Revision' => 661, 'Function' => 'UpdateTo661'),
    769816    ));
    770817  }
  • trunk/Modules/IS/IS.php

    r660 r661  
    507507      '<a href="?a=delete&amp;t='.$Table.'&amp;i=#RowId"><img alt="Smazat" title="Smazat" src="'.
    508508      $this->System->Link('/images/delete.png').'" onclick="return confirmAction(\'Opravdu smazat položku?\');"/></a>';
    509     if(($Table != '') and (array_key_exists($Table, $this->System->FormManager->Classes))) $FormClass = $this->System->FormManager->Classes[$Table];
     509    if(($Table != '') and (array_key_exists($Table, $this->System->FormManager->Classes)))
     510      $FormClass = $this->System->FormManager->Classes[$Table];
    510511      else return($this->SystemMessage('Chyba', 'Tabulka '.$Table.' nenalezena'));
    511512    if(array_key_exists('ItemActions', $FormClass))
  • trunk/Modules/Log/Log.php

    r608 r661  
    1313    $this->Dependencies = array('User');
    1414  }
    15  
     15
    1616  function DoInstall()
    1717  {
     
    2020  function DoUnInstall()
    2121  {
    22   } 
    23  
     22  }
     23
    2424  function DoStart()
    2525  {
     
    2828      'Table' => 'Log',
    2929      'DefaultSortColumn' => 'Time',
     30      'DefaultSortOrder' => 1,
    3031      'Items' => array(
    3132        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => '', 'ReadOnly' => true),
     
    3738      ),
    3839    ));
    39    
     40
    4041  }
    41  
     42
    4243  function DoStop()
    4344  {
    4445  }
    45  
     46
    4647  function NewRecord($Module, $Operation, $Value = '')
    4748  {
    48     if(array_key_exists('User', $this->System->ModuleManager->Modules) and 
     49    if(array_key_exists('User', $this->System->ModuleManager->Modules) and
    4950      array_key_exists('Id', $this->System->User->User))
    5051      $UserId = $this->System->User->User['Id'];
     
    5253    if(array_key_exists('REMOTE_ADDR', $_SERVER)) $IPAddress = $_SERVER['REMOTE_ADDR'];
    5354      else $IPAddress = '';
    54     $this->Database->insert('Log', array('Time' => 'NOW()', 
    55       'User' => $UserId, 'Module' => $Module, 
     55    $this->Database->insert('Log', array('Time' => 'NOW()',
     56      'User' => $UserId, 'Module' => $Module,
    5657      'Operation' => $Operation, 'Value' => $Value, 'IPAddress' => $IPAddress));
    5758  }
  • trunk/Modules/Network/Network.php

    r657 r661  
    2424        '<strong>Seznam známých AP a obsazení kmitočtových pásem:</strong></div>'.
    2525        '<table class="WideTable">'.
    26         '<tr><th/><br/>SSID<br/><br/></th>'; 
     26        '<tr><th/><br/>SSID<br/><br/></th>';
    2727        $ChannelList = array();
    2828        if(!array_key_exists('range', $_GET)) $_GET['range'] = 'a';
    29         if($_GET['range'] == 'a')       
     29        if($_GET['range'] == 'a')
    3030        {
    3131          $Where = '(Frequency < 5000)';
    3232          for($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq;
    3333        }
    34         if($_GET['range'] == 'bc')       
     34        if($_GET['range'] == 'bc')
    3535        {
    3636          $Where = '(Frequency >= 5000) AND (Frequency <= 5350)';
    3737          for($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq;
    3838        }
    39         if($_GET['range'] == 'd')       
     39        if($_GET['range'] == 'd')
    4040        {
    4141          $Where = '(Frequency >= 5470)';
    4242          for($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq;
    4343        }
    44          
    45         foreach($ChannelList as $Frequency)       
     44
     45        foreach($ChannelList as $Frequency)
    4646        {
    4747          $Output .= '<th><div class="RotatedHeader">'.$Frequency.'<div></th>';
     
    5757            $HighFrequency = $DbRow['Frequency'] + $DbRow2['ChannelWidth'] / 2 + $DbRow2['ChannelWidthUpper'];
    5858            $Output .= '<tr><td>'.$DbRow2['SSID'].'</td>';
    59             foreach($ChannelList as $Frequency)       
     59            foreach($ChannelList as $Frequency)
    6060            {
    6161              if(($DbRow2['Frequency'] == $Frequency)) $Color = '#000000';
    6262                else if(($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080';
    6363                else if(($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0';
    64                
     64
    6565                else $Color = '#ffffff';
    6666              $Output .= '<td style="background-color: '.$Color.';">&nbsp;</td>';
    6767            }
    6868
    69             $Output .= '</tr>'; 
    70           }         
     69            $Output .= '</tr>';
     70          }
    7171        }
    7272        $Output .= '</table>';
    7373    return($Output);
    74   } 
     74  }
    7575}
    76  
     76
    7777class PageNetwork extends Page
    7878{
     
    8787      $Output = $this->PageNotFound();
    8888    } else $Output = $this->ShowInformation();
    89     return($Output); 
    90   }
    91  
     89    return($Output);
     90  }
     91
    9292  function ShowInformation()
    9393  {
     
    111111    $this->Description = 'Networking related tools';
    112112    $this->Dependencies = array();
    113   } 
     113  }
    114114
    115115  function DoInstall()
    116116  {
    117117  }
    118  
     118
    119119  function DoUninstall()
    120   {     
    121   }
    122  
     120  {
     121  }
     122
    123123  function DoStart()
    124124  {
    125     $this->System->RegisterPage('network', 'PageNetwork');   
     125    $this->System->RegisterPage('network', 'PageNetwork');
    126126    $this->System->RegisterPage(array('network', 'administration'), 'PageNetworkAdministration');
    127127    $this->System->RegisterPage(array('network', 'availability'), 'PageAvailability');
     
    131131    $this->System->RegisterPage(array('network', 'hosts'), 'PageHostList');
    132132    $this->System->RegisterPage(array('network', 'frequency-plan'), 'PageFrequencyPlan');
    133    
    134     $this->System->FormManager->RegisterClass('Subject', array(
    135       'Title' => 'Subjekty',
    136       'Table' => 'Subject',
    137       'DefaultSortColumn' => 'Name',
    138       'Items' => array(
    139         'Id' => array('Type' => 'Integer', 'Caption' => 'Identifikace', 'Default' => '', 'ReadOnly' => true),
    140         'Name' => array('Type' => 'String', 'Caption' => 'Celé jméno', 'Default' => ''),
    141         'AddressStreet' => array('Type' => 'String', 'Caption' => 'Ulice', 'Default' => ''),
    142         'AddressTown' => array('Type' => 'String', 'Caption' => 'Město', 'Default' => ''),
    143         'AddressPSC' => array('Type' => 'String', 'Caption' => 'PSČ', 'Default' => ''),
    144         'AddressCountry' => array('Type' => 'TCountry', 'Caption' => 'Země', 'Default' => ''),
    145         'IC' => array('Type' => 'String', 'Caption' => 'IČ', 'Default' => ''),
    146         'DIC' => array('Type' => 'String', 'Caption' => 'DIČ', 'Default' => ''),
    147         'MapPosition' => array('Type' => 'TMapPosition', 'Caption' => 'Pozice na mapě', 'Default' => '', 'Null' => true),
    148         'WWW' => array('Type' => 'Hyperlink', 'Caption' => 'WWW', 'Default' => ''),
    149         'Note' => array('Type' => 'String', 'Caption' => 'Poznámka', 'Default' => ''),
    150         'Customer' => array('Type' => 'TMemberListSubject', 'Caption' => 'Členové', 'Default' => ''),
    151         'Operations' => array('Type' => 'TFinanceOperationListSubject', 'Caption' => 'Platby', 'Default' => ''),
    152         'Invoices' => array('Type' => 'TFinanceInvoiceListSubject', 'Caption' => 'Faktury', 'Default' => ''),
    153         'Payment' => array('Type' => 'Float', 'Caption' => 'Placení', 'Default' => '',
    154           'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`FinanceOperation`.`Value`) FROM `FinanceOperation` '.
    155           'WHERE `FinanceOperation`.`Subject`=#Id) - (SELECT SUM(`FinanceInvoice`.`Value`) FROM `FinanceInvoice` '.
    156           'WHERE `FinanceInvoice`.`Subject`=#Id)'),
    157       ),
    158     ));
    159     $this->System->FormManager->RegisterClass('SubjectReport', array(
    160       'Title' => 'Přehled subjektů',
    161       'Table' => 'SubjectReport',
    162       'DefaultSortColumn' => 'Id',
    163       'SQL' => '(SELECT Id FROM Subject)',
    164       'Items' => array(
    165         'Id' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => '', 'ReadOnly' => true),
    166         'Income' => array('Type' => 'Integer', 'Caption' => 'Příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    167           'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Subject` = TX.`Id`) '.
    168           'AND (`FinanceOperation`.`Value` > 0))'),
    169         'Spending' => array('Type' => 'Integer', 'Caption' => 'Výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    170           'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Subject` = TX.`Id`) '.
    171           'AND (`FinanceOperation`.`Value` < 0))'),
    172         'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true,
    173           'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Subject` = TX.`Id`) '.
    174           ')'),
    175       ),
    176     ));
     133
    177134    $this->System->FormManager->RegisterClass('NetworkDomainAlias', array(
    178135      'Title' => 'Alias domény',
     
    263220        'Configure' => array('Type' => 'Boolean', 'Caption' => 'Nastavovat', 'Default' => ''),
    264221      ),
    265     ));   
     222    ));
    266223    $this->System->FormManager->RegisterClass('NetworkLink', array(
    267224      'Title' => 'Síťové propojení',
     
    277234      'Table' => 'NetworkDeviceConfig',
    278235      'DefaultSortColumn' => 'Time',
     236      'DefaultSortOrder' => 1,
    279237      'Items' => array(
    280238        'Device' => array('Type' => 'TNetworkDevice', 'Caption' => 'Zařízení', 'Default' => ''),
     
    312270        'ChannelWidth' => array('Type' => 'Integer', 'Caption' => 'Šírka kanálu', 'Default' => '20', 'Suffix' => 'MHz'),
    313271        'ChannelWidthUpper' => array('Type' => 'Integer', 'Caption' => 'Šírka kanálu horního', 'Default' => '0', 'Suffix' => 'MHz'),
    314         'Mode' => array('Type' => 'TWirelessMode', 'Caption' => 'Režim', 'Default' => '0', 'Suffix' => ''),
    315         'TotalPower' => array('Type' => 'Integer', 'Caption' => 'Celkový výkon', 'Default' => '20', 'Suffix' => 'dBm',
     272        'Mode' => array('Type'
     273        => 'TWirelessMode', 'Caption' => 'Režim', 'Default' => '0', 'Suffix' => ''),
     274        'TotalPower' => array('Type' => 'Integer', 'Caption' => 'Celkový výkon', 'Default' => '20', 'Suffix' => 'dBm',
    316275          'SQL' => '(`TxPower` - `CableAttenuation` + `AntenaGain`)', 'ReadOnly' => true),
    317276        'LimitPower' => array('Type' => 'Integer', 'Caption' => 'Max. limit', 'Default' => '', 'Suffix' => 'dBm',
     
    354313      ),
    355314    ));
    356   } 
    357  
     315  }
     316
    358317  function DoStop()
    359   { 
    360   } 
     318  {
     319  }
    361320}
Note: See TracChangeset for help on using the changeset viewer.