Changeset 830


Ignore:
Timestamp:
03/17/10 13:24:25 (14 years ago)
Author:
nanardon
Message:
  • don't list secondaries address when user are no longer exported and unexported objects are not wanted
File:
1 edited

Legend:

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

    r565 r830  
    1313    my $sth = $base->db->prepare_cached( 
    1414        sprintf( 
    15             q{select %s as k from %s where ikey not in (select okey from %s where attr = 'isMainAddress') %s order by %s}, 
     15            q{select %s.%s as k from %s 
     16              join "user" on %s."user" = "user".name %s 
     17              where %s.ikey not in (select okey from %s where attr = 'isMainAddress') %s 
     18              order by %s.%s 
     19            }, 
     20            $base->db->quote_identifier($class->object_table), 
    1621            $base->db->quote_identifier($class->key_field), 
    1722            $base->db->quote_identifier($class->object_table), 
     23            $base->db->quote_identifier($class->object_table), 
     24            ($base->{wexported} ? '' : 'and "user".exported = true'), 
     25            $base->db->quote_identifier($class->object_table), 
    1826            $base->db->quote_identifier($class->object_table. '_attributes'), # attr 
    19             ($base->{wexported} ? '' : 'and exported = true'), 
     27            ($base->{wexported} ? '' : 'and ' . 
     28                $base->db->quote_identifier($class->object_table) . '.exported = true'), 
     29            $base->db->quote_identifier($class->object_table), 
    2030            $base->db->quote_identifier($class->key_field), 
    2131        ) 
Note: See TracChangeset for help on using the changeset viewer.