Revision 439

Date:
2014/08/11 13:08:39
Author:
ahitrov
Revision Log:
Virtual fields in section browse
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/core/comps/contenido/components/section_browse.msn

     
    257 257 % }
    258 258 %
    259 259 % } else {
    260 %
    260 % my $attr = $col->{attr};
    261 261 % if ($col->{type} eq 'date') {
    262 262 % my $date=$document->{$col->{attr}};
    263 263 % $date=~/(\d{4}-\d{2}-\d{2})/;
     
    279 279 % } else {
    280 280 <span class="hiddensect">NULL</span>\
    281 281 % }
    282 % } elsif ($col->{type} eq 'checkbox') {
    283 <td align="center"><% $document->$attr ? '<img src="/contenido/i/checked-16x16.png" width="16" height="16">' : '&nbsp;' %>\
    282 284 % } elsif ($col->{type} eq 'status') {
    283 285 % my $status_map = ref $col->{cases} eq 'ARRAY' ? $col->{cases} : $keeper->default_status();
    284 286 % my ($doc_status) = grep { $_->[0] eq $document->{$col->{attr}} } @$status_map;
    285 287 % $doc_status ||= [$document->{$col->{attr}}, 'Неизвестный'];
    286 288 <td nowrap><% $doc_status->[1].'('.$doc_status->[0].')' %>\
    287 289 % } else {
    288 <td><% defined($document->{$col->{attr}}) ? $document->{$col->{attr}} : '&nbsp;' %>\
    290 <td><% defined($document->$attr) ? $document->$attr : '&nbsp;' %>\
    289 291 % }
    290 292 % }
    291 293 </td>