1 |
3 |
ahitrov@rambler.ru |
package SQL::DocumentTable; |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use base 'SQL::ProtoTable'; |
5 |
|
|
|
6 |
|
|
sub db_table |
7 |
|
|
{ |
8 |
|
|
return 'documents'; |
9 |
|
|
} |
10 |
|
|
|
11 |
|
|
sub available_filters { |
12 |
|
|
my @available_filters = qw( |
13 |
|
|
_class_filter |
14 |
|
|
_status_filter |
15 |
|
|
_in_id_filter |
16 |
|
|
_id_filter |
17 |
|
|
_name_filter |
18 |
|
|
_class_excludes_filter |
19 |
|
|
_sfilter_filter |
20 |
|
|
_datetime_filter |
21 |
|
|
_date_equal_filter |
22 |
|
|
_date_filter |
23 |
|
|
_previous_days_filter |
24 |
|
|
_prev_to_filter |
25 |
|
|
_next_to_filter |
26 |
|
|
_s_filter |
27 |
|
|
|
28 |
|
|
_excludes_filter |
29 |
|
|
_link_filter |
30 |
|
|
); |
31 |
|
|
return \@available_filters; |
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
# ---------------------------------------------------------------------------- |
35 |
|
|
# �������� ������ � ��������, ������ ��� ������� �����! |
36 |
|
|
# ��� ����� �������� - ���������� ��� ���� ����������. |
37 |
|
|
# |
38 |
|
|
# attr - ������������ ��������, �������� ��������; |
39 |
|
|
# type - ��� ���������, ��������� ��� ������������; |
40 |
|
|
# rusname - ������� ��������, ����� �� ��������� ��� �����������; |
41 |
|
|
# hidden - ����� 1, ����� |
42 |
|
|
# readonly - ������������� ��� ������ ������ ��� ��������� � ���������� |
43 |
|
|
# db_field - ���� � ������� |
44 |
|
|
# default - �������� �� ��������� (���� ������ ����� ��� ��������) |
45 |
|
|
# ---------------------------------------------------------------------------- |
46 |
|
|
sub required_properties |
47 |
|
|
{ |
48 |
|
|
return ( |
49 |
|
|
{ # ������������� ���������, �������� �� ���� �����... |
50 |
|
|
'attr' => 'id', |
51 |
|
|
'type' => 'integer', |
52 |
|
|
'rusname' => '������������� ���������', |
53 |
|
|
'hidden' => 1, |
54 |
|
|
'readonly' => 1, |
55 |
|
|
'auto' => 1, |
56 |
|
|
'db_field' => 'id', |
57 |
|
|
'db_type' => 'integer', |
58 |
|
|
'db_opts' => "not null default nextval('public.documents_id_seq'::text)", |
59 |
|
|
}, |
60 |
|
|
{ # ����� ���������... |
61 |
|
|
'attr' => 'class', |
62 |
|
|
'type' => 'string', |
63 |
|
|
'rusname' => '����� ���������', |
64 |
|
|
'column' => 3, |
65 |
|
|
'hidden' => 1, |
66 |
|
|
'readonly' => 1, |
67 |
|
|
'db_field' => 'class', |
68 |
|
|
'db_type' => 'varchar(48)', |
69 |
|
|
'db_opts' => 'not null', |
70 |
|
|
}, |
71 |
|
|
{ # ��� ���������... |
72 |
|
|
'attr' => 'name', |
73 |
|
|
'type' => 'string', |
74 |
|
|
'rusname' => '��������', |
75 |
|
|
'column' => 2, |
76 |
|
|
'db_field' => 'name', |
77 |
|
|
'db_type' => 'varchar(255)', |
78 |
|
|
}, |
79 |
|
|
{ # ����� �������� ���������, ��������� ����... |
80 |
|
|
'attr' => 'ctime', |
81 |
|
|
'type' => 'datetime', |
82 |
|
|
'rusname' => '����� ��������', |
83 |
|
|
'readonly' => 1, |
84 |
|
|
'auto' => 1, |
85 |
|
|
'hidden' => 1, |
86 |
|
|
'db_field' => 'ctime', |
87 |
|
|
'db_type' => 'timestamp', |
88 |
|
|
'db_opts' => 'not null default now()', |
89 |
|
|
'default' => 'CURRENT_TIMESTAMP', |
90 |
|
|
}, |
91 |
|
|
{ # ����� ����������� ���������, ��������� ����... |
92 |
|
|
'attr' => 'mtime', |
93 |
|
|
'type' => 'datetime', |
94 |
|
|
'rusname' => '����� �����������', |
95 |
|
|
'hidden' => 1, |
96 |
|
|
'auto' => 1, |
97 |
|
|
'db_field' => 'mtime', |
98 |
|
|
'db_type' => 'timestamp', |
99 |
|
|
'db_opts' => 'not null default now()', |
100 |
|
|
'default' => 'CURRENT_TIMESTAMP', |
101 |
|
|
}, |
102 |
|
|
{ # ���� � ����� ���������... |
103 |
|
|
'attr' => 'dtime', |
104 |
|
|
'type' => 'datetime', |
105 |
|
|
'rusname' => '���� � ����� ���������<sup style="color:#888;"> 1)</sup>', |
106 |
|
|
'column' => 1, |
107 |
|
|
'db_field' => 'dtime', |
108 |
|
|
'db_type' => 'timestamp', |
109 |
|
|
'db_opts' => 'not null default now()', |
110 |
|
|
'default' => 'CURRENT_TIMESTAMP', |
111 |
|
|
}, |
112 |
|
|
{ # ������ ������, �������������� ����������� �������... |
113 |
|
|
'attr' => 'sections', |
114 |
|
|
'type' => 'sections_list', |
115 |
|
|
'rusname' => '������', |
116 |
|
|
'hidden' => 1, |
117 |
|
|
'db_field' => 'sections', |
118 |
|
|
'db_type' => 'integer[]', |
119 |
|
|
}, |
120 |
|
|
{ # ���� ���� ������� �������� ����������... |
121 |
|
|
'attr' => 'status', |
122 |
|
|
'type' => 'status', |
123 |
|
|
'rusname' => '������', |
124 |
|
|
'db_field' => 'status', |
125 |
|
|
'db_type' => 'integer', |
126 |
|
|
}, |
127 |
|
|
); |
128 |
|
|
} |
129 |
|
|
|
130 |
|
|
1; |
131 |
|
|
|