<%args> $type => undef $id => undef $filled => undef <& /service/open_form.mhtml, action => 'change_crr_invalidity_time.html' &> <& /lib/html/hidden.mhtml, 'name' => 'type', 'value' => $type &> <& /lib/html/hidden.mhtml, 'name' => 'id', 'value' => $id &> <& /lib/html/hidden.mhtml, 'name' => 'filled', 'value' => '1' &>

<% i18nGettext ('I18N_OPENXPKI_CLIENT_HTML_MASON_ACTIVITY_CHANGE_CRR_INVALIDITY_TIME_TITLE') %>

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_ACTIVITY_CHANGE_CRR_INVALIDITY_TIME_DESCRIPTION') %>

<& /lib/html/select_date.mhtml, 'epoch' => $time, 'prefix' => 'invalidity_', &> <& /service/send_form.mhtml &> <& /service/close_form.mhtml &> <& /service/create_csr/print_errors.mhtml, 'errors' => \@errors &> <%init> my @errors = (); my $time; if ($filled) { ## this is the second step - so we have a filled form my $new_dt = DateTime->new( year => $ARGS{'invalidity_year'}, month => $ARGS{'invalidity_month'}, day => $ARGS{'invalidity_day'}, hour => $ARGS{'invalidity_hour'}, minute => $ARGS{'invalidity_minute'}, ); ## send it to the server my $msg = $context->{client}->send_receive_command_msg( "execute_workflow_activity", { WORKFLOW => $type, ID => $id, ACTIVITY => "change_crr_invalidity_time", PARAMS => { "invalidity_time" => $new_dt->epoch(), }, }, ); if (exists $msg->{SERVICE_MSG} and $msg->{SERVICE_MSG} eq "ERROR") { @errors = $m->comp ('/lib/get_deep_error.mhtml', 'msg' => $msg); } else { return $m->comp ('/service/workflow/show_instance.html', 'msg' => $msg, 'type' => $type, 'id' => $id); } } ## this is the first step - so we have to prepare an HTML form if (not $filled) { ## load the workflow and extract the time my $msg = $context->{client}->send_receive_command_msg ( "get_workflow_info", { "WORKFLOW" => $type, "ID" => $id }, ); $time = $msg->{PARAMS}->{WORKFLOW}->{CONTEXT}->{invalidity_time}; } <%once> use DateTime;