# --
# InstallerConfigureMail.dtl - provides the form for the Installer's mail configuration
# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
# --
# $Id: InstallerConfigureMail.dtl,v 1.20 2011/11/14 09:33:27 mab Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<!-- dtl:block:ConfigureMail-->
<div class="Center">
    <ul id="ProgressBar" class="ProgressBarElements5 SpacingTop SpacingBottom">
        <li class="Highlighted NoLink First">
            <span>
                <a href="#">$Text{"Step %s", "1"}<span>$Text{"License"}</span></a>
            </span>
        </li>
        <li class="Highlighted NoLink">
            <span>
                <a href="#">$Text{"Step %s", "2"}<span>$Text{"Database Settings"}</span></a>
            </span>
        </li>
        <li class="Highlighted Active NoLink">
            <span>
                <a href="#">$Text{"Step %s", "3"}<span>$Text{"General Specifications and Mail Settings"}</span></a>
            </span>
        </li>
        <li>
            <span>
                <a href="#">$Text{"Step %s", "4"}<span>$Text{"Registration"}</span></a>
            </span>
        </li>
        <li class="Last">
            <span>
                <a href="#">$Text{"Step %s", "5"}<span>$Text{"Finish"}</span></a>
            </span>
        </li>
    </ul>
</div>

<div class="W50pc SpacingTop SpacingBottom CenterBox">
    <form action="$Env{"CGIHandle"}" method="post" id="FormMail">
        <input type="hidden" name="Action" value="Installer"/>
        <input type="hidden" name="Subaction" value="Registration"/>
        <input type="hidden" name="Skip" value="0"/>

        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"$Data{"Item"}"} ($Data{"Step"})</h2>
            </div>

            <div class="Content">
                <fieldset class="TableLike">
                    <h4>
                        $Text{"Configure Outbound Mail"}
                    </h4>
                    <div class="Clear"></div>

                    <label for="OutboundMailType">$Text{"Outbound mail type"}:</label>
                    <div class="Field">
                        $Data{"OutboundMailType"}
                        $Data{"OutboundPorts"}
                        <p class="FieldExplanation">
                            $Text{"Select outbound mail type."}
                        </p>
                    </div>
                    <div class="Clear"></div>

                    <label for="SMTPPort">$Text{"Outbound mail port"}:</label>
                    <div class="Field">
                        <input type="text" id="SMTPPort" name="SMTPPort" value="$QData{"SMTPPort"}" class="W25pc"/>
                        <p class="FieldExplanation">
                            $Text{"Select outbound mail port."}
                        </p>
                    </div>
                    <div class="Clear"></div>
                </fieldset>

                <fieldset class="TableLike" id="InfoSMTP">
                    <label for="SMTPHost">$Text{"SMTP host"}:</label>
                    <div class="Field">
                        <input type="text" id="SMTPHost" name="SMTPHost" value="$QData{"SMTPHost"}" class="W33pc"/>
                        <p class="FieldExplanation">
                            $Text{"SMTP host."}
                        </p>
                    </div>
                    <div class="Clear"></div>

                    <label for="SMTPAuth">$Text{"SMTP authentication"}:</label>
                    <div class="Field">
                        <input type="checkbox" id="SMTPAuth" name="SMTPAuth"/>
                        <p class="FieldExplanation">
                            $Text{"Does your SMTP host need authentication?"}
                        </p>
                    </div>
                    <div class="Clear"></div>
                </fieldset>

                <fieldset class="TableLike Hidden" id="InfoSMTPAuth">
                    <label for="SMTPAuthUser">$Text{"SMTP auth user"}:</label>
                    <div class="Field">
                        <input type="text" id="SMTPAuthUser" name="SMTPAuthUser" value="$QData{"SMTPAuthUser"}" disabled="disabled" class="W33pc"/>
                        <p class="FieldExplanation">
                            $Text{"Username for SMTP auth."}
                        </p>
                    </div>
                    <div class="Clear"></div>

                    <label for="SMTPAuthPassword">$Text{"SMTP auth password"}:</label>
                    <div class="Field">
                        <input type="password" id="SMTPAuthPassword" name="SMTPAuthPassword" value="$QData{"SMTPAuthPassword"}" disabled="disabled" class="W33pc"/>
                        <p class="FieldExplanation">
                            $Text{"Password for SMTP auth."}
                        </p>
                    </div>
                    <div class="Clear"></div>
                </fieldset>

                <fieldset class="TableLike">
                    <h4>
                        $Text{"Configure Inbound Mail"}
                    </h4>
                    <div class="Clear"></div>

                    <label for="InboundMailType">$Text{"Inbound mail type"}:</label>
                    <div class="Field">
                        $Data{"InboundMailType"}
                        <p class="FieldExplanation">
                            $Text{"Select inbound mail type."}
                        </p>
                    </div>
                    <div class="Clear"></div>

                    <label for="InboundHost">$Text{"Inbound mail host"}:</label>
                    <div class="Field">
                        <input type="text" id="InboundHost" name="InboundHost" value="$QData{"InboundHost"}" class="W33pc"/>
                        <p class="FieldExplanation">
                            $Text{"Inbound mail host."}
                        </p>
                    </div>
                    <div class="Clear"></div>

                    <label for="InboundUser">$Text{"Inbound mail user"}:</label>
                    <div class="Field">
                        <input type="text" id="InboundUser" name="InboundUser" value="$QData{"InboundUser"}" class="W33pc"/>
                        <p class="FieldExplanation">
                            $Text{"User for inbound mail."}
                        </p>
                    </div>
                    <div class="Clear"></div>

                    <label for="InboundPassword">$Text{"Inbound mail password"}:</label>
                    <div class="Field">
                        <input type="password" id="InboundPassword" name="InboundPassword" value="$QData{"InboundPassword"}" class="W33pc"/>
                        <p class="FieldExplanation">
                            $Text{"Password for inbound mail."}
                        </p>
                    </div>
                    <div class="Clear"></div>
                </fieldset>

                <fieldset class="TableLike Hidden ErrorMsg">
                    <h4>
                        $Text{"Result of mail configuration check"}
                    </h4>
                    <div class="Clear"></div>

                    <div class="Field">
                        <p class="Error" id="FormMailResultMessage"></p>
                    </div>
                    <div class="Clear"></div>

                </fieldset>
            </div>

            <div id="InstallerContinueWithJS" class="Spacing Right">
                <button class="Primary" type="button" id="ButtonCheckMail"  value="$Text{"Check mail configuration"}">$Text{"Check mail configuration"}</button>
                <button type="button" id="ButtonSkipMail" value="$Text{"Skip this step"}">$Text{"Skip this step"}</button>
            </div>
        </div>
    </form>
</div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#ButtonCheckMail').bind('click', Core.Installer.CheckMailConfig);
    $('#ButtonSkipMail').bind('click', function() {
        if (confirm("$JSText{"Skipping this step will automatically skip the registration of your OTRS. Are you sure you want to continue?"}")) {
            Core.Installer.SkipMailConfig();
        }
        return false;
    });
    $('#SMTPAuth').bind('change', function () {
        Core.Installer.CheckSMTPAuth($(this));
    });
    $('#OutboundMailType').bind('change', function () {
        Core.Installer.SelectOutboundMailType($(this));
    });
    $('#OutboundMailType').trigger('change');
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:ConfigureMail-->
