Revision 198 (by ahitrov, 2012/03/15 18:29:29) Simple webshop support plugin
<& "/contenido/components/header.msn" &>

<style>
<!--
.inverted td { font-weight:bold; color:white; background-color:#8093B0; }
.inverted td a { color:white; font-weight:bold; }
//-->
</style>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr valign="top">
<td width="35%">

<& /contenido/webshop/components/block_order_status_changer.msn, status => $ost &>

</td>
<td width="1%">&nbsp;</td>
<td width="65%">

<fieldset>
<legend>Заказы со статусом "<span style="color:yellow"><% $current_status->[1] %></span>"</legend>

%	if ( $total ) {

<div style="font-size:75%; font-family:Arial;">
<& /inc/pages_.msn, p=>$p, n=>$size, total=>$total, params=>\%filter_params, &>
<div style="height:5px"><spacer type="block" height="5"></div>
</div>

<& /contenido/webshop/components/order_browse.msn, documents => \@documents, columns => \@columns, filter => \%filter_params, status => $ost, %ARGS &>

<div style="font-size:75%; font-family:Arial;">
<& /inc/pages_.msn, p=>$p, n=>$size, total=>$total, params=>\%filter_params, &>
<div style="height:5px"><spacer type="block" height="5"></div>
</div>

%	} else {
<h4 align="center"><i>---- Нет документов -----</i></h4>
%	}


</td>
<td width="1%">&nbsp;</td>
</tr>
</table>

</body>
</html>
<%args>

	$ost	=> 1
	$p	=> 1

</%args>
<%init>

    my %filter_params;

    my (@documents, $total);
    $filter_params{ost} = $ost		if $ost != 1;
    my $size = 40;

    @documents = $keeper->get_documents(
			class	=> 'webshop::Order',
			status	=> $ost,
			limit	=> $size,
			offset	=> ($p-1)*$size,
		);
    $total = $keeper->get_documents(
			class	=> 'webshop::Order',
			status	=> $ost,
			count	=> 1,
		);
    my @structure = webshop::Order->new( $keeper->{webshop} )->structure;
    my @columns = sort { $a->{column} <=> $b->{column} }
			grep { $_->{column} } @structure;
    push @columns, {attr => '_act_', rusname => 'Действия'};
    my ($status_map) = grep { $_->{attr} eq 'status' } @structure;
    my ($current_status) = grep { $_->[0] == $ost } @{$status_map->{cases}};

</%init>