% if ( $context eq 'facil' ) { Комплектация ЗАКАЗА % } elsif ( $context eq 'post' ) { Доставка ЗАКАЗА % } else { Просмотр и редактирование ЗАКАЗА % }

% if ( $context eq 'facil' ) { % } elsif ( $context eq 'post' ) { % } else { % } % if ( ref $filter_params eq 'HASH' ) { % while ( my ($key, $value) = each %$filter_params ) { % next if grep { $_->{attr} eq $key } $object->structure(); % } % }
<%perl> my @properties = $object->structure(); for (0..$#properties) { my $prop = $properties[$_]; my $field = $prop->{attr}; next if ($prop->{hidden} == 1) || ($prop->{type} eq 'external'); if ( $context eq 'facil' ) { next unless $prop->{$context.'show'} || $prop->{$context."edit"}; } elsif ( $context eq 'post' ) { next unless $prop->{$context.'show'} || $prop->{$context."edit"}; } else { next if $prop->{manager_hidden}; } % if ( ($context && $prop->{$context.'show'}) || $prop->{manshow} ) { % if ( exists $prop->{lookup_opts} ) { % my $doc = $keeper->get_document_by_id( $object->$field, class => $prop->{lookup_opts}{class} ); % } elsif ( $prop->{type} eq 'status' ) { % my ($case) = grep { $_->[0] == $object->$field } @{$prop->{cases}}; % } else { % } % } else { % if ($prop->{type} eq 'parent') { % } elsif( ( $prop->{type} ne 'flag' ) && ($prop->{type} ne 'checkbox') ) { % } % } % }
% if( ( $prop->{type} eq 'flag' ) || ($prop->{type} eq 'checkbox') ) { % } % if( $prop->{readonly} ) { % }
<& "/contenido/components/inputs/checkbox.msn", prop => $prop, object=>$object, options=>$options, name => $prop->{attr}, check => $object->{$prop->{attr}}, id => $object->id() &><% $prop->{rusname} %> /  name="<% $prop->{attr} %>" / Значение нельзя изменить
<% $doc->name %>
<% ref $case ? $case->[1] : 'Значение: '.$object->$field.'' %>
<% $object->$field %>
<& "/contenido/components/inputs/$prop->{type}.msn", prop => $prop, object=>$object, options=>$options, name => $prop->{attr}, check => ($object->{$prop->{attr} } || $prop->{default} || $sect_id ), id => $object->id() &>
<& "/contenido/components/inputs/$prop->{type}.msn", prop => $prop, object=>$object, options => $options, name => $prop->{attr}, check => $object->{$prop->{attr}}, id => ($object->id() || 0) &>

% for (0..$#properties) { % my $prop = $properties[$_]; % next if ($prop->{hidden} != 1); % } %#если класса в свойствах обьекта нет все равно надо его пробросить как hidden % unless (grep {$_->{attr} eq 'class'} @properties) { % }
<% spacer(w=>270) %>

Список позиций в заказе:

<& /contenido/webshop/components/order_list.msn, order => $object, filter_params => $filter_params, context => $context &>
<%ARGS> $proto => 'documents' $object => undef $context => undef $sect_id => 1 $filter_params => undef <%ONCE> my $PROTOS = { 'documents' => ['документа','document.html','документу','документе'], 'sections' => ['секции','section.html','секции','секции'], 'links' => ['связи','link.html','связи','связи'], 'users' => ['пользователя','users.html','пользователю','пользователе'], }; <%INIT> return undef unless ref($object); my $action = $context eq 'facil' ? 'facility.html' : $context eq 'post' ? 'delivery.html' : 'take_care.html'; my $toopi = $project->$proto(); my $options = {}; if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{ $object->class }))) { %{ $options } = %{ $toopi->{ $object->class } }; }