[%# which one is authorized? #%]
[% IF !c.check_cmd_permissions('hostgroup', c.request.parameters.hostgroup) %]
  [% 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 enable notifications for all services in a particular hostgroup'
   description = 'This command is used to enable notifications for all services in the specified hostgroup. Notifications will only be sent out for the service state types you defined in your service definitions. This <i>does not</i> enable notifications for the hosts in this hostgroup unless you check the "Enable for hosts too" option.'
%]

[%# definition of the command send to your backend #%]
[% BLOCK action%]
    [% hostgroup_name       = c.request.parameters.hostgroup %]

    [% IF c.request.parameters.ahas %]
        ENABLE_HOSTGROUP_HOST_NOTIFICATIONS;[% sprintf("%s",hostgroup_name) %]
    [% END +%]
    ENABLE_HOSTGROUP_SVC_NOTIFICATIONS;[% sprintf("%s",hostgroup_name) %]
[% END %]

[%# definition of the html form data #%]
<tr><td class='optBoxRequiredItem'>Hostgroup Name:</td><td><b><input type='text' name='hostgroup' value='[% c.request.parameters.hostgroup %]'></b></td></tr>
<tr><td class='optBoxItem'>Enable For Hosts Too:</td><td><b><input type='checkbox' name='ahas'[% IF c.config.cmd_defaults.ahas %] checked[% END %]></b></td></tr>

[% END %]
[% END %]
