source: trunk/Modules/Employee/Employee.php@ 711

Last change on this file since 711 was 711, checked in by chronos, 10 years ago
  • Modified: Some FormType definition moved from global file to corresponding modules.
File size: 2.1 KB
Line 
1<?php
2
3class ModuleEmployee extends AppModule
4{
5 function __construct($System)
6 {
7 parent::__construct($System);
8 $this->Name = 'Employee';
9 $this->Version = '1.0';
10 $this->Creator = 'Chronos';
11 $this->License = 'GNU/GPL';
12 $this->Description = 'Employee wages management';
13 $this->Dependencies = array('User');
14 }
15
16 function DoStart()
17 {
18 $this->System->FormManager->RegisterClass('Employee', array(
19 'Title' => 'Zaměstnanci',
20 'Table' => 'Employee',
21 'Items' => array(
22 'FirstName' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''),
23 'SecondName' => array('Type' => 'String', 'Caption' => 'Příjmení', 'Default' => ''),
24 'Salary' => array('Type' => 'Integer', 'Caption' => 'Pevná mzda', 'Default' => '0', 'Suffix' => 'Kč'),
25 'ValidFrom' => array('Type' => 'Date', 'Caption' => 'Platnost od', 'Default' => ''),
26 'ValidTo' => array('Type' => 'Date', 'Caption' => 'Platnost do', 'Default' => '', 'Null' => true),
27 'SalaryList' => array('Type' => 'TEmployeeSalaryList', 'Caption' => 'Mzda', 'Default' => ''),
28 ),
29 ));
30 $this->System->FormManager->RegisterClass('EmployeeSalary', array(
31 'Title' => 'Výplaty zaměstnanců',
32 'Table' => 'EmployeeSalary',
33 'Items' => array(
34 'Date' => array('Type' => 'Date', 'Caption' => 'Datum', 'Default' => ''),
35 'Employee' => array('Type' => 'TEmployee', 'Caption' => 'Zaměstnance', 'Default' => ''),
36 'Amount' => array('Type' => 'Integer', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč'),
37 'Contract' => array('Type' => 'TContract', 'Caption' => 'Smlouva', 'Default' => ''),
38 ),
39 ));
40 $this->System->FormManager->RegisterFormType('TEmployee', array(
41 'Type' => 'Reference',
42 'Table' => 'Employee',
43 'Id' => 'Id',
44 'Name' => 'CONCAT(FirstName, " ", SecondName)',
45 'Filter' => '1',
46 ));
47 $this->System->FormManager->RegisterFormType('TEmployeeSalaryList', array(
48 'Type' => 'ManyToOne',
49 'Table' => 'EmployeeSalary',
50 'Id' => 'Id',
51 'Ref' => 'Employee',
52 'Filter' => '1',
53 ));
54 }
55}
Note: See TracBrowser for help on using the repository browser.