private void SetTagsInfo(dtoFilters filters, Int32 idCommunity) { Int32 idOrganization = 0; Person p = CurrentManager.GetPerson(UserContext.CurrentUserID); lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement permissions = null; if (filters.ForOrganization) { if (idCommunity == 0) { idCommunity = UserContext.CurrentCommunityID; idOrganization = CurrentManager.GetIdOrganizationFromCommunity(idCommunity); } if (idOrganization == 0) { idOrganization = CurrentManager.GetUserDefaultIdOrganization(UserContext.CurrentUserID); idCommunity = CurrentManager.GetIdCommunityFromOrganization(idOrganization); } permissions = new DomainModel.Domain.ModuleCommunityManagement(CurrentManager.GetModulePermission(UserContext.CurrentUserID, idCommunity, lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement.UniqueID)); } else { permissions = DomainModel.Domain.ModuleCommunityManagement.CreatePortalmodule((p == null) ? (Int32)UserTypeStandard.Guest : p.TypeID); } Int32 noTags = ServiceTags.GetCommunitiesWithNoTags(); String url = ""; if (permissions.Administration || permissions.Manage) { url = RootObject.BulkTagsAssignment(idOrganization, !filters.ForOrganization, true); } View.LoadTagsInfo(noTags, ServiceTags.GetUntranslatedTagsCount(filters.IdSelectedLanguage, false), 0, url); }
public lm.Comol.Core.DomainModel.Helpers.ExternalPageContext GetContext(Int32 idCommunity, long idItem, long idVersion, Int32 idModule, liteRepositoryItem item) { lm.Comol.Core.DomainModel.Helpers.ExternalPageContext context = new lm.Comol.Core.DomainModel.Helpers.ExternalPageContext(); context.Skin = new DomainModel.Helpers.dtoItemSkin(); context.Skin.IdCommunity = idCommunity; if (idCommunity > 0) { context.Skin.IdOrganization = CurrentManager.GetIdOrganizationFromCommunity(idCommunity); } else { context.Skin.IsForPortal = true; } context.Source = new ModuleObject() { CommunityID = idCommunity, ObjectLongID = idItem, ObjectIdVersion = idVersion, ServiceID = idModule, FQN = typeof(liteRepositoryItem).FullName }; if (item == null) { context.Source.ObjectTypeID = (int)ModuleRepository.ObjectType.File; } else { switch (item.Type) { case ItemType.File: context.Source.ObjectTypeID = (int)ModuleRepository.ObjectType.File; break; case ItemType.Multimedia: context.Source.ObjectTypeID = (int)ModuleRepository.ObjectType.File; break; case ItemType.ScormPackage: context.Source.ObjectTypeID = (int)ModuleRepository.ObjectType.ScormPackage; break; } } return(context); }
public void InitView(Int32 pageSize, Int32 idOrganization = 0, Boolean assigned = false, Boolean fromPortal = true, Boolean fromPage = false, String url = "") { litePerson p = CurrentManager.GetLitePerson(UserContext.CurrentUserID); if (UserContext.isAnonymous || p == null) { View.DisplaySessionTimeout(); } else { Int32 idCommunity = 0; lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement permissions = null; if (!fromPortal) { if (idOrganization > 0) { idCommunity = CurrentManager.GetIdCommunityFromOrganization(idOrganization); } if (idCommunity == 0) { idCommunity = UserContext.CurrentCommunityID; idOrganization = CurrentManager.GetIdOrganizationFromCommunity(idCommunity); } if (idOrganization == 0) { idOrganization = CurrentManager.GetUserDefaultIdOrganization(UserContext.CurrentUserID); idCommunity = CurrentManager.GetIdCommunityFromOrganization(idOrganization); } permissions = new DomainModel.Domain.ModuleCommunityManagement(CurrentManager.GetModulePermission(UserContext.CurrentUserID, idCommunity, lm.Comol.Core.DomainModel.Domain.ModuleCommunityManagement.UniqueID)); } else { permissions = DomainModel.Domain.ModuleCommunityManagement.CreatePortalmodule(p.TypeID); } View.CurrentIdOrganization = idOrganization; View.CurrentIdCommunity = idCommunity; View.CurrentAssignedTags = new List <dtoBulkCommunityForTags>(); if (!String.IsNullOrEmpty(url) && fromPage) { View.SetBackUrl(url); } if (permissions.Administration || permissions.Manage) { View.AllowSave = true; List <lm.Comol.Core.DomainModel.Filters.Filter> fToLoad = ServiceCommunities.GetDefaultFiltersForAssignments(p.Id, "", -1, null, lm.Comol.Core.BaseModules.CommunityManagement.CommunityAvailability.All, assigned).OrderBy(f => f.DisplayOrder).ToList(); View.LoadDefaultFilters(fToLoad); if (fToLoad != null && fToLoad.Any()) { lm.Comol.Core.BaseModules.CommunityManagement.dtoCommunitiesFilters filters = new lm.Comol.Core.BaseModules.CommunityManagement.dtoCommunitiesFilters(fToLoad, CommunityManagement.CommunityAvailability.All); View.CurrentFilters = filters; LoadCommunities(idCommunity, filters, 0, pageSize, ModuleTags.ActionType.BulkTagsAssignLoad, true); } else { View.DisplayNoCommunitiesToLoad(); View.SendUserAction(idCommunity, CurrentIdModule, ModuleTags.ActionType.BulkTagsNoCommunitiesFound); } } else { View.SendUserAction(idCommunity, CurrentIdModule, ModuleTags.ActionType.NoPermissionForBulkTagsAssign); } } }