Ignore:
Timestamp:
05/21/09 01:09:14 (15 years ago)
Author:
nanardon
Message:
  • improve add field in forms
  • complete menu
File:
1 edited

Legend:

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

    r148 r151  
    1919    uidNumber => [ 'UID' ], 
    2020    gidNumber => [ 'GID', 'select:group:gidNumber' ], 
     21    manager => [ 'Responsable', 'select-N:user:uid' ], 
    2122    sn => [ 'Nom' ], 
    2223    givenName => [ 'Prénom' ], 
     
    3031    postalCode => [ 'Code postal' ], 
    3132    postOfficeBox => [ 'BP' ], 
    32     department => [ 'Département' ], 
     33    department => [ 'Département', 'select-N:department' ], 
    3334    streetAddress => [ 'Rue', 'textarea' ], 
    3435    st => [ 'Etat' ], 
     
    6465        attrs => [ qw( 
    6566            company 
     67            manager 
    6668            department 
    6769            title 
     
    8082    cell => { 
    8183        name => 'Cellule', 
    82         attrs => [qw(description) ], 
     84        attrs => [qw(description manager) ], 
    8385    }, 
    8486    department => { 
    8587        name => 'Département', 
    86         attrs => [qw(description) ], 
     88        attrs => [qw(description manager) ], 
    8789    }, 
    8890    team => { 
     
    178180            $self->attr_raw_value($attr) 
    179181        ); 
    180         /^select:([^:]+):(.*)$/ and do { 
    181             my $otype = $1; 
    182             my $keyfield = $2; 
     182        /^select(-\w+)?:([^:]+)(?::(.*))?$/ and do { 
     183            my $options = $1 || ''; 
     184            my $otype = $2; 
     185            my $keyfield = $3; 
    183186            my $select = sprintf('<select name="%s">', 
    184187                $self->escape($attr)) . "\n"; 
    185             my $value = $self->attr_raw_value($attr); 
     188            $select .= '<option value="">--</option>' . "\n" if ($options =~ /N/); 
     189            my $value = $self->attr_raw_value($attr) || ''; 
    186190            foreach my $id ($self->base->list_objects($otype)) { 
    187191                my $obj = $self->base->get_object($otype, $id) or next; 
Note: See TracChangeset for help on using the changeset viewer.