/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated) { ErrorRedirector.TransferToLoginPage(this); } if (Page.IsPostBack) { return; } ctlDisplayIssues.PageSize = UserManager.GetProfilePageSize(); ctlDisplayIssues.CurrentPageIndex = 0; DisplayNameLabel.Text = string.Format(GetLocalResourceObject("MyIssuesPage_Title.Text").ToString(), Security.GetDisplayName()); ProjectListBoxFilter.DataSource = ProjectManager.GetByMemberUserName(Context.User.Identity.Name); ProjectListBoxFilter.DataTextField = "Name"; ProjectListBoxFilter.DataValueField = "Id"; ProjectListBoxFilter.DataBind(); ProjectListBoxFilter.Items.Insert(0, new ListItem(GetLocalResourceObject("ProjectListBoxFilter_SelectAll.Text").ToString(), "0")); ProjectListBoxFilter.SelectedIndex = 0; BindMembers(); ExcludeClosedIssuesFilter.Enabled = ViewIssuesDropDownFilter.SelectedValue != "Closed"; BindIssues(); }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { IList <string> segments = Request.GetFriendlyUrlSegments(); ProjectId = Int32.Parse(segments[0]); } catch { ProjectId = Request.QueryString.Get("pid", 0); } // If don't know project or issue then redirect to something missing page if (ProjectId == 0) { ErrorRedirector.TransferToSomethingMissingPage(Page); } CurrentProject = ProjectManager.GetById(ProjectId); litProject.Text = CurrentProject.Name; litProjectCode.Text = CurrentProject.Code; if (CurrentProject == null) { ErrorRedirector.TransferToNotFoundPage(Page); return; } //security check: add issue if (!UserManager.HasPermission(ProjectId, Common.Permission.AddIssue.ToString())) { ErrorRedirector.TransferToLoginPage(Page); } BindOptions(); BindDefaultValues(); //check users role permission for adding an attachment if (!Page.User.Identity.IsAuthenticated || !UserManager.HasPermission(ProjectId, Common.Permission.AddAttachment.ToString())) { pnlAddAttachment.Visible = false; } else if (HostSettingManager.Get(HostSettingNames.AllowAttachments, false) && CurrentProject.AllowAttachments) { pnlAddAttachment.Visible = true; } } //need to rebind these on every postback because of dynamic controls ctlCustomFields.DataSource = CustomFieldManager.GetByProjectId(ProjectId); ctlCustomFields.DataBind(); // The ExpandIssuePaths method is called to handle // the SiteMapResolve event. SiteMap.SiteMapResolve += ExpandIssuePaths; }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!UserManager.IsSuperUser()) { ErrorRedirector.TransferToLoginPage(this); } if (Page.IsPostBack) { return; } SortField = "Date"; BindData(); }
/// <summary> /// Page Load Event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { var s = GetLocalResourceObject("DeleteIssueQuestion").ToString().Trim().JsEncode(); lnkDelete.Attributes.Add("onclick", string.Format("return confirm('{0}');", s)); IssueId = Request.QueryString.Get("id", 0); // If don't know issue id then redirect to something missing page if (IssueId == 0) { ErrorRedirector.TransferToSomethingMissingPage(Page); } //set up global properties _currentIssue = IssueManager.GetById(IssueId); if (_currentIssue == null || _currentIssue.Disabled) { ErrorRedirector.TransferToNotFoundPage(Page); return; } //private issue check var issueVisible = IssueManager.CanViewIssue(_currentIssue, Security.GetUserName()); //private issue check if (!issueVisible) { ErrorRedirector.TransferToLoginPage(Page); } _currentProject = ProjectManager.GetById(_currentIssue.ProjectId); if (_currentProject == null) { ErrorRedirector.TransferToNotFoundPage(Page); return; } ProjectId = _currentProject.Id; if (_currentProject.AccessType == ProjectAccessType.Private && !User.Identity.IsAuthenticated) { ErrorRedirector.TransferToLoginPage(Page); } else if (User.Identity.IsAuthenticated && _currentProject.AccessType == ProjectAccessType.Private && !ProjectManager.IsUserProjectMember(User.Identity.Name, ProjectId)) { ErrorRedirector.TransferToLoginPage(Page); } BindValues(_currentIssue); // Page.Title = string.Concat(_currentIssue.FullId, ": ", Server.HtmlDecode(_currentIssue.Title)); lblIssueNumber.Text = string.Format("{0}-{1}", _currentProject.Code, IssueId); ctlIssueTabs.Visible = true; SetFieldSecurity(); if (!_currentProject.AllowIssueVoting) { VoteBox.Visible = false; } //set the referrer url if (Request.UrlReferrer != null) { if (Request.UrlReferrer.ToString() != Request.Url.ToString()) { Session["ReferrerUrl"] = Request.UrlReferrer.ToString(); } } else { Session["ReferrerUrl"] = string.Format("~/Issues/IssueList.aspx?pid={0}", ProjectId); } } Page.Title = string.Concat(lblIssueNumber.Text, ": ", Server.HtmlDecode(TitleTextBox.Text)); //need to rebind these on every postback because of dynamic controls ctlCustomFields.DataSource = CustomFieldManager.GetByIssueId(IssueId); ctlCustomFields.DataBind(); // The ExpandIssuePaths method is called to handle // the SiteMapResolve event. SiteMap.SiteMapResolve += ExpandIssuePaths; ctlIssueTabs.IssueId = IssueId; ctlIssueTabs.ProjectId = ProjectId; }