# --
# AdminPostMasterFilter.dtl - provides HTML form for AdminPostMasterFilter
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AdminPostMasterFilter.dtl,v 1.57 2012/11/20 15:10:54 mh 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:Overview -->
<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1>$Text{"PostMaster Filter Management"}</h1>

    <div class="SidebarColumn">
<!-- dtl:block:ActionList -->
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Actions"}</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
<!-- dtl:block:ActionOverview -->
                    <li>
                        <a href="$Env{"Baselink"}Action=$Env{"Action"}" class="CallForAction"><span>$Text{"Go to overview"}</span></a>
                    </li>
<!-- dtl:block:ActionOverview -->
<!-- dtl:block:ActionAdd -->
                    <li>
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=AddAction" class="CallForAction Plus"><span>$Text{"Add filter"}</span></a>
                    </li>
<!-- dtl:block:ActionAdd -->
                </ul>
            </div>
        </div>
<!-- dtl:block:ActionList -->


        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Hint"}</h2>
            </div>
            <div class="Content">
                <p class="FieldExplanation">
                    $Text{"To dispatch or filter incoming emails based on email headers. Matching using Regular Expressions is also possible."}
                </p>
                <p class="FieldExplanation">
                    $Text{"If you want to match only the email address, use EMAILADDRESS:info@example.com in From, To or Cc."}
                </p>
                <p class="FieldExplanation">
                    $Text{"If you use Regular Expressions, you also can use the matched value in () as [***] in the 'Set' action."}
                </p>
            </div>
        </div>

    </div>

    <div class="ContentColumn">
        <div class="WidgetSimple">

<!-- dtl:block:OverviewResult -->
            <div class="Header">
                <h2>$Text{"List"}</h2>
            </div>
            <div class="Content">
                <table class="DataTable VariableWidth">
                    <thead>
                        <tr>
                            <th>$Text{"Name"}</th>
                            <th>$Text{"Delete"}</th>
                        </tr>
                    </thead>
                    <tbody>
<!-- dtl:block:NoDataFoundMsg -->
                        <tr>
                            <td colspan="2">
                                $Text{"No data found."}
                            </td>
                        </tr>
<!-- dtl:block:NoDataFoundMsg -->
<!-- dtl:block:OverviewResultRow -->
                        <tr>
                            <td><a class="AsBlock" href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=Update;Name=$LQData{"Name"}">$Text{"$Data{"Name"}"}</a></td>
                            <td class="Center"><a class="TrashCan" href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=Delete;Name=$LQData{"Name"};$QEnv{"ChallengeTokenParam"}" title="$Text{"Delete this filter"}">$Text{"Delete this filter"}</a></td>
                        </tr>
<!-- dtl:block:OverviewResultRow -->
                    </tbody>
                </table>
            </div>
<!-- dtl:block:OverviewResult -->

<!-- dtl:block:OverviewUpdate -->
            <div class="Header">
<!-- dtl:block:HeaderAdd -->
                <h2>$Text{"Add PostMaster Filter"}</h2>
<!-- dtl:block:HeaderAdd -->
<!-- dtl:block:HeaderEdit -->
                <h2>$Text{"Edit PostMaster Filter"}</h2>
<!-- dtl:block:HeaderEdit -->
            </div>
            <div class="Content">
                <form action="$Env{"CGIHandle"}" method="post" class="Validate">
                    <input type="hidden" name="Action" value="$Env{"Action"}"/>
                    <input type="hidden" name="Subaction" value="UpdateAction"/>
                    <input type="hidden" name="OldName" value="$QData{"Name"}"/>
                    <fieldset class="TableLike">
                        <label class="Mandatory" for="EditName"><span class="Marker">*</span> $Text{"Filter name"}:</label>
                        <div class="Field">
                            <input type="text" class="W50pc Validate_Required $QData{"NameInvalid"}" name="Name" id="EditName" value="$QData{"Name"}"/>
                            <div id="EditNameError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                            <div id="EditNameServerError" class="TooltipErrorMessage"><p>$Text{"The name is required."}</p></div>
                        </div>
                        <div class="Clear"></div>

                        <label class="Mandatory" for="StopAfterMatch"><span class="Marker">*</span> $Text{"Stop after match"}:</label>
                        <div class="Field">
                            $Data{"StopAfterMatch"}
                            <div id="StopAfterMatchError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                            <div id="StopAfterMatchServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                        </div>
                        <div class="Clear"></div>

                        <h4>$Text{"Filter Condition"}</h4>

                        <label for="MatchHeader1">$Text{"Header"} 1:</label>
                        <div class="Field">
                            $Data{"MatchHeader1"}
                            <div id="MatchHeader1ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="MatchValue1">$Text{"Value"} 1:</label>
                            <input type="text" name="MatchValue1" id="MatchValue1" value="$QData{"MatchValue1"}" class="W33pc $QData{"MatchValue1Invalid"}" maxlength="100"/>
                            <div id="MatchValue1ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a valid regular expression or a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="MatchHeader2">$Text{"Header"} 2:</label>
                        <div class="Field">
                            $Data{"MatchHeader2"}
                            <div id="MatchHeader2ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="MatchValue2">$Text{"Value"} 2:</label>
                            <input type="text" name="MatchValue2" id="MatchValue2" value="$QData{"MatchValue2"}" class="W33pc $QData{"MatchValue2Invalid"}" maxlength="100"/>
                            <div id="MatchValue2ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a valid regular expression or a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="MatchHeader3">$Text{"Header"} 3:</label>
                        <div class="Field">
                            $Data{"MatchHeader3"}
                            <div id="MatchHeader3ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="MatchValue3">$Text{"Value"} 3:</label>
                            <input type="text" name="MatchValue3" id="MatchValue3" value="$QData{"MatchValue3"}" class="W33pc $QData{"MatchValue3Invalid"}" maxlength="100"/>
                            <div id="MatchValue3ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a valid regular expression or a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="MatchHeader4">$Text{"Header"} 4:</label>
                        <div class="Field">
                            $Data{"MatchHeader4"}
                            <div id="MatchHeader4ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="MatchValue4">$Text{"Value"} 4:</label>
                            <input type="text" name="MatchValue4" id="MatchValue4" value="$QData{"MatchValue4"}" class="W33pc $QData{"MatchValue4Invalid"}" maxlength="100"/>
                            <div id="MatchValue1ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a valid regular expression or a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <h4>$Text{"Set Email Headers"}</h4>

                        <label for="SetHeader1">$Text{"Header"} 1:</label>
                        <div class="Field">
                            $Data{"SetHeader1"}
                            <div id="SetHeader1ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="SetValue1">$Text{"Value"} 1:</label>
                            <input type="text" name="SetValue1" id="SetValue1" value="$QData{"SetValue1"}" class="W33pc $QData{"SetValue1Invalid"}" maxlength="100"/>
                            <div id="SetValue1ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="SetHeader2">$Text{"Header"} 2:</label>
                        <div class="Field">
                            $Data{"SetHeader2"}
                            <div id="SetHeader2ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="SetValue2">$Text{"Value"} 2:</label>
                            <input type="text" name="SetValue2" id="SetValue2" value="$QData{"SetValue2"}" class="W33pc $QData{"SetValue2Invalid"}" maxlength="100"/>
                            <div id="SetValue2ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="SetHeader3">$Text{"Header"} 3:</label>
                        <div class="Field">
                            $Data{"SetHeader3"}
                            <div id="SetHeader3ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="SetValue3">$Text{"Value"} 3:</label>
                            <input type="text" name="SetValue3" id="SetValue3" value="$QData{"SetValue3"}" class="W33pc $QData{"SetValue3Invalid"}" maxlength="100"/>
                            <div id="SetValue3ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="SetHeader4">$Text{"Header"} 4:</label>
                        <div class="Field">
                            $Data{"SetHeader4"}
                            <div id="SetHeader4ServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <label for="SetValue4">$Text{"Value"} 4:</label>
                            <input type="text" name="SetValue4" id="SetValue4" value="$QData{"SetValue4"}" class="W33pc $QData{"SetValue4Invalid"}" maxlength="100"/>
                            <div id="SetValue4ServerError" class="TooltipErrorMessage">
                                <p>$Text{"The field needs to be a literal word."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <div class="Field SpacingTop">
                            <button class="Primary" type="submit" value="$Text{"Submit"}">$Text{"Submit"}</button>
                            $Text{"or"}
                            <a href="$Env{"Baselink"}Action=$Env{"Action"}">$Text{"Cancel"}</a>
                        </div>
                        <div class="Clear"></div>
                    </fieldset>
                </form>
            </div>

            <div class="WidgetSimple SpacingTop">
                <div class="Header">
                    <h2>$Text{"Example"}</h2>
                </div>
                <div class="Content">
                    <fieldset class="TableLike">
                        <h4>$Text{"Filter Condition"}</h4>

                        <label for="MatchHeaderExample">$Text{"Header"} 1:</label>
                        <div class="Field">
                            <select name="MatchHeaderExample" id="MatchHeaderExample" class="W33pc">
                                <option selected="selected" value="To">To</option>
                            </select>
                            <label for="MatchValueExample">$Text{"Value"} 1:</label>
                            <input type="text" name="MatchValueExample" id="MatchValueExample" value="(me|test)@example.com" class="W33pc" maxlength="50"/>
                        </div>
                        <div class="Clear"></div>

                        <h4>$Text{"Set Email Headers"}</h4>

                        <label for="SetHeaderExample">$Text{"Header"} 1:</label>
                        <div class="Field">
                            <select name="SetHeaderExample" id="SetHeaderExample" class="W33pc">
                                <option selected="selected" value="X-OTRS-Queue">X-OTRS-Queue</option>
                            </select>
                            <label for="SetValueExample">$Text{"Value"} 1:</label>
                            <input type="text" name="SetValueExample" id="SetValueExample" value="SomeQueue" class="W33pc" maxlength="50"/>
                        </div>
                        <div class="Clear"></div>
                    </fieldset>
                </div>
            </div>
<!-- dtl:block:OverviewUpdate -->
        </div>
    </div>
    <div class="Clear"></div>
</div>
<!-- dtl:block:Overview -->
