Changeset 465


Ignore:
Timestamp:
10/03/09 03:26:10 (15 years ago)
Author:
nanardon
Message:
  • revert previous commit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm

    r464 r465  
    3232    postalCode => [ 'Code postal' ], 
    3333    postOfficeBox => [ 'BP' ], 
    34     department => [ 'Département', 'select-N:group' ], 
     34    department => [ 'Département' ], 
    3535    streetAddress => [ 'Rue', 'textarea' ], 
    3636    title => [ 'Fonction' ], 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r464 r465  
    7878        directReports => 'directReports', 
    7979        managedObjects => 'managedObjects', 
     80        department => 'department', 
    8081        otheraddress => 'otheraddress', 
    8182        mainaddress => 'mainaddress', 
     
    136137        } 
    137138        return \@res; 
     139    } elsif ($field eq 'department') { 
     140        my $sth = $self->db->prepare_cached( 
     141            q{ 
     142            select name from "group" join 
     143            group_attributes on "group".ikey = group_attributes.okey 
     144            where okey in (select okey from group_attributes_users where value = ?) 
     145            and attr = ? and value = ? 
     146            } 
     147        ); 
     148        $sth->execute($self->id, 'sutype', 'dpmt'); 
     149        my @res; 
     150        while (my $res = $sth->fetchrow_hashref) { 
     151            push(@res, $res->{name}); 
     152        } 
     153        return join(',', @res); 
    138154    } elsif ($field eq 'managedObjects') { 
    139155        my $sth = $self->db->prepare_cached( 
Note: See TracChangeset for help on using the changeset viewer.