# --
# AgentStatsEditSpecification.dtl - provides HTML form for stats edit mask
# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
# --
# $Id: AgentStatsEditSpecification.dtl,v 1.37 2011-10-28 16:28:37 en 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:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    //Check if the GraphSize List must be enabled when page loads
    Core.Agent.Stats.FormatGraphSizeRelation();
//]]></script>
<!-- dtl:js_on_document_complete -->

<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1>$Text{"Edit"}: $Text{"$Config{"Stats::StatsHook"}"} $QData{"StatNumber"}</h1>

    <div class="Center">
        <ul id="ProgressBar" class="ProgressBarElements4 SpacingTop SpacingBottom">
            <li class="Highlighted Active NoLink First">
                <span>
                    <a href="#">$Text{"Step %s", "1"}<span>$Text{"General Specifications"}</span></a>
                </span>
            </li>
            <li>
                <span>
                    <a href="#">$Text{"Step %s", "2"}<span>$Text{"Select the element that will be used at the X-axis"}</span></a>
                </span>
            </li>
            <li>
                <span>
                    <a href="#">$Text{"Step %s", "3"}<span>$Text{"Select the elements for the value series"}</span></a>
                </span>
            </li>
            <li>
                <span>
                    <a href="#">$Text{"Step %s", "4"}<span>$Text{"Select the restrictions to characterize the stat"}</span></a>
                </span>
            </li>
        </ul>
    </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"}$Env{"LastStatsOverview"}" class="CallForAction"><span>$Text{"Go to overview"}</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="ContentColumn">


        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"General Specifications"} (1/4)</h2>
            </div>
            <div class="Content">

                <form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" name="compose" class="Validate">
                    <input type="hidden" name="Action"    value="$Env{"Action"}"/>
                    <input type="hidden" name="Subaction" value="Action"/>
                    <input type="hidden" name="Home"      value="EditSpecification"/>
                    <input type="hidden" name="StatID"    value="$QData{"StatID"}"/>

                    <fieldset class="TableLike">

                        <label class="Mandatory" for="Title">
                            <span class="Marker">*</span>
                            $Text{"Title"}:
                        </label>
                        <div class="Value">
                            <input type="text" name="Title" id="Title" class="W50pc Validate_Required" value="$QData{"Title"}"/>
                            <div id="TitleError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label class="Mandatory" for="Description">
                            <span class="Marker">*</span>
                            $Text{"Description"}:
                        </label>
                        <div class="Value">
                            <textarea name="Description" id="Description" rows="4" cols="60" class="W50pc Validate_Required">$QData{"Description"}</textarea>
                            <div id="DescriptionError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

<!-- dtl:block:Selection -->
                        <label class="Mandatory">
                            <span class="Marker">*</span>
<!-- dtl:block:RadioButton -->
                            <input type="radio" name="StatType" value="$QData{"StateType"}"/>
                            $Text{"$Data{"Name"}"}:
<!-- dtl:block:RadioButton -->
<!-- dtl:block:NoRadioButton -->
                            <input type="hidden" name="StatType" value="$QData{"StateType"}"/>
                            $Text{"$Data{"Name"}"}:
<!-- dtl:block:NoRadioButton -->
                        </label>
                        <div class="Field">
<!-- dtl:block:SelectField -->
                            $Data{"SelectField"}
<!-- dtl:block:SelectField -->
<!-- dtl:block:Selected -->
                            <input type="hidden" name="$QData{"SelectedKey"}" value="$QData{"Selected"}"/>
                            $Text{"$Data{"SelectedName"}"}
<!-- dtl:block:Selected -->
                        </div>
<!-- dtl:block:Selection -->
                        <div class="Clear"></div>

                        <label class="Mandatory" for="Permission">
                            <span class="Marker">*</span>
                            $Text{"Permissions"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectPermission"}
                            <p class="FieldExplanation">
                                $Text{"You can select one or more groups to define access for different agents."}
                            </p>
                            <div id="ValueError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label class="Mandatory" for="Format">
                            <span class="Marker">*</span>
                            $Text{"Result format"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectFormat"}
<!-- dtl:block:PackageUnavailableMsg -->
                            <p class="FieldExplanation">
                                $Text{"Some result formats are disabled because at least one needed package is not installed."}
                                $Text{"Please contact your administrator."}
                            </p>
<!-- dtl:block:PackageUnavailableMsg -->
                            <div id="FormatError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#Format').bind('change', function (Event) {
        Core.Agent.Stats.FormatGraphSizeRelation();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                        </div>
                        <div class="Clear"></div>

                        <label for="GraphSize">
                            $Text{"Graph size"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectGraphSize"}
                            <p class="FieldExplanation">
                                $Text{"If you use a graph as output format you have to select at least one graph size."}
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <label for="SumRow">
                            $Text{"Sum rows"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectSumRow"}
                        </div>
                        <div class="Clear"></div>

                        <label for="SumCol">
                            $Text{"Sum columns"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectSumCol"}
                        </div>
                        <div class="Clear"></div>

                        <label for="Cache">
                            $Text{"Use cache"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectCache"}
                            <p class="FieldExplanation">
                                $Text{"Most of the stats can be cached. This will speed up the presentation of this stat."}
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <label for="Valid">
                            $Text{"Validity"}:
                        </label>
                        <div class="Value">
                            $Data{"SelectValid"}
                            <p class="FieldExplanation">
                                $Text{"If set to invalid end users can not generate the stat."}
                            </p>
                        </div>
                        <div class="Clear"></div>

                        <div class="Field SpacingTop">
                            <button class="Primary" type="submit" name="Next" value="$Text{"Next..."}" accesskey="g" title="$Text{"Next..."} (g)">$Text{"Next..."}</button>
                        </div>
                        <div class="Clear"></div>
                    </fieldset>
                </form>
            </div>
        </div>
    </div>
</div>
