# --
# InstallerRegistration.dtl - provides the Installer's form to register as an OTRS user
# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
# --
# $Id: InstallerRegistration.dtl,v 1.2 2011/12/08 07:59:25 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:Registration -->
<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 NoLink">
            <span>
                <a href="#">$Text{"Step %s", "3"}<span>$Text{"General Specifications and Mail Settings"}</span></a>
            </span>
        </li>
        <li class="Highlighted Active">
            <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="Registration">
        <input type="hidden" name="Action"    value="Installer"/>
        <input type="hidden" name="Subaction" value="Finish"/>
        <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">
                    <label for="Lastname" class="Mandatory"><span class="Marker">*</span> $Text{"Lastname"}:</label>
                    <div class="Field">
                        <input type="text" id="Lastname" name="Lastname" value="" class="W50pc"/>
                    </div>
                    <div class="Clear"></div>

                    <label for="Firstname" class="Mandatory"><span class="Marker">*</span> $Text{"Firstname"}:</label>
                    <div class="Field">
                        <input type="text" id="Firstname" name="Firstname" value="" class="W50pc"/>
                    </div>
                    <div class="Clear"></div>

                    <label for="Organization" class="Mandatory"><span class="Marker">*</span> $Text{"Organization"}:</label>
                    <div class="Field">
                        <input type="text" id="Organization" name="Organization" value="" class="W50pc"/>
                    </div>
                    <div class="Clear"></div>

                    <label for="Position">$Text{"Position"}:</label>
                    <div class="Field">
                        <input type="text" id="Position" name="Position" value="" class="W50pc"/>
                    </div>
                    <div class="Clear"></div>

                    <label for="Email" class="Mandatory"><span class="Marker">*</span> $Text{"Email"}:</label>
                    <div class="Field">
                        <input type="text" id="Email" name="Email" value="" class="W50pc"/>
                    </div>
                    <div class="Clear"></div>

                    <label for="Country">$Text{"Country"}:</label>
                    <div class="Field">
<!-- dtl:block:CountryStr -->
                        $Data{"CountryStr"}
<!-- dtl:block:CountryStr -->
<!-- dtl:block:CountryInput -->
                        <input type="text" id="Country" name="Country" value="" class="W50pc"/>
<!-- dtl:block:CountryInput -->
                    </div>
                    <div class="Clear"></div>

                    <label for="Phone">$Text{"Phone"}:</label>
                    <div class="Field">
                        <input type="text" id="Phone" name="Phone" value="" class="W50pc"/>
                    </div>
                    <div class="Clear"></div>
                </fieldset>

                <div class="Spacing Right">
                    <a href="#" id="ButtonSkipRegistration">$Text{"Skip this step"} $Text{"or"}</a>
                    <button class="Primary" type="submit" id="FormRegistrationSubmit" value="$Text{"Complete registration and continue"}">$Text{"Complete registration and continue"}</button>
                </div>
            </div>
        </div>
    </form>
</div>

<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#FormRegistrationSubmit').bind('click', function() {
        var MandatoryFieldsEmpty = 0;
        $.each($('form label.Mandatory'), function (key, value) {
            if ($('form input[name=' + $(this).attr('for') + ']').val() === '') {
                MandatoryFieldsEmpty = 1;
                return;
            }
        });
        if ( MandatoryFieldsEmpty === 1 ) {
            alert('$JSText{"Please fill in all fields marked as mandatory."}')
            return false;
        }
        $('#FormRegistrationSubmit').attr('disabled', 'disabled');
        $('form').submit();
    });
    $('#ButtonSkipRegistration').bind('click', Core.Installer.SkipRegistration);
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:Registration -->
