Revision 546

Date:
2016/02/12 11:55:42
Author:
ahitrov
Revision Log:
Inline search by status key or value

Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/core/comps/contenido/sections.html

     
    418 418 my @props = $doc_class->new( $keeper )->structure();
    419 419 my ($prop) = grep { $_->{attr} eq $search_by } @props if @props;
    420 420 if ( ref $prop && ($prop->{type} eq 'integer' || $prop->{type} eq 'checkbox' ||
    421 (($prop->{type} eq 'pickup' || $prop->{type} eq 'lookup') && $search =~ /^\d+$/) ||
    421 (($prop->{type} eq 'pickup' || $prop->{type} eq 'lookup' || $prop->{type} eq 'status') && $search =~ /^\d+$/) ||
    422 422 (exists $prop->{db_type} && $prop->{db_type} =~ /integer\[\]/) )) {
    423 423 $filter{$search_by} = int($search);
    424 } elsif ( ref $prop && $prop->{type} eq 'status' && $search =~ /\D/ ) {
    425 my $str;
    426 foreach my $pair ( @{$prop->{cases}} ) {
    427 if ( lc(Encode::decode('utf-8', $pair->[1])) eq lc(Encode::decode('utf-8', $search)) || lc(Encode::decode('utf-8', $pair->[0])) eq lc(Encode::decode('utf-8', $search)) ) {
    428 $str = $pair->[0];
    429 last;
    430 }
    431 }
    432 if ( $str ) {
    433 $filter{$search_by} = $str;
    434 }
    424 435 } elsif ( ref $prop && ($prop->{type} eq 'pickup' || $prop->{type} eq 'lookup') && $search =~ /\D/ ) {
    425 436 my $lookup_opts = $prop->{lookup_opts};
    426 437 if ( ref $lookup_opts && (exists $lookup_opts->{class} || exists $lookup_opts->{table}) ) {