/[A3C]/lib/A3C/Model/User.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/Model/User.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by dpavlin, Thu Mar 13 16:34:47 2008 UTC revision 16 by dpavlin, Thu Mar 13 18:07:28 2008 UTC
# Line 4  use warnings; Line 4  use warnings;
4  package A3C::Model::User;  package A3C::Model::User;
5  use Jifty::DBI::Schema;  use Jifty::DBI::Schema;
6    
7    use utf8;
8    
9  use A3C::Record schema {  use A3C::Record schema {
10    
11            column uid =>
12                    label is ('uid'),
13                    is indexed,
14                    is mandatory,
15                    is distinct;
16    
17            column hrEduPersonUniqueID =>
18                    label is ('hrEduPersonUniqueID'),
19                    is indexed,
20                    is mandatory,
21                    is distinct;
22    
23          column name =>          column name =>
24                  type is 'text',                  type is 'text',
25                  label is _('Ime'),                  label is _('Ime'),
# Line 25  use A3C::Record schema { Line 39  use A3C::Record schema {
39                  label is _('Ime'),                  label is _('Ime'),
40                  is mandatory;                  is mandatory;
41    
42            column mail =>
43                    type is 'virtual';
44    
45          column email =>          column email =>
46                  type is 'text',                  type is 'text',
47                  is mandatory,                  is mandatory,
# Line 63  use A3C::Record schema { Line 80  use A3C::Record schema {
80    
81          column hrEduPersonDateOfBirth =>          column hrEduPersonDateOfBirth =>
82                  type is 'date',                  type is 'date',
83                  label is _('Datum rođenja');                  render as 'date',
84                    label is _('Datum rođenja'),
85                    filters are 'Jifty::DBI::Filter::Date';
86    
87          column hrEduPersonGender =>          column hrEduPersonGender =>
88                  label is _('Spol');                  label is _('Spol');
# Line 79  use A3C::Record schema { Line 98  use A3C::Record schema {
98                    
99          column wtAdminType =>          column wtAdminType =>
100                  label is _('Tip administratora'),                  label is _('Tip administratora'),
101                  available are qw( AS AI AR AHU );                  valid are [ '', 'AS', 'AI', 'AR', 'AHU' ];
102    
103          column hrEduPersonProfessionalStatus =>          column hrEduPersonProfessionalStatus =>
104                  label is _('Stručni status'),                  label is _('Stručni status'),
105                  available are qw( DR KV MR NKV PKV SSS VKV VS VSS VŠS );                  valid are [
106                            '',
107                            'NKV',
108                            'PKV',
109                            'KV',
110                            'VKV',
111                            'SSS',
112                            'VS',
113                            'VSS',
114                            'VŠS',
115                            'MR',
116                            'DR',
117                    ],
118                    default is '';
119    
120          column hrEduPersonAcademicStatus =>          column hrEduPersonAcademicStatus =>
121                  label is _('Zvanje'),                  label is _('Zvanje'),
122                  available are [                  valid are [
123                          'asistent',                          '',
                         'asistent - predavač',  
                         'asistent visoke škole',  
                         'docent',  
                         'izvanredni profesor',  
124                          'knjižničar',                          'knjižničar',
125                            'viši knjižničar',
126                          'korepetitor',                          'korepetitor',
127                            'viši korepetitor',
128                          'lektor',                          'lektor',
129                            'viši lektor',
130                            'stručni suradnik',
131                            'asistent visoke škole',
132                            'profesor visoke škole',
133                          'mlađi asistent',                          'mlađi asistent',
134                            'znanstveni novak',
135                            'znanstveni asistent',
136                            'znanstveni suradnik',
137                          'predavač',                          'predavač',
                         'profesor visoke škole',  
                         'redoviti profesor',  
                         'stručni suradnik',  
                         'viši asistent',  
                         'viši knjižničar',  
                         'viši korepetitor',  
                         'viši lektor',  
138                          'viši predavač',                          'viši predavač',
139                          'viši znanstveni suradnik',                          'asistent',
140                          'znanstveni asistent',                          'asistent - predavač',
141                          'znanstveni novak',                          'viši asistent',
142                            'docent',
143                            'izvanredni profesor',
144                            'redoviti profesor',
145                          'znanstveni savjetnik',                          'znanstveni savjetnik',
146                          'znanstveni suradnik',                          'viši znanstveni suradnik',
147                  ];                  ],
148                    default is '';
149    
150          column hrEduPersonScienceArea =>          column hrEduPersonScienceArea =>
151                  label is _('Područje znanosti'),                  label is _('Područje znanosti'),
152                  available are [                  valid are [
153                            '',
154                          'Tehničke znanosti',                          'Tehničke znanosti',
155                          'Prirodne znanosti',                          'Prirodne znanosti',
156                          'Humanističke znanosti',                          'Humanističke znanosti',
157                          'Društvene znanosti',                          'Društvene znanosti',
158                          'Biotehničke znanosti',                          'Biotehničke znanosti',
159                          'Biomedicina i zdravstvo',                          'Biomedicina i zdravstvo',
160                  ];                  ],
161                    default is '';
162    
163          column hrEduPersonAffiliation =>          column hrEduPersonAffiliation =>
164                  label is _('Povezanost s ustanovom'),                  label is _('Povezanost s ustanovom'),
165                  is mandatory,                  is mandatory,
166                  available are [                  valid are [
                         'djelatnik',  
                         'gost',  
                         'korisnik usluge',  
                         'student',  
167                          'učenik',                          'učenik',
168                            'student',
169                            'djelatnik',
170                          'vanjski suradnik',                          'vanjski suradnik',
171                  ];                          'korisnik usluge',
172                            'gost',
173                    ],
174                    default is 'korisnik usluge';
175    
176          column hrEduPersonPrimaryAffiliation =>          column hrEduPersonPrimaryAffiliation =>
177                  label is _('Temeljna povezanost s ustanovom');                  label is _('Temeljna povezanost s ustanovom');
178                  is mandatory,                  is mandatory,
179                  available are [                  valid are [
                         'djelatnik',  
                         'gost',  
                         'korisnik usluge',  
                         'student',  
180                          'učenik',                          'učenik',
181                            'student',
182                            'djelatnik',
183                          'vanjski suradnik',                          'vanjski suradnik',
184                  ];                          'korisnik usluge',
185                            'gost',
186                    ],
187                    default is 'korisnik usluge';
188    
189          column hrEduPersonStudentCategory =>          column hrEduPersonStudentCategory =>
190                  label is 'Vrsta studenta',                  label is 'Vrsta studenta',
191                  available are [                  valid are [
192                          'dodiplomac',                          '',
193                          'osnovnoškolac',                          'osnovnoškolac',
                         'pauzira godinu',  
                         'postdiplomac',  
                         'preddiplomac',  
                         'prekid studija',  
194                          'srednjoškolac',                          'srednjoškolac',
195                          'student stručnog studija',                          'student stručnog studija',
196                  ];                          'preddiplomac',
197                            'postdiplomac',
198                            'dodiplomac',
199                            'pauzira godinu',
200                            'prekid studija',
201                    ],
202                    default is '';
203    
204          column hrEduPersonExpireDate =>          column hrEduPersonExpireDate =>
205                  label is _('Datum isteka temeljne povezanosti'),                  label is _('Datum isteka temeljne povezanosti'),
206                  type is 'date',                  type is 'date',
207                  hint is 'dd.mm.gggg',                  render as 'date',
208                  is mandatory,                  is mandatory,
209                    filters are 'Jifty::DBI::Filter::Date';
210    
211          column hrEduPersonTitle =>          column hrEduPersonTitle =>
212                  label is 'Položaj u ustanovi',                  label is 'Položaj u ustanovi',
213                  available are [                  valid are [     # FIXME reorder
214                            '',
215                          'dekan',                          'dekan',
216                          'direktor',                          'direktor',
217                          'pomoćnik ravnatelja',                          'pomoćnik ravnatelja',
# Line 187  use A3C::Record schema { Line 229  use A3C::Record schema {
229                          'voditelj projekta',                          'voditelj projekta',
230                          'zamjenik pročelnika sveučilišn',                          'zamjenik pročelnika sveučilišn',
231                          'zamjenik ravnatelja',                          'zamjenik ravnatelja',
232                  ];                  ],
233                    default is '';
234    
235          column hrEduPersonRole =>          column hrEduPersonRole =>
236                  label is 'Uloga u ustanovi',                  label is 'Uloga u ustanovi',
237                  available are [                  valid are [
238                            '',
239                          'administrator imenika',                          'administrator imenika',
240                          'CARNet koordinator',                          'CARNet koordinator',
241                          'CARNet sistem inženjer',                          'CARNet sistem inženjer',
# Line 201  use A3C::Record schema { Line 245  use A3C::Record schema {
245                          'MS koordinator',                          'MS koordinator',
246                          'MATICA operater',                          'MATICA operater',
247                          'MATICA urednik',                          'MATICA urednik',
248                  ];                  ],
249                    default is '';
250    
251          column hrEduPersonStaffCategory =>          column hrEduPersonStaffCategory =>
252                  label is 'Vrsta posla u ustanovi',                  label is 'Vrsta posla u ustanovi',
253                  available are [                  valid are [
254                          'administrativno osoblje',                          'administrativno osoblje',
255                          'ICT podrška',                          'ICT podrška',
256                          'istraživači',                          'istraživači',
# Line 272  use Jifty::Plugin::ActorMetadata::Mixin: Line 317  use Jifty::Plugin::ActorMetadata::Mixin:
317    
318  # Your model-specific methods go here.  # Your model-specific methods go here.
319    
320    =head2 set_mail
321    
322    Put mail from ldap into email row
323    
324    =cut
325    
326    sub set_mail {
327            my ($self,$v) = @_;
328            $self->set_email( $v );
329    }
330    
331  =head2 validate_telephoneNumber  =head2 validate_telephoneNumber
332    
333  =cut  =cut
# Line 284  sub validate_telephoneNumber { Line 340  sub validate_telephoneNumber {
340          return ( 1, 'OK' );          return ( 1, 'OK' );
341  }  }
342    
343    =head2 canonicalize_hrEduPersonExpireDate
344    
345    Support NONE as 2042-12-30
346    
347    =cut
348    
349    sub canonicalize_hrEduPersonExpireDate {
350            my ( $self, $value ) = @_;
351    
352            if ( $value eq 'NONE' ) {
353                    $self->log->warn("fixed hrEduPersonExpireDate");
354                    $value = '2042-12-30';
355            }
356    
357            return $value;
358    }
359    
360    =head2 current_user_can
361    
362    =cut
363    
364  sub current_user_can {  sub current_user_can {
365          # FIXME no security for now :-)          # FIXME no security for now :-)
366          return 1;          return 1;

Legend:
Removed from v.12  
changed lines
  Added in v.16

  ViewVC Help
Powered by ViewVC 1.1.26