Changeset 894 for trunk/Modules/Customer/Customer.php
- Timestamp:
- Jan 5, 2021, 10:30:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Customer/Customer.php
r893 r894 186 186 'Filter' => '1', 187 187 )); 188 $this->System->FormManager->RegisterClass('UserCustomerRel', array( 189 'Title' => 'Vztahy uživatel - zákazník', 190 'Table' => 'UserCustomerRel', 191 'Items' => array( 192 'User' => array('Type' => 'TUser', 'Caption' => 'Uživatel', 'Default' => ''), 193 'Customer' => array('Type' => 'TMember', 'Caption' => 'Zákazník', 'Default' => ''), 194 ), 195 )); 188 196 189 197 ModuleIS::Cast($this->System->GetModule('IS'))->RegisterDashboardItem('Customer', … … 193 201 function GetModels(): array 194 202 { 195 return array('Member', 'MemberPayment', 'SupportActivity', 'ServiceCategory', 'Service', 'ServiceCustomerRel'); 196 } 197 198 function DoInstall(): void 199 { 200 foreach (self::GetModels() as $Model) 201 { 202 $this->InstallModel($Model::GetDesc()); 203 } 204 } 205 206 function Uninstall(): void 207 { 208 foreach (array_reverse(self::GetModels()) as $Model) 209 { 210 $this->UninstallModel($Model::GetDesc()); 211 } 203 return array(Member::GetClassName(), MemberPayment::GetClassName(), SupportActivity::GetClassName(), ServiceCategory::GetClassName(), 204 Service::GetClassName(), ServiceCustomerRel::GetClassName(), UserCustomerRel::GetClassName()); 212 205 } 213 206 … … 230 223 static function GetDesc(): ModelDesc 231 224 { 232 $Desc = new ModelDesc( 'Member');225 $Desc = new ModelDesc(self::GetClassName()); 233 226 $Desc->AddString('Name'); 234 $Desc->AddReference('Subject', 'Subject');235 $Desc->AddReference('ResponsibleUser', 'User');227 $Desc->AddReference('Subject', Subject::GetClassName()); 228 $Desc->AddReference('ResponsibleUser', User::GetClassName()); 236 229 $Desc->AddInteger('FamilyMemberCount'); 237 230 $Desc->AddDate('MembershipDate'); 238 231 $Desc->AddInteger('MemberState'); 239 232 $Desc->AddInteger('GPS'); 240 $Desc->AddReference('BillingPeriod', 'FinanceBillingPerios');233 $Desc->AddReference('BillingPeriod', FinanceBillingPeriod::GetClassName()); 241 234 $Desc->AddDate('BillingPeriodLastDate'); 242 235 $Desc->AddBoolean('Blocked'); … … 251 244 static function GetDesc(): ModelDesc 252 245 { 253 $Desc = new ModelDesc( 'MemberPayment');254 $Desc->AddReference('Member', 'Member');246 $Desc = new ModelDesc(self::GetClassName()); 247 $Desc->AddReference('Member', Member::GetClassName()); 255 248 $Desc->AddFloat('MonthlyTotal'); 256 249 $Desc->AddFloat('MonthlyInternet'); … … 266 259 static function GetDesc(): ModelDesc 267 260 { 268 $Desc = new ModelDesc( 'Service');261 $Desc = new ModelDesc(self::GetClassName()); 269 262 $Desc->AddString('Name'); 270 $Desc->AddReference('Category', 'ServiceCategory');263 $Desc->AddReference('Category', ServiceCategory::GetClassName()); 271 264 $Desc->AddInteger('Price'); 272 265 $Desc->AddInteger('VAT'); … … 288 281 static function GetDesc(): ModelDesc 289 282 { 290 $Desc = new ModelDesc( 'ServiceCategory');283 $Desc = new ModelDesc(self::GetClassName()); 291 284 $Desc->AddString('Name'); 292 285 return $Desc; … … 298 291 static function GetDesc(): ModelDesc 299 292 { 300 $Desc = new ModelDesc( 'SupportActivity');293 $Desc = new ModelDesc(self::GetClassName()); 301 294 $Desc->AddDateTime('Time'); 302 295 $Desc->AddString('Description'); 303 $Desc->AddReference('Customer', 'Member');304 $Desc->AddReference('User', 'User');296 $Desc->AddReference('Customer', Member::GetClassName()); 297 $Desc->AddReference('User', User::GetClassName()); 305 298 return $Desc; 306 299 } … … 311 304 static function GetDesc(): ModelDesc 312 305 { 313 $Desc = new ModelDesc( 'ServiceCustomerRel');314 $Desc->AddReference('Service', 'Service');315 $Desc->AddReference('Customer', 'Member');306 $Desc = new ModelDesc(self::GetClassName()); 307 $Desc->AddReference('Service', Service::GetClassName()); 308 $Desc->AddReference('Customer', Member::GetClassName()); 316 309 $Desc->AddChangeAction(); 317 310 $Desc->AddInteger('SpeedLimit'); … … 319 312 } 320 313 } 314 315 class UserCustomerRel extends Model 316 { 317 static function GetDesc(): ModelDesc 318 { 319 $Desc = new ModelDesc(self::GetClassName()); 320 $Desc->AddReference('User', User::GetClassName()); 321 $Desc->AddReference('Customer', Member::GetClassName()); 322 return $Desc; 323 } 324 }
Note:
See TracChangeset
for help on using the changeset viewer.