web interface: reorder input fields in certificate search page
[openxpki.git] / trunk / clients / perl / OpenXPKI-Client-HTML-Mason / htdocs / service / workflow / create_instance.html
blobe8df8660f66341f955ba1f9b85310f9481e638cf
1 <%args>
2 $type => undef
3 </%args>
4 %#<& /service/open_form.mhtml &>
5 <h1><% i18nGettext ('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CREATE_INSTANCE_TITLE') %></h1>
6 <p>
7 <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CREATE_INSTANCE_DESCRIPTION') %>
8 </p>
9 % my $msg = $context->{client}->send_receive_command_msg ("list_workflow_titles");
10 % ## I expect the following:
11 % ## SERVICE_MSG => "COMMAND",
12 % ## COMMAND => $cmd,
13 % ## PARAMS => {$name => {description => $desc}, ... }
15 %#<select name="type">
16 %# foreach my $type (keys %{$msg->{PARAMS}})
17 %# {
18 %# <option value="<% $type %>">
19 %# <% i18nGettext($type) %>
20 %# </option>
21 %# }
22 %#</select>
23 %#<& /service/send_form.mhtml &>
24 %#<& /service/close_form.mhtml &>
25 <dl>
27 % foreach my $type (keys %{$msg->{PARAMS}})
28 % {
29 % next if (! grep {$_ eq $type} @optionless_workflows);
30 <dt>
31 <a href="create_instance.html?<% $context->{menu}->get_link_params() %>;type=<% $type %>">
32 <% i18nGettext($type) %>
33 </a>
34 </dt>
35 <dd><% i18nGettext($msg->{PARAMS}->{$type}->{description}) %></dd>
36 % }
37 </dl>
39 <%init>
40 # this is the list to filter the available workflows against.
41 # As it makes only sense to display workflows that have no options,
42 # show only the ones which you can create without input of data
43 my @optionless_workflows = qw(
44 I18N_OPENXPKI_WF_TYPE_CRL_ISSUANCE
46 if (defined $type)
48 my $msg = $context->{client}->send_receive_command_msg
50 "create_workflow_instance",
51 {"WORKFLOW" => $type}
53 if (exists $msg->{SERVICE_MSG} and
54 $msg->{SERVICE_MSG} eq "ERROR")
56 my $errors = [ $m->comp ('/lib/get_deep_error.mhtml', 'msg' => $msg) ];
57 return $m->comp ('/service/create_csr/print_errors.mhtml', 'errors' => $errors);
58 } else {
59 return $m->comp ('/service/workflow/show_instance.html', 'id' => $msg->{PARAMS}->{WORKFLOW}->{ID})
62 </%init>