# --
# AdminGenericInterfaceMappingSimple.dtl - provides HTML form for AdminLog
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AdminGenericInterfaceMappingSimple.dtl,v 1.24.2.1 2012-05-11 12:32:57 mg 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 AdminGenericInterfaceMappingSimple">
    <h1>$Text{"GenericInterface Mapping Simple for Web Service %s", "$Data{"WebserviceName"}"}</h1>
    <div class="GenericInterfaceWebserviceConfigPath">
        <h3>
            $Config{"GenericInterface::Webservice::Path::Separator"}
            <a href="$Env{"Baselink"}Action=AdminGenericInterfaceWebservice">$Text{"Web Services"}</a>

            $Config{"GenericInterface::Webservice::Path::Separator"}
            <a href="$Env{"Baselink"}Action=AdminGenericInterfaceWebservice;Subaction=Change;WebserviceID=$QData{"WebserviceID"}">$QData{"WebserviceName"}</a>

            $Config{"GenericInterface::Webservice::Path::Separator"}
            <a href="$Env{"Baselink"}Action=$LQData{"ActionFrontendModule"};Subaction=Change;$LQData{"ActionType"}=$LQData{"Action"};WebserviceID=$LQData{"WebserviceID"}">$QData{"ActionType"} $QData{"Action"}</a>

            $Config{"GenericInterface::Webservice::Path::Separator"}
            $Text{"$Data{"MappingDirection"}"}
        </h3>
    </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=$LQData{"ActionFrontendModule"};Subaction=Change;$LQData{"ActionType"}=$LQData{"Action"};WebserviceID=$LQData{"WebserviceID"}" class="CallForAction">
                            <span>$Text{"Go back to"} $QData{"LowerCaseActionType"}</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="ContentColumn">

        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Mapping Simple"}</h2>
            </div>
            <div class="Content">
                <form action="$Env{"CGIHandle"}" method="post" class="Validate PreventMultipleSubmits">
                    <input type="hidden" name="Action" value="$Env{"Action"}"/>
                    <input type="hidden" name="Subaction" value="$QData{"Subaction"}Action"/>
                    <input type="hidden" name="WebserviceID" value="$QData{"WebserviceID"}" id="WebserviceID"/>
                    <input type="hidden" name="CommunicationType" value="$QData{"CommunicationType"}" />
                    <input type="hidden" name="Operation" value="$QData{"Operation"}" />
                    <input type="hidden" name="Invoker" value="$QData{"Invoker"}" />
                    <input type="hidden" name="Direction" value="$QData{"Direction"}"/>
<!-- dtl:block:KeyCounter -->
                    <input type="hidden" name="KeyCounter" id="KeyCounter" value="$QData{"KeyIndex"}" />
<!-- dtl:block:KeyCounter -->
                    <fieldset class="TableLike  SpacingTop">
                        <label for="DefaultKeyType">$Text{"Default rule for unmapped keys"}:</label>
                        <div class="Field">
                            $Data{"DefaultKeyTypeStrg"}
                            <div id="DefaultKeyTypeError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="DefaultKeyTypeServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <input id="DefaultKeyMapTo" name="DefaultKeyMapTo" class="W25pc DefaultKeyType $QData{"DefaultKeyMapToHidden"} $QData{"DefaultKeyMapToError"}" type="text" maxlength="100" value="$QData{"DefaultKeyMapTo"}"/>
                            <div id="DefaultKeyMapToError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="DefaultKeyMapToServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <p class="FieldExplanation">$Text{"This rule will apply for all keys with no mapping rule."}</p>
                        </div>
                        <div class="Clear"></div>

                        <label for="DefaultKeyType">$Text{"Default rule for unmapped values"}:</label>
                        <div class="Field">
                            $Data{"DefaultValueTypeStrg"}
                            <div id="DefaultKeyValueTypeError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="DefaultValueTypeServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <input id="DefaultValueMapTo"name="DefaultValueMapTo"  class="W25pc DefaultValueType $QData{"DefaultValueMapToHidden"} $QData{"DefaultValueMapToError"}" type="text" maxlength="100" value="$QData{"DefaultValueMapTo"}"/>
                            <div id="DefaultValueMapToError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="DefaultValueMapToServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <p class="FieldExplanation">$Text{"This rule will apply for all values with no mapping rule."}</p>
                        </div>
                        <div class="Clear"></div>

                        <label for="AddKeyMapping">$Text{"New key map"}:</label>
                        <div class="Field">
                            <div class="NewRule">
                                <button type="button" id="AddKeyMapping" class="Add" value="Add key mapping">$Text{"Add key mapping"}</button>
                            </div>
                        </div>
                        <div class="Clear Spacing"></div>
                    </fieldset>
                    <div class="Content Spacing" id="KeyInsert">

<!-- dtl:block:KeyTemplate -->
                        <div class="WidgetSimple Expanded WidgetKey $QData{"Classes"}">
                            <div class="Header">
                                <div class="WidgetAction Toggle">
                                    <a href="#" title="$JSText{"Show or hide the content"}"></a>
                                </div>
                                <h3 class="Title">$Text{"Mapping for Key "} $QData{"KeyMapNew"}</h3>
                                <div class="AdditionalInformation SpacingTopMini">
                                    <button type="button" id="RemoveKeyMapping$QData{"KeyIndex"}" class="Remove" value="Remove key mapping">$Text{"Remove key mapping"}</button>
                                </div>
                            </div>
                            <div class="Content">

                                <fieldset class="TableLike FixedLabelSmall">
                                    <label>$Text{"Key mapping"}:</label>
                                    <div class="Spacing"></div>
                                    <div class="Field KeyTemplateHeader">
                                        <label for="KeyName$QData{"KeyIndex"}" class="Mandatory KeyName$QData{"KeyIndex"}Label"><span class="Marker">*</span>$Text{"Map key"}:</label>
                                        <input name="KeyName$QData{"KeyIndex"}" id="KeyName$QData{"KeyIndex"}" class="W20pc Validate_Required $QData{"KeyNameError"}" type="text" maxlength="100" value="$QData{"KeyName"}"/>
                                        <div id="KeyName$QData{"KeyIndex"}Error" class="TooltipErrorMessage">
                                            <p>$Text{"This field is required."}</p>
                                        </div>
                                        <div id="KeyName$QData{"KeyIndex"}ServerError" class="TooltipErrorMessage">
                                            <p>$Text{"This field is required."}</p>
                                        </div>

                                        <label for="KeyMapTypeStrg$QData{"KeyIndex"}" class="KeyMapTypeStrg$QData{"KeyIndex"}Label">$Text{"matching the"}:</label>
                                        $Data{"KeyMapTypeStrg"}
                                        <div id="KeyMapTypeStrg$QData{"KeyIndex"}Error" class="TooltipErrorMessage">
                                            <p>$Text{"This field is required."}</p>
                                        </div>
                                        <div id="KeyMapTypeStrg$QData{"KeyIndex"}ServerError" class="TooltipErrorMessage">
                                            <p>$Text{"This field is required."}</p>
                                        </div>

                                        <label for="KeyMapNew$QData{"KeyIndex"}" class="Mandatory KeyMapNew$QData{"KeyIndex"}Label"><span class="Marker">*</span>$Text{"to new key"}:</label>
                                        <input name="KeyMapNew$QData{"KeyIndex"}" id="KeyMapNew$QData{"KeyIndex"}" class="W20pc Validate_Required NewValue $QData{"KeyMapNewError"}" type="text" maxlength="100" value="$QData{"KeyMapNew"}"/>
                                        <div id="KeyMapNew$QData{"KeyIndex"}Error" class="TooltipErrorMessage">
                                            <p>$Text{"This field is required."}</p>
                                        </div>
                                        <div id="KeyMapNew$QData{"KeyIndex"}ServerError" class="TooltipErrorMessage">
                                            <p>$Text{"This field is required."}</p>
                                        </div>
                                        <input type="hidden" name="KeyIndex$QData{"KeyIndex"}" id="KeyIndex$QData{"KeyIndex"}" value="$QData{"KeyIndex"}" class="KeyIndex" />
                                    </div>
                                    <div class="Clear"></div>

                                    <label>$Text{"Value mapping"}:</label>
                                    <div class="Field ValueInsert">
<!-- dtl:block:ValueTemplateRowIndex -->
                                        <input type="hidden" name="ValueCounter$QData{"KeyIndex"}" value="$QData{"ValueIndex"}" id="ValueCounter$QData{"KeyIndex"}" class="ValueCounter" />
<!-- dtl:block:ValueTemplateRowIndex -->
                                        <div class="Spacing"></div>
<!-- dtl:block:ValueTemplateRow -->
                                        <div class="ValueTemplateRow SpacingTopSmall">
                                            <label class="Mandatory" for="ValueName$QData{"KeyIndex"}_$QData{"ValueIndex"}"><span class="Marker">*</span>$Text{"Map value"}:</label>
                                            <input name="ValueName$QData{"KeyIndex"}_$QData{"ValueIndex"}" id="ValueName$QData{"KeyIndex"}_$QData{"ValueIndex"}" class="W20pc Validate_Required $QData{"ValueNameError"}" type="text" maxlength="100" value="$QData{"ValueName"}"/>
                                            <div id="ValueName$QData{"KeyIndex"}_$QData{"ValueIndex"}Error" class="TooltipErrorMessage">
                                                <p>$Text{"This field is required."}</p>
                                            </div>
                                            <div id="ValueName$QData{"KeyIndex"}_$QData{"ValueIndex"}ServerError" class="TooltipErrorMessage">
                                                <p>$Text{"This field is required."}</p>
                                            </div>

                                            <label for="ValueMapTypeStrg$QData{"KeyIndex"}_$QData{"ValueIndex"}">$Text{"matching the"}:</label>
                                            $Data{"ValueMapTypeStrg"}
                                            <div id="ValueMapTypeStrg$QData{"KeyIndex"}_$QData{"ValueIndex"}Error" class="TooltipErrorMessage">
                                                <p>$Text{"This field is required."}</p>
                                            </div>
                                            <div id="ValueMapTypeStrg$QData{"KeyIndex"}_$QData{"ValueIndex"}ServerError" class="TooltipErrorMessage">
                                                <p>$Text{"This field is required."}</p>
                                            </div>

                                            <label class="Mandatory" for="ValueMapNew$QData{"KeyIndex"}_$QData{"ValueIndex"}"><span class="Marker">*</span>$Text{"to new value"}:</label>
                                            <input name="ValueMapNew$QData{"KeyIndex"}_$QData{"ValueIndex"}" id="ValueMapNew$QData{"KeyIndex"}_$QData{"ValueIndex"}" class="W20pc Validate_Required $QData{"ValueMapNewError"}" type="text" maxlength="100" value="$QData{"ValueMapNew"}"/>
                                            <div id="ValueMapNew$QData{"KeyIndex"}_$QData{"ValueIndex"}Error" class="TooltipErrorMessage">
                                                <p>$Text{"This field is required."}</p>
                                            </div>
                                            <div id="ValueMapNew$QData{"KeyIndex"}_$QData{"ValueIndex"}ServerError" class="TooltipErrorMessage">
                                                <p>$Text{"This field is required."}</p>
                                            </div>
                                            <button type="button" id="RemoveValueMapping$QData{"KeyIndex"}_$QData{"ValueIndex"}" class="Remove ValueRemove" value="Remove value mapping">$Text{"Remove value mapping"}</button>
                                        </div>
<!-- dtl:block:ValueTemplateRow -->
                                    </div>
                                    <div class="Clear"></div>

                                    <fieldset class="TableLike  SpacingTop">
                                        <label for="AddValueMapping$QData{"KeyIndex"}" class="AddValueMapping">$Text{"New value map"}:</label>
                                        <div class="Field">
                                            <div class="NewValueMap">
                                                <button type="button" id="AddValueMapping$QData{"KeyIndex"}" class="Add ValueAdd" value="Add Value mapping">$Text{"Add value mapping"}</button>
                                            </div>
                                        </div>
                                    </fieldset>
                                    <div class="Clear"></div>

                                </fieldset>
                            </div>
                        </div>
<!-- dtl:block:KeyTemplate -->

<!-- dtl:block:ValueTemplate -->
                        <div class="ValueTemplateRow ValueTemplate SpacingTopSmall Hidden">
                            <label for="ValueName" class="Mandatory ValueNameLabel"><span class="Marker">*</span>$Text{"Map value"}:</label>
                            <input name="ValueName" id="ValueName" class="W20pc" type="text" maxlength="100" value=""/>
                            <div id="ValueNameError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="ValueNameServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>

                            <label for="ValueMapTypeStrg" class="ValueMapTypeStrgLabel">$Text{"matching the"}:</label>
                            $Data{"ValueMapTypeStrg"}
                            <div id="ValueMapTypeStrgError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="ValueMapTypeStrgServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>

                            <label for="ValueMapNew" class="Mandatory ValueMapNewLabel"><span class="Marker">*</span>$Text{"to new value"}:</label>
                            <input name="ValueMapNew" id="ValueMapNew" class="W20pc" type="text" maxlength="100" value=""/>
                            <div id="ValueMapNewError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="ValueMapNewServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <button type="button" id="RemoveValueMapping" class="Remove ValueRemove" value="Spacing Remove value mapping">$Text{"Remove value mapping"}</button>
                        </div>
<!-- dtl:block:ValueTemplate -->

                    </div>
                    <fieldset class="TableLike">
                        <div class="Field Spacing">
                            <button class="Primary" type="submit" value="$Text{"Save"}">$Text{"Save"}</button>

                            <button type="submit" id="SaveAndFinishButton" value="$Text{"Save and finish"}">$Text{"Save and finish"}</button>
                            <input type="hidden" name="ReturnToAction" id="ReturnToAction" value="" />
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
$('#SaveAndFinishButton').bind('click', function(){
    $('#ReturnToAction').val(1);
});
//]]></script>
<!-- dtl:js_on_document_complete -->

                            $Text{"or"}
                            <a href="$Env{"Baselink"}Action=$LQData{"ActionFrontendModule"};Subaction=Change;$LQData{"ActionType"}=$LQData{"Action"};WebserviceID=$LQData{"WebserviceID"}">$Text{"Cancel"}</a>
                        </div>

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

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

    </div>

</div>
<div class="Hidden" id="DeleteDialogContainer">
    <span class="WarningDialog ">&nbsp;</span>
    <p id="DeleteDialog" class="Center Warning">
        $Text{"Do you really want to delete this key mapping?"}
    </p>
    <div class="SpacingTop"></div>
</div>

<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
Core.Agent.Admin.GenericInterfaceMapping.Init({
    WebserviceID: $QData{"WebserviceID"},
    DeletedString: "$QData{"DeletedString"}",
    Localization: {
        DeleteKeyMappingMsg: '$JSText{"Delete this Key Mapping"}',
        DeleteMsg: '$JSText{"Delete"}',
        CancelMsg: '$JSText{"Cancel"}'
    }
});
//]]></script>
<!-- dtl:js_on_document_complete -->
