<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" Inherits="site_HITS_EmployeeDetails" Title="Brightstar Device Protection: User Details"
    Theme="eMain" Culture="auto" UICulture="auto" CodeBehind="Details.aspx.cs" %>

<%@ Register Src="~/Controls/PhoneNumber.ascx" TagName="PhoneNumber" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ChildHeader.ascx" TagName="ChildHeader" TagPrefix="uc" %>
<%@ Register Src="~/Controls/PersistNav.ascx" TagName="PersistNav" TagPrefix="uc" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components"
    TagPrefix="cc1" %>

<%@ Register Src="~/Controls/UserPasswordResetConfirmationDialog.ascx" TagPrefix="uc" TagName="UserPasswordResetConfirmationDialog" %>

<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">

    <script src="../../../script/eSetFormControls.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">

        function EmailTextBoxKeyUp() {

            var m_btnResetPassword = document.getElementById('<%= m_btnResetPassword.ClientID %>');
            var m_txtEmail = document.getElementById('<%= m_txtEmail.ClientID %>');

            if (m_btnResetPassword && m_txtEmail) {

                if ($.trim(m_txtEmail.value) === "") {
                    m_btnResetPassword.disabled = true;
                } else {
                    m_btnResetPassword.disabled = false;
                }
            }

        }
        $(document).ready(function () {
            if ('[id$=_m_txtPhoneNumber]')[0]
            {
                $('[id$=_m_txtPhoneNumber]')[0].style.width = "121px"
            }
            if ($.browser.msie && parseFloat($.browser.version) < 8) {
                $('[id$=_m_txtZipCode]')[0].style.width = "250px"
                $('[id$=_m_txtWorkPhoneExtension]')[0].style.width = "63px"
                $('[id$=m_txtOrgUnit]')[0].style.width = "230px"

            }
            if ($.browser.msie && parseFloat($.browser.version) == 8) {
                $('[id$=_m_txtZipCode]')[0].style.width = "245px"
                $('[id$=m_txtWorkPhoneExtension]')[0].style.width = "66px"
                $('[id$=m_txtOrgUnit]')[0].style.width = "230px"
            }

            if ($.browser.msie && parseFloat($.browser.version) > 8) {
                $('[id$=m_txtOrgUnit]')[0].style.width = "225px"
                $('[id$=_m_txtZipCode]')[0].style.width = "235px"
                $('[id$=m_txtWorkPhoneExtension]')[0].style.width = "67px"
            }
        });

    </script>

    <cc1:ExtendedValidationSummary ID="m_extValidationSummaryTop" runat="server" HeaderText="<%$ Resources: UsersManagement, HeaderMessageFollowingItemsReviewedBeforeUpadating %>"
        ValidationGroup="UserGeneralInformationValidationGroup" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <h1>
                    <asp:Literal ID="m_UserDetailsHeader" runat="server" Text="<%$ Resources: UsersManagement, LabelUserDetails %>" />
                </h1>
            </td>
            <td valign="top">
                <uc:PersistNav ID="PersistNav1" runat="server" />
            </td>
        </tr>
    </table>
    <uc:ChildHeader ID="ChildHeader1" runat="server" OnSendEmailClicked="SendEmail_Clicked" />
    <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
        <ContentTemplate>
            <h2>
                <asp:Literal ID="m_litGeneralInfo" runat="server" Text="<%$ Resources: UsersManagement, LabelGeneralInformation %>" />
                <asp:Label ID="lblStatus" runat="server" />
            </h2>
            <div class="greyblock">
                <b><span style="color: #ff0000">* </span></b>
                <asp:Literal ID="m_litRequired" runat="server" Text="<%$ Resources: Default, LabelIndicatesRequiredField %>"></asp:Literal>
                <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
                    <tr>
                        <td align="right" nowrap>
                            <asp:Literal ID="m_litOrganization" runat="server" Text="<%$ Resources: OrganizationManagement, LabelOrganizationColon %>" />
                            <b><span style="color: #ff0000">*</span></b>
                        </td>
                        <td nowrap>
                            <asp:DropDownList ID="m_ddlOrg" runat="server" Width="240px" AutoPostBack="True"
                                OnSelectedIndexChanged="m_ddlOrg_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td align="right">
                            <asp:Literal ID="m_litLogin" runat="server" Text="<%$ Resources: UsersManagement, LabelUserLogin %>" />
                            <b><span style="color: #ff0000">*</span></b>
                        </td>
                        <td>
                            <asp:TextBox ID="m_txtLogin" runat="server" Width="230px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="m_rfvLogin" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageLoginIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipLoginIsRequired %>" ControlToValidate="m_txtLogin"
                                ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <asp:Panel ID="m_pnlCannotUpdate" runat="server" Visible="False">
                        <tr>
                            <td colspan="4" align="center">
                                <div style="color: Red;">
                                    <asp:Literal ID="m_litCannotUpdate" runat="server" Text="<%$ Resources: UsersManagement, LabelOnlyRootLevelUserUpdateAnothereSecuritelUser %>" />
                                </div>
                            </td>
                        </tr>
                    </asp:Panel>
                    <asp:Panel ID="m_pnlUserDetails" runat="server">
                        <tr>
                            <td align="right" rowspan="2">
                                <asp:Literal ID="m_litOrganizationUnit" runat="server" Text="<%$ Resources: OrganizationManagement, OrganizationUnitLabel %>" />
                                <b><span style="color: #ff0000">*</span></b>
                            </td>
                            <td rowspan="2">
                                <asp:ListBox ID="m_lbOrgUnit" runat="server" SelectionMode="Multiple" Width="240px"></asp:ListBox>
                                <asp:RequiredFieldValidator ID="rfOrganizationUnit" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: OrganizationManagement, ErrorMessageYouMustSelectOrganizationUnit %>" ToolTip="<%$ Resources: ORganizationManagement, ToolTipYouMustSelectOrganizationUnit %>"
                                    ControlToValidate="m_lbOrgUnit" ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                            </td>
                            <td align="right">
                                <asp:Literal ID="m_litPassword" runat="server" Text="<%$ Resources: UsersManagement, LabelUserPassword %>" />
                                <b><span style="color: #ff0000">*</span></b>

                            </td>
                            <td>
                                <asp:TextBox ID="m_txtPassword" runat="server" Width="230px" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessagePasswordIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipPasswordIsRequired %>" ControlToValidate="m_txtPassword"
                                    ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="cvPassword" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ControlToValidate="m_txtPassword" OnServerValidate="cvPassword_ServerValidate"
                                    ValidationGroup="UserGeneralInformationValidationGroup" />

                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Literal ID="m_litRetypePassword" runat="server" Text="<%$ Resources: UsersManagement, LabelRetypePassword %>" />
                                <b><span style="color: #ff0000">*</span></b>

                            </td>
                            <td>
                                <asp:TextBox ID="m_txtRetypePassword" runat="server" Width="230px" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="m_RequiredFieldValidator8" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageRetypePasswordIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipRetypePasswordIsRequired %>"
                                    ControlToValidate="m_txtRetypePassword" ValidationGroup="UserGeneralInformationValidationGroup" />
                                <asp:CompareValidator ID="m_compValRetypePassword" runat="server" ControlToValidate="m_txtRetypePassword"
                                    ControlToCompare="m_txtPassword" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageBothPasswordFieldsMustMatch %>" ToolTip="<%$ Resources: UsersManagement, ToolTipBothPasswordFieldsMustMatch %>"
                                    ValidationGroup="UserGeneralInformationValidationGroup" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Literal ID="m_litTitle" runat="server" Text="<%$ Resources: UsersManagement, LabelTitle %>" />
                                <b><span style="color: #ff0000">*</span></b>
                            </td>
                            <td>
                                <asp:TextBox ID="m_txtTitle" runat="server" Width="230px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="m_rfvTitle" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageTitleIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipTitleIsRequired %>" ControlToValidate="m_txtTitle"
                                    ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                            </td>
                            <td align="right" nowrap>
                                <asp:Literal ID="m_litWorkNumber" runat="server" Text="<%$ Resources: UsersManagement, LabelWorkPhoneNumber %>" />
                            </td>
                            <td nowrap>
                                <uc1:PhoneNumber ID="m_ucPhoneNumber" runat="server" Required="false" />
                                <asp:Literal ID="m_litExtension" runat="server" Text="<%$ Resources: UsersMAnagement, LabelUserExtColon %>" />
                                <asp:TextBox ID="m_txtPhoneExtension" runat="server" Width="63px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Literal ID="m_litFirstName" runat="server" Text="<%$ Resources: UsersManagement, LabelUserFirstName %>" />
                                <b><span style="color: #ff0000">*</span></b>
                            </td>
                            <td>
                                <asp:TextBox ID="m_txtFirstName" runat="server" Width="230px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="m_rfvFirstName" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageFirstNameIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipFirstNameIsRequired %>" ControlToValidate="m_txtFirstName"
                                    ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                            </td>
                            <td align="right" style="width: 125px" nowrap="nowrap">
                                <asp:Label ID="TimeZoneLabel" runat="server" Text="<%$ Resources: OrganizationManagement, LabelTimeZoneColon %>" Width="75px" />
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlTimeZone" runat="server" Width="243px" />
                            </td>

                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Literal ID="m_litLastName" runat="server" Text="<%$ Resources: UsersManagement, LabelUserLastName %>" />
                                <b><span style="color: #ff0000">*</span></b>
                            </td>
                            <td>
                                <asp:TextBox ID="m_txtLastName" runat="server" Width="230px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="m_rfvLastName" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageLastNameIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipLastNameIsRequired %>" ControlToValidate="m_txtLastName"
                                    ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                            </td>
                            <td align="right">
                                <asp:Literal ID="m_litActive" runat="server" Text="<%$ Resources: Default, LoginStatus%>" />
                                <b><span style="color: #ff0000">*</span></b>
                            </td>
                            <td>

                                <%--<asp:CheckBox ID="m_chkActive" runat="server" />--%>
                                <asp:RadioButtonList ID="m_rdolistLoginStatus" runat="server" DataTextField="RefName" DataValueField="ID" RepeatDirection="Horizontal">
                                </asp:RadioButtonList>



                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Literal ID="m_litEmail" runat="server" Text="<%$ Resources: UsersMAnagement, LabelUserEmail %>" />
                                <b><span style="color: #ff0000">*</span></b>
                            </td>
                            <td>
                                <asp:TextBox ID="m_txtEmail" runat="server" Width="230px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="m_rfvEmailAddress" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                                    ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageEmailAddressIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipEmailAddressIsRequired %>"
                                    ControlToValidate="m_txtEmail" ValidationGroup="UserGeneralInformationValidationGroup"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="m_regExValEmail" runat="server" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                    Text="<%$ Resources:Default, ValidatorText %>" ControlToValidate="m_txtEmail"
                                    Display="Dynamic" ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageEmailNotInInvalidFormat %>" ToolTip="<%$ Resources: UsersManagement, ToolTipEmailNotInInvalidFormat %>"
                                    ValidationGroup="UserGeneralInformationValidationGroup" />
                            </td>
                            <td align="right">
                                <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: Default, LabelSystemAccount%>" />

                            </td>
                            <td>
                                <asp:CheckBox ID="m_chkSystemAccount" runat="server" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                        </tr>
                        <tr>
                            <td align="right" nowrap></td>
                            <td nowrap></td>
                            <td align="right" nowrap></td>
                            <td nowrap></td>
                        </tr>
                        <tr>

                            <asp:Panel ID="m_pnlRootUser" runat="server">
                                <td align="right">
                                    <asp:Literal ID="m_litRootUser" runat="server" Text="<%$ Resources: UsersManagement, LabelRootUser %>" />
                                </td>
                                <td>
                                    <asp:CheckBox ID="m_chkRootUser" runat="server" />
                                </td>
                            </asp:Panel>
                        </tr>
                        <tr>
                        </tr>
                    </asp:Panel>
                </table>
            </div>

            <uc:UserPasswordResetConfirmationDialog runat="server" ID="ucUserPasswordResetConfirmationDialog" />

            <asp:Panel ID="m_pnlButtons" runat="server">
                <div style="padding-left: 370px" nowrap>
                    <asp:Button ID="m_btnUpdate" runat="server" CssClass="pagebutton" OnClick="m_btnUpdate_Click"
                        Text="<%$ Resources: Default, ButtonUpdate %>" PostBackUrl="~/site/HITS/User/Details.aspx"
                        ValidationGroup="UserGeneralInformationValidationGroup" />
                    <asp:Button ID="m_btnCancel" runat="server" CssClass="pagebutton" OnClick="m_btnCancel_Click"
                        Text="<%$ Resources: Default, ButtonCancel %>" CausesValidation="False" />

                    <asp:Button ID="m_btnResetPassword" runat="server" CssClass="pagebutton" OnClick="m_btnResetPassword_Click"
                        Text="<%$ Resources: UsersManagement, ButtonPasswordReset %>" CausesValidation="False" />
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <h2>
        <asp:Literal ID="m_litUserAssignment" runat="server" Text="<%$ Resources: UsersManagement, LabelUserAssignment %>" />
    </h2>
    <br />
    <!--------------------------------------------User Role assignment-------------------------------------->
    <asp:UpdatePanel runat="server" ID="uPanelURA" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="m_pnlRoleAssignment" runat="server">
                <div class="subpanelAddition">
                    <div class="subpanelheader hr">
                        <img src="../../../images/Collapse_13x13.jpg" class="showstate" onclick="expandcontent(this, 'm_pnlRoleAssignment')"
                            alt="contract" />
                        <asp:Literal ID="m_litUserRole" runat="server" Text="<%$ Resources: UsersManagement, LabelUserRoleAssignment %>" />&nbsp;
                        <asp:Label ID="lblUserRoleAssiStatusMessage" runat="server"></asp:Label>
                    </div>
                    <div id="m_pnlUserRoleAssignment" class="switchcontent">
                        <asp:CheckBoxList ID="m_cklRoles" runat="server" RepeatColumns="5" />
                        <asp:Button ID="m_btnAssignRole" runat="server" Text="<%$ Resources: UsersManagement, ButtonAssignRoles %>" CssClass="pagebutton"
                            OnClick="m_btnAssignRole_Click" />
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <!--------------------------------------------User group assignment-------------------------------------->
    <asp:UpdatePanel runat="server" ID="uPanelUGA" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="m_pnlGroupAssignment" runat="server">
                <div class="subpanelAddition">
                    <div class="subpanelheader hr">
                        <img src="../../../images/Collapse_13x13.jpg" class="showstate" onclick="expandcontent(this, 'm_pnlUserGroupAssignment')"
                            alt="contract" />
                        <asp:Literal ID="m_litUserGroup" runat="server" Text="<%$ Resources: UsersManagement, LabelUserGroupAssignment %>" />&nbsp;
               <asp:Label ID="lblUserGroupAssiStatusMessage" runat="server"></asp:Label>
                    </div>
                    <div id="m_pnlUserGroupAssignment" class="switchcontent">
                        <asp:CheckBoxList ID="m_cklGroups" runat="server" RepeatColumns="5" />
                        <asp:Button ID="m_btnAssignGroup" runat="server" Text="<%$ Resources: UsersManagement, ButtonAssignGroups %>" CssClass="pagebutton" OnClick="m_btnAssignGroup_Click" />
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <!--------------------------------------------User grouplist assignment-------------------------------------->
    <asp:UpdatePanel runat="server" ID="uPanelUGLA" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="m_pnlGroupListAssignment" runat="server">
                <div class="subpanelAddition">
                    <div class="subpanelheader hr">
                        <img src="../../../images/Collapse_13x13.jpg" class="showstate" onclick="expandcontent(this, 'm_pnlUserGroupListAssignment')"
                            alt="contract" />
                        <asp:Literal ID="m_litUserGroupList" runat="server" Text="<%$ Resources: UsersManagement, LabelUserGroupListAssignment %>" />&nbsp;
               <asp:Label ID="lblUserGroupListAssiStatusMessage" runat="server"></asp:Label>
                    </div>
                    <div id="m_pnlUserGroupListAssignment" class="switchcontent">
                        <asp:CheckBoxList ID="m_cklGroupLists" runat="server" RepeatColumns="5" />
                        <asp:Button ID="m_btnAssignGroupList" runat="server" Text="<%$ Resources: UsersManagement, ButtonAssignGroupLists %>" CssClass="pagebutton"
                            OnClick="m_btnAssignGroupList_Click" />
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <!--------------------------------------------------------------------------------------------------------->
    <cc1:ExtendedValidationSummary ID="m_extValidationSummaryBottom" runat="server" HeaderText="<%$ Resources: UsersManagement, HeaderMessageFollowingItemsReviewedBeforeUpadating %>"
        ValidationGroup="UserGeneralInformationValidationGroup" />
</asp:Content>
