Revision 610

Date:
2016/11/02 14:46:56
Author:
ahitrov
Revision Log:
Bug fix

Files:

Legend:

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

     
    8 8 </td>
    9 9 %
    10 10 % for my $col (@$columns) {
    11 % if ($col->{attr} eq '_sort_') {
    11 % my $attr = $col->{attr};
    12 % my $type = exists $col->{inline_type} ? $col->{inline_type} : $col->{type};
    13 % if ($attr eq '_sort_') {
    12 14 %
    13 15 <td width="20px"><% $document->{sorder} %>&nbsp;<a class="move-up" data-id="<% $document->id %>"
    14 16 href="document_move.html?id=<% $document->{id} %>&move=up&s=<% $id %><% $params_unsection ? '&'.$params_unsection : '' %>"><img
     
    16 18 href="document_move.html?id=<% $document->{id} %>&move=down&s=<% $id %><% $params_unsection ? '&'.$params_unsection : '' %>"><img
    17 19 src="/contenido/i/ico-down-9x10.gif" border=0 alt="Переместить документ на шаг вниз"></a>\
    18 20 %
    19 % } elsif ($col->{attr} eq 'dtime') {
    21 % } elsif ($attr eq 'dtime') {
    20 22 %
    21 23 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{dtime} &>\
    22 24 %
     
    27 29 %
    28 30 % }
    29 31 %
    30 % } elsif ($col->{attr} eq 'name') {
    32 % } elsif ($attr eq 'name') {
    31 33 %
    32 34 <td><span<% $document->contenido_status_style ? ' style="' . $document->contenido_status_style . '"' : '' %> class="<% $document->status ? '':'hiddensect' %>">\
    33 35 %
     
    44 46 %
    45 47 </span>\
    46 48 %
    47 % } elsif ($col->{attr} eq 'id') {
    49 % } elsif ($attr eq 'id') {
    48 50 %
    49 51 <td><span class="<% $document->status ? '':'hiddensect' %>">\
    50 52 % if ($document_access == 2) {
     
    55 57 </span>\
    56 58 %
    57 59 % } elsif ( exists $col->{inline} && $col->{inline} ) {
    58 % my $attr = $col->{attr};
    59 % my $type = exists $col->{inline_type} ? $col->{inline_type} : $col->{type};
    60 60 % if ( $type =~ /^(string|integer|float)$/ && $col->{inline} ) {
    61 61 % my $style = $col->{inline_style} ? $col->{inline_style} : ($col->{type} =~ /^(integer|float)$/ ? 'text-align:right; ' : '' );
    62 62 % $style .= $col->{inline_width} ? ' width:'.$col->{inline_width}.'px; ' : ' width:65px; ';
     
    79 79 % if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$document->class}))) {
    80 80 % %{ $options } = %{ $toopi->{$document->class} };
    81 81 % }
    82 % my $values = $options->{$col->{attr}};
    82 % my $values = $options->{$attr};
    83 83 <td><select name="<% 'update_'.$document->id.'_'.$attr %>" autocomplete="off">
    84 84 % if ( ref $values eq 'ARRAY' ) {
    85 85 % foreach my $val ( @$values ) {
     
    113 113 % my %opts = %{ $col->{lookup_opts} };
    114 114 % delete $opts{search_by} if exists $opts{search_by};
    115 115 % my $docs;
    116 % if ( ref $lookup_elements eq 'HASH' && exists $lookup_elements->{$col->{attr}} ) {
    117 % $docs = $lookup_elements->{$col->{attr}};
    116 % if ( ref $lookup_elements eq 'HASH' && exists $lookup_elements->{$attr} ) {
    117 % $docs = $lookup_elements->{$attr};
    118 118 % } else {
    119 119 % $docs = $keeper->get_documents( %opts, return_mode => 'array_ref', names => 1 );
    120 120 % if ( ref $lookup_elements eq 'HASH' ) {
    121 % $lookup_elements->{$col->{attr}} = $docs;
    121 % $lookup_elements->{$attr} = $docs;
    122 122 % }
    123 123 % }
    124 124 % if ( ref $docs eq 'ARRAY' && @$docs ) {
     
    136 136 <td><% $document->$attr %><input type="hidden" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr |h %>">\
    137 137 % }
    138 138 %
    139 % } elsif ($col->{attr} eq 'class') {
    139 % } elsif ($attr eq 'class') {
    140 140 %
    141 141 <td><% $document->class_name %>&nbsp;<font color="#999999">(<% $document->class %>)</font>\
    142 142 %
    143 143 % } elsif ($type eq 'datetime') {
    144 144 %
    145 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{$col->{attr}} &>\
    145 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{$attr} &>\
    146 146 %
    147 % } elsif ($col->{attr} eq '_act_') {
    147 % } elsif ($attr eq '_act_') {
    148 148 %
    149 149 <td nowrap>\
    150 150 % if ($document_access == 2) {
     
    176 176 % }
    177 177 %
    178 178 % } else {
    179 % my $attr = $col->{attr};
    179 % my $attr = $attr;
    180 180 % if ($type eq 'date') {
    181 % my $date=$document->{$col->{attr}};
    181 % my $date=$document->{$attr};
    182 182 % $date=~/(\d{4}-\d{2}-\d{2})/;
    183 183 <td nowrap align="right"><% $1 || '&nbsp;' %>\
    184 184 % } elsif ($type eq 'datetime') {
    185 <td nowrap align="right"><% $document->{$col->{attr}} || '&nbsp;' %>\
    185 <td nowrap align="right"><% $document->{$attr} || '&nbsp;' %>\
    186 186 % } elsif ($type eq 'integer') {
    187 <td align="right"><% $document->{$col->{attr}} %>&nbsp;\
    187 <td align="right"><% $document->{$attr} %>&nbsp;\
    188 188 % } elsif ($type eq 'lookup' || $type eq 'pickup' || $type eq 'autocomplete') {
    189 189 <td align="left">\
    190 % my $id = $document->{$col->{attr}};
    190 % my $id = $document->{$attr};
    191 191 % if ($id) {
    192 192 % my ($doc)=$keeper->get_documents( ( ref($col->{lookup_opts}) ? %{$col->{lookup_opts}} : () ), id=>$id);
    193 193 % if ($doc) {
    194 194 <a href="document.html?id=<% $doc->id %>&class=<% $doc->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>"><% $doc->name || $doc->id %></a>&nbsp;\
    195 195 % } else {
    196 <span class="hiddensect"><% $document->{$col->{attr}} %>???</span>\
    196 <span class="hiddensect"><% $document->{$attr} %>???</span>\
    197 197 % }
    198 198 % } else {
    199 199 <span class="hiddensect">NULL</span>\
     
    202 202 <td align="center"><% $document->$attr ? '<img src="/contenido/i/checked-16x16.png" width="16" height="16">' : '&nbsp;' %>\
    203 203 % } elsif ($type eq 'status') {
    204 204 % my $status_map = ref $col->{cases} eq 'ARRAY' ? $col->{cases} : $keeper->default_status();
    205 % my ($doc_status) = grep { $_->[0] eq $document->{$col->{attr}} } @$status_map;
    206 % $doc_status ||= [$document->{$col->{attr}}, 'Неизвестный'];
    205 % my ($doc_status) = grep { $_->[0] eq $document->{$attr} } @$status_map;
    206 % $doc_status ||= [$document->{$attr}, 'Неизвестный'];
    207 207 <td nowrap><% $doc_status->[1].'('.$doc_status->[0].')' %>\
    208 208 % } else {
    209 209 <td><% defined($document->$attr) ? $document->$attr : '&nbsp;' %>\