[%# which one is authorized? #%]
[% IF !c.check_cmd_permissions('servicegroup', c.request.parameters.servicegroup) %]
  [% 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 disable notifications for all services in a particular servicegroup'
   description = 'This command is used to prevent notifications from being sent out for all services in the specified servicegroup. You will have to re-enable notifications for all services in this servicegroup before any alerts can be sent out in the future. This <i>does not</i> prevent notifications from being sent out about the hosts in this servicegroup unless you check the "Disable for hosts too" option.'
%]

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

    [% IF c.request.parameters.ahas %]
        DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS;[% sprintf("%s",servicegroup_name) %]
    [% END +%]
    DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS;[% sprintf("%s",servicegroup_name) %]
[% END %]

[%# definition of the html form data #%]
[% PROCESS _cmd_parts.tt %]
  [% PROCESS cmd_form_servicegroup %]
  [% PROCESS cmd_form_ahas name="Disable" %]

[% END %]
[% END %]
