Changeset 909 for trunk


Ignore:
Timestamp:
May 3, 2021, 9:48:26 PM (4 years ago)
Author:
chronos
Message:
  • Added: Support for customer address places.
  • Added: Limit direct traffic to router.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r908 r909  
    22772277      882 => array('Revision' => 885, 'Function' => 'UpdateTo885'),
    22782278      885 => array('Revision' => 901, 'Function' => 'UpdateTo901'),
    2279       907 => array('Revision' => 907, 'Function' => 'UpdateTo907'),
     2279      901 => array('Revision' => 907, 'Function' => 'UpdateTo907'),
    22802280    );
    22812281  }
  • trunk/Modules/Customer/Customer.php

    r908 r909  
    1313    $this->Dependencies = array(ModuleUser::GetName(), ModuleFinance::GetName());
    1414    $this->Models = array(Member::GetClassName(), MemberPayment::GetClassName(), SupportActivity::GetClassName(), ServiceCategory::GetClassName(),
    15       Service::GetClassName(), ServiceCustomerRel::GetClassName(), UserCustomerRel::GetClassName());
     15      Service::GetClassName(), ServiceCustomerRel::GetClassName(), UserCustomerRel::GetClassName(), AddressPlace::GetClassName());
    1616  }
    1717
     
    2626        'ResponsibleUser' => array('Type' => 'TUser', 'Caption' => 'Zodpovědný uživatel', 'Default' => ''),
    2727        'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''),
     28        'AddressPlace' => array('Type' => 'TAddressPlace', 'Caption' => 'Adresní místo', 'Default' => '', 'Null' => true),
    2829        'FamilyMemberCount' => array('Type' => 'String', 'Caption' => 'Bydlících osob', 'Default' => '0', 'Suffix' => 'osob'),
    2930        'MembershipDate' => array('Type' => 'Date', 'Caption' => 'Datum členství', 'Default' => ''),
     
    115116      ),
    116117    ));
     118    $this->System->FormManager->RegisterClass('AddressPlace', array(
     119      'Title' => 'Adresní místno',
     120      'Table' => 'AddressPlace',
     121      'DefaultSortColumn' => 'HouseNumber',
     122      'DefaultSortOrder' => 1,
     123      'Items' => array(
     124        'Town' => array('Type' => 'String', 'Caption' => 'Město', 'Default' => ''),
     125        'Street' => array('Type' => 'String', 'Caption' => 'Ulice', 'Default' => ''),
     126        'HouseNumber' => array('Type' => 'Integer', 'Caption' => 'Číslo domu', 'Default' => ''),
     127        'HouseNumberType' => array('Type' => 'THouseNumberType', 'Caption' => 'Typ čísla', 'Default' => ''),
     128        'Psc' => array('Type' => 'Integer', 'Caption' => 'PSČ', 'Default' => ''),
     129        'RuianCode' => array('Type' => 'Integer', 'Caption' => 'Kód Ruian', 'Default' => ''),
     130        'Customers' => array('Type' => 'TCustomerListAddressPlace', 'Caption' => 'Zákazníci', 'Default' => '', 'Null' => true, 'NotInList' => true),
     131      ),
     132    ));
     133    $this->System->FormManager->RegisterFormType('TAddressPlace', array(
     134      'Type' => 'Reference',
     135      'Table' => 'AddressPlace',
     136      'Id' => 'Id',
     137      'Name' => 'CONCAT_WS(" ", NULLIF(AddressPlace.Town, ""), REPLACE(REPLACE(AddressPlace.HouseNumberType, "0", ""), 1, "e.v."), NULLIF(AddressPlace.HouseNumber, ""))',
     138      'Filter' => '1',
     139    ));
     140    $this->System->FormManager->RegisterFormType('THouseNumberType', array(
     141      'Type' => 'Enumeration',
     142      'States' => array(0 => 'Popisné', 1 => 'Evidenční'),
     143    ));
     144    $this->System->FormManager->RegisterFormType('TCustomerListAddressPlace', array(
     145      'Type' => 'ManyToOne',
     146      'Table' => 'Member',
     147      'Id' => 'Id',
     148      'Ref' => 'AddressPlace',
     149      'Filter' => '1',
     150    ));
    117151    $this->System->FormManager->RegisterFormType('TServiceCategory', array(
    118152      'Type' => 'Reference',
     
    387421  }
    388422}
     423
     424class AddressPlace extends Model
     425{
     426  static function GetModelDesc(): ModelDesc
     427  {
     428    $Desc = new ModelDesc(self::GetClassName());
     429    $Desc->AddString('Town');
     430    $Desc->AddString('Street');
     431    $Desc->AddString('HouseNumber');
     432    $Desc->AddEnum('HouseNumberType', array('Popisné', 'Evidenční'));
     433    $Desc->AddString('Psc');
     434    $Desc->AddInteger('RuianCode');
     435    return $Desc;
     436  }
     437}
  • trunk/Modules/Network/Network.php

    r908 r909  
    6363        foreach ($ChannelList as $Frequency)
    6464        {
    65           if (($DbRow2['Frequency'] == $Frequency)) $Color = '#000000';
    66             else if (($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080';
    67             else if (($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0';
     65          if (($DbRow2['Frequency'] == $Frequency)) $Color = '#408040';
     66            else if (($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#50d050';
     67            else if (($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#a0d0a0';
    6868            else $Color = '#ffffff';
    6969          $Output .= '<td style="background-color: '.$Color.';">&nbsp;</td>';
     
    168168        'Member' => array('Type' => 'TMember', 'Caption' => 'Zákazník', 'Default' => '0'),
    169169        'Location' => array('Type' => 'TMember', 'Caption' => 'Umístění', 'Default' => '0'),
    170         'AddressPlace' => array('Type' => 'TAddressPlace', 'Caption' => 'Adresní místo', 'Default' => null, 'Null' => true),
    171170        'Service' => array('Type' => 'TServiceCustomerRel', 'Caption' => 'Služba', 'Default' => '', 'Null' => true),
    172171        'Used' => array('Type' => 'Boolean', 'Caption' => 'Použito', 'Default' => '1'),
  • trunk/Modules/NetworkConfigRouterOS/Generators/FirewallMangle.php

    r892 r909  
    238238    $this->ProcessNode($AddressTree);
    239239
     240    // Limit direct input/output traffic to gateway
     241    $PacketMark = GetMarkByComment('rt-gateway-3-out');
     242    $ItemsFirewall[] = array('chain' => 'output', 'out-interface' => $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'local-out',);
     243    $PacketMark = GetMarkByComment('rt-gateway-3-in');
     244    $ItemsFirewall[] = array('chain' => 'input', 'in-interface' => $InetInterface, 'action' => 'mark-packet', 'new-packet-mark' => $PacketMark, 'comment' => 'local-in',);
     245
    240246    // Limited free internet
    241247    $PacketMark = GetMarkByComment('free-out');
  • trunk/Modules/System/System.php

    r907 r909  
    1818    $this->Dependencies = array(ModuleModuleManager::GetName());
    1919    $this->Models = array(UnitOfMeasure::GetClassName(), ActionIcon::GetClassName(), ActionGroup::GetClassName(),
    20       ActionType::GetClassName(), Action::GetClassName(), Language::GetClassName(), Country::GetClassName(), AddressPlace::GetClassName());
     20      ActionType::GetClassName(), Action::GetClassName(), Language::GetClassName(), Country::GetClassName());
    2121  }
    2222
     
    9393      'Filter' => '1',
    9494    ));
    95     $this->System->FormManager->RegisterFormType('TAddressPlace', array(
    96       'Type' => 'Reference',
    97       'Table' => 'AddressPlace',
    98       'Id' => 'Id',
    99       'Name' => 'CONCAT_WS(" ", NULLIF(AddressPlace.Town, ""), NULLIF(AddressPlace.HouseNumber, ""))',
    100       'Filter' => '1',
    101     ));
    10295    $this->System->FormManager->RegisterFormType('TUnitOfMeasure', array(
    10396      'Type' => 'Reference',
Note: See TracChangeset for help on using the changeset viewer.