private dtoTask CreateDtoTask(Person person, Task item, Boolean allVisibleItems, ModuleTasklist module, CoreModuleRepository repository, ref int lessionID) { dtoTask dtoItem = new dtoTask(); dtoItem.CommunityId = (item.Community == null ? 0 : item.Community.Id); dtoItem.Description = (from d in Manager.Linq <DescriptionEventItem>() where d.Id == item.ID select d.Description).FirstOrDefault(); dtoItem.oTask = item; dtoItem.Permission = GetTaskPermission(person, item, module, repository); dtoItem.FileLinks = GetCoreItemFileLinkPermission(dtoItem.Permission, (from fl in GetTaskFiles(item, false) where (allVisibleItems || (fl.isVisible || (!fl.isVisible && fl.Owner == person))) select fl).ToList(), null, person); dtoItem.Id = item.ID; //dtoItem.LessonNumber = lessionID; // // Posso vedere la voce // iResponse.Permission = new CoreItemPermission(); // //iResponse.Permission.Delete = ModulePermission.Administration || (ModulePermission.DeleteItem && isItemOwner); // iResponse.Permission.AllowViewFiles = module.Administration || module.ViewDiaryItems; // iResponse.Permission.AllowEdit = module.Administration || (module.Edit && isItemOwner); //// iResponse.Permission.UnDelete = ModulePermission.Administration || (ModulePermission.DeleteItem && isItemOwner); // iResponse.Permission.AllowView = module.Administration || module.ViewDiaryItems || (module.Edit && isItemOwner); // TO INSERT FOR VIRTUAL DELETE !! // iResponse.EventItem = item; // iResponse.LessonNumber = lessionID; lessionID += 1; return(dtoItem); //oHeaderTitle, }
private dtoTask CreateDtoTaskForStatistics(Person person, Task item, Boolean allVisibleItems, ModuleTasklist module, CoreModuleRepository repository) { dtoTask dtoItem = new dtoTask(); dtoItem.oTask.Project = item; dtoItem.Permission = GetTaskPermission(person, item, module, repository); dtoItem.FileLinks = GetCoreItemFileLinkPermission(dtoItem.Permission, (from fl in GetTaskFiles(item, false) where (allVisibleItems || (fl.isVisible || (!fl.isVisible && fl.Owner == person))) select fl).ToList(), null, person); dtoItem.Id = item.ID; //dtoItem.LessonNumber = lessionID; //lessionID += 1; return(dtoItem); }