<%args>
    $workflow_type => undef
</%args>
<& /service/open_form.mhtml &>
<h1><% i18nGettext ('I18N_OPENXPKI_CLIENT_HTML_MASON_CREATE_CRR_GET_WORKFLOW_TYPE_TITLE') %></h1>
<p>
  <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_CREATE_CRR_GET_WORKFLOW_TYPE_DESCRIPTION') %>
</p>
<p>
<& /lib/html/select.mhtml,
   'name'    => "workflow_type",
   'default' => [ $workflow_type ],
   'values'  => [ @types ] &>
</p>
<& /service/send_form.mhtml &>
<& /service/close_form.mhtml &>
<dl>

<%init>
    ## define the available workflow types
    my @types = ("I18N_OPENXPKI_WF_TYPE_CERTIFICATE_REVOCATION_REQUEST",
                 "I18N_OPENXPKI_WF_TYPE_CERTIFICATE_REVOCATION_REQUEST_OFFLINE_CA");

    ## return the role if it exists
    if (defined $workflow_type and
        grep /^$workflow_type$/, @types)
    {
        return $workflow_type;
    }

    ## if we have only one configuration
    ## then we have not to ask the user
    if (scalar @types == 1)
    {
        return $types[0];
    }

    ## ok, we have to ask the user
</%init>
