<%args> $type => undef $context_key => undef $context_value => undef $notitle => undef $certificate_link => undef $limit => 20 $start => 1 $page => 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; % my $nr_of_results; % if (scalar @search_context > 0) { % my $params = { % 'CONTEXT' => \@search_context, % }; % if ($type) { % $params->{TYPE} = $type, % } % $nr_of_results = $context->{client}->send_receive_command_msg( % 'search_workflow_instances_count', % $params, % )->{PARAMS}; % $params->{LIMIT} = $limit, % my $page_info = $m->comp('/lib/paging.mhtml', % totalEntries => $nr_of_results, % entriesPerPage => $limit, % page => $page, % start => $start, % url => 'search_instances.html', % ); % if (defined $page_info) { % $params->{START} = $page_info->first - 1; % } % if ($params->{START} == -1) { % $params->{START} = 1; % } % $msg = $context->{client}->send_receive_command_msg % ( % "search_workflow_instances", % $params, % ); % } % if ($nr_of_results > 0) { # SEARCH RESULT % if (! $notitle) {

<% i18nGettext ('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SEARCH_INSTANCES_RESULT_TITLE') %>

% } % foreach my $instance (@{$msg->{PARAMS}}) # @{$msg->{PARAMS}}) % { % } # END FOREACH % } # END IF % elsif (! defined $nr_of_results) { # 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'}) %> % if ($certificate_link && $instance->{'WORKFLOW.WORKFLOW_TYPE'} eq 'I18N_OPENXPKI_WF_TYPE_CERTIFICATE_SIGNING_REQUEST' && ($instance->{'WORKFLOW.WORKFLOW_STATE'} eq 'SUCCESS' || $instance->{'WORKFLOW.WORKFLOW_STATE'} eq 'CHECK_CHILD_FINISHED')) { % # we have a CSR workflow with a potential certificate <& '/service/workflow/link_to_cert_by_csr_id.mhtml', id => $instance->{'WORKFLOW.WORKFLOW_SERIAL'}, label => '(' . i18nGettext('I18N_OPENXPKI_HTML_MASON_DOWNLOAD_CERTIFICATE') . ')', &> % } <% $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 &> % }