protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        _manager.AjaxSettings.AddAjaxSetting(editorDescription, editorDescription);

        if (Request["VersionID"] != null)
        {
            _versionID = int.Parse(Request["VersionID"]);
        }
        else
        {
            _productID = int.Parse(Request["ProductID"]);
        }

        _fieldControls.RefID = _versionID;

        if (!IsPostBack)
        {
            LoadStatuses();
            LoadProducts();
            LoadVersion(_versionID);
            _fieldControls.LoadValues();
            Page.RegisterStartupScript("AddMasks", @"
        <script type=""text/javascript"">
          $('.masked').each(function (index) {
            $(this).mask($(this).attr('placeholder'));
          });
        </script>
      ");
        }
        dpRelease.Culture = UserSession.LoginUser.CultureInfo;

        lblRelease.Text = cbReleased.Checked ? "Released On:" : "Expected Release On:";
    }
示例#2
0
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        _manager.AjaxSettings.AddAjaxSetting(cmbProducts, cmbVersions);


        _organizationProductID = Request["OrganizationProductID"] != null?int.Parse(Request["OrganizationProductID"]) : -1;

        _productID = Request["ProductID"] != null?int.Parse(Request["ProductID"]) : -1;

        _versionID = Request["VersionID"] != null?int.Parse(Request["VersionID"]) : -1;

        _organizationID = Request["OrganizationID"] != null?int.Parse(Request["OrganizationID"]) : -1;

        _fieldControls.RefID = _organizationProductID;
        if (!IsPostBack)
        {
            LoadOrganizationProduct(_organizationProductID);
            _fieldControls.LoadValues();
            Page.RegisterStartupScript("AddMasks", @"
        <script type=""text/javascript"">
          $('.masked').each(function (index) {
            $(this).mask($(this).attr('placeholder'));
          });
        </script>
      ");
        }
    }
示例#3
0
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        _customControls.RefID = _organizatinID;

        pnlEdit.Visible       = _organizatinID > 0;
        _isAdmin              = UserSession.CurrentUser.IsSystemAdmin && (_organizatinID != UserSession.LoginUser.OrganizationID);
        cbActive.Visible      = _isAdmin;
        spanActive.Visible    = cbActive.Visible;
        tdPortalInput.Visible = _isAdmin && UserSession.CurrentUser.HasPortalRights;
        tdPortalLabel.Visible = tdPortalInput.Visible;
        trApi.Visible         = _isAdmin;

        trTimeZone.Visible = UserSession.LoginUser.OrganizationID == _organizatinID;

        trSupportRow.Visible           = UserSession.LoginUser.OrganizationID != _organizatinID;
        spanDefaultPortalGroup.Visible = cmbGroups.Visible = UserSession.LoginUser.OrganizationID == _organizatinID;

        dpSAExpiration.Culture = UserSession.LoginUser.CultureInfo;

        if (!IsPostBack)
        {
            dpSAExpiration.MinDate = new DateTime(1800, 1, 1);
            LoadTimeZones();
            LoadSlas();
            LoadUsers(_organizatinID);
            LoadGroups(_organizatinID);
            LoadOrganization(_organizatinID);
            if (_organizatinID != UserSession.LoginUser.OrganizationID)
            {
                _customControls.LoadValues();
            }
            Page.RegisterStartupScript("AddMasks", @"
        <script type=""text/javascript"">
          $('.masked').each(function (index) {
            $(this).mask($(this).attr('placeholder'));
          });
        </script>
      ");
        }

        pnlActiveReason.Visible = _isAdmin && !cbActive.Checked;
    }
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        if (Request["ProductID"] != null)
        {
            _productID = int.Parse(Request["ProductID"]);
        }

        _fieldControls.RefID = _productID;
        if (!IsPostBack)
        {
            LoadProduct(_productID);
            _fieldControls.LoadValues();
            Page.RegisterStartupScript("AddMasks", @"
        <script type=""text/javascript"">
          $('.masked').each(function (index) {
            $(this).mask($(this).attr('placeholder'));
          });
        </script>
      ");
        }
    }
示例#5
0
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);


        Organization organization = (Organization)Organizations.GetOrganization(UserSession.LoginUser, _organizationID);

        if (organization.OrganizationID != UserSession.LoginUser.OrganizationID && organization.ParentID != UserSession.LoginUser.OrganizationID)
        {
            Response.Write("Invalid Request");
            Response.End();
            return;
        }

        if (!IsPostBack)
        {
            LoadTimeZones();
            LoadDateFormats();
            LoadFontFamilies(organization.FontFamily);
            LoadFontSizes(organization.FontSize);
            textEmail.Text            = "";
            textFirstName.Text        = "";
            textLastName.Text         = "";
            cbActive.Checked          = true;
            cbIsSystemAdmin.Checked   = false;
            cbChat.Checked            = false;
            cbEmailNotify.Checked     = true;
            cbSubscribe.Checked       = false;
            cbSubscribeAction.Checked = false;
            cbReceiveGroup.Checked    = false;
            cbNoAutoSubscribe.Checked = false;
            cbRestrictUserFromEditingAnyActions.Checked = false;
            cbAllowUserToEditAnyAction.Checked          = false;
            cbUserCanPinAction.Checked = true;
            Page.Title = "New User";

            if (!string.IsNullOrEmpty(organization.TimeZoneID))
            {
                cmbTimeZones.SelectedValue = organization.TimeZoneID;
            }

            cmbRights.Items.Add(new RadComboBoxItem("All tickets", "0"));
            cmbRights.Items.Add(new RadComboBoxItem("Only assigned tickets", "1"));
            cmbRights.Items.Add(new RadComboBoxItem("Only assigned and user's groups", "2"));
            cmbRights.Items.Add(new RadComboBoxItem("Only assigned and tickets associated with specific customers", "3"));

            if (_userID > -1)
            {
                LoadUser(_userID);
            }
            cbEmail.Visible      = _userID < 0;
            _fieldControls.RefID = _userID;
            _fieldControls.LoadValues();
            Page.RegisterStartupScript("AddMasks", @"
        <script type=""text/javascript"">
          $('.masked').each(function (index) {
            $(this).mask($(this).attr('placeholder'));
          });
        </script>
      ");
        }


        btnReset.Visible    = UserSession.CurrentUser.IsSystemAdmin && _userID != UserSession.LoginUser.UserID && (_userID > -1);
        pnlChange.Visible   = _userID == UserSession.LoginUser.UserID;
        cbActive.Visible    = tdActive.Visible = trAdmin.Visible = UserSession.CurrentUser.IsSystemAdmin;
        tdChatLabel.Visible = UserSession.CurrentUser.HasChatRights;
        cbChat.Visible      = tdChatLabel.Visible;
    }
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        _manager.AjaxSettings.AddAjaxSetting(cbIsPortalUser, cbEmail);
        _manager.AjaxSettings.AddAjaxSetting(cbIsPortalUser, btnReset);

        if (Request["UserID"] != null)
        {
            _userID = int.Parse(Request["UserID"]);
        }

        if (Request["OrganizationID"] != null)
        {
            _organizationID = int.Parse(Request["OrganizationID"]);
        }

        Organization organization = (Organization)Organizations.GetOrganization(UserSession.LoginUser, _organizationID);

        if (organization == null || organization.ParentID != UserSession.LoginUser.OrganizationID)
        {
            Response.Write("Invalid Request");
            Response.End();
            return;
        }

        if (!IsPostBack)
        {
            cbActive.Checked = true;
            Page.Title       = "New Contact";
            if (_userID > -1)
            {
                LoadUser(_userID);
            }
            //cbEmail.Visible = (_userID < 0);
            _fieldControls.RefID = _userID;
            _fieldControls.LoadValues();

            User            user = Users.GetUser(UserSession.LoginUser, _userID);
            RadComboBoxItem item = new RadComboBoxItem(organization.Name, organization.OrganizationID.ToString());
            item.Selected = true;
            cmbCustomer.Items.Add(item);
            Page.RegisterStartupScript("AddMasks", @"
        <script type=""text/javascript"">
          $('.masked').each(function (index) {
            $(this).mask($(this).attr('placeholder'));
          });
        </script>
      ");
        }



        trAdmin.Visible          = false;
        spanIsPortalUser.Visible = cbIsPortalUser.Visible = UserSession.CurrentUser.HasPortalRights && UserSession.CurrentUser.IsSystemAdmin && organization.HasPortalAccess;
        btnReset.Visible         = cbIsPortalUser.Visible && cbIsPortalUser.Checked && (_userID > -1) && _userID != UserSession.LoginUser.UserID;

        if (UserSession.CurrentUser.IsTSUser)
        {
            trAdmin.Visible          = true;
            cbActive.Visible         = true;
            cbIsFinanceAdmin.Visible = true;
            cbIsPortalUser.Visible   = true;
            cbIsSystemAdmin.Visible  = true;
            btnReset.Visible         = _userID > -1;
            btnWelcome.Visible       = _userID > -1;
            cbEmail.Visible          = !btnReset.Visible;
            cbEmail.Text             = "Send user a password email";
            btnReset.Text            = "Reset User Password";
        }
    }