# --
# AdminDynamicFieldText.dtl - provides HTML form for AdminDynamicFieldsText
# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
# --
# $Id: AdminDynamicFieldText.dtl,v 1.21 2011/11/09 00:12:33 cr 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.
# --

<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1>$Text{"Dynamic Fields"} - $Text{"$Data{"ObjectTypeName"}"}: $Text{"$Data{"Mode"}"} $Text{"$Data{"FieldTypeName"}"} $Text{"Field"}</h1>

    <div class="Clear"></div>

    <div class="SidebarColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Actions"}</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
                    <li>
                        <a href="$Env{"Baselink"}Action=AdminDynamicField" class="CallForAction"><span>$Text{"Go back to overview"}</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="ContentColumn">
        <form action="$Env{"CGIHandle"}" method="post" class="Validate PreventMultipleSubmits">
            <input type="hidden" name="Action" value="AdminDynamicFieldText" />
            <input type="hidden" name="Subaction" value="$QData{"Mode"}Action" />
            <input type="hidden" name="ObjectType" value="$QData{"ObjectType"}" />
            <input type="hidden" name="FieldType" value="$QData{"FieldType"}" />
            <input type="hidden" name="ID" value="$QData{"ID"}" />

            <div class="WidgetSimple">
                <div class="Header">
                    <h2>$Text{"General"}</h2>
                </div>
                <div class="Content">
                    <div class="LayoutGrid ColumnsWithSpacing">
                        <div class="Size1of2">
                            <fieldset class="TableLike">
                                <label class="Mandatory" for="Name"><span class="Marker">*</span> $Text{"Name"}:</label>
                                <div class="Field">
                                    <input id="Name" class="W50pc $QData{"NameServerError"} $QData{"ShowWarning"}  Validate_Alphanumeric" type="text" maxlength="200" value="$QData{"Name"}" name="Name"/>
                                    <div id="NameError" class="TooltipErrorMessage"><p>$Text{"This field is required, and the value should be alphabetic and numeric characters only."}</p></div>
                                    <div id="NameServerError" class="TooltipErrorMessage"><p>$Text{"$Data{"NameServerErrorMessage"}"}</p></div>
                                    <p class="FieldExplanation">$Text{"Must be unique and only accept alphabetic and numeric characters."}</p>
                                    <p class="Warning Hidden">$Text{"Changing this value will require manual changes in the system."}</p>
                                </div>
                                <div class="Clear"></div>

                                <label class="Mandatory" for="Label"><span class="Marker">*</span> $Text{"Label"}:</label>
                                <div class="Field">
                                    <input id="Label" class="W50pc $QData{"LabelServerError"} Validate_Required" type="text" maxlength="200" value="$QData{"Label"}" name="Label"/>
                                    <div id="LabelError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                                    <div id="LabelServerError" class="TooltipErrorMessage"><p>$Text{"$Data{"LabelServerErrorMessage"}"}</p></div>
                                    <p class="FieldExplanation">$Text{"This is the name to be shown on the screens where the field is active."}</p>
                                </div>
                                <div class="Clear"></div>

                                <label class="Mandatory" for="FieldOrder"><span class="Marker">*</span> $Text{"Field order"}:</label>
                                <div class="Field">
                                    $Data{"DynamicFieldOrderSrtg"}
                                    <div id="FieldOrderError" class="TooltipErrorMessage"><p>$Text{"This field is required and must be numeric."}</p></div>
                                    <div id="FieldOrderServerError" class="TooltipErrorMessage"><p>$Text{"$Data{"FieldOrderServerErrorMessage"}"}</p></div>
                                    <p class="FieldExplanation">$Text{"This is the order in which this field will be shown on the screens where is active."}</p>
                                </div>
                                <div class="Clear"></div>
                            </fieldset>
                        </div>
                        <div class="Size1of2">
                            <fieldset class="TableLike">
                                <label for="ValidID">$Text{"Validity"}:</label>
                                <div class="Field">
                                    $Data{"ValidityStrg"}
                                </div>
                                <div class="Clear"></div>

                                <div class="SpacingTop"></div>
                                <label for="FieldTypeName">$Text{"Field type"}:</label>
                                <div class="Field">
                                    <input id="FieldTypeName" readonly="readonly" class="W50pc" type="text" maxlength="200" value="$QData{"FieldTypeName"}" name="FieldTypeName"/>
                                    <div class="Clear"></div>
                                </div>

                                <div class="SpacingTop"></div>
                                <label for="ObjectTypeName">$Text{"Object type"}:</label>
                                <div class="Field">
                                    <input id="ObjectTypeName" readonly="readonly" class="W50pc" type="text" maxlength="200" value="$QData{"ObjectTypeName"}" name="ObjectTypeName"/>
                                    <div class="Clear"></div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
            <div class="WidgetSimple">
                <div class="Header">
                    <h2>$Text{"$Data{"FieldTypeName"}"} $Text{"Field Settings"}</h2>
                </div>
                <div class="Content">
                    <fieldset class="TableLike">
<!-- dtl:block:ColsRowsValues -->
                        <label for="Rows">$Text{"Number of rows"}:</label>
                        <div class="Field">
                            <input id="Rows" class="W25pc Validate_Number $Data{"RowsServerError"}" type="text" maxlength="3" value="$QData{"Rows"}" name="Rows"/>
                            <div id="RowsError" class="TooltipErrorMessage"><p>$Text{"This field must be numeric."}</p></div>
                            <div id="RowsServerError" class="TooltipErrorMessage"><p>$Text{"$Data{"RowsServerErrorMessage"}"}</p></div>
                            <p class="FieldExplanation">$Text{"Specify the height (in lines) for this field in the edit mode."}</p>
                        </div>
                        <div class="Clear"></div>
                        <label for="Cols">$Text{"Number of cols"}:</label>
                        <div class="Field">
                            <input id="Cols" class="W25pc Validate_Number $Data{"ColsServerError"}" type="text" maxlength="3" value="$QData{"Cols"}" name="Cols"/>
                            <div id="ColsError" class="TooltipErrorMessage"><p>$Text{"This field must be numeric."}</p></div>
                            <div id="ColsServerError" class="TooltipErrorMessage"><p>$Text{"$Data{"ColsServerErrorMessage"}"}</p></div>
                            <p class="FieldExplanation">$Text{"Specify the width (in characters) for this field in the edit mode."}</p>
                        </div>
                        <div class="Clear"></div>
<!-- dtl:block:ColsRowsValues -->


                        <label for="DefaultValue">$Text{"Default value"}:</label>
                        <div class="Field">
<!-- dtl:block:DefaultValueText -->
                            <input id="DefaultValue" class="W50pc" type="text" maxlength="200" value="$QData{"DefaultValue"}" name="DefaultValue"/>
<!-- dtl:block:DefaultValueText -->
<!-- dtl:block:DefaultValueTextArea -->
                            <textarea id="DefaultValue" class="W50pc" rows="10" cols="60" name="DefaultValue">$QData{"DefaultValue"}</textarea>
<!-- dtl:block:DefaultValueTextArea -->
                            <p class="FieldExplanation">$Text{"This is the default value for this field."}</p>
                        </div>
                        <div class="Clear"></div>
<!-- dtl:block:Link -->
                        <label for="Link">$Text{"Show link"}:</label>
                        <div class="Field">
                            <input id="Link" class="W50pc" type="text" maxlength="500" value="$QData{"Link"}" name="Link"/>
                            <p class="FieldExplanation">
                                $Text{"Here you can specify an optional HTTP link for the field value in Overviews and Zoom screens."}
                                <br/>
                                $Text{"Example"}: http://some.example.com/handle?query=<span>$</span>LQData{"Field1"}
                            </p>
                        </div>
                        <div class="Clear"></div>
<!-- dtl:block:Link -->
                    </fieldset>
                </div>
            </div>
            <fieldset class="TableLike">
                <div class="Field SpacingTop">
                    <button type="submit" class="Primary" value="$Text{"Save"}">$Text{"Save"}</button>
                    $Text{"or"}
                    <a href="$Env{"Baselink"}Action=AdminDynamicField">$Text{"Cancel"}</a>
                </div>
                <div class="Clear"></div>
            </fieldset>
        </form>
    </div>
</div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
$('.ShowWarning').bind('change keyup', function (Event) {
    $('p.Warning').removeClass('Hidden');
});

Core.Agent.Admin.DynamicField.ValidationInit();
//]]></script>
<!--dtl:js_on_document_complete-->
