Changeset 2480
- Timestamp:
- 10/08/21 18:29:39 (3 years ago)
- Location:
- trunk/LATMOS-Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r2461 r2480 685 685 sub obj_attr_allowed_values { 686 686 my ($self, $otype, $attr) = @_; 687 if ($self->_allowed_values && 688 $self->_allowed_values->SectionExists("$otype.$attr")) { 689 return grep { defined($_) } $self->_allowed_values->val("$otype.$attr", 'allowed'); 690 } 691 return(); 687 return grep { defined($_) } $self->obj_attr_param($otype, $attr, 'allowed'); 692 688 } 693 689 … … 715 711 } 716 712 return 1; 713 } 714 715 =head2 obj_attr_param ( $otype, $attr, $param ) 716 717 Return, if any, the paramater $param for this attribute from allowed_values config file 718 719 =cut 720 721 sub obj_attr_param { 722 my ( $self, $otype, $attr, $param ) = @_; 723 724 if ( $self->_allowed_values && 725 $self->_allowed_values->SectionExists("$otype.$attr")) { 726 return $self->_allowed_values->val( "$otype.$attr", $param ); 727 } 728 return; 717 729 } 718 730 -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Attributes.pm
r2478 r2480 405 405 sub form_type { 406 406 407 if (my $type = $_[0]->base->obj_attr_param( $_[0]->otype, $_[0]->name, 'type' ) ) { 408 # Forced from config: 409 return uc($type); 410 } 411 407 412 my @values = $_[0]->can_values; 408 413 409 414 $_[0]->readonly ? 'LABEL' : 410 415 $_[0]->{formtype} ? $_[0]->{formtype} : 411 $_[0]->has_values_list ? ( scalar(@values) > 15 ? 'LIST' : 'SELECT') :416 $_[0]->has_values_list ? ( scalar(@values) > 5 ? 'LIST' : 'SELECT') : 412 417 $_[0]->real_form_type 413 418 } -
trunk/LATMOS-Accounts/man/man5/la-allowed-values.ini.pod
r2479 r2480 28 28 The list of value allowed for this attribute 29 29 30 =head3 type 31 32 Force the attribute type: LIST, SELECT, DATE, ... 33 30 34 =head1 EXAMPLE 31 35
Note: See TracChangeset
for help on using the changeset viewer.