Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!VoipPaymentSettings.IsEnabled)
            {
                Response.Redirect(PathProvider.StartURL() + "settings.aspx");
            }

            var emptyScreenControl = new EmptyScreenControl
                {
                    ID = "voip-calls-empty-list-box",
                    ImgSrc = WebPath.GetPath("usercontrols/feed/images/empty_screen_feed.png"),
                    Header = UserControlsCommonResource.VoipCallsNotFound,
                    Describe = UserControlsCommonResource.VoipCallsNotFoundDescription
                };
            controlsHolder.Controls.Add(emptyScreenControl);

            var emptyScreenFilterControl = new EmptyScreenControl
            {
                ID = "voip-calls-empty-filter-box",
                ImgSrc = WebPath.GetPath("usercontrols/feed/images/empty_filter.png"),
                Header = UserControlsCommonResource.FilterNoVoipCalls,
                Describe = UserControlsCommonResource.FilterNoVoipCallsDescription,
                ButtonHTML = string.Format("<a href='javascript:void(0)' class='baseLinkAction clearFilterButton'>{0}</a>",
                                           UserControlsCommonResource.ResetFilter)
            };
            controlsHolder.Controls.Add(emptyScreenFilterControl);

            Page.RegisterBodyScripts(PathProvider.GetFileStaticRelativePath("voip.calls.js"));
        }
Exemplo n.º 2
0
        private void LoadData()
        {
            var storage = StorageFactory.GetStorage();
            var list = storage.GetAlbumItemsLastCommented((_selectedPage - 1)*_CountPhotoPerPage, _CountPhotoPerPage);
            var count = (int) storage.GetAlbumItemsLastCommentedCount();

            if (list.Count == 0)
            {
                var emptyScreenControl = new EmptyScreenControl
                                             {
                                                 ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_photo_icon.png", PhotoConst.ModuleID),
                                                 Header = PhotoManagerResource.EmptyScreenLatestCommentsCaption,
                                                 Describe = PhotoManagerResource.EmptyScreenText,
                                                 ButtonHTML = CommunitySecurity.CheckPermissions(PhotoConst.Action_AddPhoto) ? String.Format("<a class='linkAddMediumText' href='" + PhotoConst.PAGE_ADD_PHOTO + "'>{0}</a>", PhotoManagerResource.EmptyScreenLatestCommentsLink) : String.Empty
                                             };

                _contentHolder.Controls.Add(emptyScreenControl);
            }
            else
            {
                var pageNavigator = new Web.Controls.PageNavigator
                                        {
                                            PageUrl = PhotoConst.PAGE_LAST_COMMENTED + "?t=&",
                                            CurrentPageNumber = _selectedPage,
                                            EntryCountOnPage = _CountPhotoPerPage,
                                            VisiblePageCount = 5,
                                            ParamName = "page",
                                            EntryCount = count
                                        };

                pageNavigatorHolder.Controls.Add(pageNavigator);

                RenderImagesList(list);
            }
        }
Exemplo n.º 3
0
        private void CreateEmptyPanel()
        {
            var buttons = "<a id='uploadFirstFile' class='baseLinkAction'>" + MenuUploadFile + "</a><br/>" +
                          "<a id='createFirstDocument' class='baseLinkAction'>" + MenuNewDocument + "</a><img id='firstDocComb' src= '" + VirtualPathUtility.ToAbsolute("~/UserControls/Common/Attachments/Images/combobox_black.png") + "' class='newDocComb'/>";
            if(ModuleName!="crm")
            {
                buttons += "<br/><a id='attachProjDocuments' class='baseLinkAction'>" + MenuProjectDocuments + "</a>";
            }

            var emptyParticipantScreenControl = new EmptyScreenControl
            {
                ImgSrc = VirtualPathUtility.ToAbsolute("~/UserControls/Common/Attachments/Images/documents-logo.png"),
                Header = Resources.UserControlsCommonResource.EmptyListDocumentsHead,
                Describe = String.Format(Resources.UserControlsCommonResource.EmptyListDocumentsDescr,
                    //create
                                         "<span class='hintCreate baseLinkAction' >", "</span>",
                    //upload
                                         "<span class='hintUpload baseLinkAction' >", "</span>",
                    //open
                                         "<span class='hintOpen baseLinkAction' >", "</span>",
                    //edit
                                         "<span class='hintEdit baseLinkAction' >", "</span>"),
                ButtonHTML = buttons
            };
            _phEmptyDocView.Controls.Add(emptyParticipantScreenControl);
        }
Exemplo n.º 4
0
        private void LoadControls()
        {
            var feedList = (FeedList)LoadControl(FeedList.Location);

            controlsHolder.Controls.Add(feedList);

            var emptyScreenFilter = new Controls.Common.EmptyScreenControl
            {
                ImgSrc     = WebPath.GetPath("usercontrols/feed/images/empty_filter.png"),
                Header     = UserControlsCommonResource.FilterNoNews,
                Describe   = UserControlsCommonResource.FilterNoNewsDescription,
                ButtonHTML =
                    string.Format("<a href='javascript:void(0)' class='baseLinkAction clearFilterButton'>{0}</a>",
                                  UserControlsCommonResource.ResetFilter)
            };

            controlsHolder.Controls.Add(emptyScreenFilter);

            var emptyScreenControl = new Controls.Common.EmptyScreenControl
            {
                ImgSrc   = WebPath.GetPath("usercontrols/feed/images/empty_screen_feed.png"),
                Header   = UserControlsCommonResource.NewsNotFound,
                Describe = UserControlsCommonResource.NewsNotFoundDescription
            };

            controlsHolder.Controls.Add(emptyScreenControl);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumManager.Instance.SetCurrentPage(ForumPage.Default);

            List<ThreadCategory> categories;
            List<Thread> threads;

            ForumDataProvider.GetThreadCategories(TenantProvider.CurrentTenantID, true, out categories, out threads);

            if (0 < categories.Count)
            {
                var categoryListControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/ThreadCategoryListControl.ascx") as UserControls.Forum.ThreadCategoryListControl;
                categoryListControl.Categories = categories;
                categoryListControl.Threads = threads;
                categoryListControl.SettingsID = ForumManager.Settings.ID;
                forumListHolder.Controls.Add(categoryListControl);

                (Master as ForumMasterPage).CurrentPageCaption = ForumResource.ForumsBreadCrumbs;
            }
            else
            {
                _headerHolder.Visible = false;

                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                        Header = ForumResource.EmptyScreenForumCaption,
                        Describe = ForumResource.EmptyScreenForumText,
                        ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null) ? String.Format("<a class='link underline blue plus' href='NewForum.aspx'>{0}</a>", ForumResource.EmptyScreenForumLink) : String.Empty
                    };
                forumListHolder.Controls.Add(emptyScreenControl);
            }

            Title = HeaderStringHelper.GetPageTitle((Master as ForumMasterPage).CurrentPageCaption ?? ForumResource.AddonName);
        }
Exemplo n.º 6
0
        protected string RenderForumCategories()
        {
            List<ThreadCategory> categories;
            List<Thread> threads;
            ForumDataProvider.GetThreadCategories(TenantProvider.CurrentTenantID, out categories, out threads);

            var sb = new StringBuilder();

            HasCategories = categories.Count > 0;

            if (HasCategories)
            {
                foreach (var category in categories)
                    sb.Append(RenderForumCategory(category, threads.FindAll(t => t.CategoryID == category.ID)));
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                        Header = Resources.ForumResource.EmptyScreenForumCaption,
                        Describe = Resources.ForumResource.EmptyScreenForumText,
                        ButtonHTML = String.Format("<a class='link underline blue plus' href='NewForum.aspx'>{0}</a>", Resources.ForumResource.EmptyScreenForumLink)
                    };
                EmptyContent.Controls.Add(emptyScreenControl);
            }

            return sb.ToString();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.RegisterTypeForAjax(this.GetType());

            _templateConatainerPanel.Options.IsPopup = true;
            _templatePanel.Options.IsPopup = true;

            var entityType = StringToEntityType(Request["view"]);

            InitViewSwitcher(entityType);

            RegisterClientScript(entityType);

            var cntrlCategorySelector = (CategorySelector)LoadControl(CategorySelector.Location);
            cntrlCategorySelector.Categories = Global.DaoFactory.GetListItemDao().GetItems(ListType.TaskCategory);
            cntrlCategorySelector.ID = "taskTemplateCategorySelector";
            phCategorySelector.Controls.Add(cntrlCategorySelector);
            
            var emptyScreenControl = new EmptyScreenControl
            {
                ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_tasks.png", ProductEntryPoint.ID),
                Header = CRMSettingResource.EmptyContentTaskTemplates,
                Describe = CRMSettingResource.EmptyContentTaskTemplatesDescript,
                ButtonHTML = String.Format("<a id='addTag' class='linkAddMediumText baseLinkAction' onclick='ASC.CRM.TaskTemplateView.showTemplateConatainerPanel();'>{0}</a>",
                                           CRMSettingResource.AddTaskTemplateContainer)
            };

            _phEmptyContent.Controls.Add(emptyScreenControl);
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            Master.DisabledSidePanel = true;

            Title = HeaderStringHelper.GetPageTitle(Resource.Search);

            var productID = !String.IsNullOrEmpty(Request["productID"]) ? new Guid(Request["productID"]) : Guid.Empty;
            var moduleID = !String.IsNullOrEmpty(Request["moduleID"]) ? new Guid(Request["moduleID"]) : Guid.Empty;

            SearchText = Request["search"] ?? "";

            var searchResultsData = new List<SearchResult>();
            if (!string.IsNullOrEmpty(SearchText))
            {
                List<ISearchHandlerEx> handlers = null;

                var products = !String.IsNullOrEmpty(Request["products"]) ? Request["products"] : string.Empty;
                if (!string.IsNullOrEmpty(products))
                {
                    try
                    {
                        var productsStr = products.Split(new[] { ',' });
                        var productsGuid = productsStr.Select(p => new Guid(p)).ToArray();

                        handlers = SearchHandlerManager.GetHandlersExForProductModule(productsGuid);
                    }
                    catch
                    {
                    }
                }

                if (handlers == null)
                {
                    handlers = SearchHandlerManager.GetHandlersExForProductModule(productID, moduleID);
                }

                searchResultsData = GetSearchresultByHandlers(handlers, SearchText);
            }

            if (searchResultsData.Count <= 0)
            {
                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_search.png"),
                        Header = Resource.SearchNotFoundMessage,
                        Describe = Resource.SearchNotFoundDescript
                    };
                SearchContent.Controls.Add(emptyScreenControl);
            }
            else
            {
                searchResultsData = GroupSearchresult(productID, searchResultsData);
                var oSearchView = (SearchResults)LoadControl(SearchResults.Location);
                oSearchView.SearchResultsData = searchResultsData;
                SearchContent.Controls.Add(oSearchView);
            }
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/audittrail/js/audittrail.js"));
            Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/usercontrols/management/audittrail/css/audittrail.less"));

            var emptyScreenControl = new EmptyScreenControl
            {
                ImgSrc = WebPath.GetPath("usercontrols/management/audittrail/img/audit_trail_empty_screen.jpg"),
                Header = AuditResource.AuditTrailEmptyScreenHeader,
                Describe = AuditResource.AuditTrailEmptyScreenDscr
            };
            emptyScreenHolder.Controls.Add(emptyScreenControl);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     _documentUploader.Options.IsPopup = true;
     InitScripts();
     var emptyParticipantScreenControl = new EmptyScreenControl
     {
         ImgSrc = VirtualPathUtility.ToAbsolute("~/UserControls/Common/ProjectDocumentsPopup/Images/project-documents.png"),
         Header = UserControlsCommonResource.ProjectDocuments,
         HeaderDescribe = UserControlsCommonResource.EmptyDocsHeaderDescription,
         Describe = Resources.UserControlsCommonResource.EmptyDocsDescription
     };
     _phEmptyDocView.Controls.Add(emptyParticipantScreenControl);
 }
Exemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _documentUploader.Options.IsPopup = true;
     InitScripts();
     var emptyParticipantScreenControl = new EmptyScreenControl
     {
         ImgSrc = VirtualPathUtility.ToAbsolute("~/UserControls/Common/DocumentsPopup/css/images/project-documents.png"),
         Header = "", //UserControlsCommonResource.DocumentsProduct,
         HeaderDescribe = UserControlsCommonResource.EmptyDocsHeaderDescription,
         Describe = ""//"<a id='empty_screen_back_link' href='javascript:;' onclick='DocumentsPopup.openPreviosFolder(); return false;'>Back</a>"//Resources.UserControlsCommonResource.EmptyDocsDescription
     };
     _phEmptyDocView.Controls.Add(emptyParticipantScreenControl);
 }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumManager.Instance.SetCurrentPage(ForumPage.TopicList);

            int idThread;
            if (!int.TryParse(Request["f"], out idThread))
                Response.Redirect("default.aspx");

            var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, idThread);

            if (thread == null)
                Response.Redirect("default.aspx");

            if (thread.TopicCount > 0)
            {
                var topicsControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicListControl.ascx") as UserControls.Forum.TopicListControl;
                topicsControl.SettingsID = ForumManager.Settings.ID;
                topicsControl.ThreadID = thread.ID;
                topicsHolder.Controls.Add(topicsControl);
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                                             {
                                                 ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                                                 Header = Resources.ForumResource.EmptyScreenTopicCaption,
                                                 Describe = Resources.ForumResource.EmptyScreenTopicText,
                                                 ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.TopicCreate, thread) ? String.Format("<a class='linkAddMediumText' href='newpost.aspx?f=" + thread.ID + "&m=0'>{0}</a>", Resources.ForumResource.EmptyScreenTopicLink) : String.Empty
                                             };

                topicsHolder.Controls.Add(emptyScreenControl);
            }

            Utility.RegisterTypeForAjax(typeof (Subscriber));
            var subscriber = new Subscriber();

            var isThreadSubscribe = subscriber.IsThreadSubscribe(thread.ID);

            var master = Master as ForumMasterPage;
            master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID)));

            //bread crumbs
            var breadCrumbs = (Master as ForumMasterPage).BreadCrumbs;
            breadCrumbs.Add(new BreadCrumb {Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx"});
            breadCrumbs.Add(new BreadCrumb {Caption = thread.Title});

            Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs);
        }
Exemplo n.º 13
0
        private void RenderEmptyScreens()
        {
            var emptyScreenControl = new EmptyScreenControl
            {
                ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_milestones.png", ProductEntryPoint.ID),
                Header = MilestoneResource.MilestoneNotFound_Header,
                Describe = String.Format(MilestoneResource.MilestonesMarkMajorTimestamps),
                ID = "emptyListMilestone" 
            };

            if (RequestContext.CanCreateMilestone(true))
                emptyScreenControl.ButtonHTML = String.Format("<a class='baseLinkAction addFirstElement'>{0}</a>", MilestoneResource.PlanFirstMilestone);

            _emptyScreenPlaceHolder.Controls.Add(emptyScreenControl);

            _emptyScreenPlaceHolder.Controls.Add(Masters.BasicTemplate.RenderEmptyScreenForFilter(MilestoneResource.FilterNoMilestones, MilestoneResource.DescrEmptyListMilFilter));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _documentUploader.Options.IsPopup = true;
            InitScripts();
            var empty_participant_screen_control = new EmptyScreenControl
            {
                ImgSrc = VirtualPathUtility.ToAbsolute("~/addons/mail/controls/documentspopup/css/images/project-documents.png"),
                Header = "",
                HeaderDescribe = UserControlsCommonResource.EmptyDocsHeaderDescription,
                Describe = ""
            };
            _phEmptyDocView.Controls.Add(empty_participant_screen_control);

            var tree = (Tree)LoadControl(Tree.Location);
            tree.ID = "documentSelectorTree";
            tree.WithoutTrash = false;
            TreeHolder.Controls.Add(tree);
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _manageTagPopup.Options.IsPopup = true;

            var entityType = StringToEntityType(Request["view"]);

            _switcherEntityType.SortItemsHeader = CRMCommonResource.Show + ":";
            
            _forContacts.SortLabel = CRMSettingResource.BothPersonAndCompany;
            _forContacts.SortUrl = "settings.aspx?type=tag";
            _forContacts.IsSelected = entityType == EntityType.Contact;


            _forDeals.SortLabel = CRMCommonResource.DealModuleName;
            _forDeals.SortUrl = String.Format("settings.aspx?type=tag&view={0}", EntityType.Opportunity.ToString().ToLower());
            _forDeals.IsSelected = entityType == EntityType.Opportunity;


            _forCases.SortLabel = CRMCommonResource.CasesModuleName;
            _forCases.SortUrl = String.Format("settings.aspx?type=tag&view={0}", EntityType.Case.ToString().ToLower());
            _forCases.IsSelected = entityType == EntityType.Case;


            var tagList = Global.DaoFactory.GetTagDao().GetAllTags(entityType).ToList();

            Page.ClientScript.RegisterClientScriptBlock(typeof(TagSettingsView), "e7302d41-5ae9-4a0a-b156-0b11515ec67c",
                                                        "tagList = "
                                                        + JavaScriptSerializer.Serialize(tagList.ConvertAll(item => new { value = item.HtmlEncode() }))
                                                        + "; ", true);
            Page.ClientScript.RegisterClientScriptBlock(typeof (TagSettingsView), "4b363cea-b734-4f85-91d8-72f70c150a24",
                                                        String.Format("relativeItemsCountArray = {0};", Global.DaoFactory.GetTagDao().GetTagsLinkCountJSON(entityType)),
                                                        true);

            var emptyScreenControl = new EmptyScreenControl
                                         {
                                             ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_tags.png", ProductEntryPoint.ID),
                                             Header = CRMSettingResource.EmptyContentTags,
                                             Describe = CRMSettingResource.EmptyContentTagsDescript,
                                             ButtonHTML = String.Format("<a id='addTag' class='linkAddMediumText baseLinkAction' onclick='ASC.CRM.TagSettingsView.showAddTagPanel();' >{0}</a>",
                                                                        CRMSettingResource.AddTag)
                                         };
            _phEmptyContent.Controls.Add(emptyScreenControl);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _templateConatainerPanel.Options.IsPopup = true;
            _templatePanel.Options.IsPopup = true;

            var entityType = StringToEntityType(Request["view"]);

            InitViewSwitcher(entityType);

            RegisterClientScript(entityType);

            //var cntrlCategorySelector = (CategorySelector)LoadControl(CategorySelector.Location);
            //cntrlCategorySelector.Categories = Global.DaoFactory.GetListItemDao().GetItems(ListType.TaskCategory);
            //cntrlCategorySelector.ID = "taskTemplateCategorySelector";
            //phCategorySelector.Controls.Add(cntrlCategorySelector);

            var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_tasks.png", ProductEntryPoint.ID),
                    Header = CRMSettingResource.EmptyContentTaskTemplates,
                    Describe = CRMSettingResource.EmptyContentTaskTemplatesDescript,
                    ButtonHTML = String.Format("<a id='addTag' class='link dotline blue plus' onclick='ASC.CRM.TaskTemplateView.showTemplateConatainerPanel();'>{0}</a>",
                                               CRMSettingResource.AddTaskTemplateContainer)
                };

            _phEmptyContent.Controls.Add(emptyScreenControl);

            //init task responsible
            var taskTemplateResponsibleSelector = new AdvancedUserSelector
                {
                    ID = "taskTemplateResponsibleSelector",
                    IsLinkView = false,
                    EmployeeType = EmployeeType.User,
                    LinkText = CustomNamingPeople.Substitute<CRMCommonResource>("AddUser"),
                    ParentContainerHtmlSelector = "#taskTemplateViewAdvUsrSrContainer"
                };
            AdvancedUserSelector.RegisterStartupScripts(Page, taskTemplateResponsibleSelector);

            RegisterScript();
        }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userInfo = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);
            IsAdmin = userInfo.IsAdmin();
            Actions = new AllowedActions(userInfo);

            _confirmationDeleteDepartmentPanel.Options.IsPopup = true;
            _resendInviteDialog.Options.IsPopup = true;
            _changeStatusDialog.Options.IsPopup = true;
            _changeTypeDialog.Options.IsPopup = true;
            _deleteUsersDialog.Options.IsPopup = true;


            var emptyContentForPeopleFilter = new EmptyScreenControl
                {
                    ID = "emptyContentForPeopleFilter",
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png"),
                    Header = PeopleResource.NotFoundTitle,
                    Describe = PeopleResource.NotFoundDescription,
                    ButtonHTML = String.Format(@"<a class='clearFilterButton' href='javascript:void(0);' 
                                            onclick='ASC.People.PeopleController.resetAllFilters();'>{0}</a>",
                                               PeopleResource.ClearButton),
                    CssClass = "display-none"
                };

            emptyScreen.Controls.Add(emptyContentForPeopleFilter);


            var controlEmailChange = (UserEmailChange)LoadControl(UserEmailChange.Location);
            controlEmailChange.UserInfo = userInfo;
            userEmailChange.Controls.Add(controlEmailChange);

            userConfirmationDelete.Controls.Add(LoadControl(ConfirmationDeleteUser.Location));

            if (Actions.AllowEdit)
            {
                userPwdChange.Controls.Add(LoadControl(PwdTool.Location));
            }
            Title = HeaderStringHelper.GetPageTitle(PeopleResource.ProductName);
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumManager.Instance.SetCurrentPage(ForumPage.Default);

            List<ThreadCategory> categories;
            List<Thread> threads;

            ForumDataProvider.GetThreadCategories(TenantProvider.CurrentTenantID, true, out categories, out threads);

            if (0 < categories.Count)
            {
                var categoryListControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/ThreadCategoryListControl.ascx") as UserControls.Forum.ThreadCategoryListControl;
                categoryListControl.Categories = categories;
                categoryListControl.Threads = threads;
                categoryListControl.SettingsID = ForumManager.Settings.ID;
                forumListHolder.Controls.Add(categoryListControl);
            }
            else
            {
                _headerHolder.Visible = false;

                var emptyScreenControl = new EmptyScreenControl
                                             {
                                                 ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                                                 Header = Resources.ForumResource.EmptyScreenForumCaption,
                                                 Describe = Resources.ForumResource.EmptyScreenForumText,
                                                 ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null) ? String.Format("<a class='linkAddMediumText' href='javascript:ForumMakerProvider.ShowForumMakerDialog(false,\"window.location.reload(true)\");'>{0}</a>", Resources.ForumResource.EmptyScreenForumLink) : String.Empty
                                             };
                forumListHolder.Controls.Add(emptyScreenControl);
            }

            var breadCrumbs = (Master as ForumMasterPage).BreadCrumbs;
            breadCrumbs.Add(new BreadCrumb {Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx"});

            Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs);
        }
Exemplo n.º 19
0
        private void LoadControls()
        {
            var feedList = (FeedList)LoadControl(FeedList.Location);
            controlsHolder.Controls.Add(feedList);

            var emptyScreenFilter = new Controls.Common.EmptyScreenControl
                {
                    ImgSrc = WebPath.GetPath("usercontrols/feed/images/empty_filter.png"),
                    Header = UserControlsCommonResource.FilterNoNews,
                    Describe = UserControlsCommonResource.FilterNoNewsDescription,
                    ButtonHTML =
                        string.Format("<a href='javascript:void(0)' class='baseLinkAction clearFilterButton'>{0}</a>",
                                      UserControlsCommonResource.ResetFilter)
                };
            controlsHolder.Controls.Add(emptyScreenFilter);

            var emptyScreenControl = new Controls.Common.EmptyScreenControl
                {
                    ImgSrc = WebPath.GetPath("usercontrols/feed/images/empty_screen_feed.png"),
                    Header = UserControlsCommonResource.NewsNotFound,
                    Describe = UserControlsCommonResource.NewsNotFoundDescription
                };
            controlsHolder.Controls.Add(emptyScreenControl);
        }
Exemplo n.º 20
0
        private void LoadControls()
        {
            var feedList = (FeedList)LoadControl(FeedList.Location);
            loaderHolder.Controls.Add(LoadControl(LoaderPage.Location));
            controlsHolder.Controls.Add(feedList);

            var emptyScreen = new EmptyScreenControl
            {
                ID = "emptyFeedScr",
                ImgSrc = WebPath.GetPath("usercontrols/feed/images/empty_screen_feed.png"),
                Header = UserControlsCommonResource.NewsNotFound,
                Describe = UserControlsCommonResource.NewsNotFoundDescription
            };
            emptyScreensHolder.Controls.Add(emptyScreen);

            var emptyFilterScreen = new EmptyScreenControl
            {
                ID = "emptyFeedFilterScr",
                ImgSrc = WebPath.GetPath("usercontrols/feed/images/empty_filter.png"),
                Header = UserControlsCommonResource.FilterNoNews,
                Describe = UserControlsCommonResource.FilterNoNewsDescription,
                ButtonHTML =
                    string.Format("<a href='javascript:void(0)' class='baseLinkAction clearFilterButton'>{0}</a>",
                                  UserControlsCommonResource.ResetFilter)
            };
            emptyScreensHolder.Controls.Add(emptyFilterScreen);

            var managerEmptyScreen = (ManagerDashboardEmptyScreen)Page.LoadControl(ManagerDashboardEmptyScreen.Location);
            emptyScreensHolder.Controls.Add(managerEmptyScreen);

            var userId = SecurityContext.CurrentAccount.ID;
            var isVisitor = CoreContext.UserManager.GetUsers(userId).IsVisitor();

            emptyScreensHolder.Controls.Add(new EmptyScreenControl
                {
                    ID = "emptyListCommunity",
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("community150.png"),
                    Header = UserControlsCommonResource.FeedEmptyCommunityHeader,
                    Describe = UserControlsCommonResource.FeedEmptyCommunityDescription,
                    ButtonHTML = isVisitor
                                     ? string.Empty
                                     : string.Format("<a class='link underline plus' href='{0}'>{1}</a>" +
                                                     "<br/><a class='link underline plus' href='{2}'>{3}</a>" +
                                                     "<br/><a class='link underline plus' href='{4}'>{5}</a>",
                                                     VirtualPathUtility.ToAbsolute("~/products/community/modules/blogs/addblog.aspx"),
                                                     UserControlsCommonResource.FeedBlogsModuleLink,
                                                     VirtualPathUtility.ToAbsolute("~/products/community/modules/news/editnews.aspx"),
                                                     UserControlsCommonResource.FeedEventsModuleLink,
                                                     VirtualPathUtility.ToAbsolute("~/products/community/modules/bookmarking/createbookmark.aspx"),
                                                     UserControlsCommonResource.FeedBookmarkModuleLink)
                });

            emptyScreensHolder.Controls.Add(new EmptyScreenControl
                {
                    ID = "emptyListCrm",
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_persons.png", WebItemManager.CRMProductID),
                    Header = UserControlsCommonResource.FeedEmptyContactListHeader,
                    Describe = UserControlsCommonResource.FeedEmptyContactListDescription,
                    ButtonHTML = string.Format("<a class='link underline plus' href='{0}?action=manage'>{1}</a><br/>" +
                                               "<a class='link underline plus' href='{0}?action=manage&type=people'>{2}</a>",
                                               VirtualPathUtility.ToAbsolute("~/products/crm/default.aspx"),
                                               UserControlsCommonResource.FeedCreateFirstCompany,
                                               UserControlsCommonResource.FeedCreateFirstPerson)
                });

            var canCreateProjects =
                !isVisitor
                && (CoreContext.UserManager.IsUserInGroup(userId, Constants.GroupAdmin.ID)
                    || WebItemSecurity.IsProductAdministrator(WebItemManager.ProjectsProductID, userId));
            emptyScreensHolder.Controls.Add(new EmptyScreenControl
                {
                    Header = UserControlsCommonResource.FeedEmptyListProjHeader,
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("projects_logo.png", WebItemManager.ProjectsProductID),
                    Describe = UserControlsCommonResource.FeedEmptyListProjDescribe,
                    ID = "emptyListProjects",
                    ButtonHTML = canCreateProjects
                                     ? string.Format("<a href='{0}' class='link underline addFirstElement'>{1}<a>",
                                                     VirtualPathUtility.ToAbsolute("~/products/projects/projects.aspx?action=add"),
                                                     UserControlsCommonResource.FeedCreateFirstProject)
                                     : string.Empty
                });

            emptyScreensHolder.Controls.Add(new EmptyScreenControl
                {
                    ID = "emptyListDocuments",
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("documents150.png"),
                    Header = UserControlsCommonResource.FeedCorporateFiles,
                    Describe = UserControlsCommonResource.FeedEmptyScreenDescrCorporate,
                    ButtonHTML = string.Format("<a href=\"{0}\" class=\"link underline up\">{1}</a>",
                                               VirtualPathUtility.ToAbsolute("~/products/files/"),
                                               UserControlsCommonResource.FeedButtonGotoMy)
                });
        }
Exemplo n.º 21
0
        private void BindRepeater()
        {
            var resultToShow = Wiki.GetFiles();
            UpdateHasFilesToDelete(resultToShow);

            HasFiles = resultToShow.Count > 0;

            if (HasFiles)
            {
                rptFilesList.DataSource = resultToShow;
                rptFilesList.DataBind();
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("WikiLogo150.png", WikiManager.ModuleId),
                        Header = WikiResource.EmptyScreenWikiFilesCaption,
                        Describe = WikiResource.EmptyScreenWikiFilesText,
                    };

                if (CanUpload)
                    emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='javascript:ShowUploadFileBox();'>{0}</a>", WikiResource.menu_AddNewFile);

                EmptyContent.Controls.Add(emptyScreenControl);
            }
        }
Exemplo n.º 22
0
        private void FillSelectedPage(List<Post> posts, BlogsEngine engine)
        {
            if (posts == null || posts.Count == 0)
            {
                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("blog_icon.png", ASC.Blogs.Core.Constants.ModuleId),
                        Header = BlogsResource.EmptyScreenBlogCaption,
                        Describe = BlogsResource.EmptyScreenBlogText
                    };

                if (CommunitySecurity.CheckPermissions(new PersonalBlogSecObject(CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID)), ASC.Blogs.Core.Constants.Action_AddPost)
                    && string.IsNullOrEmpty(UserID) && string.IsNullOrEmpty(Search))
                {
                    emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='addblog.aspx'>{0}</a>", BlogsResource.EmptyScreenBlogLink);
                }

                placeContent.Controls.Add(emptyScreenControl);
                return;
            }

            placeContent.Controls.Add(new Literal {Text = "<div>"});

            var post_with_comments = engine.GetPostsCommentsCount(posts);

            if (!String.IsNullOrEmpty(UserID))
            {

                var post = post_with_comments[0].Item1;
                var user = CoreContext.UserManager.GetUsers(post.UserID);

                var st = new StringBuilder();
                st.Append("<div class=\"BlogsHeaderBlock\" style=\"margin-bottom:16px;\">");
                st.Append("<span class=\"header-with-menu\">" + CoreContext.UserManager.GetUsers(user.ID).DisplayUserName() + "</span>");
                st.Append("</div>");

                placeContent.Controls.Add(new Literal {Text = st.ToString()});
            }

            for (var i = 0; i < post_with_comments.Count; i++)
            {
                var post = post_with_comments[i].Item1;
                var commentCount = post_with_comments[i].Item2;

                var sb = new StringBuilder();
                var user = CoreContext.UserManager.GetUsers(post.UserID);

                sb.Append("<div class=\"container-list\">");
                sb.Append("<div class=\"header-list\">");

                sb.Append("<div class=\"avatar-list\">");
                sb.Append("<a href=\"viewblog.aspx?blogid=" + post.ID.ToString() + "\">" + ImageHTMLHelper.GetHTMLUserAvatar(post.UserID) + "</a>");
                sb.Append("</div><div class=\"describe-list\">");
                sb.Append("<div class=\"title-list\">");
                sb.Append("<a href=\"viewblog.aspx?blogid=" + post.ID.ToString() + "\">" + HttpUtility.HtmlEncode(post.Title) + "</a>");
                sb.Append("</div>");

                sb.Append("<div class=\"info-list\">");
                sb.Append("<span class=\"caption-list\">" + BlogsResource.PostedTitle + ":</span>");
                sb.Append(CoreContext.UserManager.GetUsers(user.ID).RenderCustomProfileLink(CommunityProduct.ID, "name-list", "link"));
                sb.Append("</div>");
                if (String.IsNullOrEmpty(UserID))
                {
                    sb.Append("<div class=\"info-list\">");
                    sb.Append("<a class=\"link gray-text\" href=\"" + VirtualPathUtility.ToAbsolute(ASC.Blogs.Core.Constants.BaseVirtualPath) + "?userid=" + post.UserID + "\">" + BlogsResource.AllRecordsOfTheAutor + "</a>");
                    sb.Append("</div>");
                }

                sb.Append("<div class=\"date-list\">");
                sb.AppendFormat("{0}<span class=\"time-list\">{1}</span>", post.Datetime.ToString("d"), post.Datetime.ToString("t"));
                sb.Append("</div></div></div>");

                sb.Append("<div class=\"content-list\">");
               
                sb.Append(post.Content);
                sb.Append("<div id=\"postIndividualLink\" class=\"display-none\">viewblog.aspx?blogid=" + post.ID.ToString() + "</div>");               
                sb.Append("<div class=\"comment-list\">");
                sb.Append("<a href=\"viewblog.aspx?blogid=" + post.ID + "#comments\">" + BlogsResource.CommentsTitle + ": " + commentCount.ToString() + "</a>");
                sb.Append("<a href=\"viewblog.aspx?blogid=" + post.ID + "#addcomment\">" + BlogsResource.CommentsAddButtonTitle + "</a>");
                sb.Append("</div></div></div>");

                placeContent.Controls.Add(new Literal {Text = sb.ToString()});
            }

            placeContent.Controls.Add(new Literal {Text = "</div>"});
        }
Exemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var master = Master as IStudioMaster;
            if (master == null) return;
            
            AjaxPro.Utility.RegisterTypeForAjax(this.GetType());
            
            //top navigator
            if (master is StudioTemplate)
            {
                (master as StudioTemplate).TopNavigationPanel.CustomTitle = Resources.Resource.Search;
                (master as StudioTemplate).TopNavigationPanel.CustomTitleIconURL = WebImageSupplier.GetAbsoluteWebPath("search.png");
            }

            master.DisabledSidePanel = true;
            
            Guid productID;
            if (!String.IsNullOrEmpty(Request["productID"]))
                productID = new Guid(Request["productID"]);
            else
                productID = GetProductID();
            


            _searchText = Request["search"] ?? "";
            var data = SearchAll(_searchText, productID);

            var container = new Container {Body = new PlaceHolder(), Header = new PlaceHolder()};
            container.BreadCrumbs.Add(new BreadCrumb {Caption = Resources.Resource.MainTitle, NavigationUrl = productID.Equals(Guid.Empty) ? CommonLinkUtility.GetDefault() : VirtualPathUtility.ToAbsolute(ProductManager.Instance[productID].StartURL)});
            container.BreadCrumbs.Add(new BreadCrumb {Caption = HeaderStringHelper.GetHTMLSearchHeader(_searchText)});
            master.ContentHolder.Controls.Add(container);

            Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Search, container.BreadCrumbs);

            if (data.Count <= 0)
            {
                var emptyScreenControl=new EmptyScreenControl
                {
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_search.png"),
                    Header = Resources.Resource.SearchNotFoundMessage,
                    Describe = Resources.Resource.SearchNotFoundDescript
                };
                container.Body.Controls.Add(emptyScreenControl);
            }
            else
            {
                var oSearchView = (SearchResults) LoadControl(SearchResults.Location);
                //data.Sort(new SearchComparer());
                oSearchView.DataSourceObj = data;
                container.Body.Controls.Add(oSearchView);
            }
        }
Exemplo n.º 24
0
        private void Page_Load(object sender, EventArgs e)
        {
            MobileVer = ASC.Web.Core.Mobile.MobileDetector.IsRequestMatchesMobile(this.Context);
            
            Utility.RegisterTypeForAjax(GetType());

            var emptyScreenControl = new EmptyScreenControl
                                         {
                                             ID = "emptyContentForEventsFilter",
                                             ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png", ProductEntryPoint.ID),
                                             Header = CRMCommonResource.EmptyHistoryHeader,
                                             Describe = CRMCommonResource.EmptyHistoryDescription,
                                             ButtonHTML = String.Format(@"
                        <a class='crm-clearFilterButton' href='javascript:void(0);'
                            onclick='ASC.CRM.HistoryView.advansedFilter.advansedFilter(null);'>
                                {0}
                        </a>",
                        CRMCommonResource.ClearFilter)
            };
            _phEmptyContent.Controls.Add(emptyScreenControl);



            switch (TargetEntityType)
            {
                case EntityType.Opportunity:
                    ContactMembers = Global.DaoFactory.GetContactDao().GetContacts(Global.DaoFactory.GetDealDao().GetMembers(TargetEntityID));
                    break;
                case EntityType.Case:
                    ContactMembers = Global.DaoFactory.GetContactDao().GetContacts(Global.DaoFactory.GetCasesDao().GetMembers(TargetEntityID));
                    break;
            }

            var eventsCategories = Global.DaoFactory.GetListItemDao().GetItems(ListType.HistoryCategory);
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "592b6142-cc8b-4c63-a866-c300e2af536e",
                                                        "eventsCategories = " +
                                                        JavaScriptSerializer.Serialize(eventsCategories.ConvertAll
                                                                                           (item => new
                                                                                                        {
                                                                                                            value = item.ID,
                                                                                                            title = item.Title.HtmlEncode()
                                                                                                        }
                                                                                           )) + "; ", true);

            if (TargetContactID != 0)
                Deals = Global.DaoFactory.GetDealDao().GetDeals(String.Empty, Guid.Empty, 0, null, TargetContactID, null,
                                                                true, DateTime.MinValue,
                                                                DateTime.MinValue, 0, 0,
                                                                new OrderBy(DealSortedByType.Title, true));
                    
                    


            var userSelector = (Studio.UserControls.Users.UserSelector) LoadControl(Studio.UserControls.Users.UserSelector.Location);
            userSelector.BehaviorID = "UserSelector";

            if (!MobileVer)
            {
                //init uploader
                var uploader = (FileUploader) LoadControl(FileUploader.Location);
                _phfileUploader.Controls.Add(uploader);
            }

            //init event categorySelector
            var cntrlCategorySelector = (CategorySelector) LoadControl(CategorySelector.Location);
            cntrlCategorySelector.Categories = Global.DaoFactory.GetListItemDao().GetItems(ListType.HistoryCategory);
            cntrlCategorySelector.ID = "eventCategorySelector";
            cntrlCategorySelector.MaxWidth = 130;
            phCategorySelector.Controls.Add(cntrlCategorySelector);

            var users = new List<Guid>();

            switch (TargetEntityType)
            {
                case EntityType.Contact:
                    var contact = Global.DaoFactory.GetContactDao().GetByID(TargetContactID);
                    if (CRMSecurity.IsPrivate(contact))
                        users = CRMSecurity.GetAccessSubjectTo(contact).Keys.ToList<Guid>();
                    break;
                case EntityType.Opportunity:
                    var deal = Global.DaoFactory.GetDealDao().GetByID(TargetEntityID);
                    if (CRMSecurity.IsPrivate(deal))
                        users = CRMSecurity.GetAccessSubjectTo(deal).Keys.ToList<Guid>();
                    break;
                case EntityType.Case:
                    var caseItem = Global.DaoFactory.GetCasesDao().GetByID(TargetEntityID);
                    if (CRMSecurity.IsPrivate(caseItem))
                        users = CRMSecurity.GetAccessSubjectTo(caseItem).Keys.ToList<Guid>();
                    break;
            }

            //init userSelectorListView
            var selector = (UserSelectorListView)LoadControl(UserSelectorListView.Location);
            if (users.Count > 0)
            {
                //with admins
                var admins = CoreContext.UserManager.GetUsersByGroup(Constants.GroupAdmin.ID).ToList();
                admins.AddRange(from u in users
                                where !CoreContext.UserManager.IsUserInGroup(u, Constants.GroupAdmin.ID)
                                select CoreContext.UserManager.GetUsers(u));
                selector.UserList = admins.SortByUserName();
                //without admins
                //selector.UserList = users.Select(u => CoreContext.UserManager.GetUsers(u)).ToList().SortByUserName();
            }
            selector.DisabledUsers = new List<Guid> {SecurityContext.CurrentAccount.ID};
            _phUserSelectorListView.Controls.Add(selector);
        }
Exemplo n.º 25
0
        private void BindRepeater()
        {
            phListResult.Visible = phTableResult.Visible = false;
            if (isByUser || isShowNew || isShowFresh)
            {
                phListResult.Visible = true;
                List<Page> dataSource;
                var emptyScreenCaption = string.Empty;
                var emptyScreenText = string.Empty;

                if (isByUser)
                {
                    dataSource = Wiki.GetPages(byUserID);
                }
                else if (isShowNew)
                {
                    dataSource = Wiki.GetNewPages(MaxNewResults);
                    emptyScreenCaption = WikiResource.EmptyScreenWikiNewPagesCaption;
                    emptyScreenText = WikiResource.EmptyScreenWikiNewPagesText;
                }
                else
                {
                    dataSource = Wiki.GetRecentEditedPages(MaxNewResults);
                    emptyScreenCaption = WikiResource.EmptyScreenWikiRecentlyEditedCaption;
                    emptyScreenText = WikiResource.EmptyScreenWikiRecentlyEditedText;
                }

                //foreach (Pages p in dataSource)
                //{
                //    p.PageName = HttpUtility.HtmlEncode(p.PageName);
                //}

                if (dataSource.Count > 0)
                {
                    rptPageList.DataSource = dataSource;
                    rptPageList.DataBind();
                }
                else
                {
                    var emptyScreenControl = new EmptyScreenControl
                        {
                            ImgSrc = WebImageSupplier.GetAbsoluteWebPath("WikiLogo150.png", WikiManager.ModuleId),
                            Header = emptyScreenCaption,
                            Describe = emptyScreenText
                        };

                    if (CommunitySecurity.CheckPermissions(Community.Wiki.Common.Constants.Action_AddPage))
                    {
                        emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='default.aspx?action=New'>{0}</a>", WikiResource.menu_AddNewPage);
                    }

                    phListResult.Controls.Add(emptyScreenControl);
                }
            }
            else
            {
                phTableResult.Visible = true;
                List<Page> result;
                result = isShowCat ? Wiki.GetPages(categoryName) : Wiki.GetPages();

                result.RemoveAll(pemp => string.IsNullOrEmpty(pemp.PageName));

                var letters = new List<string>(WikiResource.wikiCategoryAlfaList.Split(','));

                var otherSymbol = string.Empty;
                if (letters.Count > 0)
                {
                    otherSymbol = letters[0];
                    letters.Remove(otherSymbol);
                }

                var dictList = new List<PageDictionary>();
                foreach (var page in result)
                {
                    page.PageName = HttpUtility.HtmlEncode(page.PageName);

                    var firstLetter = new string(page.PageName[0], 1);

                    if (!letters.Exists(lt => lt.Equals(firstLetter, StringComparison.InvariantCultureIgnoreCase)))
                    {
                        firstLetter = otherSymbol;
                    }

                    PageDictionary pageDic;
                    if (!dictList.Exists(dl => dl.HeadName.Equals(firstLetter, StringComparison.InvariantCultureIgnoreCase)))
                    {
                        pageDic = new PageDictionary { HeadName = firstLetter };
                        pageDic.Pages.Add(page);
                        dictList.Add(pageDic);
                    }
                    else
                    {
                        pageDic = dictList.Find(dl => dl.HeadName.Equals(firstLetter, StringComparison.InvariantCultureIgnoreCase));
                        pageDic.Pages.Add(page);
                    }
                }

                dictList.Sort(SortPageDict);

                var countAll = dictList.Count*3 + result.Count; //1 letter is like 2 links to category
                var perColumn = (int)(Math.Round((decimal)countAll/3));

                var mainDictList = new List<List<PageDictionary>>();

                int index = 0, lastIndex = 0, count = 0;

                for (int i = 0; i < dictList.Count; i++)
                {
                    var p = dictList[i];

                    count += 3;
                    count += p.Pages.Count;
                    index++;
                    if (count >= perColumn || i == dictList.Count - 1)
                    {
                        count = count - perColumn;
                        mainDictList.Add(dictList.GetRange(lastIndex, index - lastIndex));
                        lastIndex = index;
                    }
                }

                if (mainDictList.Count > 0)
                {
                    rptMainPageList.DataSource = mainDictList;
                    rptMainPageList.DataBind();
                }
                else
                {
                    var emptyScreenControl = new EmptyScreenControl
                        {
                            ImgSrc = WebImageSupplier.GetAbsoluteWebPath("WikiLogo150.png", WikiManager.ModuleId),
                            Header = WikiResource.EmptyScreenWikiIndexCaption,
                            Describe = WikiResource.EmptyScreenWikiIndexText
                        };

                    if (CommunitySecurity.CheckPermissions(Community.Wiki.Common.Constants.Action_AddPage))
                    {
                        emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='default.aspx?action=New'>{0}</a>", WikiResource.menu_AddNewPage);
                    }

                    phTableResult.Controls.Add(emptyScreenControl);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            Utility.RegisterTypeForAjax(typeof(BookmarkingUserControl));
            Utility.RegisterTypeForAjax(typeof(SingleBookmarkUserControl));
            Utility.RegisterTypeForAjax(typeof(CommentsUserControl));

            BookmarkPageCounter = string.IsNullOrEmpty(Request["size"]) ? 20 : Convert.ToInt32(Request["size"]);

            var createBookmark = LoadControl(BookmarkUserControlPath.CreateBookmarkUserControlPath) as CreateBookmarkUserControl;
            CreateBookmarkPanel.Controls.Add(createBookmark);

            var removePopup = LoadControl(BookmarkingRemoverFromFavouritePopup.Location) as BookmarkingRemoverFromFavouritePopup;
            BookmarkingRemoveFromFavouritePopupContainer.Controls.Add(removePopup);

            InitSettings();

            var SortControl = new ViewSwitcher { SortItemsHeader = BookmarkingUCResource.ShowLabel };

            _serviceHelper.InitServiceHelper(SortControl);
            BookmarkingSortPanel.Controls.Add(SortControl);

            if (Bookmarks == null)
            {
                Bookmarks = _serviceHelper.GetBookmarks(BookmarkPageCounter);
            }

            if (Bookmarks == null || Bookmarks.Count == 0)
            {
                var hidePanelsFlag = false;
                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("bookmarks_icon.png", BookmarkingSettings.ModuleId),
                        Describe = BookmarkingUCResource.EmptyScreenText
                    };

                if (_serviceHelper.DisplayMode.Equals(BookmarkingServiceHelper.BookmarkDisplayMode.SearchBookmarks))
                {
                    hidePanelsFlag = true;

                    emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                }
                else
                {
                    var sortBy = Request.QueryString[BookmarkingRequestConstants.SortByParam];
                    if (string.IsNullOrEmpty(sortBy)
                        || BookmarkingRequestConstants.MostRecentParam.Equals(sortBy)
                        || BookmarkingRequestConstants.PopularityParam.Equals(sortBy))
                    {
                        hidePanelsFlag = true;

                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenCaption;

                        if (BookmarkingPermissionsCheck.PermissionCheckCreateBookmark())
                        {
                            emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='CreateBookmark.aspx'>{0}</a>", BookmarkingUCResource.EmptyScreenLink);
                        }
                    }
                    else
                    {
                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                    }
                }

                BookmarksHolder.Controls.Add(emptyScreenControl);
                if (hidePanelsFlag)
                {
                    BookmarkingSortPanel.Visible = false;
                    CreateBookmarkPanel.Visible = false;
                    BookmarksMainPanel.Visible = false;
                }
            }
            else
            {
                LoadBookmarks(Bookmarks);
            }
            InitScripts();
        }
        private void BindRepeater()
        {
            var dictList = new List<CategoryDictionary>();
            var calList = Wiki.GetCategories();

            List<string> letters = new List<string>(WikiResource.wikiCategoryAlfaList.Split(','));
            string otherSymbol = string.Empty;
            if (letters.Count > 0)
            {
                otherSymbol = letters[0];
                letters.Remove(otherSymbol);
            }


            string firstLetter;
            CategoryDictionary catDic;
            foreach (Category cat in calList)
            {
                if (string.IsNullOrEmpty(cat.CategoryName))
                    continue;

                firstLetter = new string(cat.CategoryName[0], 1);

                if (!letters.Exists(lt => lt.Equals(firstLetter, StringComparison.InvariantCultureIgnoreCase)))
                {
                    firstLetter = otherSymbol;
                }

                if (!dictList.Exists(dl => dl.HeadName.Equals(firstLetter, StringComparison.InvariantCultureIgnoreCase)))
                {
                    catDic = new CategoryDictionary();
                    catDic.HeadName = firstLetter;
                    catDic.Categories.Add(GetCategoryInfo(cat.CategoryName));
                    dictList.Add(catDic);
                }
                else
                {
                    catDic = dictList.Find(dl => dl.HeadName.Equals(firstLetter, StringComparison.InvariantCultureIgnoreCase));
                    catDic.Categories.Add(GetCategoryInfo(cat.CategoryName));
                }
            }

            dictList.Sort(SortCatDict);

            int countAll = dictList.Count * 3 + calList.Count; //1 letter is like 2 links to category
            int perColumn = (int)(Math.Round((decimal)countAll / 3));

            List<List<CategoryDictionary>> mainDictList = new List<List<CategoryDictionary>>();

            int index = 0, lastIndex = 0, count = 0;

            CategoryDictionary cd;
            for (int i = 0; i < dictList.Count; i++)
            {
                cd = dictList[i];

                count += 3;
                count += cd.Categories.Count;
                index++;
                if (count >= perColumn || i == dictList.Count - 1)
                {
                    count = count - perColumn;
                    mainDictList.Add(dictList.GetRange(lastIndex, index - lastIndex));
                    lastIndex = index;
                }

            }


            HasCategories = mainDictList.Count > 0;

            if (HasCategories)
            {
                rptCategoryList.DataSource = mainDictList;
                rptCategoryList.DataBind();
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc = WebImageSupplier.GetAbsoluteWebPath("WikiLogo150.png", WikiManager.ModuleId),
                    Header = WikiResource.EmptyScreenWikiCategoriesCaption,
                    Describe = WikiResource.EmptyScreenWikiCategoriesText
                };

                if (CommunitySecurity.CheckPermissions(Community.Wiki.Common.Constants.Action_AddPage))
                {
                    emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='default.aspx?action=New'>{0}</a>", WikiResource.menu_AddNewPage);
                }

                EmptyContent.Controls.Add(emptyScreenControl);
            }

        }
Exemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumManager.Instance.SetCurrentPage(ForumPage.Search);

            var currentPageNumber = 0;
            if (!String.IsNullOrEmpty(Request["p"]))
            {
                try
                {
                    currentPageNumber = Convert.ToInt32(Request["p"]);
                }
                catch
                {
                    currentPageNumber = 0;
                }
            }
            if (currentPageNumber <= 0)
                currentPageNumber = 1;

            var findTopicList = new List<Topic>();
            var topicCount = 0;

            var searchText = "";
            _tagID = 0;
            _isFindByTag = false;

            var tagName = "";

            if (!String.IsNullOrEmpty(Request["tag"]))
            {
                _isFindByTag = true;
                try
                {
                    _tagID = Convert.ToInt32(Request["tag"]);
                }
                catch
                {
                    _tagID = 0;
                }

                findTopicList = ForumDataProvider.SearchTopicsByTag(TenantProvider.CurrentTenantID, _tagID, currentPageNumber, ForumManager.Settings.TopicCountOnPage, out topicCount);

            }
            else if (!String.IsNullOrEmpty(Request["search"]))
            {
                searchText = Request["search"];
                findTopicList = ForumDataProvider.SearchTopicsByText(TenantProvider.CurrentTenantID, searchText, currentPageNumber, ForumManager.Settings.TopicCountOnPage, out topicCount);
            }

            if (findTopicList.Count > 0)
            {
                _isFind = true;

                var i = 0;
                foreach (var topic in findTopicList)
                {
                    if (i == 0)
                    {
                        foreach (var tag in topic.Tags)
                        {
                            if (tag.ID == _tagID)
                            {
                                tagName = tag.Name;
                                break;
                            }
                        }
                    }

                    var topicControl = (TopicControl) LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicControl.ascx");
                    topicControl.SettingsID = ForumManager.Settings.ID;
                    topicControl.Topic = topic;
                    topicControl.IsShowThreadName = true;
                    topicControl.IsEven = (i%2 == 0);
                    topicListHolder.Controls.Add(topicControl);
                    i++;
                }

                var pageNavigator = new PageNavigator
                                        {
                                            CurrentPageNumber = currentPageNumber,
                                            EntryCountOnPage = ForumManager.Settings.TopicCountOnPage,
                                            VisiblePageCount = 5,
                                            EntryCount = topicCount
                                        };
                if (_isFindByTag)
                    pageNavigator.PageUrl = _isFindByTag ? "search.aspx?tag=" + _tagID.ToString() : "search.aspx?search=" + HttpUtility.UrlEncode(searchText, Encoding.UTF8);

                bottomPageNavigatorHolder.Controls.Add(pageNavigator);
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                                             {
                                                 ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                                                 Header = Resources.ForumResource.EmptyScreenSearchCaption,
                                                 Describe = Resources.ForumResource.EmptyScreenSearchText,
                                             };

                topicListHolder.Controls.Add(emptyScreenControl);
            }

            var breadCrumbs = (Master as ForumMasterPage).BreadCrumbs;
            breadCrumbs.Add(new BreadCrumb {Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx"});
            breadCrumbs.Add(new BreadCrumb {Caption = HeaderStringHelper.GetHTMLSearchHeader(_isFindByTag ? tagName : searchText)});

            Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs);
        }
Exemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.RegisterTypeForAjax(typeof (CustomFieldsView));
            EntityType entityType;

            var view = Request["view"];

            switch (view)
            {
                case "person":
                    entityType = EntityType.Person;
                    break;
                case "company":
                    entityType = EntityType.Company;
                    break;
                case "opportunity":
                    entityType = EntityType.Opportunity;
                    break;
                case "case":
                    entityType = EntityType.Case;
                    break;
                default:
                    entityType = EntityType.Contact;
                    break;
            }

            _manageFieldPopup.Options.IsPopup = true;

            _switcherEntityType.SortItemsHeader = CRMCommonResource.Show + ":";

            _switcherEntityType.SortItems[0].SortLabel = CRMSettingResource.BothPersonAndCompany;
            _switcherEntityType.SortItems[0].SortUrl = "settings.aspx?type=custom_field";
            _switcherEntityType.SortItems[0].IsSelected = entityType == EntityType.Contact;

            _switcherEntityType.SortItems[1].SortLabel = CRMSettingResource.JustForPerson;
            _switcherEntityType.SortItems[1].SortUrl = String.Format("settings.aspx?type=custom_field&view={0}",
                                                                     EntityType.Person.ToString().ToLower());
            _switcherEntityType.SortItems[1].IsSelected = entityType == EntityType.Person;

            _switcherEntityType.SortItems[2].SortLabel = CRMSettingResource.JustForCompany;
            _switcherEntityType.SortItems[2].SortUrl = String.Format("settings.aspx?type=custom_field&view={0}",
                                                                     EntityType.Company.ToString().ToLower());
            _switcherEntityType.SortItems[2].IsSelected = entityType == EntityType.Company;

            _switcherEntityType.SortItems[3].SortLabel = CRMCommonResource.DealModuleName;
            _switcherEntityType.SortItems[3].SortUrl = String.Format("settings.aspx?type=custom_field&view={0}", EntityType.Opportunity.ToString().ToLower());
            _switcherEntityType.SortItems[3].IsSelected = entityType == EntityType.Opportunity;

            _switcherEntityType.SortItems[4].SortLabel = CRMCommonResource.CasesModuleName;
            _switcherEntityType.SortItems[4].SortUrl = String.Format("settings.aspx?type=custom_field&view={0}", EntityType.Case.ToString().ToLower());
            _switcherEntityType.SortItems[4].IsSelected = entityType == EntityType.Case;

            var customFieldList = Global.DaoFactory.GetCustomFieldDao().GetFieldsDescription(entityType);
            Page.JsonPublisher(customFieldList, "customFieldList");

            Page.ClientScript.RegisterClientScriptBlock(GetType(),
                                                        Guid.NewGuid().ToString(),
                                                        String.Format(" var relativeItems = {0};", Global.DaoFactory.GetCustomFieldDao().GetContactLinkCountJSON(entityType)),
                                                        true);
            var emptyScreenControl = new EmptyScreenControl
                                         {
                                             ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_userfields.png", ProductEntryPoint.ID),
                                             Header = CRMSettingResource.EmptyContentCustomFields,
                                             Describe = CRMSettingResource.EmptyContentCustomFieldsDescript,
                                             ButtonHTML = String.Format("<a class='linkAddMediumText baseLinkAction' onclick='ASC.CRM.SettingsPage.showAddFieldPanel();' >{0}</a>",
                                                                        CRMSettingResource.AddCustomField)
                                         };
            _phEmptyContent.Controls.Add(emptyScreenControl);

        }
Exemplo n.º 30
0
        private void LoadData()
        {
            var storage = FeedStorageFactory.Create();
            var feedType = FeedType.All;

            if (!string.IsNullOrEmpty(Request["type"]))
            {
                feedType = (FeedType) Enum.Parse(typeof (FeedType), Request["type"], true);
                var feedTypeInfo = FeedTypeInfo.FromFeedType(feedType);
                Breadcrumb.Add(new BreadCrumb
                                   {
                                       Caption = feedTypeInfo.TypeName,
                                       NavigationUrl = FeedUrls.GetFeedListUrl(feedType)
                                   });
                if (!string.IsNullOrEmpty(Request["search"]))
                {
                    Breadcrumb.Add(new BreadCrumb {Caption = HeaderStringHelper.GetHTMLSearchHeader(Request["search"]), NavigationUrl = VirtualPathUtility.ToAbsolute("~/products/community/modules/news/") + "?type=" + Request["type"] + "&search=" + Request["search"] + Info.UserIdAttribute});
                }
            }
            else if (!string.IsNullOrEmpty(Request["search"]))
            {
                Breadcrumb.Add(new BreadCrumb {Caption = HeaderStringHelper.GetHTMLSearchHeader(Request["search"]), NavigationUrl = VirtualPathUtility.ToAbsolute("~/products/community/modules/news/") + "?search=" + Request["search"] + Info.UserIdAttribute});
            }

            var feedsCount = !string.IsNullOrEmpty(Request["search"]) ? storage.SearchFeedsCount(Request["search"], feedType, Info.UserId) : storage.GetFeedsCount(feedType, Info.UserId);

            if (feedsCount == 0)
            {
                FeedRepeater.Visible = false;
                MessageShow.Visible = true;

                string buttonLink;
                string buttonName;
                var emptyScreenControl = new EmptyScreenControl {Describe = NewsResource.EmptyScreenText};

                switch (feedType)
                {
                    case FeedType.News:
                        emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_news.png", NewsConst.ModuleId);
                        emptyScreenControl.Header = NewsResource.EmptyScreenNewsCaption;
                        buttonLink = FeedUrls.EditNewsUrl;
                        buttonName = NewsResource.EmptyScreenNewsLink;
                        break;
                    case FeedType.Order:
                        emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_order.png", NewsConst.ModuleId);
                        emptyScreenControl.Header = NewsResource.EmptyScreenOrdersCaption;
                        buttonLink = FeedUrls.EditOrderUrl;
                        buttonName = NewsResource.EmptyScreenOrderLink;
                        break;
                    case FeedType.Advert:
                        emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_advert.png", NewsConst.ModuleId);
                        emptyScreenControl.Header = NewsResource.EmptyScreenAdvertsCaption;
                        buttonLink = FeedUrls.EditAdvertUrl;
                        buttonName = NewsResource.EmptyScreenAdvertLink;
                        break;
                    case FeedType.Poll:
                        emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_poll.png", NewsConst.ModuleId);
                        emptyScreenControl.Header = NewsResource.EmptyScreenPollsCaption;
                        buttonLink = FeedUrls.EditPollUrl;
                        buttonName = NewsResource.EmptyScreenPollLink;
                        break;
                    default:
                        emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_newslogo.png", NewsConst.ModuleId);
                        emptyScreenControl.Header = NewsResource.EmptyScreenEventsCaption;
                        buttonLink = FeedUrls.EditNewsUrl;
                        buttonName = NewsResource.EmptyScreenEventLink;
                        break;
                }

                if (CommunitySecurity.CheckPermissions(NewsConst.Action_Add) && String.IsNullOrEmpty(Request["uid"]) && String.IsNullOrEmpty(Request["search"]))
                    emptyScreenControl.ButtonHTML = String.Format("<a class='linkAddMediumText' href='{0}'>{1}</a>", buttonLink, buttonName);


                MessageShow.Controls.Add(emptyScreenControl);
            }
            else
            {
                const int pageSize = 20;
                var pageCount = (int) (feedsCount/pageSize + 1);
                if (pageCount < PageNumber) PageNumber = pageCount;

                var feeds = !string.IsNullOrEmpty(Request["search"]) ?
                                                                         storage.SearchFeeds(Request["search"], feedType, Info.UserId, pageSize, (PageNumber - 1)*pageSize) :
                                                                                                                                                                                storage.GetFeeds(feedType, Info.UserId, pageSize, (PageNumber - 1)*pageSize);

                pgNavigator.EntryCountOnPage = pageSize;
                pgNavigator.EntryCount = 0 < pageCount ? (int) feedsCount : pageSize;
                pgNavigator.CurrentPageNumber = PageNumber;

                pgNavigator.ParamName = "page";
                if (!string.IsNullOrEmpty(Request["search"]))
                {
                    pgNavigator.PageUrl = string.Format(CultureInfo.CurrentCulture, "{0}?search={1}", VirtualPathUtility.ToAbsolute("~/products/community/modules/news/"), Request["search"]);
                }
                else
                {
                    pgNavigator.PageUrl = string.IsNullOrEmpty(Request["type"]) ?
                                                                                    string.Format(CultureInfo.CurrentCulture, "{0}?{1}", VirtualPathUtility.ToAbsolute("~/products/community/modules/news/"), (string.IsNullOrEmpty(Info.UserIdAttribute) ? string.Empty : "?" + Info.UserIdAttribute.Substring(1))) :
                                                                                                                                                                                                                                                                                                                         string.Format(CultureInfo.CurrentCulture, "{0}?type={1}{2}", VirtualPathUtility.ToAbsolute("~/products/community/modules/news/"), Request["type"], Info.UserIdAttribute);
                }
                FeedRepeater.DataSource = feeds;
                FeedRepeater.DataBind();
            }
        }
Exemplo n.º 31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumManager.Instance.SetCurrentPage(ForumPage.Search);

            int currentPageNumber;
            if (!int.TryParse(Request["p"], out currentPageNumber))
                currentPageNumber = 1;

            if (currentPageNumber <= 0)
                currentPageNumber = 1;

            var findTopicList = new List<Topic>();
            var topicCount = 0;

            if (!String.IsNullOrEmpty(Request["uid"]))
            {
                try
                {
                    _userID = new Guid(Request["uid"]);
                }
                catch
                {
                    _userID = Guid.Empty;
                }

                if (_userID != Guid.Empty)
                {
                    findTopicList = ForumDataProvider.SearchTopicsByUser(TenantProvider.CurrentTenantID, _userID, currentPageNumber, ForumManager.Settings.TopicCountOnPage, out topicCount);
                }
            }

            if (findTopicList.Count > 0)
            {
                _isFind = true;

                var i = 0;
                foreach (var topic in findTopicList)
                {
                    var topicControl = (TopicControl)LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicControl.ascx");
                    topicControl.SettingsID = ForumManager.Settings.ID;
                    topicControl.Topic = topic;
                    topicControl.IsShowThreadName = true;
                    topicControl.IsEven = (i%2 == 0);
                    topicListHolder.Controls.Add(topicControl);
                    i++;
                }

                #region navigators

                var pageNavigator = new PageNavigator
                    {
                        CurrentPageNumber = currentPageNumber,
                        EntryCountOnPage = ForumManager.Settings.TopicCountOnPage,
                        VisiblePageCount = 5,
                        EntryCount = topicCount,
                        PageUrl = "usertopics.aspx?uid=" + _userID.ToString()
                    };

                bottomPageNavigatorHolder.Controls.Add(pageNavigator);

                #endregion
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                    {
                        ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                        Header = Resources.ForumResource.EmptyScreenSearchCaption,
                        Describe = Resources.ForumResource.EmptyScreenSearchText,
                    };

                topicListHolder.Controls.Add(emptyScreenControl);
            }

            //bread crumbs
            (Master as ForumMasterPage).CurrentPageCaption = CoreContext.UserManager.GetUsers(_userID).DisplayUserName(false);

            Title = HeaderStringHelper.GetPageTitle((Master as ForumMasterPage).CurrentPageCaption);
        }