<%args> $type => undef $context_key => undef $context_value => undef <%init> my @search_context; if (defined $context_key && defined $context_value) { for (my $i = 0; $i < scalar @{$context_key}; $i++) { if ($context_key->[$i] ne '') { push @search_context, { KEY => $context_key->[$i], VALUE => $context_value->[$i], }; } } } % my $msg; % if (scalar @search_context > 0 && defined $type && $type ne '') { % $msg = $context->{client}->send_receive_command_msg % ( % "search_workflow_instances", % { % CONTEXT => \@search_context, % TYPE => $type, % }, % ); % } % elsif (scalar @search_context > 0 && (!defined $type || $type eq '')) { % $msg = $context->{client}->send_receive_command_msg % ( % "search_workflow_instances", % { % CONTEXT => \@search_context, % }, % ); % } % if (defined $msg) { # SEARCH RESULT

<% i18nGettext ('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_RESULT_TITLE') %>

% foreach my $instance (@{$msg->{PARAMS}}) # @{$msg->{PARAMS}}) % { % } # END FOREACH % } # END IF % else { # SEARCH FORM % #### TODO: get all possible context keys (for type) from DB

<% i18nGettext ('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_FORM_TITLE') %>

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_FORM_DESCRIPTION') %>

<& /service/open_form.mhtml &> % my $msg = $context->{client}->send_receive_command_msg ("list_workflow_titles");
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_TYPE') %> <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SERIAL') %> <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_STATE') %> <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_LAST_UPDATE') %>
<% i18nGettext($instance->{'WORKFLOW.WORKFLOW_TYPE'}) %> <% $instance->{'WORKFLOW.WORKFLOW_SERIAL'} %> <% i18nGettext($instance->{'WORKFLOW.WORKFLOW_STATE'}) %> <% $instance->{'WORKFLOW.WORKFLOW_LAST_UPDATE'} %>
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_WORKFLOW_TYPE') %>
% if (!defined $type) { % $type = ''; % } % my $keys_msg = $context->{client}->send_receive_command_msg % ( % "list_context_keys", % { % 'WORKFLOW_TYPE' => $type % }, % );
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_FORM_KEY') %> <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_FORM_VALUE') %>
<& /lib/html/input.mhtml, 'name' => "context_value" &>
<& /lib/html/input.mhtml, 'name' => "context_value" &>
<& /lib/html/input.mhtml, 'name' => "context_value" &>
<& /lib/html/input.mhtml, 'name' => "context_value" &>

<& /service/send_form.mhtml &> <& /service/close_form.mhtml &> % }