Changeset 2074


Ignore:
Timestamp:
08/26/17 15:33:59 (7 years ago)
Author:
nanardon
Message:

All reset department at unumployment

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm

    r1329 r2074  
    128128    $c->stash->{random_password} = 
    129129    LATMOS::Accounts::Utils::genpassword( 
    130         %{ $c->req->params() } 
     130        %{ $c->req->params() }, 
     131        checkpassword => sub { 
     132            $self->model('Accounts')->base->check_password(@_) 
     133        }, 
    131134    ); 
    132135} 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r2070 r2074  
    15811581            my $cval = $currentemployment->get_attributes($attr) || ''; 
    15821582 
    1583             for ($attr) { 
    1584                 if ($attr eq 'managerContact') { 
    1585                     if (!$cval) { 
    1586                         my $dpmt  = $currentemployment->get_attributes('department') or last; 
    1587                         my $odmpt = $currentemployment->base->get_object('group', $dpmt) or last; 
    1588                         $cval = $odmpt->get_attributes('managedBy'); 
    1589                     } 
     1583            if ($attr eq 'managerContact') { 
     1584                if (!$cval) { 
     1585                    my $dpmt  = $currentemployment->get_attributes('department') or last; 
     1586                    my $odmpt = $currentemployment->base->get_object('group', $dpmt) or last; 
     1587                    $cval = $odmpt->get_attributes('managedBy'); 
    15901588                } 
    15911589            } 
     
    16251623    ); 
    16261624 
    1627     my @attributesToReset = _reported_atributes; 
    1628     if (!$self->_get_attributes('_startEmployment')) { 
    1629         push(@attributesToReset, qw(department)); 
    1630     } 
     1625    my @attributesToReset = (_reported_atributes, qw(department)); 
    16311626 
    16321627    foreach my $attr (@attributesToReset) { 
    16331628        my $default = $self->base->config("unemployment.$attr") || ''; 
    16341629        my $old = $self->_get_attributes($attr) || ''; 
     1630        warn "$attr $old $default"; 
    16351631        if ($old ne $default) { 
    16361632            $changes{$attr} = $default || undef; 
     
    16431639            $changes{'manager'} = $onext->_get_attributes('managerContact'); 
    16441640        } 
    1645  
    16461641    } 
    16471642 
Note: See TracChangeset for help on using the changeset viewer.