>
% unless ( $no_inline ) {
\
% if ($document_access == 2) {
% $delete_status = 1;
% } else {
% }
|
% }
class="<% $document->status ? '':'hiddensect' %>"><% $a1.$document->id.$a2 %> |
%
% for my $col (@$columns) {
% my $attr = $col->{attr};
% if ($attr eq 'dtime') {
%
<& "/contenido/components/show_dtime.msn", dtime=>$document->{dtime} &>\
% if ($document->{ctime} ne $document->{mtime}) {
% my $colortime = '#c66';
<& "/contenido/components/show_dtime.msn", dtime=>$document->{mtime} &> \
% }
%
% } elsif ($attr eq 'name') {
| class="<% $document->status ? '':'hiddensect' %>">\
%
% my $name=$document->name ? $document->name : 'Безымянный документ N'.$document->id;
<% $a1 %><% $name | h %><% $a2 %>\
%
\
%
% } elsif ($attr eq 'id') {
%
| \
% if ($document_access == 2) {
<% $document->id %> \
% } else {
<% $document->id %> \
% }
\
%
% } elsif ( exists $col->{inline} && $col->{inline} ) {
% $inline_status = 1;
% if ( $col->{type} =~ /^(string|integer|float)$/ && $col->{inline} ) {
% my $style = $col->{inline_style} ? $col->{inline_style} : ($col->{type} =~ /^(integer|float)$/ ? 'text-align:right; ' : '' );
|
% } elsif ($col->{type} eq 'checkbox') {
% my $checked = $document->$attr ? ' checked' : '';
| >
% } elsif ($col->{type} eq 'select') {
% my $options = {};
% if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$document->class}))) {
% %{ $options } = %{ $toopi->{$document->class} };
% }
% my $values = $options->{$attr};
|
% } elsif ($col->{type} eq 'status') {
% my $cases = $col->{cases};
% if ( ref $cases eq 'ARRAY' ) {
|
% }
% }
%
% } elsif ($attr eq 'class') {
%
| <% $document->class_name %> (<% $document->class %>)\
%
% } elsif ($col->{type} eq 'datetime') {
%
| <& "/contenido/components/show_dtime.msn", dtime=>$document->$attr &>\
%
% } elsif ($attr eq '_act_') {
% my $actions;
% if ( $document->$user_id == $user->id ) {
% $actions = join (' | ', map { ''.$_->{name}.'' } @actions);
% } else {
% my $profile = exists $users{$document->$user_id} ? $users{$document->$user_id} : undef;
% unless ( ref $profile ) {
% $profile = $keeper->get_user_by_id( $document->$user_id );
% $users{$profile->id} = $profile if ref $profile;
% }
% if ( ref $profile ) {
% $actions = $profile->name;
% } else {
% $actions = join (' | ', map { ''.$_->{name}.'' } @actions);
% }
% }
% if ( $active_rights == 0 ) {
% if ( $user_id && $user_id eq 'manager_id' && $document->$user_id && $document->$user_id != $user->id ) {
% $actions .= ' (unlock)'
% } else {
% $actions = join (' | ', map { ''.$_->{name}.'' } @actions);
% }
% }
| <% $actions %>\
% if ( $inline_status ) {
% }
% if ( $delete_status ) {
% }
%
% } else {
%
% if ($col->{type} eq 'date') {
% my $date=$document->$attr;
% $date=~/(\d{4}-\d{2}-\d{2})/;
| <% $1 || ' ' %>\
% } elsif ($col->{type} eq 'datetime') {
| <% $document->$attr || ' ' %>\
% } elsif ($col->{type} eq 'integer') {
| <% $document->$attr %> \
% } elsif ($col->{type} eq 'lookup') {
| \
% my $id = $document->$attr;
% if ($id) {
% my ($doc)=$keeper->get_documents( ( ref($col->{lookup_opts}) ? %{$col->{lookup_opts}} : () ), id=>$id);
% if ($doc) {
<% $doc->name || $doc->id %> \
% } else {
<% $document->$attr %>???\
% }
% } else {
NULL\
% }
% } elsif ($col->{type} eq 'status') {
% my $status_map = ref $col->{cases} eq 'ARRAY' ? $col->{cases} : $keeper->default_status();
% my ($doc_status) = grep { $_->[0] eq $document->$attr } @$status_map;
% $doc_status ||= [$document->$attr, 'Неизвестный'];
| <% $doc_status->[1].'('.$doc_status->[0].')' %>\
% } else {
| <% defined($document->$attr) ? $document->$attr : ' ' %>\
% }
% }
|
%
% } #- for @columns
%
% } #- foreach @documents