• section_browse_row.msn

    608 609  
    1 <tr valign="top">
    1 <tr valign="top" id="row-<% $document->id %>">
    2 2 <td nowrap>\
    3 3 % if ($document_access == 2) {
    4 4 <input type="checkbox" class="common-check" name="<% 'delete_'.$document->id.'_id' %>">
     
    10 10 % for my $col (@$columns) {
    11 11 % if ($col->{attr} eq '_sort_') {
    12 12 %
    13 <td width="20px"><% $document->{sorder} %>&nbsp;<a
    13 <td width="20px"><% $document->{sorder} %>&nbsp;<a class="move-up" data-id="<% $document->id %>"
    14 14 href="document_move.html?id=<% $document->{id} %>&move=up&s=<% $id %><% $params_unsection ? '&'.$params_unsection : '' %>"><img
    15 src="/contenido/i/ico-up-9x10.gif" border=0 alt="Переместить документ на шаг вверх"></a>&nbsp;<a
    15 src="/contenido/i/ico-up-9x10.gif" border=0 alt="Переместить документ на шаг вверх"></a>&nbsp;<a class="move-down" data-id="<% $document->id %>"
    16 16 href="document_move.html?id=<% $document->{id} %>&move=down&s=<% $id %><% $params_unsection ? '&'.$params_unsection : '' %>"><img
    17 17 src="/contenido/i/ico-down-9x10.gif" border=0 alt="Переместить документ на шаг вниз"></a>\
    18 18 %
     
    56 56 %
    57 57 % } elsif ( exists $col->{inline} && $col->{inline} ) {
    58 58 % my $attr = $col->{attr};
    59 % if ( $col->{type} =~ /^(string|integer|float)$/ && $col->{inline} ) {
    59 % my $type = exists $col->{inline_type} ? $col->{inline_type} : $col->{type};
    60 % if ( $type =~ /^(string|integer|float)$/ && $col->{inline} ) {
    60 61 % my $style = $col->{inline_style} ? $col->{inline_style} : ($col->{type} =~ /^(integer|float)$/ ? 'text-align:right; ' : '' );
    61 62 % $style .= $col->{inline_width} ? ' width:'.$col->{inline_width}.'px; ' : ' width:65px; ';
    62 63 <td><input type="text" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr |h %>" style="<% $style %>">
    63 % } elsif ($col->{type} eq 'checkbox') {
    64 % } elsif ($type eq 'checkbox') {
    64 65 % my $checked = $document->$attr ? ' checked' : '';
    65 66 <td align="center"><input type="checkbox" class="<% $attr %>-check" name="<% 'update_'.$document->id.'_'.$attr %>"<% $checked %>>
    66 % } elsif ($col->{type} eq 'text') {
    67 % } elsif ($type eq 'text') {
    67 68 % my $style = $col->{inline_style} ? $col->{inline_style} : '';
    68 69 % $style .= $col->{inline_width} ? ' width:'.$col->{inline_width}.'px; ' : ' width:100px; ';
    69 70 % $style .= $col->{inline_height} ? ' width:'.$col->{inline_height}.'px; ' : ' height:70px; ';
     
    73 74 % s/>/&gt;/sgi;
    74 75 % }
    75 76 <td><textarea name="<% 'update_'.$document->id.'_'.$attr %>" style="<% $style %>"><% $value %></textarea>
    76 % } elsif ($col->{type} eq 'select') {
    77 % } elsif ($type eq 'select') {
    77 78 % my $options = {};
    78 79 % if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$document->class}))) {
    79 80 % %{ $options } = %{ $toopi->{$document->class} };
     
    87 88 % }
    88 89 % }
    89 90 </select>
    90 % } elsif ($col->{type} eq 'status') {
    91 % } elsif ($type eq 'status') {
    91 92 % my $cases = $col->{cases};
    92 93 % if ( ref $cases eq 'ARRAY' ) {
    93 94 <td><select name="<% 'update_'.$document->id.'_'.$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : '' %> <% $col->{inline_style} || '' %>" autocomplete="off">
     
    97 98 % }
    98 99 </select>
    99 100 % }
    100 % } elsif ($col->{type} eq 'pickup' || $col->{type} eq 'autocomplete') {
    101 % } elsif ($type eq 'pickup' || $type eq 'autocomplete') {
    101 102 % my %opts = %{ $col->{lookup_opts} };
    102 103 % my $doc;
    103 104 % if ( $document->$attr ) {
     
    108 109 title="<% defined $document->$attr ? 'Значение: '.$document->$attr : '' %>"
    109 110 rel="<% 'update_'.$document->id.'_'.$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : '' %> <% $col->{inline_style} || '' %>"
    110 111 old-value="<% (ref $doc ? $doc->name : '') |h %>" onfocus="" onblur="">
    111 % } elsif ($col->{type} eq 'lookup') {
    112 % } elsif ($type eq 'lookup') {
    112 113 % my %opts = %{ $col->{lookup_opts} };
    113 114 % delete $opts{search_by} if exists $opts{search_by};
    114 115 % my $docs;
     
    139 140 %
    140 141 <td><% $document->class_name %>&nbsp;<font color="#999999">(<% $document->class %>)</font>\
    141 142 %
    142 % } elsif ($col->{type} eq 'datetime') {
    143 % } elsif ($type eq 'datetime') {
    143 144 %
    144 145 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{$col->{attr}} &>\
    145 146 %
     
    176 177 %
    177 178 % } else {
    178 179 % my $attr = $col->{attr};
    179 % if ($col->{type} eq 'date') {
    180 % if ($type eq 'date') {
    180 181 % my $date=$document->{$col->{attr}};
    181 182 % $date=~/(\d{4}-\d{2}-\d{2})/;
    182 183 <td nowrap align="right"><% $1 || '&nbsp;' %>\
    183 % } elsif ($col->{type} eq 'datetime') {
    184 % } elsif ($type eq 'datetime') {
    184 185 <td nowrap align="right"><% $document->{$col->{attr}} || '&nbsp;' %>\
    185 % } elsif ($col->{type} eq 'integer') {
    186 % } elsif ($type eq 'integer') {
    186 187 <td align="right"><% $document->{$col->{attr}} %>&nbsp;\
    187 % } elsif ($col->{type} eq 'lookup' || $col->{type} eq 'pickup' || $col->{type} eq 'autocomplete') {
    188 % } elsif ($type eq 'lookup' || $type eq 'pickup' || $type eq 'autocomplete') {
    188 189 <td align="left">\
    189 190 % my $id = $document->{$col->{attr}};
    190 191 % if ($id) {
     
    197 198 % } else {
    198 199 <span class="hiddensect">NULL</span>\
    199 200 % }
    200 % } elsif ($col->{type} eq 'checkbox') {
    201 % } elsif ($type eq 'checkbox') {
    201 202 <td align="center"><% $document->$attr ? '<img src="/contenido/i/checked-16x16.png" width="16" height="16">' : '&nbsp;' %>\
    202 % } elsif ($col->{type} eq 'status') {
    203 % } elsif ($type eq 'status') {
    203 204 % my $status_map = ref $col->{cases} eq 'ARRAY' ? $col->{cases} : $keeper->default_status();
    204 205 % my ($doc_status) = grep { $_->[0] eq $document->{$col->{attr}} } @$status_map;
    205 206 % $doc_status ||= [$document->{$col->{attr}}, 'Неизвестный'];