[% UNLESS c.request.parameters.service %]
    [%# which one is authorized? #%]
    [% IF !c.check_cmd_permissions('host', c.request.parameters.host) %]
      [% WRAPPER error.tt errorMessage = "you are not authorized for this command" errorDescription = "check your configuration if you believe this is an error" %][% END %]
    [% ELSE %]

    [%# description used by the commands page #%]
    [% WRAPPER $cmd_tt
       request     = 'You are requesting to delete all downtimes for a host'
       description = 'This command is used to delete all downtimes associated with the specified host.'
    %]

    [%# definition of the command send to your backend #%]
    [% BLOCK action%]
        [% host_name            = c.request.parameters.host %]
    [% END %]

    [%# definition of the html form data #%]
    <tr class="hidden"><td colspan=2><input type='text' name='active_downtimes' value='1'></td></tr>
    <tr class="hidden"><td colspan=2><input type='text' name='future_downtimes' value='2'></td></tr>
    <tr><td class='optBoxRequiredItem'>Host Name:</td><td><b><input type='text' name='host' value='[% c.request.parameters.host %]'></b></td></tr>

    [% END %]
    [% END %]

[% ELSE %]

    [%# which one is authorized? #%]
    [% IF !c.check_cmd_permissions('service', c.request.parameters.service, c.request.parameters.host) %]
      [% WRAPPER error.tt errorMessage = "you are not authorized for this command" errorDescription = "check your configuration if you believe this is an error" %][% END %]
    [% ELSE %]

    [%# description used by the commands page #%]
    [% WRAPPER $cmd_tt
       request     = 'You are requesting to delete all downtimes for a service'
       description = 'This command is used to delete all downtimes associated with the specified service.'
    %]

    [%# definition of the command send to your backend #%]
    [% BLOCK action%]
        [% host_name            = c.request.parameters.host %]
        [% service_desc         = c.request.parameters.service %]
    [% END %]

    [%# definition of the html form data #%]
    <tr class="hidden"><td colspan=2><input type='text' name='active_downtimes' value='1'></td></tr>
    <tr class="hidden"><td colspan=2><input type='text' name='future_downtimes' value='2'></td></tr>
    <tr><td class='optBoxRequiredItem'>Host Name:</td><td><b><input type='text' name='host' value='[% c.request.parameters.host %]'></td></tr>
    <tr><td class='optBoxRequiredItem'>Service:</td><td><b><input type='text' name='service' value='[% c.request.parameters.service %]'></b></td></tr>

    [% END %]
    [% END %]

[% END %]
