%args> $type => undef $id => undef $msg => undef $activities => undef %args> % if (! defined $type) { % $type = $context->{client}->send_receive_command_msg( % 'get_workflow_type_for_id', % { % ID => $id, % }, % )->{PARAMS}; % } % if ($type eq 'I18N_OPENXPKI_WF_TYPE_SCEP_REQUEST') {
<& /service/open_form.mhtml, 'action' => $context->{menu}->get_root()."/service/workflow/activity/$filename.html" &> <& /lib/html/hidden.mhtml, 'name' => 'type', 'value' => $type &> <& /lib/html/hidden.mhtml, 'name' => 'id', 'value' => $id &> <& /lib/html/hidden.mhtml, 'name' => 'context_hash', 'value' => $context_hash &> <& /lib/html/input.mhtml, 'type' => 'submit', 'value' => i18nGettext($action) &> <& /service/close_form.mhtml &> | % } % }
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_CREATOR') %>: | <& /lib/html/a.mhtml, target => $context->{menu}->get_root()."/service/workflow/show_pending_requests.html", params => [ [ 'creator', $creator ], [ 'show_approval_buttons', 1], ], label => $creator &> % if (defined $mail) { (mail) % } | ||||
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_TICKETS') %>: | % my $tickets = join(q{, }, @tickets); <% $tickets | n %> | ||||
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_WORKFLOW_LAST_UPDATE') %> | <% $last_update %> | ||||
<& '/lib/field_to_i18n.mhtml', 'field' => 'cert_role' &> % if (exists $sources->{'cert_role'} && $sources->{'cert_role'} ne 'USER') { (<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_SOURCE') %>: <% $sources->{'cert_role'} %>) % } / <& '/lib/field_to_i18n.mhtml', field => 'cert_profile' &> % if (exists $sources->{'cert_role'} && $sources->{'cert_profile'} ne 'USER') { (<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_SOURCE') %>: <% $sources->{'cert_profile'} %>) % } |
|
||||
<& '/lib/field_to_i18n.mhtml', 'field' => 'cert_subject' &> |
|
||||
<& '/lib/field_to_i18n.mhtml', field => 'cert_subject_alt_name' &> % if ($sources->{'cert_subject_alt_name_parts'} ne 'USER') { (<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_SOURCE') %>: <% $sources->{'cert_subject_alt_name_parts'} %>) % } % if (exists $actions{i18nGettext('I18N_OPENXPKI_WF_ACTION_CHANGE_CSR_SUBJECT_ALT_NAME')}) { <& /service/open_form.mhtml, 'action' => $context->{menu}->get_root()."/service/workflow/activity/change_csr_subject_alt_name.html" &> <& /lib/html/hidden.mhtml, 'name' => 'type', 'value' => $type &> <& /lib/html/hidden.mhtml, 'name' => 'id', 'value' => $id &> <& /lib/html/input.mhtml, 'type' => 'submit', 'value' => i18nGettext('I18N_OPENXPKI_HTML_MASON_CHANGE') &> <& /service/close_form.mhtml &> % } |
% foreach my $san (@sans) {
% if ($san->[0] =~ m{ \A DNS \z }xms) {
% if (! gethostbyname($san->[1])) {
<% $san->[0] %>: <% $san->[1] %> % } % else { <% $san->[0] %>: <% $san->[1] %> % } % } % else { <% $san->[0] %>: <% $san->[1] %> % } % } |
||||
<& '/lib/field_to_i18n.mhtml', field => $key &> | <% $cert_info{$key} %> |
<& /lib/html/a.mhtml, target => $context->{menu}->get_root()."/service/workflow/show_instance.html", params => [ [ 'id', $id ], [ 'type', $type ], ], label => i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_SHOW_CSR_BRIEF_DETAILED_LINK') &>
<%once> use Encode qw(encode decode); %once> <%init> if (not defined $msg or not ref $msg or not ref $msg eq "HASH") { if (! defined $type) { # type was not specified, get it from the server my $type_msg = $context->{client}->send_receive_command_msg( 'get_workflow_type_for_id', { 'ID' => $id, }, ); $type = $type_msg->{PARAMS}; } ## 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; } my $creator = $msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{creator}; my $mail; if ($creator =~ m{ \@ }xms) { # looks like an e-mail address, let's make it a link $mail = $creator; } my $last_update = $msg->{PARAMS}->{WORKFLOW}->{LAST_UPDATE}; $last_update =~ s{T}{ }xms; my $ser = OpenXPKI::Serialization::Simple->new(); my $sources = {}; my $sources_ser = $msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{sources}; if (defined $sources_ser && $sources_ser ne '') { $sources = $ser->deserialize($sources_ser); } my $subject = $msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{cert_subject}; if ($type eq 'I18N_OPENXPKI_WF_TYPE_SMARTCARD_PERSONALIZATION') { # Smartcard personalization workflow context has different structure my $cert_iss_data = OpenXPKI::Serialization::Simple->new()->deserialize($msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{cert_issuance_data}); my @subjects = map { $_->{'cert_subject'} } @{ $cert_iss_data }; $subject = join q{