Changeset 1508


Ignore:
Timestamp:
12/20/15 22:51:02 (9 years ago)
Author:
nanardon
Message:

Add a configurable delay to allow between two employment

Location:
trunk/LATMOS-Accounts
Files:
2 edited

Legend:

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

    r1506 r1508  
    219219                        SELECT * FROM employment WHERE "user" = ? and 
    220220                            (lastday is null or lastday >= now() - '1 days'::interval)  
     221                            order by firstday asc 
    221222                    }); 
    222223                    $list_empl->execute($self->id); 
     
    230231                        if ($end) { 
    231232                            my $nextstart = DateTime->from_epoch(epoch => str2time($res->{firstday})); 
    232                             if ($end->ymd lt $nextstart->ymd) { 
     233                            my $tend = $end->clone; 
     234                            if (my $days = $self->base->config('employment_delay')) { 
     235                                $tend->add(days => $days); 
     236                            } 
     237                            if ($tend->ymd lt $nextstart->ymd) { 
    233238                                last; 
    234239                            } 
  • trunk/LATMOS-Accounts/man/man8/latmos-accounts-base-sql.pod

    r1490 r1508  
    5757attributes (C<accountExpires> for Active Directory). 
    5858 
     59=head2 User endEmployment 
     60 
     61THis attribute compute the next day the user will leave the company according 
     62the employment object registered. 
     63 
     64The parameter C<employment_delay> give the number of days to ignore when a hole 
     65exists between two employment 
     66 
    5967=head2 Group AutoMemberFilter 
    6068 
Note: See TracChangeset for help on using the changeset viewer.