Changeset 909 for trunk/Modules/Customer/Customer.php
- Timestamp:
- May 3, 2021, 9:48:26 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Customer/Customer.php
r908 r909 13 13 $this->Dependencies = array(ModuleUser::GetName(), ModuleFinance::GetName()); 14 14 $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()); 16 16 } 17 17 … … 26 26 'ResponsibleUser' => array('Type' => 'TUser', 'Caption' => 'Zodpovědný uživatel', 'Default' => ''), 27 27 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 28 'AddressPlace' => array('Type' => 'TAddressPlace', 'Caption' => 'Adresní místo', 'Default' => '', 'Null' => true), 28 29 'FamilyMemberCount' => array('Type' => 'String', 'Caption' => 'Bydlících osob', 'Default' => '0', 'Suffix' => 'osob'), 29 30 'MembershipDate' => array('Type' => 'Date', 'Caption' => 'Datum členství', 'Default' => ''), … … 115 116 ), 116 117 )); 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 )); 117 151 $this->System->FormManager->RegisterFormType('TServiceCategory', array( 118 152 'Type' => 'Reference', … … 387 421 } 388 422 } 423 424 class 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 }
Note:
See TracChangeset
for help on using the changeset viewer.