1 | <?php
|
---|
2 |
|
---|
3 | class 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 | }
|
---|