private Domain.DTO.DTO_ManagerModify FileUpdateMessage(String HtmlText, String PreviewText) { if (!CheckSessionAccess()) { return(null); } if (!service.UserHasManResTicketPermission(View.TicketId)) { View.SendUserActions(service.ModuleID, ModuleTicket.ActionType.NoPermission, this.CurrentCommunityId, ModuleTicket.InteractionType.None); View.ShowNoPermission(); } Domain.DTO.DTO_ManagerModify Data = service.TicketGetManager(View.TicketId, View.MassageFilter, View.MessagesOrder); if (Data.Errors != Domain.Enums.TicketEditManErrors.none) { return(null); } if (Data.DraftMessage.Id != View.DraftMsgId) { return(null); } service.MessageDraftUpdate(HtmlText, PreviewText, View.TicketId, View.DraftMsgId); return(Data); }
public void AttachmentsAddAlsoToCommunity(String HtmlText, String PreviewText) { Domain.DTO.DTO_ManagerModify Data = FileUpdateMessage(HtmlText, PreviewText); if (Data == null) { return; } int CommunityID = (this.UserContext != null) ? UserContext.CurrentCommunityID : 0; int UserID = (this.UserContext != null) ? UserContext.CurrentUserID : 0; lm.Comol.Core.FileRepository.Domain.ModuleRepository cRepository = service.GetRepositoryPermissions(CommunityID, UserID); List <lm.Comol.Core.DomainModel.Repository.RepositoryAttachmentUploadActions> actions = service.UploadAvailableActionsGet(Data.CurrentUserType, CommunityID, UserID, cRepository); if (!actions.Contains(lm.Comol.Core.DomainModel.Repository.RepositoryAttachmentUploadActions.uploadtomoduleitemandcommunity)) { return; } //------------------------------------------------------------------------------------- service.AttachmentsAddFiles(View.DraftMsgId, View.GetUploadedItems(Data.DraftMessage, DomainModel.Repository.RepositoryAttachmentUploadActions.uploadtomoduleitemandcommunity)); //------------------------------------------------------------------------------------- this.InitView(); }
public void AttachmentsLinkFromCommunity(String HtmlText, String PreviewText, List <ModuleActionLink> links) { Domain.DTO.DTO_ManagerModify Data = FileUpdateMessage(HtmlText, PreviewText); if (Data == null || Data.DraftMessage == null) { return; } //TO DO List <Domain.TicketFile> attachments = service.AttachmentsLinkFiles(Data.DraftMessage.Id, links); int addedfiles = (attachments != null ? attachments.Count : 0); this.InitView(); }
public void InitView() { if (!CheckSessionAccess()) { return; } int ColUserId = this.UserContext.CurrentUserID; Domain.DTO.DTO_ManagerModify Data = service.TicketGetManager(View.TicketId, View.MassageFilter, View.MessagesOrder); if (Data.Errors == TicketEditManErrors.NoPermission)// (!service.UserHasManResTicketPermission(View.TicketId)) { View.SendUserActions(service.ModuleID, ModuleTicket.ActionType.NoPermission, this.CurrentCommunityId, ModuleTicket.InteractionType.None); View.ShowNoPermission(); } //Int32 CommunityId = UserContext.CurrentCommunityID; IList <Domain.DTO.DTO_CategoryTree> Categories = service.CategoriesGetTreeDLL(CurrentCommunityId, CategoryTREEgetType.FilterManager); //service.CategoryGetDDLManRes_ComCurrent(); View.UserType = Data.CurrentUserType; //this.CurrentCommunityId // lm.Comol.Core.FileRepository.Domain.ModuleRepository cRepository = service.GetRepositoryPermissions(CurrentCommunityId, ColUserId); //List<iCoreItemFileLink<long>> alreadyLinkedFiles = new List<iCoreItemFileLink<long>>(); ////= new List<iCoreItemFileLink<long>>(); ////Link di comunità già usati //if (Data.DraftMessage != null && Data.DraftMessage.Attachments.Any()) //{ // alreadyLinkedFiles = (from Domain.TicketFile fl in Data.DraftMessage.Attachments // where fl.File != null && fl.Link != null // select new dtoCoreItemFileLink<long>() // { // CreatedBy = fl.CreatedBy, // CreatedOn = fl.CreatedOn, // Deleted = fl.Deleted, // ItemFileLinkId = fl.Id, // StatusId = 0, // Link = fl.Link, // ModifiedBy = fl.ModifiedBy, // ModifiedOn = fl.ModifiedOn, // Owner = fl.CreatedBy, // isVisible = (fl.Deleted == BaseStatusDeleted.None && !fl.File.isDeleted), // File = fl.File // }).ToList<iCoreItemFileLink<long>>(); // //fl.Link.DestinationItem.ObjectLongID // // && fl.Visibility == Domain.Enums.FileVisibility.visible // //NO: se non è visibile, non lo è per l'utente, manager e resolver lo possono vedere E comunque non posso linkarlo nuovamente. //} //if (alreadyLinkedFiles == null) // alreadyLinkedFiles = new List<iCoreItemFileLink<long>>(); bool hasComManager = service.UsersCommunityHasManRes(CurrentCommunityId, Data.UserAssignedId); bool hasCommunity = (CurrentCommunityId > 0); View.InitView( Data, Categories, service.CategoryGetDTOCatTree(Data.CategoryCurrentId), service.UploadAvailableActionsGet( Data.CurrentUserType, CurrentCommunityId, ColUserId, cRepository), cRepository, CurrentCommunityId, (Data.DraftMessage == null ? 0 : Data.DraftMessage.Id), hasComManager, hasCommunity); if (Data.Errors == Domain.Enums.TicketEditManErrors.none) { View.DraftMsgId = Data.DraftMessage.Id; View.TicketId = Data.TicketId; } //Begin Action List <KeyValuePair <int, String> > Objects = new List <KeyValuePair <int, string> >(); Objects.Add(ModuleTicket.KVPgetPerson(UserContext.CurrentUserID)); Objects.Add(ModuleTicket.KVPgetTicket(View.TicketId)); View.SendUserActions(service.ModuleID, ModuleTicket.ActionType.TicketLoadEditManRes, this.CurrentCommunityId, ModuleTicket.InteractionType.UserWithLearningObject, Objects); //End Action }