private Feed ToFeed(Contact contact) { var item = string.Empty; if (contact is Person) { item = "person"; } else if (contact is Company) { item = "company"; } var itemUrl = "/products/crm/?id=" + contact.ID + "#profile"; return(new Feed(contact.CreateBy, contact.CreateOn) { Item = item, ItemId = contact.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), Product = Product, Module = Name, Title = contact.GetTitle(), Description = Helper.GetHtmlDescription(HttpUtility.HtmlEncode(contact.About)), Keywords = string.Format("{0}", contact.GetTitle()), HasPreview = false, CanComment = false, GroupId = GetGroupId(item, contact.CreateBy) }); }
private void BlockNotPaidPortal(Tenant tenant) { if (tenant == null) { return; } var passthroughtRequestEndings = new[] { ".htm", ".ashx", ".png", ".ico", ".less", ".css", ".js", "capabilities.json" }; if (passthroughtRequestEndings.Any(path => Request.Url.AbsolutePath.EndsWith(path, StringComparison.InvariantCultureIgnoreCase))) { return; } if (!TenantExtra.EnableTariffSettings && TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid) { if (string.IsNullOrEmpty(AdditionalWhiteLabelSettings.Instance.BuyUrl) || AdditionalWhiteLabelSettings.Instance.BuyUrl == AdditionalWhiteLabelSettings.DefaultBuyUrl) { LogManager.GetLogger("ASC").WarnFormat("Tenant {0} is not paid", tenant.TenantId); Response.StatusCode = (int)HttpStatusCode.PaymentRequired; Response.End(); } else if (!Request.Url.AbsolutePath.EndsWith(CommonLinkUtility.ToAbsolute(PaymentRequired.Location))) { ResponseRedirect(PaymentRequired.Location, HttpStatusCode.PaymentRequired); } } }
private static object PrepareUserInfo(UserInfo userInfo) { return(new { id = userInfo.ID, displayName = DisplayUserSettings.GetFullUserName(userInfo), title = userInfo.Title, avatarSmall = UserPhotoManager.GetSmallPhotoURL(userInfo.ID), avatarBig = UserPhotoManager.GetBigPhotoURL(userInfo.ID), profileUrl = CommonLinkUtility.ToAbsolute(CommonLinkUtility.GetUserProfile(userInfo.ID.ToString(), false)), groups = CoreContext.UserManager.GetUserGroupsId(userInfo.ID), isPending = userInfo.ActivationStatus == EmployeeActivationStatus.Pending, isActivated = userInfo.ActivationStatus.HasFlag(EmployeeActivationStatus.Activated), isVisitor = userInfo.IsVisitor(), isOutsider = userInfo.IsOutsider(), isAdmin = userInfo.IsAdmin(), isOwner = userInfo.IsOwner(), contacts = GetContacts(userInfo), created = userInfo.CreateDate, email = userInfo.Email, isLDAP = userInfo.IsLDAP(), isSSO = userInfo.IsSSO(), isTerminated = userInfo.Status == EmployeeStatus.Terminated }); }
private static object PrepareUserInfo(UserInfo userInfo) { return(new { id = userInfo.ID, displayName = DisplayUserSettings.GetFullUserName(userInfo), title = userInfo.Title, avatarSmall = UserPhotoManager.GetSmallPhotoURL(userInfo.ID), avatarBig = UserPhotoManager.GetBigPhotoURL(userInfo.ID), profileUrl = CommonLinkUtility.ToAbsolute(CommonLinkUtility.GetUserProfile(userInfo.ID.ToString(), false)), groups = CoreContext.UserManager.GetUserGroups(userInfo.ID).Select(x => new { id = x.ID, name = x.Name, manager = CoreContext.UserManager.GetUsers(CoreContext.UserManager.GetDepartmentManager(x.ID)).UserName }).ToList(), isPending = userInfo.ActivationStatus == EmployeeActivationStatus.Pending, isActivated = userInfo.ActivationStatus == EmployeeActivationStatus.Activated, isVisitor = userInfo.IsVisitor(), isOutsider = userInfo.IsOutsider(), isAdmin = userInfo.IsAdmin(), isOwner = userInfo.IsOwner(), contacts = GetContacts(userInfo), created = userInfo.CreateDate, email = userInfo.Email, isLDAP = userInfo.Sid != null }); }
// private WebPath _webPath; public PathProvider(CommonLinkUtility commonLinkUtility) { _commonLinkUtility = commonLinkUtility; // _httpContext = httpContextAccessor.HttpContext; BaseAbsolutePath = _commonLinkUtility.ToAbsolute(BaseVirtualPath); }
public static String GetFolderUrl(Folder folder) { if (folder == null) { throw new ArgumentNullException("folder", FilesCommonResource.ErrorMassage_FolderNotFound); } using (var folderDao = Global.DaoFactory.GetFolderDao()) { switch (folder.RootFolderType) { case FolderType.BUNCH: var path = folderDao.GetBunchObjectID(folder.RootFolderId); var projectID = path.Split('/').Last(); if (String.IsNullOrEmpty(projectID)) { return(String.Empty); } return(String.Format("{0}?prjid={1}#{2}", CommonLinkUtility.ToAbsolute(ProjectVirtualPath), projectID, folder.ID)); default: return(FilesLinkUtility.FilesBaseAbsolutePath + "#" + HttpUtility.UrlPathEncode(folder.ID.ToString())); } } }
protected override void PageLoad() { Title = HeaderStringHelper.GetPageTitle(ProjectsCommonResource.CommonSettings); Page.RegisterStyle( PathProvider.GetFileStaticRelativePath("settings.less"), "~/Products/Files/Controls/FileSelector/fileselector.css", "~/Products/Files/Controls/ThirdParty/thirdparty.css", "~/Products/Files/Controls/ContentList/contentlist.css", "~/Products/Files/Controls/EmptyFolder/emptyfolder.css", "~/Products/Files/Controls/Tree/tree.css") .RegisterBodyScripts( PathProvider.GetFileStaticRelativePath("settings.js"), "~/Products/Files/Controls/Tree/tree.js", "~/Products/Files/Controls/EmptyFolder/emptyfolder.js", "~/Products/Files/Controls/FileSelector/fileselector.js", "~/Products/Files/js/common.js", "~/Products/Files/js/templatemanager.js", "~/Products/Files/js/servicemanager.js", "~/Products/Files/js/ui.js", "~/Products/Files/js/eventhandler.js"); FolderSelectorHolder.Controls.Add(LoadControl(CommonLinkUtility.ToAbsolute("~/Products/Files/Controls/FileSelector/FileSelector.ascx"))); Page.RegisterClientScript(new ClientSettingsResources()); }
private Feed ToFeed(Post post) { var item = string.Empty; if (post.Topic.Type == TopicType.Informational) { item = "forumTopic"; } else if (post.Topic.Type == TopicType.Poll) { item = "forumPoll"; } var itemUrl = "/Products/Community/Modules/Forum/Posts.aspx?t=" + post.Topic.ID + "&post=" + post.ID; var threadUrl = "/Products/Community/Modules/Forum/Topics.aspx?f=" + post.Topic.ThreadID; return(new Feed(post.Topic.PosterID, post.Topic.CreateDate) { Item = item, ItemId = post.Topic.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), Product = Product, Module = Name, Title = post.Topic.Title, Description = HtmlUtility.GetFull(post.Text), ExtraLocation = post.Topic.ThreadTitle, ExtraLocationUrl = CommonLinkUtility.ToAbsolute(threadUrl), Keywords = string.Format("{0} {1}", post.Topic.Title, post.Text), HasPreview = false, CanComment = false, GroupId = GetGroupId(item, post.Topic.PosterID, post.Topic.ThreadID.ToString(CultureInfo.InvariantCulture)) }); }
protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(BackupAjaxHandler), Page); Page.RegisterStyleControl(ResolveUrl("~/usercontrols/management/backup/css/backup.less")); Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/backup/js/backup.js")); FolderSelectorHolder.Controls.Add(LoadControl(CommonLinkUtility.ToAbsolute("~/products/files/controls/fileselector/fileselector.ascx"))); BackupTimePeriod.Controls.Add(LoadControl(ChooseTimePeriod.Location)); RestoreHolder.Controls.Add(LoadControl(Restore.Location)); var size = CoreContext.TenantManager.FindTenantQuotaRows(new TenantQuotaRowQuery(TenantProvider.CurrentTenantID)) .Where(r => !string.IsNullOrEmpty(r.Tag) && new Guid(r.Tag) != Guid.Empty && !new Guid(r.Tag).Equals(_mailStorageTag)) .Sum(r => r.Counter); if (size > AvailableZipSize) { AvailableStatus = BackupAvailableSize.NotAvailable; } else { size = TenantStatisticsProvider.GetUsedSize(); if (size > AvailableZipSize) { AvailableStatus = BackupAvailableSize.WithoutMail; } } }
private Feed ToFeed(Post post) { var item = string.Empty; if (post.Topic.Type == TopicType.Informational) { item = "forumTopic"; } else if (post.Topic.Type == TopicType.Poll) { item = "forumPoll"; } var itemUrl = "/products/community/modules/forum/posts.aspx?t=" + post.Topic.ID + "&post=" + post.ID; return(new Feed(post.Topic.PosterID, post.Topic.CreateDate) { Item = item, ItemId = post.Topic.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), Product = Product, Module = Name, Title = post.Topic.Title, Description = HtmlSanitizer.Sanitize(post.Text), Keywords = string.Format("{0} {1}", post.Topic.Title, post.Text), HasPreview = false, CanComment = false, GroupId = string.Format("{0}_{1}", item, post.Topic.ID) }); }
public static string GetFileWebViewerUrlForMobile(object fileId, int fileVersion) { var viewerUrl = CommonLinkUtility.ToAbsolute("~/../products/files/") + EditorPage + "?" + FileId + "={0}"; return(string.Format(viewerUrl, HttpUtility.UrlEncode(fileId.ToString())) + (fileVersion > 0 ? "&" + Version + "=" + fileVersion : string.Empty)); }
protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(ConfirmActivation)); Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/confirmactivation/js/confirmactivation.js")); Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/usercontrols/management/ConfirmActivation/css/confirmactivation.less")); Page.Title = HeaderStringHelper.GetPageTitle(Resource.Authorization); ButtonEmailAndPasswordOK.Text = Resource.EmailAndPasswordOK; btChangeEmail.Text = Resource.ChangeEmail; var email = (Request["email"] ?? "").Trim(); if (string.IsNullOrEmpty(email)) { ShowError(Resource.ErrorNotCorrectEmail); return; } Type = typeof(ConfirmType).TryParseEnum(Request["type"] ?? "", ConfirmType.EmpInvite); try { if (Type == ConfirmType.EmailChange) { User = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID); User.Email = email; CoreContext.UserManager.SaveUserInfo(User); ActivateMail(User); const string successParam = "email_change=success"; if (User.IsVisitor()) { Response.Redirect(CommonLinkUtility.ToAbsolute("~/my.aspx?" + successParam)); } Response.Redirect(string.Format("{0}&{1}", User.GetUserProfilePageURL(), successParam)); } else { User = CoreContext.UserManager.GetUserByEmail(email); if (User.ID.Equals(Constants.LostUser.ID)) { ShowError(string.Format(Resource.ErrorUserNotFoundByEmail, email)); return; } UserAuth(User, HttpContext.Current); ActivateMail(User); } if (Type == ConfirmType.PasswordChange) { passwordSetter.Visible = true; } } catch (ThreadAbortException) { } catch (Exception ex) { ShowError(ex.Message); } }
protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context) { var curQuota = TenantExtra.GetTenantQuota(); var result = new List <KeyValuePair <string, object> >(32) { RegisterObject( new { ApiPath = SetupInfo.WebApiBaseUrl, IsAuthenticated = SecurityContext.IsAuthenticated, IsAdmin = CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, Constants.GroupAdmin.ID), IsVisitor = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsVisitor(), CurrentTenantId = CoreContext.TenantManager.GetCurrentTenant().TenantId, CurrentTenantCreatedDate = CoreContext.TenantManager.GetCurrentTenant().CreatedDateTime, CurrentTenantVersion = CoreContext.TenantManager.GetCurrentTenant().Version, CurrentTenantUtcOffset = CoreContext.TenantManager.GetCurrentTenant().TimeZone, CurrentTenantUtcHoursOffset = CoreContext.TenantManager.GetCurrentTenant().TimeZone.BaseUtcOffset.Hours, CurrentTenantUtcMinutesOffset = CoreContext.TenantManager.GetCurrentTenant().TimeZone.BaseUtcOffset.Minutes, TimezoneDisplayName = CoreContext.TenantManager.GetCurrentTenant().TimeZone.DisplayName, TimezoneOffsetMinutes = CoreContext.TenantManager.GetCurrentTenant().TimeZone.GetUtcOffset(DateTime.UtcNow).TotalMinutes, TenantIsPremium = curQuota.Trial ? "No" : "Yes", TenantTariff = curQuota.Id, EmailRegExpr = @"^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$", GroupSelector_MobileVersionGroup = new { Id = -1, Name = UserControlsCommonResource.LblSelect.HtmlEncode().ReplaceSingleQuote() }, GroupSelector_WithGroupEveryone = new { Id = Constants.GroupEveryone.ID, Name = UserControlsCommonResource.Everyone.HtmlEncode().ReplaceSingleQuote() }, GroupSelector_WithGroupAdmin = new { Id = Constants.GroupAdmin.ID, Name = UserControlsCommonResource.Admin.HtmlEncode().ReplaceSingleQuote() }, SetupInfoNotifyAddress = SetupInfo.NotifyAddress, SetupInfoTipsAddress = SetupInfo.TipsAddress, CKEDITOR_BASEPATH = WebPath.GetPath("/usercontrols/common/ckeditor/"), MaxImageFCKWidth = ConfigurationManager.AppSettings["MaxImageFCKWidth"] ?? "620", UserPhotoHandlerUrl = VirtualPathUtility.ToAbsolute("~/UserPhoto.ashx"), ImageWebPath = WebImageSupplier.GetImageFolderAbsoluteWebPath(), UrlShareGooglePlus = SetupInfo.ShareGooglePlusUrl, UrlShareTwitter = SetupInfo.ShareTwitterUrl, UrlShareFacebook = SetupInfo.ShareFacebookUrl, ZeroClipboardMoviePath = CommonLinkUtility.ToAbsolute("~/js/flash/zeroclipboard/zeroclipboard10.swf") }) }; if (CoreContext.Configuration.Personal) { result.Add(RegisterObject(new { CoreContext.Configuration.Personal })); } if (CoreContext.Configuration.Standalone) { result.Add(RegisterObject(new { CoreContext.Configuration.Standalone })); } var helpLink = CommonLinkUtility.GetHelpLink(); if (!string.IsNullOrEmpty(helpLink)) { result.Add(RegisterObject(new { FilterHelpCenterLink = helpLink.TrimEnd('/') + "/tipstricks/using-search.aspx" })); } return(result); }
protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context) { return(new List <KeyValuePair <string, object> >(1) { RegisterObject( new { URL_OAUTH_BOX = Import.Box.Box.Location.ToLower(), URL_OAUTH2_GOOGLE = Import.Google.Google.Location.ToLower(), URL_OAUTH_DROPBOX = Import.DropBox.Dropbox.Location.ToLower(), URL_OAUTH_SKYDRIVE = Import.OneDrive.OneDriveOAuth.Location.ToLower(), URL_BASE = FilesLinkUtility.FilesBaseAbsolutePath, URL_WCFSERVICE = PathProvider.GetFileServicePath, URL_TEMPLATES_HANDLER = CommonLinkUtility.ToAbsolute("~/template.ashx") + "?id=" + PathProvider.TemplatePath + "&name=collection&ver=" + ClientSettings.ResetCacheKey, ADMIN = Global.IsAdministrator, MAX_NAME_LENGTH = Global.MaxTitle, CHUNK_UPLOAD_SIZE = SetupInfo.ChunkUploadSize, UPLOAD_FILTER = Global.EnableUploadFilter, ENABLE_UPLOAD_CONVERT = FileConverter.EnableAsUploaded, FOLDER_ID_MY_FILES = Global.FolderMy, FOLDER_ID_SHARE = Global.FolderShare, FOLDER_ID_COMMON_FILES = Global.FolderCommon, FOLDER_ID_PROJECT = Global.FolderProjects, FOLDER_ID_TRASH = Global.FolderTrash, FileConstant.ShareLinkId, AceStatusEnum = new { FileShare.None, FileShare.ReadWrite, FileShare.Read, FileShare.Restrict, FileShare.Varies, FileShare.Review }, FilterType = new { FilterType.None, FilterType.FilesOnly, FilterType.FoldersOnly, FilterType.DocumentsOnly, FilterType.PresentationsOnly, FilterType.SpreadsheetsOnly, FilterType.ImagesOnly, FilterType.ArchiveOnly, FilterType.ByUser, FilterType.ByDepartment, FilterType.ByExtension } }) }); }
private void RegisterScript() { var sb = new StringBuilder(); sb.AppendFormat(@"ZeroClipboard.setMoviePath('{0}');", CommonLinkUtility.ToAbsolute("~/js/flash/zeroclipboard/ZeroClipboard10.swf") ); Page.RegisterInlineScript(sb.ToString(), true); }
static PathProvider() { BaseVirtualPath = "~/Products/Projects/"; try { BaseAbsolutePath = CommonLinkUtility.ToAbsolute(BaseVirtualPath); } catch (Exception) { BaseAbsolutePath = BaseVirtualPath; } }
protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(BackupAjaxHandler), Page); Page.RegisterStyleControl(ResolveUrl("~/usercontrols/management/backup/css/backup.less")); Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/backup/js/backup.js")); FolderSelectorHolder.Controls.Add(LoadControl(CommonLinkUtility.ToAbsolute("~/products/files/controls/fileselector/fileselector.ascx"))); BackupTimePeriod.Controls.Add(LoadControl(ChooseTimePeriod.Location)); RestoreHolder.Controls.Add(LoadControl(Restore.Location)); }
static PathProvider() { BaseVirtualPath = "~/products/sample/"; try { BaseAbsolutePath = CommonLinkUtility.ToAbsolute(BaseVirtualPath).ToLower(); } catch (Exception) { BaseAbsolutePath = BaseVirtualPath; } }
private Tuple <Feed, object> ToFeed(Tuple <Topic, IEnumerable <Post> > t) { var topic = t.Item1; var item = string.Empty; if (topic.Type == TopicType.Informational) { item = "forum"; } else if (topic.Type == TopicType.Poll) { item = "forumPoll"; } var itemUrl = "/products/community/modules/forum/posts.aspx?t=" + topic.ID + "&post=" + topic.RecentPostID; var commentApiUrl = "/api/2.0/community/forum/topic/" + topic.ID + ".json"; var comments = t.Item2.Where(p => p.CreateDate != topic.CreateDate).OrderBy(p => p.CreateDate).ToList(); var feedDate = comments.Any() ? comments.First().CreateDate : topic.CreateDate; var feedAutohor = comments.Any() ? comments.Last().PosterID : topic.PosterID; var feed = new Feed(topic.PosterID, feedDate, true) { Item = item, ItemId = topic.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), LastModifiedBy = feedAutohor, Product = Product, Module = Name, Action = comments.Any() ? FeedAction.Commented : FeedAction.Created, Title = topic.Title, HasPreview = false, CanComment = true, CommentApiUrl = CommonLinkUtility.ToAbsolute(commentApiUrl), Comments = comments.Select(ToFeedComment), GroupId = string.Format("{0}_{1}", item, topic.ID) }; feed.Keywords = string.Format("{0} {1}", topic.Title, string.Join(" ", feed.Comments.Select(x => x.Description))); var firstPost = t.Item2.FirstOrDefault(p => p.CreateDate == topic.CreateDate); if (firstPost != null) { feed.Description = HtmlSanitizer.Sanitize(firstPost.Text); } return(new Tuple <Feed, object>(feed, topic)); }
public static string GetFileStaticRelativePath(String fileName) { var ext = FileUtility.GetFileExtension(fileName); switch (ext) { case ".js": return VirtualPathUtility.ToAbsolute("~/Products/Projects/js/" + fileName); case ".png": return WebPath.GetPath("/Products/Projects/App_Themes/Default/images/" + fileName); case ".ascx": return CommonLinkUtility.ToAbsolute("~/Products/Projects/Controls/" + fileName); case ".css": case ".less": return VirtualPathUtility.ToAbsolute("~/Products/Projects/App_Themes/default/css/" + fileName); } return fileName; }
public static String GetFileStaticRelativePath(String fileName) { var ext = FileUtility.GetFileExtension(fileName); switch (ext) { case ".js": return(WebPath.GetPath("/products/files/js/" + fileName).ToLowerInvariant()); case ".ascx": return(CommonLinkUtility.ToAbsolute("~/products/files/controls/" + fileName).ToLowerInvariant()); case ".css": return(WebPath.GetPath("/products/files/app_themes/default/" + fileName).ToLowerInvariant()); } return(fileName); }
public static string GetFileStaticRelativePath(string fileName) { var ext = FileUtility.GetFileExtension(fileName); switch (ext) { case ".js": //Attention: Only for ResourceBundleControl return(VirtualPathUtility.ToAbsolute("~/Products/Files/js/" + fileName)); case ".ascx": return(CommonLinkUtility.ToAbsolute("~/Products/Files/Controls/" + fileName)); case ".css": //Attention: Only for ResourceBundleControl return(VirtualPathUtility.ToAbsolute("~/Products/Files/App_Themes/default/" + fileName)); } return(fileName); }
private Feed ToFeed(UserInfo user, DateTime now) { var item = Constants.BirthdaysModule; return(new Feed(user.ID, now.Date) { Item = item, ItemId = user.ID.ToString(), Title = Web.Studio.PublicResources.FeedResource.Birthday, ItemUrl = CommonLinkUtility.ToAbsolute("~/Products/People/Birthdays.aspx"), Product = Product, Action = FeedAction.AllDayEventCreated, Module = Name, IsAllDayEvent = true, GroupId = GetGroupId(item, user.ID), HasPreview = false, CanComment = false }); }
private Feed ToFeed(ParticipantFull participant) { var itemUrl = "/products/projects/tasks.aspx?prjID=" + participant.Project.ID; var feed = new Feed(participant.ID, participant.Created) { Item = item, ItemId = string.Format("{0}_{1}", participant.ID, participant.Project.ID), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), Product = Product, Module = Name, Title = participant.Project.Title, HasPreview = false, CanComment = false, GroupId = string.Format("{0}_{1}_{2}", item, participant.Project.ID, participant.ID) }; feed.Keywords = feed.Author.DisplayName; return(feed); }
private Feed ToFeed(Post post) { var itemUrl = "/products/community/modules/forum/posts.aspx?t=" + post.TopicID + "&post=" + post.ID; return(new Feed(post.PosterID, post.CreateDate) { Item = item, ItemId = post.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), Product = Product, Module = Name, Title = post.Subject, Description = HtmlUtility.GetFull(post.Text), Keywords = string.Format("{0} {1}", post.Subject, post.Text), HasPreview = false, CanComment = false, GroupId = string.Format("{0}_{1}", item, post.ID) }); }
private Tuple <Feed, object> ToFeed(Tuple <Task, IEnumerable <ProjectComment> > t) { var task = t.Item1; var itemUrl = "/products/projects/tasks.aspx?prjID=" + task.Project.ID + "&id=" + task.ID; var projectUrl = "/products/projects/tasks.aspx?prjID=" + task.Project.ID; var commentApiUrl = "/api/2.0/project/task/" + task.ID + "/comment.json"; var responsiblesString = Helper.GetUsersString(task.Responsibles); var comments = t.Item2.Where(c => c.Comment != null).OrderBy(c => c.Comment.CreateOn).ToList(); var feedDate = comments.Any() ? comments.First().Comment.CreateOn : task.CreateOn; var feedAutohor = comments.Any() ? comments.Last().Comment.CreateBy : task.CreateBy; var feed = new Feed(task.CreateBy, feedDate, true) { Item = item, ItemId = task.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), LastModifiedBy = feedAutohor, Product = Product, Module = Name, Action = comments.Any() ? FeedAction.Commented : FeedAction.Created, Title = task.Title, Description = Helper.GetHtmlDescription(HttpUtility.HtmlEncode(task.Description)), ExtraLocation = task.Project.Title, ExtraLocationUrl = CommonLinkUtility.ToAbsolute(projectUrl), AdditionalInfo = responsiblesString, HasPreview = false, CanComment = true, CommentApiUrl = CommonLinkUtility.ToAbsolute(commentApiUrl), Comments = comments.Select(ToFeedComment), GroupId = string.Format("{0}_{1}", item, task.ID) }; feed.Keywords = string.Format("{0} {1} {2}", task.Title, task.Description, string.Join(" ", feed.Comments.Select(x => x.Description))); return(new Tuple <Feed, object>(feed, task)); }
private Feed ToFeed(Deal deal) { var itemId = "/products/crm/deals.aspx?id=" + deal.ID + "#profile"; return(new Feed(deal.CreateBy, deal.CreateOn) { Item = item, ItemId = deal.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemId), Product = Product, Module = Name, Title = deal.Title, Description = Helper.GetHtmlDescription(HttpUtility.HtmlEncode(deal.Description)), AdditionalInfo = deal.Contact.GetTitle(), Keywords = string.Format("{0} {1}", deal.Title, deal.Description), HasPreview = false, CanComment = false, GroupId = GetGroupId(item, deal.CreateBy) }); }
private Feed ToFeed(Project project) { var itemUrl = "/Products/Projects/Tasks.aspx?prjID=" + project.ID; return(new Feed(project.CreateBy, project.CreateOn) { Item = item, ItemId = project.ID.ToString(CultureInfo.InvariantCulture), ItemUrl = CommonLinkUtility.ToAbsolute(itemUrl), Product = Product, Module = Name, Title = project.Title, Description = Helper.GetHtmlDescription(HttpUtility.HtmlEncode(project.Description)), AdditionalInfo = Helper.GetUser(project.Responsible).DisplayUserName(), Keywords = string.Format("{0} {1}", project.Title, project.Description), HasPreview = false, CanComment = false, GroupId = string.Format("{0}_{1}", item, project.ID) }); }
protected void Page_Load(object sender, EventArgs e) { TariffPageLink = TenantExtra.GetTariffPageLink(); if (!SetupInfo.IsVisibleSettings(ManagementType.Backup.ToString())) { Response.Redirect(CommonLinkUtility.GetDefault(), true); return; } TenantId = TenantProvider.CurrentTenantID; AjaxPro.Utility.RegisterTypeForAjax(typeof(BackupAjaxHandler), Page); Page.RegisterStyle("~/UserControls/Management/Backup/css/backup.less", "~/Products/Files/Controls/FileSelector/fileselector.css", "~/Products/Files/Controls/ThirdParty/thirdparty.css", "~/Products/Files/Controls/ContentList/contentlist.css", "~/Products/Files/Controls/EmptyFolder/emptyfolder.css", "~/Products/Files/Controls/Tree/tree.css" ) .RegisterBodyScripts("~/UserControls/Management/Backup/js/backup.js", "~/Products/Files/Controls/Tree/tree.js", "~/Products/Files/Controls/EmptyFolder/emptyfolder.js", "~/Products/Files/Controls/FileSelector/fileselector.js", "~/Products/Files/js/common.js", "~/Products/Files/js/templatemanager.js", "~/Products/Files/js/servicemanager.js", "~/Products/Files/js/ui.js", "~/Products/Files/js/eventhandler.js" ); FolderSelectorHolder.Controls.Add(LoadControl(CommonLinkUtility.ToAbsolute("~/Products/Files/Controls/FileSelector/FileSelector.ascx"))); BackupTimePeriod.Controls.Add(LoadControl(ChooseTimePeriod.Location)); if (SetupInfo.IsVisibleSettings("Restore")) { RestoreHolder.Controls.Add(LoadControl(Restore.Location)); } HelpLink = CommonLinkUtility.GetHelpLink(); }
private void BlockNotPaidPortal(Tenant tenant) { if (tenant == null) { return; } var passthroughtRequestEndings = new[] { ".htm", ".ashx", ".png", ".ico", ".less", ".css", ".js" }; if (passthroughtRequestEndings.Any(path => Request.Url.AbsolutePath.EndsWith(path, StringComparison.InvariantCultureIgnoreCase))) { return; } if (!TenantExtra.EnableTarrifSettings && TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid) { if (string.IsNullOrEmpty(AdditionalWhiteLabelSettings.Instance.BuyUrl) || AdditionalWhiteLabelSettings.Instance.BuyUrl == AdditionalWhiteLabelSettings.DefaultBuyUrl) { LogManager.GetLogger(typeof(Global)).WarnFormat("Tenant {0} is not paid", tenant.TenantId); Response.StatusCode = (int)HttpStatusCode.PaymentRequired; Response.End(); } else if (!Request.Url.AbsolutePath.EndsWith(CommonLinkUtility.ToAbsolute(PaymentRequired.Location))) { ResponseRedirect(PaymentRequired.Location, HttpStatusCode.PaymentRequired); } return; } if (CoreContext.Configuration.Standalone) { var licenseDay = TenantExtra.GetCurrentTariff().LicenseDate.Date; if (licenseDay < DateTime.Today && licenseDay < TenantExtra.VersionReleaseDate) { LogManager.GetLogger(typeof(Global)).Fatal("The installation was updated without a license"); Response.StatusCode = (int)HttpStatusCode.PaymentRequired; Response.End(); } } }