<form action="index.php?module=settings&amp;event=EscalationSettings" method="post" name="hm" id="hm-Settings-Escalation" enctype="multipart/form-data" class="form-horizontal form-label-left">
    <input type="hidden" name="hmescalation" value="0" />

    <input type="hidden" name="storeEscalationSettings" value="1" />
    <input type="hidden" name="task" value="escalation" />

    <div class="row">
        <div class="col-12">
            <div class="card panel-info shadow-sm rounded">
                <div class="card-body">
                    <div class="btn-group">
                        <input type="reset" class="btn btn-outline-secondary" value="[% $user->gettext('Reset') %]" />
                        <input type="submit" class="btn btn-outline-secondary" value="[% $user->gettext('&Auml;nderungen speichern') %]" />
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="card panel-info shadow-sm rounded">
                <div class="card-header">
                    <h3 class="card-title">[% $user->gettext('Supportzeiten') %]</h3>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table"  >
                            <thead>       
                                <tr>
                                <th><label>[% $user->gettext('Wochentage') %]</label></th>
                                <th [% if $SupporttimeErrors[0] %]class="error" title="[% $SupporttimeErrors[0] %]"[% /if %]>[% $user->gettext('Mo') %]</th>
                                <th [% if $SupporttimeErrors[1] %]class="error" title="[% $SupporttimeErrors[1] %]"[% /if %]>[% $user->gettext('Di') %]</th>
                                <th [% if $SupporttimeErrors[2] %]class="error" title="[% $SupporttimeErrors[2] %]"[% /if %]>[% $user->gettext('Mi') %]</th>
                                <th [% if $SupporttimeErrors[3] %]class="error" title="[% $SupporttimeErrors[3] %]"[% /if %]>[% $user->gettext('Do') %]</th>
                                <th [% if $SupporttimeErrors[4] %]class="error" title="[% $SupporttimeErrors[4] %]"[% /if %]>[% $user->gettext('Fr') %]</th>
                                <th [% if $SupporttimeErrors[5] %]class="error" title="[% $SupporttimeErrors[5] %]"[% /if %]>[% $user->gettext('Sa') %]</th>
                                <th [% if $SupporttimeErrors[6] %]class="error" title="[% $SupporttimeErrors[6] %]"[% /if %]>[% $user->gettext('So') %]</th>
                                </tr>
                                </thead>
                                <tbody>

                                    <tr>
                                        <td>[% $user->gettext('Ist Supporttag') %]</td>
                                        <td><input type="checkbox" name="weekday[1]" value="1" [% if $escalation.days[0] %]checked="checked"[% /if %]/></td>
                                        <td><input type="checkbox" name="weekday[2]" value="1" [% if $escalation.days[1] %]checked="checked"[% /if %] /></td>
                                        <td><input type="checkbox" name="weekday[3]" value="1" [% if $escalation.days[2] %]checked="checked"[% /if %] /></td>
                                        <td><input type="checkbox" name="weekday[4]" value="1" [% if $escalation.days[3] %]checked="checked"[% /if %] /></td>
                                        <td><input type="checkbox" name="weekday[5]" value="1" [% if $escalation.days[4] %]checked="checked"[% /if %] /></td>
                                        <td><input type="checkbox" name="weekday[6]" value="1" [% if $escalation.days[5] %]checked="checked"[% /if %] /></td>
                                        <td><input type="checkbox" name="weekday[7]" value="1" [% if $escalation.days[6] %]checked="checked"[% /if %] /></td>
                                    </tr>
                                    <tr>
                                        <td>[% $user->gettext('Uhrzeit') %] [% $user->gettext('von') %]</td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[1]" value="[% $escalation.start.0 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[2]" value="[% $escalation.start.1 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[3]" value="[% $escalation.start.2 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[4]" value="[% $escalation.start.3 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[5]" value="[% $escalation.start.4 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[6]" value="[% $escalation.start.5 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from[7]" value="[% $escalation.start.6 %]" class="form-control" />
                                        </td>

                                    </tr>
                                    <tr class="addPause" id="PauseStart" [% if !$Tools->FCS_Count($escalation.stop2) %] style="display:none;"[% /if %]>
                                        <td>[% $user->gettext('Uhrzeit') %] [% $user->gettext('bis') %]</td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[1]" value="[% $escalation.stop2.0 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[2]" value="[% $escalation.stop2.1 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[3]" value="[% $escalation.stop2.2 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[4]" value="[% $escalation.stop2.3 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[5]" value="[% $escalation.stop2.4 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[6]" value="[% $escalation.stop2.5 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to2[7]" value="[% $escalation.stop2.6 %]" class="form-control" />
                                        </td>

                                    </tr>
                                    <tr>
                                        <td colspan="8" style="text-align: center;" id="PauseZeile"><input type="button" id="showPausenBtn" class="button button-green addPause" value="[% $user->gettext('Pausen hinzufügen') %]" [% if $Tools->FCS_Count($escalation.stop2) %]style="display:none"[% /if %]/> <span class="addPause" [% if !$Tools->FCS_Count($escalation.stop2) %]style="display:none"[% /if %]> [% $user->gettext('Pause') %]</span></td>
                                    </tr>
                                    <tr class="addPause" id="PauseEnde" [% if !$Tools->FCS_Count($escalation.stop2) %] style="display:none;"[% /if %]>
                                        <td>[% $user->gettext('Uhrzeit') %] [% $user->gettext('von') %]</td>

                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[1]" value="[% $escalation.start2.0 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[2]" value="[% $escalation.start2.1 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[3]" value="[% $escalation.start2.2 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[4]" value="[% $escalation.start2.3 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[5]" value="[% $escalation.start2.4 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[6]" value="[% $escalation.start2.5 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_from2[7]" value="[% $escalation.start2.6 %]" class="form-control" />
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>[% $user->gettext('Uhrzeit') %] [% $user->gettext('bis') %]</td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[1]" value="[% $escalation.stop.0 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[2]" value="[% $escalation.stop.1 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[3]" value="[% $escalation.stop.2 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[4]" value="[% $escalation.stop.3 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[5]" value="[% $escalation.stop.4 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[6]" value="[% $escalation.stop.5 %]" class="form-control" />
                                        </td>
                                        <td>
                                            <input type="text" size="5" maxlength="5" name="time_to[7]" value="[% $escalation.stop.6 %]" class="form-control" />
                                        </td>
                                    </tr>
                                </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="card panel-info shadow-sm rounded">
                <div class="card-header">
                    <h3 class="card-title">[% $user->gettext('E-Mail-Benachrichtigung') %]</h3>
                </div>
                <div class="card-body">
                    <div class="form-group row mb-3">
                        <label class="col-lg-6 control-label">[% $user->gettext('Eskalation per E-Mail melden') %]</label>
                        <div class="col-lg-6">
                            <input type="radio" value="1" id="escalationmailing_on" name="escalationmailing" [% if $smarty.const.ESCALATIONMAILING == 1 %]checked="checked"[% /if %]/> [% $user->gettext('ja') %]
                            <input type="radio" value="0" id="escalationmailing_off"name="escalationmailing" [% if $smarty.const.ESCALATIONMAILING != 1 %]checked="checked"[% /if %]/> [% $user->gettext('nein') %]
                        </div>
                    </div>
                    <div class="form-group row mb-3">
                        <label class="col-lg-6 control-label">[% $user->gettext('Eskalationsmeldungen immer an folgende Adresse senden') %]</label>
                        <div class="col-lg-6">
                            <input type="radio" value="1" name="escalationmaster" [% if $smarty.const.ESCALATIONMASTER == 1 %]checked="checked"[% /if %]/> [% $user->gettext('ja') %]
                            <input type="radio" value="0" name="escalationmaster" [% if $smarty.const.ESCALATIONMASTER != 1 %]checked="checked"[% /if %]/> [% $user->gettext('nein') %]
                        </div>
                    </div>
                    <div class="form-group row mb-3">
                        <label class="col-lg-6 control-label">[% $user->gettext('E-Mail') %]</label>
                        <div class="col-lg-6">
                            <input type="text" name="escalationmail" value="[% $smarty.const.ESCALATIONMAIL %]" class="form-control" size="50" maxlength="255" />
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <div class="col-lg-6">

            <div class="panel-group" id="EscalationTypeAccordion" role="tablist" aria-multiselectable="true">           

                <!--EscCatDepends-->
                <div class="card panel-info shadow-sm rounded">
                    <div class="card-header" role="tab" id="headingEscCatDepends">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#DEACTIVEEscalationTypeAccordion" href="#EscCatDependsPanel" aria-expanded="false" aria-controls="collapseContact">
                            <div class="row">
                                <div class="col-7">
                                    <h4 class="card-title">
                                        [% $user->gettext('Kategorieabhängige Eskalation') %]
                                    </h4>
                                </div>
                                <div class="col-5">

                                </div>
                            </div>
                        </a>
                    </div>
                    <div id="EscCatDependsPanel" class="panel-collapse collapse [% if $smarty.const.CATEGORY_ESCALATION == 1 %]in[% /if %]" role="tabpanel" aria-labelledby="headingEscCatDepends">
                        <div class="card-body">
                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label" for="category">[% $user->gettext('Aktivieren') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" value="1" id="category_on" name="category" [% if $smarty.const.CATEGORY_ESCALATION == 1 %]checked="checked"[% /if %] /> [% $user->gettext('ja') %]
                                    <input type="radio" value="0" id="category_off" name="category" [% if $smarty.const.CATEGORY_ESCALATION != 1 %]checked="checked"[% /if %] /> [% $user->gettext('nein') %]
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!--EscTypeLifetime-->
                <div id="escalation_simple" class="card panel-info shadow-sm rounded" style="display:[% if $smarty.const.CATEGORY_ESCALATION != 1 %]block[% else %]none[% /if %]">
                    <div class="card-header" role="tab" id="headingEscTypeLifetime">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#DEACTIVEEscalationTypeAccordion" href="#EscTypeLifetimePanel" aria-expanded="false" aria-controls="collapseContact">
                            <div class="row">
                                <div class="col-7">
                                    <h4 class="card-title">
                                        [% $user->gettext('Eskalation nach Liegezeit') %]
                                    </h4>
                                </div>
                                <div class="col-5">

                                </div>
                            </div>
                        </a>
                    </div>
                    <div id="EscTypeLifetimePanel" class="panel-collapse collapse [% if $smarty.const.SIMPLE_ESCALATION == 1 %]in[% /if %]" role="tabpanel" aria-labelledby="headingEscTypeLifetime">
                        <div class="card-body">

                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label">[% $user->gettext('Aktivieren') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" value="1" name="simple" [% if $smarty.const.SIMPLE_ESCALATION == 1 %]checked="checked"[% /if %]/> [% $user->gettext('ja') %]
                                    <input type="radio" value="0" name="simple" [% if $smarty.const.SIMPLE_ESCALATION != 1 %]checked="checked"[% /if %]/> [% $user->gettext('nein') %]
                                </div>
                            </div>
                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label">[% $user->gettext('Einheitliche Eskalationsregel') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" value="0" id="priority_on" name="priority" [% if $smarty.const.PRIORITY_ESCALATION != 1 %]checked="checked"[% /if %]/> [% $user->gettext('ja') %]
                                    <input type="radio" value="1" id="priority_off" name="priority" [% if $smarty.const.PRIORITY_ESCALATION == 1 %]checked="checked"[% /if %]/> [% $user->gettext('nein') %]
                                </div>
                            </div>

                            <div class="form-group row mb-3">
                                <label class="col-lg-6 control-label">[% $user->gettext('Eintritt der Eskalationsstufen nach Minuten') %]</label>
                                <div class="col-lg-8">
                                    <span class="help-block">[% $user->gettext('nach Beginn der vorherigen Eskalationsstufe') %]</span>
                                </div>
                            </div>


                            <div class="form-group row mb-3 priority_off" onclick="document.getElementById('rowX').style.display = 'none';">

                                <label class="col-lg-2 control-label">[% $user->gettext('Einheitliche Regel:') %]</label>

                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">1.</div><input type="form-control" name="step1" value="[% $escalation.steps[0] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">2.</div><input type="form-control" name="step2" value="[% $escalation.steps[1] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">3.</div><input type="form-control" name="step3" value="[% $escalation.steps[2] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">4.</div><input type="form-control" name="step4" value="[% $escalation.steps[3] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">5.</div><input type="form-control" name="step5" value="[% $escalation.steps[4] %]" maxlength="5" class="form-control" /></div>
                                </div>
                            </div>


                            <div class="form-group row mb-3 priority_on">
                                <label class="col-lg-2 control-label">[% $Prios[1] %]</label>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">1.</div><input type="form-control" name="priority_low_step1" value="[% $escalation.priority_low_steps[0] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">2.</div><input type="form-control" name="priority_low_step2" value="[% $escalation.priority_low_steps[1] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">3.</div><input type="form-control" name="priority_low_step3" value="[% $escalation.priority_low_steps[2] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">4.</div><input type="form-control" name="priority_low_step4" value="[% $escalation.priority_low_steps[3] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">5.</div><input type="form-control" name="priority_low_step5" value="[% $escalation.priority_low_steps[4] %]" maxlength="5" class="form-control" /></div>
                                </div>
                            </div>

                            <div class="form-group row mb-3 priority_on">
                                <label class="col-lg-2 control-label">[% $Prios[2] %]</label>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">1.</div><input type="form-control" name="priority_medium_step1" value="[% $escalation.priority_medium_steps[0] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">2.</div><input type="form-control" name="priority_medium_step2" value="[% $escalation.priority_medium_steps[1] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">3.</div><input type="form-control" name="priority_medium_step3" value="[% $escalation.priority_medium_steps[2] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">4.</div><input type="form-control" name="priority_medium_step4" value="[% $escalation.priority_medium_steps[3] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">5.</div><input type="form-control" name="priority_medium_step5" value="[% $escalation.priority_medium_steps[4] %]" maxlength="5" class="form-control" /></div>
                                </div>
                            </div>

                            <div class="form-group row mb-3 priority_on">
                                <label class="col-lg-2 control-label">[% $Prios[3] %]</label>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">1.</div><input type="form-control" name="priority_high_step1" value="[% $escalation.priority_high_steps[0] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">2.</div><input type="form-control" name="priority_high_step2" value="[% $escalation.priority_high_steps[1] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">3.</div><input type="form-control" name="priority_high_step3" value="[% $escalation.priority_high_steps[2] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">4.</div><input type="form-control" name="priority_high_step4" value="[% $escalation.priority_high_steps[3] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">5.</div><input type="form-control" name="priority_high_step5" value="[% $escalation.priority_high_steps[4] %]" maxlength="5" class="form-control" /></div>
                                </div>
                            </div>

                            <div class="form-group row mb-3 priority_on">
                                <label class="col-lg-2 control-label">[% $Prios[4] %]</label>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">1.</div><input type="form-control" name="priority_urgent_step1" value="[% $escalation.priority_urgent_steps[0] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">2.</div><input type="form-control" name="priority_urgent_step2" value="[% $escalation.priority_urgent_steps[1] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">3.</div><input type="form-control" name="priority_urgent_step3" value="[% $escalation.priority_urgent_steps[2] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">4.</div><input type="form-control" name="priority_urgent_step4" value="[% $escalation.priority_urgent_steps[3] %]" maxlength="5" class="form-control" /></div>
                                </div>
                                <div class="col-lg-2">
                                    <div class="input-group"><div class="input-group-text">5.</div><input type="form-control" name="priority_urgent_step5" value="[% $escalation.priority_urgent_steps[4] %]" maxlength="5" class="form-control" /></div>
                                </div>
                            </div>                                
                        </div>
                    </div>
                </div>

                <!--EscSpecialRules-->
                <div class="card panel-info shadow-sm rounded">
                    <div class="card-header" role="tab" id="headingEscSpecialRules">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#DEACTIVEEscalationTypeAccordion" href="#EscSpecialRulesPanel" aria-expanded="false" aria-controls="collapseContact">
                            <div class="row">
                                <div class="col-7">
                                    <h4 class="card-title">
                                        [% $user->gettext('Besondere Eskalationsregeln') %]
                                    </h4>
                                </div>
                                <div class="col-5">

                                </div>
                            </div>
                        </a>
                    </div>
                    <div id="EscSpecialRulesPanel" class="panel-collapse collapse [% if $smarty.const.EXTRA_NOTIF_ESCALATION == 1 %]in[% /if %]" role="tabpanel" aria-labelledby="headingEscSpecialRules">
                        <div class="card-body">


                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label">[% $user->gettext('Aktivieren') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" value="1" id="extra_notif_on" name="extra_notif" [% if $smarty.const.EXTRA_NOTIF_ESCALATION == 1 %]checked="checked"[% /if %]/> [% $user->gettext('ja') %]
                                    <input type="radio" value="0" id="extra_notif_off" name="extra_notif" [% if $smarty.const.EXTRA_NOTIF_ESCALATION != 1 %]checked="checked"[% /if %]/> [% $user->gettext('nein') %]
                                </div>
                            </div>

                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label">[% $user->gettext('Diese Emails auch versenden, wenn Mailversand für Eskalation deaktiviert') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" name="extra_notif_email_active" value="1" [% if $smarty.const.EXTRA_NOTIF_EMAIL_ACTIVE == 1 %]checked="checked"[% /if %] />[% $user->gettext('Ja') %] &nbsp;
                                    <input type="radio" name="extra_notif_email_active" value="0" [% if $smarty.const.EXTRA_NOTIF_EMAIL_ACTIVE != 1 %]checked="checked"[% /if %] /> [% $user->gettext('Nein') %]
                                    <span class="help-block">[% $user->gettext('Wenn der Mailversand generell aktiviert, aber für die Eskalation deaktiviert ist, kann hier eingestellt werden, das für Stufe 4 und 5 dennoch die Benachrichtigungen versand werden.') %]</span>            
                                </div>
                            </div>


                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label">[% $user->gettext('Ticketsupporter ebenfalls benachrichtigen') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" name="EXTRA_NOTIF_SUPPORTER_ACTIVE" value="1" [% if $smarty.const.EXTRA_NOTIF_SUPPORTER_ACTIVE == 1 %]checked="checked"[% /if %] />[% $user->gettext('Ja') %] &nbsp;
                                    <input type="radio" name="EXTRA_NOTIF_SUPPORTER_ACTIVE" value="0" [% if $smarty.const.EXTRA_NOTIF_SUPPORTER_ACTIVE != 1 %]checked="checked"[% /if %] /> [% $user->gettext('Nein') %]
                                    <span class="help-block">[% $user->gettext('Wenn diese Einstellung gesetzt ist, wird der eingetragene Supporter oder die Mitglieder der eingetragenen Gruppe eines Tickets bei erreichen der Stufe 4 und 5 ebenfalls benachrichtigt.') %]</span>            
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table">
                                    <tr class="">
                                        <td colspan="5"><label>[% $user->gettext('Zus&auml;tzliche Benachrichtigung ab') %]</label></td>
                                    </tr>

                                    <tr class="">
                                        <td></td>
                                        <td colspan="2"><label>[% $user->gettext('Eskalationsstufe 4') %] </label></td>
                                        <td colspan="2"><label>[% $user->gettext('Eskalationsstufe 5') %] </label></td>
                                    </tr>

                                    <tr class="" onclick="document.getElementById('rowX').style.display = 'none';">
                                        <td></td>
                                        <td>[% $user->gettext('E-Mail-Adresse') %]</td>
                                        <td>[% $user->gettext('Gruppe') %]</td>
                                        <td>[% $user->gettext('E-Mail-Adresse') %]</td>
                                        <td>[% $user->gettext('Gruppe') %]</td>
                                    </tr>

                                    <tr class=" priority_on"  id="ExtraNotifNoPrio" onclick="document.getElementById('rowX').style.display = 'none';">
                                        <td>[% $user->gettext('Einheitliche Regel:') %]</td>
                                        <td>
                                            <input type="form-control" name="extra_email_level4" value="[% $smarty.const.EXTRA_NOTIF_EMAIL_LEVEL4 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_defgroup_level4" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_GROUP_LEVEL4 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                        <td>
                                            <input type="form-control" name="extra_email_level5" value="[% $smarty.const.EXTRA_NOTIF_EMAIL_LEVEL5 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_defgroup_level5" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_GROUP_LEVEL5 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                    </tr>



                                    <tr class=" priority_off">
                                        <td>[% $Prios[1] %]</td>
                                        <td>
                                            <input type="form-control" name="extra_email_low_level4" value="[% $smarty.const.EXTRA_NOTIF_LOW_EMAIL_LEVEL4 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_low_level4" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_LOW_GROUP_LEVEL4 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                        <td>
                                            <input type="form-control" name="extra_email_low_level5" value="[% $smarty.const.EXTRA_NOTIF_LOW_EMAIL_LEVEL5 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_low_level5" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_LOW_GROUP_LEVEL5 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                    </tr>
                                    <tr class=" priority_off">
                                        <td>[% $Prios[2] %]</td>
                                        <td>
                                            <input type="form-control" name="extra_email_medium_level4" value="[% $smarty.const.EXTRA_NOTIF_MEDIUM_EMAIL_LEVEL4 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_medium_level4" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_MEDIUM_GROUP_LEVEL4 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                        <td>
                                            <input type="form-control" name="extra_email_medium_level5" value="[% $smarty.const.EXTRA_NOTIF_MEDIUM_EMAIL_LEVEL5 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_medium_level5" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_MEDIUM_GROUP_LEVEL5 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                    </tr>
                                    <tr class=" priority_off">
                                        <td>[% $Prios[3] %]</td>
                                        <td>
                                            <input type="form-control" name="extra_email_high_level4" value="[% $smarty.const.EXTRA_NOTIF_HIGH_EMAIL_LEVEL4 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_high_level4" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_HIGH_GROUP_LEVEL4 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                        <td>
                                            <input type="form-control" name="extra_email_high_level5" value="[% $smarty.const.EXTRA_NOTIF_HIGH_EMAIL_LEVEL5 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_high_level5" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_HIGH_GROUP_LEVEL5 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                    <tr class=" priority_off">
                                        <td>[% $Prios[4] %]</td>
                                        <td>
                                            <input type="form-control" name="extra_email_urgent_level4" value="[% $smarty.const.EXTRA_NOTIF_URGENT_EMAIL_LEVEL4 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_urgent_level4" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_URGENT_GROUP_LEVEL4 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                        <td>
                                            <input type="form-control" name="extra_email_urgent_level5" value="[% $smarty.const.EXTRA_NOTIF_URGENT_EMAIL_LEVEL5 %]" size="18" maxlength="255" class="form-control" />
                                        </td>
                                        <td>
                                            <select size="1" name="extra_group_urgent_level5" class="form-control">
                                                [% foreach from=$Groups item=group %]
                                                    <option value="[% $group.group_id %]" [% if $smarty.const.EXTRA_NOTIF_URGENT_GROUP_LEVEL5 == $group.group_id %]selected="selected"[% /if %]>[% $group.name %]</option>
                                                [% /foreach %]
                                            </select>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>    
                            </div>

                        </div>
                    </div>
                </div>           

                <!--EscTypeDesiretime-->
                <div class="card panel-info shadow-sm rounded" id="escalation_desire" style="display:[% if $smarty.const.CATEGORY_ESCALATION != 1 %]block[% else %]none[% /if %]">
                    <div class="card-header" role="tab" id="headingEscTypeDesiretime">
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#DEACTIVEEscalationTypeAccordion" href="#EscTypeDesiretimePanel" aria-expanded="false" aria-controls="collapseContact">
                            <div class="row">
                                <div class="col-7">
                                    <h4 class="card-title">
                                        [% $user->gettext('Eskalation nach F&auml;lligkeitstermin') %]
                                    </h4>
                                </div>
                                <div class="col-5">

                                </div>
                            </div>
                        </a>
                    </div>
                    <div id="EscTypeDesiretimePanel" class="panel-collapse collapse [% if $smarty.const.DESIREDATE_ESCALATION == 1 %]in[% /if %]" role="tabpanel" aria-labelledby="headingEscTypeDesiretime">
                        <div class="card-body">

                            <div class="form-group row mb-3">
                                <label class="col-lg-4 control-label">[% $user->gettext('Aktivieren') %]</label>
                                <div class="col-lg-8">
                                    <input type="radio" id="desire_on" value="1" name="desire" [% if $smarty.const.DESIREDATE_ESCALATION == 1 %]checked="checked"[% /if %]/> [% $user->gettext('ja') %]
                                    <input type="radio" id="desire_off" value="0" name="desire" [% if $smarty.const.DESIREDATE_ESCALATION != 1 %]checked="checked"[% /if %]/> [% $user->gettext('nein') %]
                                </div>
                            </div>
                            <div class="form-group row mb-3 escalation_desire_row">
                                <label class="col-lg-4 control-label">[% $user->gettext('Minuten vor Termin') %]</label>
                                <div class="col-lg-8">
                                    <input type="form-control" name="desirediff" value="[% $smarty.const.DESIREDIFF %]" size="5" maxlength="5" class="form-control" />
                                </div>
                            </div>
                            <div class="form-group row mb-3 escalation_desire_row">
                                <label class="col-lg-4 control-label">[% $user->gettext('Zeit bis zur n&auml;chsten Eskalation') %]</label>
                                <div class="col-lg-8">
                                    <input type="form-control" name="desireinterval" value="[% $smarty.const.DESIREINTERVAL %]" size="5" maxlength="5" class="form-control" />
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</form>

<script>
<!--


    $(document).ready(function () {

    [% if $smarty.const.EXTRA_NOTIF_ESCALATION == 1 %]
        $(".extra_notif").show();
    [% else %]
        $(".extra_notif").hide();
    [% /if %]

        $("input[name='extra_notif']").on("change", function () {
            if ($("input[name='extra_notif']:checked").val() == 1) {
                $(".extra_notif").show();
            } else {
                $(".extra_notif").hide();
            }

            if ($("input[name='priority']:checked").val() == 1) {
                $(".priority_off").hide();
            } else {
                $(".priority_on").hide();
            }
        });

    [% if $smarty.const.PRIORITY_ESCALATION == 1 %]
        $(".priority_off").hide();
        $(".priority_on").show();
    [% else %]
        $(".priority_off").show();
        $(".priority_on").hide();
    [% /if %]

    [% if $smarty.const.EXTRA_NOTIF_ESCALATION == 1 %]
        $(".extra_notif").show();
    [% else %]
        $(".extra_notif").hide();
    [% /if %]
        
        $("input[name='priority']").on("change", function () {
            if ($("input[name='priority']:checked").val() == 1) {
                $(".priority_off").hide();
                $(".priority_on").show();
            } else {
                $(".priority_off").show();
                $(".priority_on").hide();
            }

            if ($("input[name='extra_notif']:checked").val() == 1) {
                if ($("input[name='priority']:checked").val() == 1) {
                    $(".extra_notif").filter('.priority_on').show();
                } else {
                    $(".extra_notif").filter('.priority_on').hide();
                }
            } else {
                $(".extra_notif").hide();
            }
        });

        $("#category_off").on("change", function () {
            $("#escalation_simple").show();
            $("#escalation_desire").show();
        });
        $("#category_on").on("change", function () {
            $("#escalation_simple").hide();
            $("#escalation_desire").hide();
        });

        if ($("input[name='desire']:checked").val() == 1) {
            $(".escalation_desire_row").show();
        } else {
            $(".escalation_desire_row").hide();
        }

        $("#desire_on").on("change", function () {
            $(".escalation_desire_row").show();
        });
        $("#desire_off").on("change", function () {
            $(".escalation_desire_row").hide();
        });

        if ($("input[name='extra_notif']:checked").val() == 1 && $("input[name='priority']:checked").val() == 1) {
            $("#ExtraNotifNoPrio").show();
        } else {
            $("#ExtraNotifNoPrio").hide();
        }
    });

    $("#showPausenBtn").on("click", function () {
        $(".addPause").toggle();
    });
// -->
</script>

<!-- Component Settings  - Costs.tpl end -->

