Changeset 738 for LATMOS-Accounts-Web


Ignore:
Timestamp:
01/25/10 01:47:16 (14 years ago)
Author:
nanardon
Message:
  • don't take into account label attribute
File:
1 edited

Legend:

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

    r733 r738  
    378378    $self->{c}->req->param($self->label) or return; 
    379379    my $prefix = $self->{object}->id . '_'; 
    380     $self->{object}->set_c_fields( 
    381         map { 
    382             $_ => 
    383                 ($attrs->{$_}[1] || '') eq 'checkbox' 
    384                 ? ($self->{c}->req->param("$prefix$_") ? 1 : 0) 
    385                 : ($self->{c}->req->param("$prefix$_") || undef) 
    386         } grep { $self->base->get_field_name($self->otype, $_, 'w') } $self->attributes 
    387     ) or return; 
     380    my %fields; 
     381    foreach ( 
     382        grep { $self->base->get_field_name($self->otype, $_, 'w') } 
     383        $self->attributes) { 
     384        if (($attrs->{$_}[1] || '') eq 'checkbox') { 
     385            $fields{$_} = $self->{c}->req->param("$prefix$_") ? 1 : 0; 
     386        } elsif (($attrs->{$_}[1] || '') eq 'label') { 
     387            next; 
     388        } else { 
     389            $fields{$_} = $self->{c}->req->param("$prefix$_"); 
     390        } 
     391    } 
     392    $self->{object}->set_c_fields(%fields) or return; 
    388393    $self->{object}->base->commit; 
    389394} 
Note: See TracChangeset for help on using the changeset viewer.