1 |
use strict; |
use strict; |
2 |
use warnings; |
use warnings; |
3 |
|
|
4 |
package A3C::Model::User; |
package A3C::Model::Person; |
5 |
use Jifty::DBI::Schema; |
use Jifty::DBI::Schema; |
6 |
|
|
7 |
|
use A3C::AAIEduHr; |
8 |
|
|
9 |
use utf8; |
use utf8; |
10 |
|
|
11 |
use A3C::Record schema { |
use A3C::Record schema { |
12 |
|
|
13 |
column uid => |
column uid => |
14 |
label is ('uid'), |
label is _('UID'), |
15 |
is indexed, |
is indexed, |
16 |
is mandatory, |
is mandatory, |
17 |
is distinct; |
is distinct; |
18 |
|
|
19 |
column hrEduPersonUniqueID => |
column hrEduPersonUniqueID => |
20 |
label is ('hrEduPersonUniqueID'), |
label is _('hr Edu Person Unique ID'), |
21 |
is indexed, |
is indexed, |
22 |
is distinct, |
is distinct, |
23 |
is mandatory; |
is mandatory; |
38 |
type is 'text', |
type is 'text', |
39 |
is mandatory, |
is mandatory, |
40 |
label is _('Email address'), default is '', |
label is _('Email address'), default is '', |
41 |
|
is indexed, |
42 |
is immutable, |
is immutable, |
43 |
is distinct; |
is distinct; |
44 |
|
|
76 |
filters are 'Jifty::DBI::Filter::Date'; |
filters are 'Jifty::DBI::Filter::Date'; |
77 |
|
|
78 |
column hrEduPersonGender => |
column hrEduPersonGender => |
79 |
label is _('Spol'); |
label is _('Spol'), |
80 |
|
valid are [ { display => 'Nepoznato', value => 0 }, A3C::AAIEduHr->vocabulary('hrEdu002') ]; |
81 |
|
|
82 |
column jpegPhoto => |
column jpegPhoto => |
83 |
label is _('Slika'); |
label is _('Slika'); |
92 |
label is _('Tip administratora'), |
label is _('Tip administratora'), |
93 |
valid are [ '', 'AS', 'AI', 'AR', 'AHU' ]; |
valid are [ '', 'AS', 'AI', 'AR', 'AHU' ]; |
94 |
|
|
95 |
|
column hrEduPersonHomeOrg => |
96 |
|
label is _('Oznaka matične ustanove'), |
97 |
|
hint is 'CARNet', |
98 |
|
is mandatory; |
99 |
|
|
100 |
column hrEduPersonProfessionalStatus => |
column hrEduPersonProfessionalStatus => |
101 |
label is _('Stručni status'), |
label is _('Stručni status'), |
102 |
valid are [ |
valid are [ '', A3C::AAIEduHr->vocabulary('hrEdu001'), 'VŠS' ], |
|
'', |
|
|
'NKV', |
|
|
'PKV', |
|
|
'KV', |
|
|
'VKV', |
|
|
'SSS', |
|
|
'VS', |
|
|
'VSS', |
|
|
'VŠS', |
|
|
'MR', |
|
|
'DR', |
|
|
], |
|
103 |
default is ''; |
default is ''; |
104 |
|
|
105 |
column hrEduPersonAcademicStatus => |
column hrEduPersonAcademicStatus => |
106 |
label is _('Zvanje'), |
label is _('Zvanje'), |
107 |
valid are [ |
valid are [ '', A3C::AAIEduHr->vocabulary('hrEdu002') ], |
|
'', |
|
|
'knjižničar', |
|
|
'viši knjižničar', |
|
|
'korepetitor', |
|
|
'viši korepetitor', |
|
|
'lektor', |
|
|
'viši lektor', |
|
|
'stručni suradnik', |
|
|
'asistent visoke škole', |
|
|
'profesor visoke škole', |
|
|
'mlađi asistent', |
|
|
'znanstveni novak', |
|
|
'znanstveni asistent', |
|
|
'znanstveni suradnik', |
|
|
'predavač', |
|
|
'viši predavač', |
|
|
'asistent', |
|
|
'asistent - predavač', |
|
|
'viši asistent', |
|
|
'docent', |
|
|
'izvanredni profesor', |
|
|
'redoviti profesor', |
|
|
'znanstveni savjetnik', |
|
|
'viši znanstveni suradnik', |
|
|
], |
|
108 |
default is ''; |
default is ''; |
109 |
|
|
110 |
column hrEduPersonScienceArea => |
column hrEduPersonScienceArea => |
111 |
label is _('Područje znanosti'), |
label is _('Područje znanosti'), |
112 |
valid are [ |
valid are [ '', A3C::AAIEduHr->vocabulary('hrEdu007') ], |
|
'', |
|
|
'Tehničke znanosti', |
|
|
'Prirodne znanosti', |
|
|
'Humanističke znanosti', |
|
|
'Društvene znanosti', |
|
|
'Biotehničke znanosti', |
|
|
'Biomedicina i zdravstvo', |
|
|
], |
|
113 |
default is ''; |
default is ''; |
114 |
|
|
115 |
column organization => |
column 'o' => |
116 |
refers_to A3C::Model::Organization by 'id', |
is indexed; |
117 |
is mandatory; |
|
118 |
|
column 'l'; |
119 |
|
column 'postalAddress'; |
120 |
|
column 'postalCode'; |
121 |
|
column 'street'; |
122 |
|
|
123 |
|
# column organization => |
124 |
|
# refers_to A3C::Model::Organization by 'id', |
125 |
|
# is mandatory; |
126 |
|
|
127 |
column hrEduPersonAffiliation => |
column hrEduPersonAffiliation => |
128 |
label is _('Povezanost s ustanovom'), |
label is _('Povezanost s ustanovom'), |
129 |
is mandatory, |
is mandatory, |
130 |
valid are [ |
valid are A3C::AAIEduHr->vocabulary('hrEdu004'), |
|
'učenik', |
|
|
'student', |
|
|
'djelatnik', |
|
|
'vanjski suradnik', |
|
|
'korisnik usluge', |
|
|
'gost', |
|
|
], |
|
131 |
default is 'korisnik usluge'; |
default is 'korisnik usluge'; |
132 |
|
|
133 |
column hrEduPersonPrimaryAffiliation => |
column hrEduPersonPrimaryAffiliation => |
134 |
label is _('Temeljna povezanost s ustanovom'); |
label is _('Temeljna povezanost s ustanovom'); |
135 |
is mandatory, |
is mandatory, |
136 |
valid are [ |
valid are A3C::AAIEduHr->vocabulary('hrEdu004'), |
|
'učenik', |
|
|
'student', |
|
|
'djelatnik', |
|
|
'vanjski suradnik', |
|
|
'korisnik usluge', |
|
|
'gost', |
|
|
], |
|
137 |
default is 'korisnik usluge'; |
default is 'korisnik usluge'; |
138 |
|
|
139 |
column hrEduPersonStudentCategory => |
column hrEduPersonStudentCategory => |
140 |
label is 'Vrsta studenta', |
label is 'Vrsta studenta', |
141 |
valid are [ |
valid are [ |
142 |
'', |
'', |
143 |
'osnovnoškolac', |
A3C::AAIEduHr->vocabulary('hrEdu010'), |
|
'srednjoškolac', |
|
|
'student stručnog studija', |
|
|
'preddiplomac', |
|
|
'postdiplomac', |
|
|
'dodiplomac', |
|
|
'pauzira godinu', |
|
|
'prekid studija', |
|
144 |
], |
], |
145 |
default is ''; |
default is ''; |
146 |
|
|
153 |
|
|
154 |
column hrEduPersonTitle => |
column hrEduPersonTitle => |
155 |
label is 'Položaj u ustanovi', |
label is 'Položaj u ustanovi', |
156 |
valid are [ # FIXME reorder |
valid are [ '', A3C::AAIEduHr->vocabulary('hrEdu003') ], |
|
'', |
|
|
'dekan', |
|
|
'direktor', |
|
|
'pomoćnik ravnatelja', |
|
|
'predstojnik zavoda', |
|
|
'pročelnik katedre', |
|
|
'pročelnik odsjeka', |
|
|
'pročelnik sveučilišnog odjela', |
|
|
'prodekan', |
|
|
'prorektor', |
|
|
'ravnatelj', |
|
|
'rektor', |
|
|
'voditelj laboratorija', |
|
|
'voditelj odjela', |
|
|
'voditelj organizacijske jedini', |
|
|
'voditelj projekta', |
|
|
'zamjenik pročelnika sveučilišn', |
|
|
'zamjenik ravnatelja', |
|
|
], |
|
157 |
default is ''; |
default is ''; |
158 |
|
|
159 |
column hrEduPersonRole => |
column hrEduPersonRole => |
160 |
label is 'Uloga u ustanovi', |
label is 'Uloga u ustanovi', |
161 |
valid are [ |
valid are [ |
162 |
'', |
'', |
163 |
'administrator imenika', |
A3C::AAIEduHr->vocabulary('hrEdu006'), |
|
'CARNet koordinator', |
|
|
'CARNet sistem inženjer', |
|
|
'ICT koordinator', |
|
|
'ISVU koordinator', |
|
|
'kontakt za sigurnosna pitanja', |
|
|
'MS koordinator', |
|
164 |
'MATICA operater', |
'MATICA operater', |
165 |
'MATICA urednik', |
'MATICA urednik', |
166 |
], |
], |
168 |
|
|
169 |
column hrEduPersonStaffCategory => |
column hrEduPersonStaffCategory => |
170 |
label is 'Vrsta posla u ustanovi', |
label is 'Vrsta posla u ustanovi', |
171 |
valid are [ |
valid are [ '', A3C::AAIEduHr->vocabulary('hrEdu005') ]; |
|
'administrativno osoblje', |
|
|
'ICT podrška', |
|
|
'istraživači', |
|
|
'nastavno osoblje', |
|
|
'osoblje knjižnice', |
|
|
'tehničko osoblje', |
|
|
]; |
|
172 |
|
|
173 |
column hrEduPersonGroupMember => |
column hrEduPersonGroupMember => |
174 |
label is 'Pripadnost grupi', |
label is 'Pripadnost grupi', |
194 |
label is _('Oznaka privatnosti'); |
label is _('Oznaka privatnosti'); |
195 |
|
|
196 |
column loginShell => |
column loginShell => |
197 |
label is _('shell'); |
label is _('login shell'); |
198 |
|
|
199 |
column uidNumber => |
column uidNumber => |
200 |
label is _('uid'), |
label is _('uid number'), |
201 |
type is 'int'; |
type is 'int'; |
202 |
|
|
203 |
column gidNumber => |
column gidNumber => |
204 |
label is _('gid'); |
label is _('gid number'); |
205 |
type is 'int'; |
type is 'int'; |
206 |
|
|
207 |
column homeDirectory => |
column homeDirectory => |
208 |
label is _('home'); |
label is _('home directory'); |
209 |
|
|
210 |
}; |
}; |
211 |
|
|
243 |
|
|
244 |
sub email { |
sub email { |
245 |
my $self = shift; |
my $self = shift; |
246 |
return $self->__value('mail'); |
return $self->mail; |
247 |
} |
} |
248 |
|
|
249 |
sub email_confirmed { 1 }; |
sub email_confirmed { 1 }; |
250 |
|
|
251 |
|
=head2 name |
252 |
|
|
253 |
|
=cut |
254 |
|
|
255 |
|
sub name { |
256 |
|
my $self = shift; |
257 |
|
return $self->cn . ' <' . $self->mail . '>'; |
258 |
|
} |
259 |
|
|
260 |
=head2 validate_telephoneNumber |
=head2 validate_telephoneNumber |
261 |
|
|
262 |
=cut |
=cut |
269 |
return ( 1, 'OK' ); |
return ( 1, 'OK' ); |
270 |
} |
} |
271 |
|
|
272 |
=head hrEduPersonUniqueNumber |
=head2 hrEduPersonUniqueNumber |
273 |
|
|
274 |
Check if JMBG is valid |
Check if JMBG is valid |
275 |
|
|
326 |
return $value; |
return $value; |
327 |
} |
} |
328 |
|
|
329 |
=head2 current_user_can |
use A3C::DefaultACL; |
|
|
|
|
=cut |
|
|
|
|
|
sub current_user_can { |
|
|
# FIXME no security for now :-) |
|
|
return 1; |
|
|
} |
|
330 |
|
|
331 |
1; |
1; |
332 |
|
|