Changeset 1761


Ignore:
Timestamp:
05/06/16 08:57:49 (8 years ago)
Author:
nanardon
Message:

Add trickery to make stat working

Location:
trunk
Files:
2 edited

Legend:

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

    r1758 r1761  
    3434 
    3535    my @filteredObj = $base->search_objects( 
    36         'employment', sprintf('firstday<=%s', $end->ymd('-')), sprintf('lastday>=%s', $start->ymd('-')) 
     36        'employment', sprintf('firstday<=%s', $end->ymd('-')), sprintf('lastday>=%s', $start->ymd('-')), 'lastday=NULL' 
    3737    ); 
    3838    my %atstart = map { $_ => 1 } $base->search_objects( 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r1758 r1761  
    742742        # attr=foo => no extra white space ! 
    743743        # \W is false, it is possible to have two char 
    744         my ($attr, $mode, $val) = $item =~ /^(\w+)(?:(\W+)(.+))?$/ or next; 
     744        my ($attr, $mode, $val) = $item =~ /^(\w+)(?:([^\w*]+)(.+))?$/ or next; 
    745745        if (!$mode) { 
    746746            $mode = '~'; 
     
    776776                $base->db->quote_identifier($attribute->iname), 
    777777                ($mode eq '~' ? '::text' : ''), 
    778                 $val eq '*' 
     778                $mode eq '=' && $val eq '*' 
    779779                    ? 'is not NULL' 
     780                    : $mode eq '=' && $val eq 'NULL' 
     781                    ? 'is NULL' 
    780782                    : $mode eq '~' 
    781783                        ? 'ILIKE ?' 
    782784                        : "$mode ?" 
    783785            ); 
    784             push(@{$attrbind{$attr}}, $mode eq '~' ? '%' . $val . '%' : $val) unless($val eq '*'); 
     786            push(@{$attrbind{$attr}}, $mode eq '~' ? '%' . $val . '%' : $val) unless($mode eq '=' && ($val eq '*' || $val eq 'NULL')); 
    785787        } else { 
    786788            $sql = sprintf( 
Note: See TracChangeset for help on using the changeset viewer.