Changeset 1834


Ignore:
Timestamp:
08/29/16 12:28:13 (8 years ago)
Author:
nanardon
Message:

Allow to create pasted employment (trought config)

Location:
trunk/LATMOS-Accounts
Files:
2 edited

Legend:

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

    r1832 r1834  
    296296    }; 
    297297 
     298    if (! $base->config("allow_pasted_employment")) { 
    298299    # Completed contract are RO, we allow to still set lastday 
    299     foreach (qw(endcircuit firstday contratType department managerContact company)) { 
    300         $attrs->{$_}{ro} = sub { 
    301             my ($self) = $_[0]; 
    302             $self or return 0; 
    303             my $st = $self->get_attributes('state') || '0'; 
    304             return $st < 0 ? 1 : 0; 
    305         }; 
     300        foreach (qw(endcircuit firstday contratType department managerContact company)) { 
     301            $attrs->{$_}{ro} = sub { 
     302                my ($self) = $_[0]; 
     303                $self or return 0; 
     304                my $st = $self->get_attributes('state') || '0'; 
     305                return $st < 0 ? 1 : 0; 
     306            }; 
     307        } 
    306308    } 
    307309    $class->SUPER::_get_attr_schema($base, $attrs); 
  • trunk/LATMOS-Accounts/man/man8/latmos-accounts-base-sql.pod

    r1784 r1834  
    9494You can change this beaviour using C<employment_lock_user> parameter: 
    9595 
     96By default it is impossible to modify or create past employment. This behavior 
     97can be changed by settings C<allow_pasted_employment> parameter in base 
     98configuration. 
     99 
    96100=over 4 
    97101 
Note: See TracChangeset for help on using the changeset viewer.