protected void Page_Load(object sender, EventArgs e) { mEmail = QueryHelper.GetString(Server.UrlDecode("email"), String.Empty); Guid subscriptionGUID = QueryHelper.GetGuid("guid", Guid.Empty); mReportSubscriptionInfo = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(subscriptionGUID); if (mReportSubscriptionInfo != null) { mReportInfo = ReportInfoProvider.GetReportInfo(mReportSubscriptionInfo.ReportSubscriptionReportID); if (mReportInfo != null) { // Set info label based by subscription's report lblInfo.Text = String.Format(GetString("reportsubscription.unsubscription.info"), HTMLHelper.HTMLEncode(mEmail), HTMLHelper.HTMLEncode(mReportInfo.ReportDisplayName)); } } else { ShowError(GetString("reportsubscription.notfound")); pnlInfo.Visible = false; btnUnsubscribe.Enabled = false; } btnUnsubscribe.Text = GetString("reportsubscription.unsubscribe"); Title = GetString("reportsubscription.unsubscribe.title"); PageTitle.TitleText = GetString("reportsubscription.unsubscribe.title"); }
protected void Page_Load(object sender, EventArgs e) { email = QueryHelper.GetString(Server.UrlDecode("email"), String.Empty); Guid subscriptionGUID = QueryHelper.GetGuid("guid", Guid.Empty); rsi = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(subscriptionGUID); if (rsi != null) { ri = ReportInfoProvider.GetReportInfo(rsi.ReportSubscriptionReportID); if (ri != null) { // Set info label based by subscription's report lblInfo.Text = String.Format(GetString("reportsubscription.unsubscription.info"), email, ri.ReportDisplayName); } } else { ShowError(GetString("reportsubscription.notfound")); pnlInfo.Visible = false; btnUnsubscribe.Enabled = false; } btnUnsubscribe.Text = GetString("reportsubscription.unsubscribe"); Title = GetString("reportsubscription.unsubscribe.title"); CurrentMaster.Title.TitleText = GetString("reportsubscription.unsubscribe.title"); CurrentMaster.Title.TitleImage = GetImageUrl("/CMSModules/CMS_Reporting/Subscription24.png"); }
void gridElem_OnAction(string actionName, object actionArgument) { if (actionName == "delete") { int id = ValidationHelper.GetInteger(actionArgument, 0); var cui = MembershipContext.AuthenticatedUser; bool haveModify = cui.IsAuthorizedPerResource("cms.reporting", "modify"); if (!(cui.IsAuthorizedPerResource("cms.reporting", "subscribe") || haveModify)) { RedirectToAccessDenied("cms.reporting", "Subscribe"); } if (!cui.IsAuthorizedPerResource("cms.reporting", "modify")) { ReportSubscriptionInfo rsi = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(id); if ((rsi != null) && (rsi.ReportSubscriptionUserID != cui.UserID)) { RedirectToAccessDenied(GetString("reportsubscription.onlymodifyusersallowed")); } } ReportSubscriptionInfoProvider.DeleteReportSubscriptionInfo(id); } }
protected void Page_Load(object sender, EventArgs e) { email = QueryHelper.GetString(Server.UrlDecode("email"), String.Empty); Guid subscriptionGUID = QueryHelper.GetGuid("guid", Guid.Empty); rsi = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(subscriptionGUID); if (rsi != null) { ri = ReportInfoProvider.GetReportInfo(rsi.ReportSubscriptionReportID); if (ri != null) { // Set info label based by subscription's report lblInfo.Text = String.Format(GetString("reportsubscription.unsubscription.info"), email, ri.ReportDisplayName); } } else { ShowError(GetString("reportsubscription.notfound")); pnlInfo.Visible = false; btnUnsubscribe.Enabled = false; } btnUnsubscribe.Text = GetString("reportsubscription.unsubscribe"); Title = GetString("reportsubscription.unsubscribe.title"); CurrentMaster.Title.TitleText = GetString("reportsubscription.unsubscribe.title"); CurrentMaster.Title.TitleImage = GetImageUrl("/CMSModules/CMS_Reporting/Subscription24.png"); }
protected override void OnInit(EventArgs e) { // Security check UseCMSDeskAccessDeniedPage = !IsLiveSite; var cui = MembershipContext.AuthenticatedUser; bool haveModify = cui.IsAuthorizedPerResource("cms.reporting", "modify"); if (!(cui.IsAuthorizedPerResource("cms.reporting", "subscribe") || haveModify)) { RedirectToAccessDenied("cms.reporting", "Subscribe"); } // Init validators rfvEmail.Text = GetString("om.contact.enteremail"); rfvSubject.Text = GetString("bizformgeneral.emptyemailsubject"); var subscriptionId = QueryHelper.GetInteger("SubscriptionID", 0); mReportSubscriptionInfo = subscriptionId > 0 ? ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(QueryHelper.GetInteger("SubscriptionID", 0)) : new ReportSubscriptionInfo(); // Set edited object EditedObject = mReportSubscriptionInfo; int reportID = QueryHelper.GetInteger("ReportID", 0); string reportName = QueryHelper.GetString("reportName", String.Empty); if (reportID != 0) { Report = ReportInfoProvider.GetReportInfo(reportID); } else if (!String.IsNullOrEmpty(reportName)) { Report = ReportInfoProvider.GetReportInfo(reportName); } else { if (mReportSubscriptionInfo.ReportSubscriptionID > 0) { // If no report specified, get it from subscription Report = ReportInfoProvider.GetReportInfo(mReportSubscriptionInfo.ReportSubscriptionReportID); } } if ((mReportSubscriptionInfo.ReportSubscriptionID > 0) && !haveModify && !SimpleMode) { if (mReportSubscriptionInfo.ReportSubscriptionUserID != cui.UserID) { RedirectToAccessDenied(GetString("reportsubscription.onlymodifyusersallowed")); } } if (Report == null) { return; } // Set interval control for subscription mode ucInterval.DisplayStartTime = false; ucInterval.DisplayOnce = false; ucInterval.DisplaySecond = false; if (!RequestHelper.IsPostBack()) { drpLast.Items.Add(new ListItem(GetString("reportsubscription.hours"), "hour")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.days"), "day")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.weeks"), "week")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.months"), "month")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.years"), "year")); } if (SimpleMode) { LoadAdHoc(); } else { LoadData(); } // Show save changes after new object created if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false)) { ShowChangesSaved(); } base.OnInit(e); }
protected override void OnInit(EventArgs e) { // Security check UseCMSDeskAccessDeniedPage = !IsLiveSite; var cui = MembershipContext.AuthenticatedUser; bool haveModify = cui.IsAuthorizedPerResource("cms.reporting", "modify"); if (!(cui.IsAuthorizedPerResource("cms.reporting", "subscribe") || haveModify)) { RedirectToAccessDenied("cms.reporting", "Subscribe"); } // Init validators rfvEmail.Text = GetString("om.contact.enteremail"); rfvSubject.Text = GetString("bizformgeneral.emptyemailsubject"); var subscriptionId = QueryHelper.GetInteger("SubscriptionID", 0); mReportSubscriptionInfo = subscriptionId > 0 ? ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(QueryHelper.GetInteger("SubscriptionID", 0)) : new ReportSubscriptionInfo(); // Set edited object EditedObject = mReportSubscriptionInfo; int reportID = QueryHelper.GetInteger("ReportID", 0); string reportName = QueryHelper.GetString("reportName", String.Empty); if (reportID != 0) { Report = ReportInfoProvider.GetReportInfo(reportID); } else if (!String.IsNullOrEmpty(reportName)) { Report = ReportInfoProvider.GetReportInfo(reportName); } else { if (mReportSubscriptionInfo.ReportSubscriptionID > 0) { // If no report specified, get it from subscription Report = ReportInfoProvider.GetReportInfo(mReportSubscriptionInfo.ReportSubscriptionReportID); } } if ((mReportSubscriptionInfo.ReportSubscriptionID > 0) && !haveModify && !SimpleMode) { if (mReportSubscriptionInfo.ReportSubscriptionUserID != cui.UserID) { RedirectToAccessDenied(GetString("reportsubscription.onlymodifyusersallowed")); } } if (Report == null) { return; } // Set interval control for subscription mode ucInterval.DisplayStartTime = false; ucInterval.DisplayOnce = false; ucInterval.DisplaySecond = false; if (!RequestHelper.IsPostBack()) { drpLast.Items.Add(new ListItem(GetString("reportsubscription.hours"), "hour")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.days"), "day")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.weeks"), "week")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.months"), "month")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.years"), "year")); } if (SimpleMode) { LoadAdHoc(); } else { LoadData(); } // Show save changes after new object created if (!RequestHelper.IsPostBack() && QueryHelper.GetBoolean("saved", false)) { ShowChangesSaved(); } base.OnInit(e); }
/// <summary> /// Checks if given subscription is for current user. /// </summary> /// <param name="subscriptionID">Subscription ID</param> /// <returns>True if subscription belongs to user, false if not</returns> private bool CheckSecurity(int subscriptionID) { ReportSubscriptionInfo rsi = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(subscriptionID); return(rsi.ReportSubscriptionUserID == UserID); }
protected override void OnInit(EventArgs e) { UseCMSDeskAccessDeniedPage = !IsLiveSite; CurrentUserInfo cui = CMSContext.CurrentUser; bool haveModify = cui.IsAuthorizedPerResource("cms.reporting", "modify"); if (!(cui.IsAuthorizedPerResource("cms.reporting", "subscribe") || haveModify)) { RedirectToAccessDenied("cms.reporting", "Subscribe"); } pnlBasic.GroupingText = GetString("reportsubscription.settings"); pnlParameters.GroupingText = GetString("reportsubscription.parameters.title"); // Init validator rfvEmail.Text = GetString("om.contact.enteremail"); rfvSubject.Text = GetString("bizformgeneral.emptyemailsubject"); rsi = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(QueryHelper.GetInteger("SubscriptionID", 0)); int reportID = QueryHelper.GetInteger("ReportID", 0); String reportName = QueryHelper.GetString("reportName", String.Empty); if (reportID != 0) { ri = ReportInfoProvider.GetReportInfo(reportID); } else if (!String.IsNullOrEmpty(reportName)) { ri = ReportInfoProvider.GetReportInfo(reportName); } else { if (rsi != null) { // If no report specified, get it from subscription ri = ReportInfoProvider.GetReportInfo(rsi.ReportSubscriptionReportID); } } if ((rsi != null) && !haveModify && !SimpleMode) { if (rsi.ReportSubscriptionUserID != cui.UserID) { RedirectToAccessDenied(GetString("reportsubscription.onlymodifyusersallowed")); } } if (ri == null) { return; } // Set interval control for subscription mode ucInterval.DisplayStartTime = false; ucInterval.DisplayOnce = false; ucInterval.DisplaySecond = false; if (!RequestHelper.IsPostBack()) { drpLast.Items.Add(new ListItem(GetString("reportsubscription.hours"), "hour")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.days"), "day")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.weeks"), "week")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.months"), "month")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.years"), "year")); } if (SimpleMode) { LoadAdHoc(); } else { LoadData(); } // Show save changes after new object created if (!RequestHelper.IsPostBack() && (QueryHelper.GetBoolean("saved", false) == true)) { ShowChangesSaved(); } base.OnInit(e); }
/// <summary> /// Saves the control. Returns false, if error eccured. /// </summary> public bool Save() { // Validates input data String error = ValidateData(); if (!String.IsNullOrEmpty(error)) { ShowError(error); return(false); } if (ri != null) { bool isNew = false; if (rsi == null) { // Create new object for new subscription rsi = new ReportSubscriptionInfo(); rsi.ReportSubscriptionUserID = CMSContext.CurrentUser.UserID; rsi.ReportSubscriptionSiteID = CMSContext.CurrentSiteID; rsi.ReportSubscriptionSettings["ReportInterval"] = intervalStr; isNew = true; } if (!SimpleMode) { // Save basic form & validates basic form data if (!formElem.SaveData(null)) { return(false); } // Store all parameters in basic form to string XML representation drParameters = formElem.DataRow; rsi.ReportSubscriptionValueID = 0; rsi.ReportSubscriptionTableID = 0; rsi.ReportSubscriptionGraphID = 0; // If subscription is not for whole report, store item ID String drpValue = drpItems.SelectedValue; if (drpValue != "all") { int id = ValidationHelper.GetInteger(drpValue.Substring(1), 0); if (drpValue.Contains('g')) { rsi.ReportSubscriptionGraphID = id; } if (drpValue.Contains('t')) { rsi.ReportSubscriptionTableID = id; } if (drpValue.Contains('v')) { rsi.ReportSubscriptionValueID = id; } } } else { rsi.ReportSubscriptionGraphID = graphID; rsi.ReportSubscriptionTableID = tableID; rsi.ReportSubscriptionValueID = valueID; } if (drParameters != null) { // Find special 'from' and 'to' parameters. DataColumn dcFrom = drParameters.Table.Columns["fromdate"]; DataColumn dcTo = drParameters.Table.Columns["todate"]; if (rbTime.Checked) { if (dcTo != null) { // Convert column from datetime to string to enable store macros drParameters.Table.Columns.Remove(dcTo.ColumnName); drParameters.Table.Columns.Add(dcTo.ColumnName, typeof(String)); // Add current date time macro drParameters[dcTo.ColumnName] = "{%CurrentDateTime%}"; } // Create right macro datetime command based on given interval. String command = String.Empty; switch (drpLast.SelectedValue) { case "hour": command = "AddHours"; break; case "day": command = "AddDays"; break; case "week": command = "AddWeeks"; break; case "month": command = "AddMonths"; break; case "year": command = "AddYears"; break; } // Create todate macro int last = ValidationHelper.GetInteger(txtLast.Text.Trim(), 0); String dateCommand = String.Format("{{%CurrentDateTime.{0}({1})%}}", command, last * (-1)); // Convert fromdate to string if (dcFrom != null) { drParameters.Table.Columns.Remove(dcFrom.ColumnName); drParameters.Table.Columns.Add(dcFrom.ColumnName, typeof(String)); drParameters[dcFrom.ColumnName] = dateCommand; } } else { // Empty fromdate and todate for uncheck limit date if (dcFrom != null) { drParameters[dcFrom.ColumnName] = DBNull.Value; } if (dcTo != null) { drParameters[dcTo.ColumnName] = DBNull.Value; } } // Write parameters to XML string representation rsi.ReportSubscriptionParameters = ReportHelper.WriteParametersToXml(drParameters); } String email = txtEmail.Text.Trim(); bool emailChanged = rsi.ReportSubscriptionEmail != email; rsi.ReportSubscriptionEnabled = chkEnabled.Checked; rsi.ReportSubscriptionReportID = ri.ReportID; rsi.ReportSubscriptionInterval = ucInterval.ScheduleInterval; rsi.ReportSubscriptionEmail = email; rsi.ReportSubscriptionSubject = txtSubject.Text; rsi.ReportSubscriptionCondition = ucMacroEditor.Text; rsi.ReportSubscriptionOnlyNonEmpty = chkNonEmpty.Checked; rsi.ReportSubscriptionNextPostDate = SchedulingHelper.GetNextTime(ucInterval.ScheduleInterval, DateTimeHelper.ZERO_TIME, DateTimeHelper.ZERO_TIME); ReportSubscriptionInfoProvider.SetReportSubscriptionInfo(rsi); // Check whether email changed (applies for new subscription also) if (emailChanged) { String siteName = CMSContext.CurrentSiteName; EmailTemplateInfo eti = EmailTemplateProvider.GetEmailTemplate("Reporting_Subscription_information", siteName); if (eti != null) { // Send information email EmailMessage em = new EmailMessage(); em.EmailFormat = EmailFormatEnum.Default; em.From = String.IsNullOrEmpty(eti.TemplateFrom) ? EmailHelper.Settings.NotificationsSenderAdress(siteName) : eti.TemplateFrom;; em.Recipients = email; em.Subject = eti.TemplateSubject; em.BccRecipients = eti.TemplateBcc; em.CcRecipients = eti.TemplateCc; MacroResolver resolver = ReportSubscriptionSender.CreateSubscriptionMacroResolver(ri, rsi, CMSContext.CurrentSite, em.Recipients); em.Body = resolver.ResolveMacros(eti.TemplateText); em.PlainTextBody = resolver.ResolveMacros(eti.TemplatePlainText); MetaFileInfoProvider.ResolveMetaFileImages(em, eti.TemplateID, EmailObjectType.EMAILTEMPLATE, MetaFileInfoProvider.OBJECT_CATEGORY_TEMPLATE); EmailSender.SendEmail(siteName, em); } } // For new item and advanced mode redirect to store ID in query string if ((isNew) && (!SimpleMode)) { URLHelper.Redirect(URLHelper.CurrentURL + "&saved=1&subscriptionid=" + rsi.ReportSubscriptionID); } ShowChangesSaved(); return(true); } return(false); }
/// <summary> /// Saves the control. Returns false, if error eccured. /// </summary> public bool Save() { // Validates input data String error = ValidateData(); if (!String.IsNullOrEmpty(error)) { ShowError(error); return false; } if (ri != null) { bool isNew = false; if (rsi == null) { // Create new object for new subscription rsi = new ReportSubscriptionInfo(); rsi.ReportSubscriptionUserID = CMSContext.CurrentUser.UserID; rsi.ReportSubscriptionSiteID = CMSContext.CurrentSiteID; rsi.ReportSubscriptionSettings["ReportInterval"] = intervalStr; isNew = true; } if (!SimpleMode) { // Save basic form & validates basic form data if (!formElem.SaveData(null)) { return false; } // Store all parameters in basic form to string XML representation drParameters = formElem.DataRow; rsi.ReportSubscriptionValueID = 0; rsi.ReportSubscriptionTableID = 0; rsi.ReportSubscriptionGraphID = 0; // If subscription is not for whole report, store item ID String drpValue = drpItems.SelectedValue; if (drpValue != "all") { int id = ValidationHelper.GetInteger(drpValue.Substring(1), 0); if (drpValue.Contains('g')) { rsi.ReportSubscriptionGraphID = id; } if (drpValue.Contains('t')) { rsi.ReportSubscriptionTableID = id; } if (drpValue.Contains('v')) { rsi.ReportSubscriptionValueID = id; } } } else { rsi.ReportSubscriptionGraphID = graphID; rsi.ReportSubscriptionTableID = tableID; rsi.ReportSubscriptionValueID = valueID; } if (drParameters != null) { // Find special 'from' and 'to' parameters. DataColumn dcFrom = drParameters.Table.Columns["fromdate"]; DataColumn dcTo = drParameters.Table.Columns["todate"]; if (rbTime.Checked) { if (dcTo != null) { // Convert column from datetime to string to enable store macros drParameters.Table.Columns.Remove(dcTo.ColumnName); drParameters.Table.Columns.Add(dcTo.ColumnName, typeof(String)); // Add current date time macro drParameters[dcTo.ColumnName] = "{%CurrentDateTime%}"; } // Create right macro datetime command based on given interval. String command = String.Empty; switch (drpLast.SelectedValue) { case "hour": command = "AddHours"; break; case "day": command = "AddDays"; break; case "week": command = "AddWeeks"; break; case "month": command = "AddMonths"; break; case "year": command = "AddYears"; break; } // Create todate macro int last = ValidationHelper.GetInteger(txtLast.Text.Trim(), 0); String dateCommand = String.Format("{{%CurrentDateTime.{0}({1})%}}", command, last * (-1)); // Convert fromdate to string if (dcFrom != null) { drParameters.Table.Columns.Remove(dcFrom.ColumnName); drParameters.Table.Columns.Add(dcFrom.ColumnName, typeof(String)); drParameters[dcFrom.ColumnName] = dateCommand; } } else { // Empty fromdate and todate for uncheck limit date if (dcFrom != null) { drParameters[dcFrom.ColumnName] = DBNull.Value; } if (dcTo != null) { drParameters[dcTo.ColumnName] = DBNull.Value; } } // Write parameters to XML string representation rsi.ReportSubscriptionParameters = ReportHelper.WriteParametersToXml(drParameters); } String email = txtEmail.Text.Trim(); bool emailChanged = rsi.ReportSubscriptionEmail != email; rsi.ReportSubscriptionEnabled = chkEnabled.Checked; rsi.ReportSubscriptionReportID = ri.ReportID; rsi.ReportSubscriptionInterval = ucInterval.ScheduleInterval; rsi.ReportSubscriptionEmail = email; rsi.ReportSubscriptionSubject = txtSubject.Text; rsi.ReportSubscriptionCondition = ucMacroEditor.Text; rsi.ReportSubscriptionOnlyNonEmpty = chkNonEmpty.Checked; rsi.ReportSubscriptionNextPostDate = SchedulingHelper.GetNextTime(ucInterval.ScheduleInterval, DateTimeHelper.ZERO_TIME, DateTimeHelper.ZERO_TIME); ReportSubscriptionInfoProvider.SetReportSubscriptionInfo(rsi); // Check whether email changed (applies for new subscription also) if (emailChanged) { String siteName = CMSContext.CurrentSiteName; EmailTemplateInfo eti = EmailTemplateProvider.GetEmailTemplate("Reporting_Subscription_information", siteName); if (eti != null) { // Send information email EmailMessage em = new EmailMessage(); em.EmailFormat = EmailFormatEnum.Default; em.From = String.IsNullOrEmpty(eti.TemplateFrom) ? EmailHelper.Settings.NotificationsSenderAdress(siteName) : eti.TemplateFrom; ; em.Recipients = email; em.Subject = eti.TemplateSubject; em.BccRecipients = eti.TemplateBcc; em.CcRecipients = eti.TemplateCc; MacroResolver resolver = ReportSubscriptionSender.CreateSubscriptionMacroResolver(ri, rsi, CMSContext.CurrentSite, em.Recipients); em.Body = resolver.ResolveMacros(eti.TemplateText); em.PlainTextBody = resolver.ResolveMacros(eti.TemplatePlainText); MetaFileInfoProvider.ResolveMetaFileImages(em, eti.TemplateID, EmailObjectType.EMAILTEMPLATE, MetaFileInfoProvider.OBJECT_CATEGORY_TEMPLATE); EmailSender.SendEmail(siteName, em); } } // For new item and advanced mode redirect to store ID in query string if ((isNew) && (!SimpleMode)) { URLHelper.Redirect(URLHelper.CurrentURL + "&saved=1&subscriptionid=" + rsi.ReportSubscriptionID); } ShowChangesSaved(); return true; } return false; }
protected override void OnInit(EventArgs e) { UseCMSDeskAccessDeniedPage = !IsLiveSite; CurrentUserInfo cui = CMSContext.CurrentUser; bool haveModify = cui.IsAuthorizedPerResource("cms.reporting", "modify"); if (!(cui.IsAuthorizedPerResource("cms.reporting", "subscribe") || haveModify)) { RedirectToAccessDenied("cms.reporting", "Subscribe"); } pnlBasic.GroupingText = GetString("reportsubscription.settings"); pnlParameters.GroupingText = GetString("reportsubscription.parameters.title"); // Init validator rfvEmail.Text = GetString("om.contact.enteremail"); rfvSubject.Text = GetString("bizformgeneral.emptyemailsubject"); rsi = ReportSubscriptionInfoProvider.GetReportSubscriptionInfo(QueryHelper.GetInteger("SubscriptionID", 0)); int reportID = QueryHelper.GetInteger("ReportID", 0); String reportName = QueryHelper.GetString("reportName", String.Empty); if (reportID != 0) { ri = ReportInfoProvider.GetReportInfo(reportID); } else if (!String.IsNullOrEmpty(reportName)) { ri = ReportInfoProvider.GetReportInfo(reportName); } else { if (rsi != null) { // If no report specified, get it from subscription ri = ReportInfoProvider.GetReportInfo(rsi.ReportSubscriptionReportID); } } if ((rsi != null) && !haveModify && !SimpleMode) { if (rsi.ReportSubscriptionUserID != cui.UserID) { RedirectToAccessDenied(GetString("reportsubscription.onlymodifyusersallowed")); } } if (ri == null) { return; } // Set interval control for subscription mode ucInterval.DisplayStartTime = false; ucInterval.DisplayOnce = false; ucInterval.DisplaySecond = false; if (!RequestHelper.IsPostBack()) { drpLast.Items.Add(new ListItem(GetString("reportsubscription.hours"), "hour")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.days"), "day")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.weeks"), "week")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.months"), "month")); drpLast.Items.Add(new ListItem(GetString("reportsubscription.years"), "year")); } if (SimpleMode) { LoadAdHoc(); } else { LoadData(); } // Show save changes after new object created if (!RequestHelper.IsPostBack() && (QueryHelper.GetBoolean("saved", false) == true)) { ShowChangesSaved(); } base.OnInit(e); }