-
order_browse.msn
269 270 48 48 <td><span<% $style %> class="<% $document->status ? '':'hiddensect' %>"><% $a1.$document->id.$a2 %></span></td> 49 49 % 50 50 % for my $col (@$columns) { 51 % if ($col->{attr} eq 'dtime') { 51 % my $attr = $col->{attr}; 52 % if ($attr eq 'dtime') { 52 53 % 53 54 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{dtime} &>\ 54 55 % if ($document->{ctime} ne $document->{mtime}) { … … 56 57 <div style="color:<% $colortime %>;"><& "/contenido/components/show_dtime.msn", dtime=>$document->{mtime} &></div>\ 57 58 % } 58 59 % 59 % } elsif ($col->{attr} eq 'name') { 60 % } elsif ($attr eq 'name') { 60 61 <td><span<% $style %> class="<% $document->status ? '':'hiddensect' %>">\ 61 62 % 62 63 % my $name=$document->name ? $document->name : 'Безымянный документ N'.$document->id; … … 64 65 % 65 66 </span>\ 66 67 % 67 % } elsif ($col->{attr} eq 'id') { 68 % } elsif ($attr eq 'id') { 68 69 % 69 70 <td><span class="<% $document->status ? '':'hiddensect' %>">\ 70 71 % if ($document_access == 2) { … … 76 77 % 77 78 % } elsif ( exists $col->{inline} && $col->{inline} ) { 78 79 % $inline_status = 1; 79 % my $attr = $col->{attr}; 80 80 % if ( $col->{type} =~ /^(string|integer|float)$/ && $col->{inline} ) { 81 81 % my $style = $col->{inline_style} ? $col->{inline_style} : ($col->{type} =~ /^(integer|float)$/ ? 'text-align:right; ' : '' ); 82 82 <td><input type="text" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : 'width:65px; ' %> <% $col->{inline_style} || '' %>"> … … 88 88 % if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$document->class}))) { 89 89 % %{ $options } = %{ $toopi->{$document->class} }; 90 90 % } 91 % my $values = $options->{$col->{attr}}; 91 % my $values = $options->{$attr}; 92 92 <td><select name="<% 'update_'.$document->id.'_'.$attr %>"> 93 93 % if ( ref $values eq 'ARRAY' ) { 94 94 % foreach my $val ( @$values ) { … … 109 109 % } 110 110 % } 111 111 % 112 % } elsif ($col->{attr} eq 'class') { 112 % } elsif ($attr eq 'class') { 113 113 % 114 114 <td><% $document->class_name %> <font color="#999999">(<% $document->class %>)</font>\ 115 115 % 116 116 % } elsif ($col->{type} eq 'datetime') { 117 117 % 118 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{$col->{attr}} &>\ 118 <td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->$attr &>\ 119 119 % 120 % } elsif ($col->{attr} eq '_act_') { 120 % } elsif ($attr eq '_act_') { 121 121 % my $actions; 122 122 % if ( $document->$user_id == $user->id ) { 123 123 % $actions = join (' | ', map { '<a href="./'.$_->{href}.'?id='.$document->id.($params_unclassed ? '&'.$params_unclassed : '').'">'.$_->{name}.'</a>' } @actions); … … 144 144 % } else { 145 145 % 146 146 % if ($col->{type} eq 'date') { 147 % my $date=$document->{$col->{attr}}; 147 % my $date=$document->$attr; 148 148 % $date=~/(\d{4}-\d{2}-\d{2})/; 149 149 <td nowrap align="right"><% $1 || ' ' %>\ 150 150 % } elsif ($col->{type} eq 'datetime') { 151 <td nowrap align="right"><% $document->{$col->{attr}} || ' ' %>\ 151 <td nowrap align="right"><% $document->$attr || ' ' %>\ 152 152 % } elsif ($col->{type} eq 'integer') { 153 <td align="right"><% $document->{$col->{attr}} %> \ 153 <td align="right"><% $document->$attr %> \ 154 154 % } elsif ($col->{type} eq 'lookup') { 155 155 <td align="left">\ 156 % my $id = $document->{$col->{attr}}; 156 % my $id = $document->$attr; 157 157 % if ($id) { 158 158 % my ($doc)=$keeper->get_documents( ( ref($col->{lookup_opts}) ? %{$col->{lookup_opts}} : () ), id=>$id); 159 159 % if ($doc) { 160 <a href="document.html?id=<% $doc->id %>&class=<% $doc->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>"><% $doc->name || $doc->id %></a> \ 160 <a href="/contenido/document.html?id=<% $doc->id %>&class=<% $doc->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>"><% $doc->name || $doc->id %></a> \ 161 161 % } else { 162 <span class="hiddensect"><% $document->{$col->{attr}} %>???</span>\ 162 <span class="hiddensect"><% $document->$attr %>???</span>\ 163 163 % } 164 164 % } else { 165 165 <span class="hiddensect">NULL</span>\ 166 166 % } 167 167 % } elsif ($col->{type} eq 'status') { 168 168 % my $status_map = ref $col->{cases} eq 'ARRAY' ? $col->{cases} : $keeper->default_status(); 169 % my ($doc_status) = grep { $_->[0] eq $document->{$col->{attr}} } @$status_map; 170 % $doc_status ||= [$document->{$col->{attr}}, 'Неизвестный']; 169 % my ($doc_status) = grep { $_->[0] eq $document->$attr } @$status_map; 170 % $doc_status ||= [$document->$attr, 'Неизвестный']; 171 171 <td nowrap><% $doc_status->[1].'('.$doc_status->[0].')' %>\ 172 172 % } else { 173 <td><% defined($document->{$col->{attr}}) ? $document->{$col->{attr}} : ' ' %>\ 173 <td><% defined($document->$attr) ? $document->$attr : ' ' %>\ 174 174 % } 175 175 % } 176 176 </td>