--- lib/CAdmin/Model/User.pm 2008/03/09 22:49:40 3 +++ lib/CAdmin/Model/User.pm 2008/03/10 00:19:52 4 @@ -6,9 +6,281 @@ use CAdmin::Record schema { + column name => + type is 'text', + label is _('Ime'), + is mandatory; + + column cn => + label is _('Ime'), + type is 'virtual'; + + column sn => + type is 'virtual', + label is _('Prezime'), + is mandatory; + + column givenName => + type is 'virtual', + label is _('Ime'), + is mandatory; + + column email => + type is 'text', + is mandatory, + label is _('Email address'), default is '', is immutable, is distinct; + + column email_confirmed => + label is _('Email address confirmed?'), + type is 'boolean'; + + column password => + is unreadable, + label is _('Password'), + type is 'varchar', + hints is _('Your password should be at least six characters'), + render_as 'password', +# filters are 'Jifty::DBI::Filter::SaltHash', + is mandatory; + + column telephoneNumber => + type is 'text', + label is _('Telefonski broj'), + hint is '+385 xx yyyyyy'; + + column hrEduPersonExtensionNumber => + label is _('Lokalni telefonski broj'); + + column mobile => + label is _('Broj mobilnog telefona'); + + column facsimileTelephoneNumber => + label is _('Fax broj'); + + column hrEduPersonUniqueNumber => + is mandatory, + label is _('JMBG'); + + column hrEduPersonDateOfBirth => + type is 'date', + label is _('Datum rođenja'); + + column hrEduPersonGender => + label is _('Spol'); + + column jpegPhoto => + label is _('Slika'); + + column userCertificate => + label is _('Ceritifikat'); + + column labeledURI => + label is _('URI adresa'); + + column wtAdminType => + label is _('Tip administratora'), + available are qw( AS AI AR AHU ); + + column hrEduPersonProfessionalStatus => + label is _('Stručni status'), + available are qw( DR KV MR NKV PKV SSS VKV VS VSS VŠS ); + + column hrEduPersonAcademicStatus => + label is _('Zvanje'), + available are [ + 'asistent', + 'asistent - predavač', + 'asistent visoke škole', + 'docent', + 'izvanredni profesor', + 'knjižničar', + 'korepetitor', + 'lektor', + 'mlađi asistent', + 'predavač', + 'profesor visoke škole', + 'redoviti profesor', + 'stručni suradnik', + 'viši asistent', + 'viši knjižničar', + 'viši korepetitor', + 'viši lektor', + 'viši predavač', + 'viši znanstveni suradnik', + 'znanstveni asistent', + 'znanstveni novak', + 'znanstveni savjetnik', + 'znanstveni suradnik', + ]; + + column hrEduPersonScienceArea => + label is _('Područje znanosti'), + available are [ + 'Tehničke znanosti', + 'Prirodne znanosti', + 'Humanističke znanosti', + 'Društvene znanosti', + 'Biotehničke znanosti', + 'Biomedicina i zdravstvo', + ]; + + column hrEduPersonAffiliation => + label is _('Povezanost s ustanovom'), + is mandatory, + available are [ + 'djelatnik', + 'gost', + 'korisnik usluge', + 'student', + 'učenik', + 'vanjski suradnik', + ]; + + column hrEduPersonPrimaryAffiliation => + label is _('Temeljna povezanost s ustanovom'); + is mandatory, + available are [ + 'djelatnik', + 'gost', + 'korisnik usluge', + 'student', + 'učenik', + 'vanjski suradnik', + ]; + + column hrEduPersonStudentCategory => + label is 'Vrsta studenta', + available are [ + 'dodiplomac', + 'osnovnoškolac', + 'pauzira godinu', + 'postdiplomac', + 'preddiplomac', + 'prekid studija', + 'srednjoškolac', + 'student stručnog studija', + ]; + + column hrEduPersonExpireDate => + label is _('Datum isteka temeljne povezanosti'), + type is 'date', + hint is 'dd.mm.gggg', + is mandatory, + + column hrEduPersonTitle => + label is 'Položaj u ustanovi', + available are [ + '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', + ]; + + column hrEduPersonRole => + label is 'Uloga u ustanovi', + available are [ + 'administrator imenika', + 'CARNet koordinator', + 'CARNet sistem inženjer', + 'ICT koordinator', + 'ISVU koordinator', + 'kontakt za sigurnosna pitanja', + 'MS koordinator', + 'MATICA operater', + 'MATICA urednik', + ]; + + column hrEduPersonStaffCategory => + label is 'Vrsta posla u ustanovi', + available are [ + 'administrativno osoblje', + 'ICT podrška', + 'istraživači', + 'nastavno osoblje', + 'osoblje knjižnice', + 'tehničko osoblje', + ]; + + column hrEduPersonGroupMember => + label is 'Pripadnost grupi', + hint is 'skolskagodina::razred'; + + column o => + label is _('Naziv matične ustanove'), + is mandatory; + + column hrEduPersonHomeOrg => + label is _('Oznaka matične ustanove'), + hint is 'CARNet', + is mandatory; + + column ou => + label is _('Organizacijska jedinica'); + + column roomNumber => + label is _('Broj sobe'); + + column postalAddress => + label is _('Poštanska adresa'), + is mandatory; + + column l => + label is _('Mjesto'), + hist is 'Zagreb', + is mandatory; + + column postalCode => + label is _('Poštanski broj'), + hint is 'HR-10000'; + + column street => + label is _('Ulica i kućni broj'); + + column homePostalAddress => + label is _('Kućna poštanska adresa'); + + column homePhone => + label is _('Kućni telefonski broj'); + + column hrEduPersonCommURI => + label is _('Desktop uređaj'); + + column hrEduPersonPrivacy => + label is _('Oznaka privatnosti'); + }; +use Jifty::Plugin::User::Mixin::Model::User; +use Jifty::Plugin::Authentication::Password::Mixin::Model::User; +#use Jifty::Plugin::OpenID::Mixin::Model::User; +use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on + # Your model-specific methods go here. +=head2 validate_telephoneNumber + +=cut + +sub validate_telephoneNumber { + my ( $self, $value ) = @_; + + return ( 0, _('Telephone number invalid') ) if $value !~ m/^(\+?385)?[\d\s-]+$/; + + return ( 1, 'OK' ); +} + 1;