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

Allow to create pasted employment (trought config)

File:
1 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); 
Note: See TracChangeset for help on using the changeset viewer.