コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsVisitor()) // Redirect to home page if user hasn't permissions or not authenticated.
            {
                Response.Redirect("/");
            }
            Accounts = GetAccounts();
            MailAccountData defaultAccount;
            List<MailAccountData> commonAccounts;
            List<MailAccountData> serverAccounts;
            List<MailAccountData> aliases;
            List<MailAccountData> groups;
            Accounts.GetNeededAccounts(out defaultAccount, out commonAccounts, out serverAccounts, out aliases, out groups);
            DefaultAccount = defaultAccount;
            CommonAccounts = commonAccounts;
            ServerAccounts = serverAccounts;
            Aliases = aliases;
            Groups = groups;
            _manageFieldPopup.Options.IsPopup = true;
            _commonPopup.Options.IsPopup = true;

            Page.Title = HeaderStringHelper.GetPageTitle(Resources.MailResource.MailTitle);

            ProductEntryPoint.ConfigurePortal();

            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));

            MailSidePanelContainer.Controls.Add(LoadControl(TagBox.Location));

            MailControlContainer.Controls.Add(LoadControl(MailBox.Location));

            var help_center = (HelpCenter)LoadControl(HelpCenter.Location);
            help_center.IsSideBar = true;
            sideHelpCenter.Controls.Add(help_center);

            SupportHolder.Controls.Add(LoadControl(Support.Location));
            VideoGuides.Controls.Add(LoadControl(VideoGuidesControl.Location));
            UserForumHolder.Controls.Add(LoadControl(UserForum.Location));
            InviteUserHolder.Controls.Add(LoadControl(InviteLink.Location));

            PeopleGroupLocalize.Text = CustomNamingPeople.Substitute<Resources.MailResource>("FilterByGroup");

            // If user doesn't have any mailboxes this will showed.
            var mail_box_manager = new ASC.Mail.Aggregator.MailBoxManager();
            if (!mail_box_manager.HasMailboxes(TenantProvider.CurrentTenantID, SecurityContext.CurrentAccount.ID.ToString()))
                BlankModalPH.Controls.Add(LoadControl(BlankModal.Location));

            if (!IsCrmAvailable())
            {
                crmContactsContainer.Visible = false;
            }

            if (!IsPeopleAvailable())
            {
                tlContactsContainer.Visible = false;
            }

            Page.RegisterBodyScripts(LoadControl(VirtualPathUtility.ToAbsolute("~/addons/mail/masters/BodyScripts.ascx")));
            Page.RegisterStyleControl(LoadControl(VirtualPathUtility.ToAbsolute("~/addons/mail/masters/Styles.ascx")));
            Page.RegisterClientLocalizationScript(typeof(Masters.ClientScripts.ClientLocalizationResources));
            Page.RegisterClientLocalizationScript(typeof(Masters.ClientScripts.ClientTemplateResources));

            Master.DisabledHelpTour = true;

            Page.RegisterInlineScript(BuildErrorConstants());

            Page.RegisterInlineScript(BuildAlertTypes());
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsVisitor()) // Redirect to home page if user hasn't permissions or not authenticated.
            {
                Response.Redirect("/");
            }
            Accounts = GetAccounts();
            MailAccountData        defaultAccount;
            List <MailAccountData> commonAccounts;
            List <MailAccountData> serverAccounts;
            List <MailAccountData> aliases;
            List <MailAccountData> groups;

            Accounts.GetNeededAccounts(out defaultAccount, out commonAccounts, out serverAccounts, out aliases, out groups);
            DefaultAccount = defaultAccount;
            CommonAccounts = commonAccounts;
            ServerAccounts = serverAccounts;
            Aliases        = aliases;
            Groups         = groups;
            _manageFieldPopup.Options.IsPopup = true;
            _commonPopup.Options.IsPopup      = true;

            Page.Title = HeaderStringHelper.GetPageTitle(Resources.MailResource.MailTitle);

            ProductEntryPoint.ConfigurePortal();

            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));

            MailSidePanelContainer.Controls.Add(LoadControl(TagBox.Location));

            MailControlContainer.Controls.Add(LoadControl(MailBox.Location));

            var help_center = (HelpCenter)LoadControl(HelpCenter.Location);

            help_center.IsSideBar = true;
            sideHelpCenter.Controls.Add(help_center);

            SupportHolder.Controls.Add(LoadControl(Support.Location));
            VideoGuides.Controls.Add(LoadControl(VideoGuidesControl.Location));
            UserForumHolder.Controls.Add(LoadControl(UserForum.Location));
            InviteUserHolder.Controls.Add(LoadControl(InviteLink.Location));

            PeopleGroupLocalize.Text = CustomNamingPeople.Substitute <Resources.MailResource>("FilterByGroup");

            // If user doesn't have any mailboxes this will showed.
            var mail_box_manager = new ASC.Mail.Aggregator.MailBoxManager();

            if (!mail_box_manager.HasMailboxes(TenantProvider.CurrentTenantID, SecurityContext.CurrentAccount.ID.ToString()))
            {
                BlankModalPH.Controls.Add(LoadControl(BlankModal.Location));
            }

            if (!IsCrmAvailable())
            {
                crmContactsContainer.Visible = false;
            }

            if (!IsPeopleAvailable())
            {
                tlContactsContainer.Visible = false;
            }

            Page.RegisterBodyScripts(LoadControl(VirtualPathUtility.ToAbsolute("~/addons/mail/masters/BodyScripts.ascx")));
            Page.RegisterStyleControl(LoadControl(VirtualPathUtility.ToAbsolute("~/addons/mail/masters/Styles.ascx")));
            Page.RegisterClientLocalizationScript(typeof(Masters.ClientScripts.ClientLocalizationResources));
            Page.RegisterClientLocalizationScript(typeof(Masters.ClientScripts.ClientTemplateResources));

            Master.DisabledHelpTour = true;

            Page.RegisterInlineScript(BuildErrorConstants());

            Page.RegisterInlineScript(BuildAlertTypes());
        }