Ignore:
Timestamp:
01/21/16 12:32:53 (8 years ago)
Author:
nanardon
Message:

User w/o employment have their status reset (except departement for short departure)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Employment.pm

    r1647 r1648  
    4646sub _has_extended_attributes { 1 } 
    4747 
    48 sub _reported_atributes { qw(contratType endcircuit hosted) } 
     48sub _reported_atributes { qw(contratType endcircuit hosted company) } 
    4949 
    5050sub _get_attr_schema { 
     
    361361        appliedEmployement => $self->id, 
    362362    ); 
    363     foreach my $attr (_reported_atributes(), qw(company department managerContact)) { 
     363    foreach my $attr (_reported_atributes(), qw(department managerContact)) { 
    364364        my $uval = $user->get_attributes($attr) || ''; 
    365365        my $cval = $self->get_attributes($attr) || ''; 
     
    385385    my ($ouser) = @_; 
    386386 
     387    $ouser->computeEmploymentDate; 
     388 
    387389    my %changes = ( 
    388390        appliedEmployement => undef, 
    389391    ); 
    390     foreach my $attr (LATMOS::Accounts::Bases::Sql::Employment::_reported_atributes) { 
     392 
     393    my @attributesToReset = _reported_atributes; 
     394    if (!$ouser->_get_attributes('_startEmployment')) { 
     395        push(@attributesToReset, qw(department)); 
     396    } 
     397 
     398    foreach my $attr (_reported_atributes) { 
    391399        my $default = $ouser->base->config("unemployment.$attr") || ''; 
    392400        my $old = $ouser->_get_attributes($attr) || ''; 
Note: See TracChangeset for help on using the changeset viewer.