protected void Page_Load(object sender, EventArgs e) { mNewsletter = EditedObjectParent as NewsletterInfo; if (mNewsletter == null) { RedirectToAccessDenied(GetString("general.invalidparameters")); } if (!mNewsletter.CheckPermissions(PermissionsEnum.Read, CurrentSiteName, CurrentUser)) { RedirectToAccessDenied(mNewsletter.TypeInfo.ModuleName, "Read"); } mBounceMonitoringEnabled = NewsletterHelper.MonitorBouncedEmails(CurrentSiteName); mTrackingEnabled = NewsletterHelper.IsTrackingAvailable(); if (mTrackingEnabled && !mBounceMonitoringEnabled) { ShowInformation(GetString("newsletter.viewadditionalstatsmessage")); } ScriptHelper.RegisterTooltip(this); // Initialize unigrid UniGrid.WhereCondition = String.Format("IssueNewsletterID={0} AND IssueVariantOfIssueID IS NULL", mNewsletter.NewsletterID); UniGrid.ZeroRowsText = GetString("Newsletter_Issue_List.NoIssuesFound"); UniGrid.OnAction += uniGrid_OnAction; UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload; UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound; // Initialize header actions InitHeaderActions(); // Prepare data for listing // Group clicked link records by IssueID with Columns LinkIssueID, UniqueUserClicks, VariantParent (to calculate clicked links through all variant) mClickedLinksSummary = ClickedLinkInfoProvider.GetClickedLinks() .Columns(new QueryColumn("LinkIssueID"), new AggregatedColumn(AggregationType.Count, "DISTINCT(ClickedLinkEmail)").As("UniqueUserClicks")) .Source(s => s.Join <LinkInfo>("ClickedLinkNewsletterLinkID", "LinkID")) .GroupBy("LinkIssueID"); // Prepare variant summaries mVariantIssueSummaries = IssueInfoProvider.GetIssues() .Columns(new QueryColumn("IssueVariantOfIssueID"), new AggregatedColumn(AggregationType.Sum, "IssueOpenedEmails").As("OpenedEmailsSum")) .WhereEquals("IssueNewsletterID", mNewsletter.NewsletterID) .GroupBy("IssueVariantOfIssueID") .Having("IssueVariantOfIssueID IS NOT NULL"); // AB Variant issues for current newsletter mVariantIssues = IssueInfoProvider.GetIssues() .Columns("IssueID", "IssueVariantOfIssueID") .WhereEquals("IssueNewsletterID", mNewsletter.NewsletterID) .WhereNotNull("IssueVariantOfIssueID"); AddBrokenEmailUrlNotifier(mNewsletter, lblUrlWarning); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); mNewsletter = EditedObjectParent as NewsletterInfo; if (mNewsletter == null) { RedirectToAccessDenied(GetString("general.invalidparameters")); } if (!mNewsletter.CheckPermissions(PermissionsEnum.Read, CurrentSiteName, CurrentUser)) { RedirectToAccessDenied(mNewsletter.TypeInfo.ModuleName, "Read"); } mBounceMonitoringEnabled = NewsletterHelper.MonitorBouncedEmails(CurrentSiteName); mTrackingEnabled = NewsletterHelper.IsTrackingAvailable(); if (mTrackingEnabled && !mBounceMonitoringEnabled) { ShowInformation(GetString("newsletter.viewadditionalstatsmessage")); } RegisterScripts(); InitializeUnigrid(); InitHeaderActions(); // Prepare data for listing // Group clicked link records by IssueID with Columns LinkIssueID, UniqueUserClicks, VariantParent (to calculate clicked links through all variant) mClickedLinksSummary = ClickedLinkInfo.Provider.Get() .Columns(new QueryColumn("LinkIssueID"), new AggregatedColumn(AggregationType.Count, "DISTINCT(ClickedLinkEmail)").As("UniqueUserClicks")) .Source(s => s.Join <LinkInfo>("ClickedLinkNewsletterLinkID", "LinkID")) .GroupBy("LinkIssueID"); // Prepare variant summaries mVariantIssueSummaries = IssueInfo.Provider.Get() .Columns(new QueryColumn("IssueVariantOfIssueID"), new AggregatedColumn(AggregationType.Sum, "IssueOpenedEmails").As("OpenedEmailsSum")) .WhereEquals("IssueNewsletterID", mNewsletter.NewsletterID) .GroupBy("IssueVariantOfIssueID") .Having("IssueVariantOfIssueID IS NOT NULL"); // AB Variant issues for current newsletter mVariantIssues = IssueInfo.Provider.Get() .Columns("IssueID", "IssueVariantOfIssueID") .WhereEquals("IssueNewsletterID", mNewsletter.NewsletterID) .WhereNotNull("IssueVariantOfIssueID"); AddBrokenEmailUrlNotifier(mNewsletter, lblUrlWarning); }
protected void Page_Load(object sender, EventArgs e) { mNewsletter = EditedObject as NewsletterInfo; if (mNewsletter == null) { RedirectToAccessDenied(GetString("general.invalidparameters")); } if (!mNewsletter.CheckPermissions(PermissionsEnum.Read, CurrentSiteName, CurrentUser)) { RedirectToAccessDenied(mNewsletter.TypeInfo.ModuleName, "Read"); } mBounceMonitoringEnabled = NewsletterHelper.MonitorBouncedEmails(CurrentSiteName); mOnlineMarketingEnabled = NewsletterHelper.OnlineMarketingAvailable(CurrentSiteName); mTrackingEnabled = NewsletterHelper.IsTrackingAvailable(); mABTestEnabled = NewsletterHelper.IsABTestingAvailable(); ScriptHelper.RegisterDialogScript(this); string scriptBlock = string.Format(@" function RefreshPage() {{ document.location.replace(document.location); }} function NewItem(id) {{ modalDialog('{0}?parentobjectid=' + id, 'NewsletterNewIssue', screen.availWidth - 10, screen.availHeight - 80); }} function ShowOpenedBy(id) {{ modalDialog('{1}?objectid=' + id, 'NewsletterIssueOpenedBy', '900px', '700px'); return false; }} function ViewClickedLinks(id) {{ modalDialog('{2}?objectid=' + id, 'NewsletterTrackedLinks', '900px', '700px'); return false; }}", ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_New.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_OpenedBy.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_TrackedLinks.aspx")); ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Actions", scriptBlock, true); // Initialize unigrid UniGrid.WhereCondition = String.Format("IssueNewsletterID={0} AND IssueVariantOfIssueID IS NULL", mNewsletter.NewsletterID); UniGrid.ZeroRowsText = GetString("Newsletter_Issue_List.NoIssuesFound"); UniGrid.OnAction += uniGrid_OnAction; UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload; UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound; // Initialize header actions InitHeaderActions(); }
protected void Page_Load(object sender, EventArgs e) { newsletterId = QueryHelper.GetInteger("newsletterid", 0); if (newsletterId == 0) { RequestHelper.EndResponse(); } // Get newsletter object and check its existence mNewsletter = NewsletterInfoProvider.GetNewsletterInfo(newsletterId); EditedObject = mNewsletter; string siteName = CMSContext.CurrentSiteName; mBounceMonitoringEnabled = NewsletterHelper.MonitorBouncedEmails(siteName); mOnlineMarketingEnabled = NewsletterHelper.OnlineMarketingAvailable(siteName); mTrackingEnabled = NewsletterHelper.IsTrackingAvailable(); mABTestEnabled = NewsletterHelper.IsABTestingAvailable(); ScriptHelper.RegisterDialogScript(this); string scriptBlock = string.Format(@" function RefreshPage() {{ document.location.replace(document.location); }} function NewItem(id) {{ modalDialog('{0}?newsletterid=' + id, 'NewsletterNewIssue', screen.availWidth - 10, screen.availHeight - 80); }} function ShowOpenedBy(id) {{ modalDialog('{1}?issueid=' + id, 'NewsletterIssueOpenedBy', '900px', '700px'); return false; }} function ViewClickedLinks(id) {{ modalDialog('{2}?issueid=' + id, 'NewsletterTrackedLinks', '900px', '700px'); return false; }}", ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_New.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_OpenedBy.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_TrackedLinks.aspx")); ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Actions", scriptBlock, true); // Initialize unigrid UniGrid.WhereCondition = String.Format("IssueNewsletterID={0} AND IssueVariantOfIssueID IS NULL", newsletterId); UniGrid.ZeroRowsText = GetString("Newsletter_Issue_List.NoIssuesFound"); UniGrid.OnAction += uniGrid_OnAction; UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload; UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound; // Initialize header actions InitHeaderActions(); }