% foreach my $param (sort keys %{$msg->{PARAMS}->{WORKFLOW}->{CONTEXT}})
% {
% next if ($param eq "approvals" and length $msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{$param} == 0);
% next if ($param eq "cert_profile_id");
% if (exists $fields{$param}) {
<% i18nGettext($fields{$param}) %>
% } else {
<% i18nGettext($param) %>
% }
% my $value = $msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{$param};
% if ($value =~ /^(ARRAY|HASH|-----BEGIN)/)
% {
% ## serialized stuff
% my $ser = OpenXPKI::Serialization::Simple->new();
% my $ref = $ser->deserialize($value);
% if ($param eq "cert_info")
% {
% ## simple hash
% foreach my $key (sort keys %{$ref})
% {
<% $key %>::=<% $ref->{$key} %>
% }
% }
% elsif ($param eq "cert_subject_alt_name")
% {
% ## array of arrays
% foreach my $pair (@{$ref})
% {
% next if (not $pair); ## empty array
<% $pair->[0] %>::=<% $pair->[1] %>
% }
% }
% elsif ($param eq "approvals")
% {
% ## hash: user to role
% foreach my $user (sort keys %{$ref})
% {
% next if (not defined $user); ## empty hash
<% $user %>→<% $ref->{$user} %>
% }
% }
% else
% {
<% $value %>
% }
<%init>
if (not defined $msg or
not ref $msg or
not ref $msg eq "HASH")
{
## ok we have to get the info from the server
$msg = $context->{client}->send_receive_command_msg
(
"get_workflow_info",
{
"WORKFLOW" => $type,
"ID" => $id
}
);
}
else
{
## sometimes we have only the message
$id = $msg->{PARAMS}->{WORKFLOW}->{ID} if (not defined $id);
$type = $msg->{PARAMS}->{WORKFLOW}->{TYPE} if (not defined $type);
}
if (not defined $activities)
{
## ok we have to get the info from the server
## FIXME: this fails if type and id are undefined, id can
## be extracted from $msg, but what about type?
my $hmsg = $context->{client}->send_receive_command_msg
(
"get_workflow_activities",
{
"WORKFLOW" => $type,
"ID" => $id
}
);
$activities = $hmsg->{PARAMS};
}
my %actions = ();
foreach my $key (@{$activities})
{
## I hope that nobody will translate two actions with the same string
$actions{i18nGettext($key)} = $key;
}
%init>
<%once>
my %fields = (
"creator" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CREATOR",
"cert_role" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_CERT_ROLE",
"cert_profile" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_CERT_PROFILE",
"keygen" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_KEYGEN",
"cert_subject_style" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_CERT_SUBJECT_STYLE",
"cert_subject" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_CERT_SUBJECT",
"cert_subject_alt_name" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_CERT_SUBJECT_ALT_NAME",
"cert_info" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_CERT_INFO",
"csr_type" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_TYPE",
"spkac" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_SPKAC",
"pkcs10" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_PKCS10",
"approvals" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_APPROVALS",
"export_workflow_type" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_EXPORT_WORKFLOW_TYPE",
"export_destination" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_EXPORT_DESTINATION",
"export_params" => "I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_CSR_EXPORT_PARAMS",
);
%once>