Line # Revision Author
1 195 ahitrov <& "/contenido/components/title.msn" &>
2 <div style="font:bold 13px Verdana; margin:4px;">�����: <span style="color:teal;"><% $class %></span>
3 <span style="font:11px Verdana;">(<a href="document.html?class=<% $class %>&<% $field %>=<% $id %>" target="_blank">������� �����</a>)</span></div>
4 % if ( ref $docs eq 'ARRAY' && @$docs ) {
5 % if ($total > $size) {
6 <div style="font-size:75%; font-family:Arial; text-align:center;">
7 <& /inc/pages_.msn, p => $p, n => $size, total => $total, params => {%ARGS} &></div>
8 % }
9 % my @props = sort { $a->{column} <=> $b->{column} } grep { exists $_->{column} } $docs->[0]->required_properties;
10 <table width="100%" border="0" cellpadding="4" cellspacing="0" class="tlistdocs">
11 <tr bgcolor="#efefef">
12 % foreach my $prop (@props) {
13 <th><% $prop->{rusname} %></th>
14 % }
15 </tr>
16 % foreach my $doc (@$docs) {
17 % my $color = $doc->contenido_status_style ? $doc->contenido_status_style :
18 % $doc->status == 1 ? 'blue' :
19 % $doc->status == 0 ? 'gray' : 'blue';
20
21 %# my ($stat) = grep { $_->{attr} eq 'status' } @props;
22 %# my ($case) = grep { $_->[0] == $banner->status } @{ $stat->{cases} } if ref $stat eq 'HASH' && exists $stat->{cases};
23 <tr>
24 % foreach my $prop (@props) {
25 % my $attr = $prop->{attr};
26 % if ( $attr =~ /dtime/ ) {
27 <td><a href="document.html?id=<% $doc->id %>&class=<% $doc->class %>"
28 style="<% $color %>" target="_blank"><& "/contenido/components/show_dtime.msn", dtime => $doc->$attr &></a></td>
29 % }else{
30 <td><a href="document.html?id=<% $doc->id %>&class=<% $doc->class %>"
31 style="<% $color %>" target="_blank"><% $doc->$attr %></a></td>
32 % }
33 % }
34 </tr>
35 % }
36 </table>
37 % }
38 %#<pre><% Dumper($docs->[0]->required_properties) %></pre>
39 <%args>
40 $id => undef
41 $filter => undef
42 $field => undef
43 $class => undef
44 $order_by => undef
45 $p => 1
46 </%args>
47 <%init>
48
49 my ($docs, $total);
50 my $size = 15;
51 if ( $id && $filter && $class ) {
52 my %opts = ();
53 $opts{$filter} = $id;
54 $opts{order_by} = $order_by if $order_by;
55 $docs = $keeper->get_documents (
56 class => $class,
57 return_mode => 'array_ref',
58 offset => ($p-1)*$size,
59 limit => $size,
60 %opts,
61 );
62 $total = $keeper->get_documents (
63 class => $class,
64 count => 1,
65 %opts,
66 );
67 } else {
68 return;
69 }
70
71 </%init>