# --
# AdminCustomerUserGroup.dtl - provides HTML form for AdminInterface
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AdminCustomerUserGroup.dtl,v 1.34 2012/11/20 15:07:35 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">
    <div class="Header">
        <h1>$Text{"Manage Customer-Group Relations"}</h1>
    </div>
    <div class="SidebarColumn">

<!-- dtl:block:Disabled -->
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Notice"}</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
                    <form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data">
                        <input type="hidden" name="Action" value="AdminSysConfig"/>
                        <input type="hidden" name="Subaction" value="Edit"/>
                        <input type="hidden" name="SysConfigGroup" value="Framework"/>
                        <input type="hidden" name="SysConfigSubGroup" value="Frontend::Customer"/>
                        <h3>$Text{"This feature is disabled!"}</h3>
                        <fieldset>
                            <p class="FieldExplanation">
                                $Text{"Just use this feature if you want to define group permissions for customers."}
                            </p>
                            <div class="Field SpacingTop">
                                <button class="CallForAction" type="submit" value="$Text{"Enable it here!"}">
                                    <span>$Text{"Enable it here!"}</span>
                                </button>
                            </div>
                            <div class="Clear"></div>

                        </fieldset>
                    </form>
                </ul>
            </div>
        </div>
<!-- dtl:block:Disabled -->

<!-- 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"};CustomerUserSearch=$LQData{"CustomerUserSearch"}" class="CallForAction"><span>$Text{"Go to overview"}</span></a>
                    </li>
<!-- dtl:block:ActionOverview -->
<!-- dtl:block:Search -->
                    <li>
                        <form class="SearchBox" action="$Env{"CGIHandle"}" method="post">
                            <input type="hidden" name="Action" value="$Env{"Action"}" />
                            <input type="text" name="CustomerUserSearch" id="CustomerUserSearch" value="$QData{"CustomerUserSearch"}" title="$Text{"Search"}" />
<!-- dtl:block:SearchChangeGroup -->
                            <input type="hidden" name="Subaction" value="$QData{"Subaction"}" />
                            <input type="hidden" name="ID" value="$QData{"GroupID"}" />
<!-- dtl:block:SearchChangeGroup -->
                            <button class="Primary" type="submit" value="$Text{"Search"}"><span>$Text{"Search"}</span></button>
                            <p class="FieldExplanation">
                                <label for="CustomerUserSearch">
                                    $Text{"Search for customers."} $Text{"Wildcards like '*' are allowed."}
                                </label>
                            </p>
                        </form>
                    </li>
<!-- dtl:block:Search -->
<!-- dtl:block:AlwaysGroupsConfig -->
                    <li>
                        <a href="$Env{"Baselink"}Action=AdminSysConfig;Subaction=Edit;SysConfigGroup=Framework;SysConfigSubGroup=Frontend::Customer" class="CallForAction"><span>$Text{"Edit Customer Default Groups"}</span></a>
                        <p class="FieldExplanation">
                            $Text{"These groups are automatically assigned to all customers."}
                            $Text{"You can manage these groups via the configuration setting "CustomerGroupAlwaysGroups"."}
                        </p>
                    </li>

<!-- dtl:block:AlwaysGroupsConfig -->
                </ul>
            </div>
        </div>
<!-- dtl:block:ActionList -->
<!-- dtl:block:Filter -->
        <div class="WidgetSimple">
            <div class="Header">
                <h2><label for="FilterGroups">$Text{"Filter for Groups"}</label></h2>
            </div>
            <div class="Content">
                <ul>
                    <li>
                        <form action="">
                            <fieldset>
                                <input type="text" id="FilterGroups" class="W50pc" name="FilterGroups" value="" title="$Text{"Filter for Groups"}" />
                            </fieldset>
                        </form>
                    </li>
                </ul>
            </div>
        </div>
<!-- dtl:block:Filter -->
<!-- dtl:block:Note -->
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Hint"}</h2>
            </div>
            <div class="Content">
                <p class="FieldExplanation">
                    $Text{"Select the customer:group permissions."}
                </p>
                <p class="FieldExplanation">
                    $Text{"If nothing is selected, then there are no permissions in this group (tickets will not be available for the customer)."}
                </p>

            </div>
        </div>
<!-- dtl:block:Note -->
    </div>
    <div class="ContentColumn">
        <div class="WidgetSimple">
<!-- dtl:block:Result -->
            <div class="Header">
                <h2>$Text{"Search Result:"}</h2>
            </div>
            <div class="Content LayoutGrid ColumnsWithSpacing">
                <div class="Size1of2">
                    <ul class="Tablelike" id="Customers">
                        <li class="Header">$Text{"Customers"}
<!-- dtl:block:ResultCustomerUserCount -->
                            ($QData{"CustomerUserCount"})
<!-- dtl:block:ResultCustomerUserCount -->
<!-- dtl:block:ResultCustomerUserCountLimit -->
                            (<span class='Error'>$QData{"CustomerUserCount"}</span>)
<!-- dtl:block:ResultCustomerUserCountLimit -->
                        </li>
<!-- dtl:block:List1n-->
                        <li><a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$LQData{"Subaction"};ID=$LQData{"ID"};CustomerUserSearch=$LQData{"CustomerUserSearch"}" class="AsBlock">$QData{"Name"}</a></li>
<!-- dtl:block:List1n-->
<!-- dtl:block:NoDataFoundMsgList -->
                        <li>$Text{"No data found."}</li>
<!-- dtl:block:NoDataFoundMsgList -->
                    </ul>
                </div>
                <div class="Size1of2">
                    <ul class="Tablelike" id="Group">
                        <li class="Header">$Text{"Groups"}</li>
<!-- dtl:block:Listn1-->
                        <li><a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=$LQData{"Subaction"};ID=$LQData{"ID"};CustomerUserSearch=$LQData{"CustomerUserSearch"}" class="AsBlock">$QData{"Name"}</a></li>
<!-- dtl:block:Listn1-->
                        <li class="FilterMessage Hidden">$Text{"No matches found."}</li>
                    </ul>
                </div>
                <div class="Clear"></div>
            </div>
<!-- dtl:block:Result -->

<!-- dtl:block:Change -->
            <div class="Header">
                <h2>
<!-- dtl:block:ChangeHeadingGroup -->
                    $Text{"Change Group Relations for Customer"}
<!-- dtl:block:ChangeHeadingGroup -->
<!-- dtl:block:ChangeHeadingCustomer -->
                    $Text{"Change Customer Relations for Group"}
<!-- dtl:block:ChangeHeadingCustomer -->
                    <a href="$Env{"Baselink"}Action=$LQData{"ActionHome"};Subaction=Change;ID=$LQData{"ID"}">$QData{"Name"}</a>
                </h2>
            </div>
            <div class="Content ">
                <form action="$Env{"CGIHandle"}" method="post" name="matrix">
                    <input type="hidden" name="Action" value="$Env{"Action"}"/>
                    <input type="hidden" name="Subaction" value="Change$QData{"Type"}"/>
                    <input type="hidden" name="ID" value="$QData{"ID"}"/>
                    <table class="DataTable VariableWidth" id="$QData{"VisibleNeType"}">
                        <thead>
                            <tr>
                                <th>$Text{"$Data{"VisibleNeType"}"}
<!-- dtl:block:ChangeItemCount -->
                                    ($QData{"ItemCount"})
<!-- dtl:block:ChangeItemCount -->
<!-- dtl:block:ChangeItemCountLimit -->
                                    (<Span class="Error">$QData{"ItemCount"}</span>)
<!-- dtl:block:ChangeItemCountLimit -->
                                </th>
<!-- dtl:block:ChangeHeader -->
                                <th class="Center $QData{"Mark"}">
                                    <input type="checkbox" name="$QData{"Type"}" id="SelectAll$QData{"Type"}" title="$Text{"Toggle %s Permission for all", "$QData{"Type"}"}" value="" />
                                    $QData{"Type"}
                                </th>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    Core.Form.InitSelectAllCheckboxes($('table td input:checkbox[name=$QData{"Type"}]'), $('#SelectAll$QData{"Type"}'));
    $('input:checkbox[name=$QData{"Type"}]').bind('click', function () {
        Core.Form.SelectAllCheckboxes($(this), $('#SelectAll$QData{"Type"}'));
    });
//]]></script>
<!-- dtl:js_on_document_complete -->
<!-- dtl:block:ChangeHeader -->
                            </tr>
                        </thead>
                        <tbody>
<!-- dtl:block:NoDataFoundMsg -->
                            <tr>
                                <td colspan="$QData{"ColSpan"}">
                                    $Text{"No data found."}
                                </td>
                            </tr>
<!-- dtl:block:NoDataFoundMsg -->
<!-- dtl:block:ChangeRow -->
                            <tr>
                                <td><a href="$Env{"Baselink"}Action=Admin$LQData{"NeType"};Subaction=Change;ID=$LQData{"ID"}">$QData{"Name"}</a></td>
<!-- dtl:block:ChangeRowItem -->
                                <td class="$QData{"Mark"}">
                                    <input type="checkbox" name="$QData{"Type"}" title="$Text{"Toggle %s permission for %s", "$QData{"Type"}", "$QData{"Name"}"}" value="$QData{"ID"}" $Data{"Selected"}/>
                                </td>
<!-- dtl:block:ChangeRowItem -->
                            </tr>
<!-- dtl:block:ChangeRow -->
                            <tr class="FilterMessage Hidden">
                                <td colspan="3">$Text{"No matches found."}</td>
                            </tr>
                        </tbody>
                    </table>
                    <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>
                </form>
            </div>
<!-- dtl:block:Change -->
        </div>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    Core.UI.Table.InitTableFilter($('#FilterGroups'), $('#Group'));
//]]></script>
<!-- dtl:js_on_document_complete -->

<!-- dtl:block:AlwaysGroups -->
        <div class="WidgetSimple SpacingTop">
            <div class="Header">
                <h2>$Text{"Customer Default Groups:"}</h2>
            </div>
            <div class="Content LayoutGrid ColumnsWithSpacing">
                <div class="Size1of2">
                    <ul class="Tablelike" id="Always Groups">
                        <li class="Header">$Text{"Groups"}</li>
<!-- dtl:block:AlwaysGroupsList-->
                        <li>$QData{"Name"}</li>
<!-- dtl:block:AlwaysGroupsList-->
                    </ul>
                    <p class="FieldExplanation">
                        $Text{"No changes can be made to these groups."}
                    </p>
                </div>
            </div>
        </div>
<!-- dtl:block:AlwaysGroups -->

<!-- dtl:block:Reference -->
        <div class="WidgetSimple SpacingTop">
            <div class="Header">
                <h2>$Text{"Reference"}</h2>
            </div>
            <div class="Content">

                <dl>
                    <dt>$Text{"ro"}</dt>
                    <dd>
                        $Text{"Read only access to the ticket in this group/queue."}
                    </dd>

                    <dt>$Text{"rw"}</dt>
                    <dd>
                        $Text{"Full read and write access to the tickets in this group/queue."}
                    </dd>
                </dl>
            </div>
        </div>
<!-- dtl:block:Reference -->
    </div>
    <div class="Clear"></div>
</div>
<!-- dtl:block:Overview -->
