Changeset 2478


Ignore:
Timestamp:
10/07/21 19:03:50 (3 years ago)
Author:
nanardon
Message:

Add attribute BAP and Grade

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm

    r2413 r2478  
    6868            manager 
    6969            contratType 
     70            assigned 
     71            grade 
     72            BAP 
    7073            expire 
    7174            endcircuit 
     
    148151            contratType 
    149152            assigned 
     153            grade 
     154            BAP 
    150155            department 
    151156            managerContact 
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrFormsA.pm

    r1953 r2478  
    372372sub attr_LIST { 
    373373    my ($self, $value) = @_; 
    374  
    375     my @values = $self->can_values; 
    376374    $value ||= ''; 
    377375 
    378     if (@values < 5) { 
    379         return sprintf(q|<select id="%s" name="%s">%s%s</select>|, 
    380             $self->htmlid, 
    381             $self->htmlname, 
    382             ($self->mandatory ? '' : '<option value="">--</option>'), 
    383             join(",\n", map { $_ = sprintf('<option value="%s"%s>%s</option>', $_, ($_ eq $value ? ' selected="selected"' : ''), $self->display($_)) } sort $self->can_values), 
    384         ); 
    385     } else { 
    386         my $html = $self->attr_TEXT($self->display($value)); 
    387     } 
     376    my $html = $self->attr_TEXT($self->display($value)); 
    388377} 
    389378 
     
    392381    return sprintf(q| 
    393382            $('[name="%s"]').autocomplete({ 
    394                 delay: 200, 
     383                delay: 100, 
    395384                minLength: 0, 
    396385                source: '%s', 
     
    406395    ); 
    407396} 
     397 
     398sub attr_SELECT { 
     399    my ($self, $value) = @_; 
     400    $value ||= ''; 
     401 
     402    return sprintf(q|<select id="%s" name="%s">%s%s</select>|, 
     403        $self->htmlid, 
     404        $self->htmlname, 
     405        ($self->mandatory ? '' : '<option value="">--</option>'), 
     406        join(",\n", map { $_ = sprintf('<option value="%s"%s>%s</option>', $_, ($_ eq $value ? ' selected="selected"' : ''), $self->display($_)) } sort $self->can_values), 
     407    ); 
     408} 
     409 
     410sub attr_SELECT_js { } 
    408411 
    409412sub _uri_part { 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Attributes.pm

    r2264 r2478  
    404404 
    405405sub form_type { 
     406 
     407    my @values = $_[0]->can_values; 
     408 
    406409    $_[0]->readonly ? 'LABEL' : 
    407410    $_[0]->{formtype} ? $_[0]->{formtype} : 
    408     $_[0]->has_values_list ? 'LIST' : 
     411    $_[0]->has_values_list ? ( scalar(@values) > 15 ? 'LIST' : 'SELECT') : 
    409412    $_[0]->real_form_type 
    410413} 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ldap/User.pm

    r2476 r2478  
    118118        physicalDeliveryOfficeName => { }, 
    119119        ou => { }, 
     120        employeeType => {}, 
    120121        st => { }, 
    121122        l => { }, 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Employment.pm

    r2385 r2478  
    88use LATMOS::Accounts::Log; 
    99use LATMOS::Accounts::I18N; 
     10use LATMOS::Accounts::Bases::Sql::User; 
    1011use Date::Parse; 
    1112use DateTime; 
     
    161162            label => l('Department'), 
    162163        }, 
     164        grade => { }, 
     165        BAP   => { }, 
    163166        company => { 
    164167            label => l('Company'), 
     
    308311    if (! $base->config("allow_pasted_employment")) { 
    309312    # Completed contract are RO, we allow to still set lastday 
    310         foreach (qw(endcircuit firstday contratType department managerContact company employer)) { 
     313        foreach (LATMOS::Accounts::Bases::Sql::User::_reported_atributes(), qw(firstday contratType managerContact)) { 
    311314            $attrs->{$_}{ro} = sub { 
    312315                my ($self) = $_[0]; 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r2475 r2478  
    784784                label => l('Type of contract'), 
    785785            }, 
     786            employeeType => { 
     787                iname => 'contratType', 
     788                ro => 1, 
     789            }, 
     790            grade => { }, 
     791 
    786792            site => { 
    787793                reference => 'site', 
     
    13951401            }, 
    13961402            grade => { }, 
     1403            BAP   => { }, 
    13971404            givenName => { 
    13981405                label => l('First name'), 
     
    16531660    }; 
    16541661 
    1655     foreach (_reported_atributes(), qw(department managerContact contratTypeHistory)) { 
     1662    foreach (_reported_atributes(), qw(managerContact contratTypeHistory)) { 
    16561663        $attrs->{$_}{ro} = $employmentro; 
    16571664    } 
     
    17611768} 
    17621769 
    1763 sub _reported_atributes { qw(contratType endcircuit hosted assigned requestId company employer) } 
     1770sub _reported_atributes { qw(contratType endcircuit hosted assigned requestId company employer department BAP grade) } 
    17641771 
    17651772=head2 applyCurrentEmployment 
     
    17911798            appliedEmployement => $currentemployment->id, 
    17921799        ); 
    1793         foreach my $attr (_reported_atributes(), qw(department managerContact)) { 
     1800        foreach my $attr (_reported_atributes(), qw(managerContact)) { 
    17941801            my $uval = $self->get_attributes($attr) || ''; 
    17951802            my $cval = $currentemployment->get_attributes($attr) || ''; 
     
    18391846    ); 
    18401847 
    1841     my @attributesToReset = (_reported_atributes(), qw(department)); 
     1848    my @attributesToReset = _reported_atributes(); 
    18421849 
    18431850    foreach my $attr (@attributesToReset) { 
Note: See TracChangeset for help on using the changeset viewer.