- Timestamp:
- 05/19/12 11:38:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm
r959 r1002 474 474 my ($self, $attr, $type) = @_; 475 475 476 my $attribute = ($type 477 ? ref $type 478 ? $self->base->attribute( 476 my $attribute; 477 if ($type) { 478 if (ref $type) { 479 $attribute = $self->base->attribute( 479 480 $self->otype, 480 { %$type, name => $attr },) 481 : $self->base->attribute( 481 { %$type, name => $attr }, 482 ); 483 } else { 484 $attribute = $self->base->attribute( 482 485 $self->otype, 483 { formtype => $type , name => $attr },) 484 : ($self->{object} 485 ? $self->{object}->attribute($attr) 486 : $self->base->attribute($self->otype, $attr, { formtype => $type }))) 487 || $self->base->attribute($self->otype, { name => $attr }); 486 { formtype => $type , name => $attr }, 487 ); 488 } 489 } else { 490 if ($self->{object}) { 491 $attribute = $self->{object}->attribute($attr); 492 } else { 493 $attribute = $self->base->attribute( 494 $self->otype, $attr, 495 { formtype => $type } 496 ); 497 } 498 } 499 $attribute ||= $self->base->attribute($self->otype, { name => $attr }); 488 500 489 501 … … 494 506 # Force Array context: 495 507 my @attr_raw_value = (); 508 496 509 if ($attribute->multiple) { 497 510 @attr_raw_value = grep { $_ } $self->attr_raw_value($attribute);
Note: See TracChangeset
for help on using the changeset viewer.