private String GenerateItemUrl(PageListType currentPageType, PageListType fromPage, dtoItemsFilter filter, dtoProjectContext context, Int32 idContainerCommunity, ItemsGroupBy groupBy, ItemListStatus status, UserActivityStatus activitiesStatus = UserActivityStatus.Ignore) { switch (currentPageType) { case PageListType.ListAdministrator: return(RootObject.ProjectListAdministrator(context.IdCommunity, context.isForPortal, context.isPersonal, false, 0, groupBy, filter.FilterBy, status, filter.TimeLine, filter.Display)); case PageListType.ListManager: return(RootObject.ProjectListManager(context.IdCommunity, context.isForPortal, context.isPersonal, false, 0, groupBy, filter.FilterBy, status, filter.TimeLine, filter.Display)); case PageListType.ListResource: return(RootObject.ProjectListResource(context.IdCommunity, context.isForPortal, context.isPersonal, false, 0, groupBy, filter.FilterBy, status, filter.TimeLine, filter.Display)); case PageListType.DashboardManager: case PageListType.DashboardResource: case PageListType.DashboardAdministrator: return(RootObject.Dashboard(context, idContainerCommunity, View.PageContainer, fromPage, currentPageType, filter.TimeLine, filter.Display, filter.FilterBy, groupBy, status, activitiesStatus, View.CurrentActivityTimeLine)); case PageListType.ProjectDashboardResource: case PageListType.ProjectDashboardManager: return(RootObject.ProjectDashboard(context, idContainerCommunity, filter.IdProject, fromPage, currentPageType, groupBy, status, filter.TimeLine, activitiesStatus, View.CurrentActivityTimeLine)); default: return(""); } }
public String GetDashboardUrl(PageListType pageType) { //switch (pageType) { //} return(""); }
private void SetBackUrls(PageListType fromPage, Int32 idContainerCommunity, dtoProject project, dtoProjectContext cContext) { switch (fromPage) { case PageListType.ListAdministrator: case PageListType.ListManager: case PageListType.ListResource: View.SetProjectsUrl(Service.GetBackUrl(fromPage, idContainerCommunity, (project == null) ? 0: project.Id)); break; case PageListType.DashboardManager: case PageListType.DashboardResource: case PageListType.DashboardAdministrator: if (project != null) { View.SetDashboardUrl(RootObject.DashboardFromCookies(cContext, idContainerCommunity, fromPage, project.Id), fromPage); } break; case PageListType.ProjectDashboardManager: case PageListType.ProjectDashboardResource: if (project != null) { View.SetDashboardUrl(RootObject.ProjectDashboardFromCookies(cContext, idContainerCommunity, fromPage, project.Id), fromPage); } break; } if (project != null) { View.SetProjectMapUrl(RootObject.ProjectMap(project.Id, project.IdCommunity, project.isPortal, project.isPersonal, fromPage, idContainerCommunity)); } }
public Boolean VirtualUndeleteProject(long idProject, dtoItemsFilter filter, PageListType currentPage, Int32 idCommunity, Int32 pageIndex, Int32 pageSize, ref long deleted) { Boolean result = false; if (UserContext.isAnonymous) { View.DisplayPager(false); View.LoadedNoProjects(currentPage); } else { result = Service.SetProjectVirtualDelete(idProject, false); if (result) { View.SendUserAction(View.IdCurrentCommunityForList, CurrentIdModule, idProject, ModuleProjectManagement.ActionType.ProjectVirtualUndelete); } List <dtoPlainProject> projects = Service.GetProjects(UserContext.CurrentUserID, filter, currentPage, idCommunity, View.RoleTranslations); deleted = projects.Count; if (deleted > 0) { LoadProjects(Service.GetProjects(UserContext.CurrentUserID, filter, currentPage, idCommunity, View.RoleTranslations), currentPage, filter.TimeLine, pageIndex, pageSize); } } return(result); }
public void InitView() { long idProject = View.PreloadIdProject; dtoProjectContext cContext = new dtoProjectContext() { IdCommunity = View.PreloadIdCommunity, isPersonal = View.PreloadIsPersonal, isForPortal = View.PreloadForPortal }; dtoProject project = InitializeContext(idProject, ref cContext); if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else { if (project == null) { View.DisplayUnknownProject(); View.SendUserAction(UserContext.CurrentCommunityID, CurrentIdModule, idProject, ModuleProjectManagement.ActionType.ProjectUnknown); } else { Person p = CurrentManager.GetPerson(UserContext.CurrentUserID); ModuleProjectManagement mPermission = (project.isPortal) ? ModuleProjectManagement.CreatePortalmodule((p == null) ? (Int32)UserTypeStandard.Guest : p.TypeID) : new ModuleProjectManagement(CurrentManager.GetModulePermission(UserContext.CurrentUserID, cContext.IdCommunity, CurrentIdModule)); PmActivityPermission pPermissions = Service.GetProjectPermission(idProject, UserContext.CurrentUserID); SetBackUrls(View.PreloadFromPage, View.PreloadIdContainerCommunity, project, cContext); if ((mPermission.Administration && !project.isPersonal) || (pPermissions.HasFlag(PmActivityPermission.ViewProjectMap))) { PageListType fromPage = View.PreloadFromPage; View.LoadProjectDateInfo(project, (fromPage != PageListType.ProjectDashboardResource && fromPage != PageListType.DashboardResource && fromPage != PageListType.ListResource) && ((mPermission.Administration && !project.isPersonal) || (pPermissions.HasFlag(PmActivityPermission.ManageProject)))); List <dtoMapActivity> activities = Service.GetActivities(mPermission, pPermissions, project); if (activities == null) { View.DisplayNoActivities(); View.SendUserAction(View.ProjectIdCommunity, CurrentIdModule, idProject, ModuleProjectManagement.ActionType.ProjectMapErrorFromDb); } else { View.SendUserAction(View.ProjectIdCommunity, CurrentIdModule, idProject, ModuleProjectManagement.ActionType.ProjectMapView); View.LoadActivities(activities); } if ((mPermission.Administration && !project.isPersonal) || (pPermissions.HasFlag(PmActivityPermission.ManageProject))) { View.SetEditProjectUrl(RootObject.EditProject(project.Id, project.IdCommunity, project.isPortal, project.isPersonal, View.PreloadFromPage, View.IdContainerCommunity)); View.SetEditMapUrl(RootObject.ProjectMap(project.Id, project.IdCommunity, project.isPortal, project.isPersonal, View.PreloadFromPage, View.IdContainerCommunity)); } View.LoadAttachments(Service.GetProjectAttachments(idProject, 0, false, View.UnknownUser, true)); } else { View.DisplayNoPermission(project.IdCommunity, currentIdModule); } } } }
public ActivityRole GetMajorRole(PageListType view) { if (Roles == null || !Roles.Any()) { return(ActivityRole.None); } else { return(Roles.Where(r => (view == PageListType.ListResource && r.ProjectRole > ActivityRole.Manager) || view != PageListType.ListResource).Select(r => r.ProjectRole).OrderBy(r => r).FirstOrDefault()); } }
public void LoadProjects(dtoItemsFilter filter, ItemsGroupBy groupBy, PageListType currentPage, Int32 idCommunity, Int32 pageIndex, Int32 pageSize) { if (UserContext.isAnonymous) { View.DisplayPager(false); View.LoadedNoProjects(currentPage); } else { LoadProjects(Service.GetProjects(UserContext.CurrentUserID, filter, currentPage, idCommunity, View.RoleTranslations), groupBy, currentPage, filter.TimeLine, pageIndex, pageSize); } }
public void LoadAttachments(long idProject, PageListType currentPage) { if (UserContext.isAnonymous) { View.DisplayPager(false); View.LoadedNoProjects(currentPage); } else { View.LoadAttachments(Service.GetProjectAttachments(idProject, 0, false, View.UnknownUserTranslation, true)); } }
public dtoDisplayTimelineContext(dtoProjectContext context, Int32 idContainerCommunity, PageContainerType container, PageListType currentPage, PageListType fromPage, SummaryTimeLine timeline, SummaryDisplay display, ProjectFilterBy filterBy = ProjectFilterBy.All, ItemsGroupBy groupBy = ItemsGroupBy.None, ItemListStatus status = ItemListStatus.All) { FromPage = fromPage; ProjectContext = context; FromPage = fromPage; CurrentPage = currentPage; IdContainerCommunity = idContainerCommunity; Display = display; FilterBy = filterBy; ContainerTimeline = timeline; Container = container; GroupBy = groupBy; Status = status; }
public void LoadProjects(List <dtoPlainProject> projects, PageListType currentPage, SummaryTimeLine currentTimeline, Int32 pageIndex, Int32 pageSize) { Int32 idContainerCommunity = View.IdCurrentCommunityForList; PagerBase pager = new PagerBase(); pager.PageSize = pageSize; //Me.View.CurrentPageSize pager.Count = (projects.Count > 0) ? projects.Count - 1 : 0; pager.PageIndex = pageIndex; // Me.View.CurrentPageIndex View.Pager = pager; projects = projects.Skip(pageIndex * pageSize).Take(pageSize).ToList(); if (projects.Any()) { foreach (dtoPlainProject p in projects) { p.Urls.Edit = RootObject.EditProject(p.Id, p.IdCommunity, p.isPortal, p.isPersonal, currentPage, idContainerCommunity); p.Urls.EditResources = RootObject.ProjectResources(p.Id, p.IdCommunity, p.isPortal, p.isPersonal, currentPage, idContainerCommunity); p.Urls.PhisicalDelete = RootObject.PhisicalDeleteProject(p.Id, p.IdCommunity, p.isPortal, p.isPersonal, currentPage, idContainerCommunity); switch (currentPage) { case PageListType.ListResource: p.Urls.ProjectUrl = RootObject.ProjectDashboard(p.IdCommunity, p.isPortal, p.isPersonal, idContainerCommunity, p.Id, currentPage, PageListType.ProjectDashboardResource, currentTimeline, GetDefaultUserActivityStatus(p), currentTimeline); break; case PageListType.ListManager: p.Urls.ProjectUrl = RootObject.ProjectDashboard(p.IdCommunity, p.isPortal, p.isPersonal, idContainerCommunity, p.Id, currentPage, PageListType.DashboardManager, currentTimeline, GetDefaultUserActivityStatus(p), currentTimeline); break; case PageListType.ListAdministrator: p.Urls.ProjectUrl = RootObject.ProjectDashboard(p.IdCommunity, p.isPortal, p.isPersonal, idContainerCommunity, p.Id, currentPage, PageListType.DashboardAdministrator, currentTimeline, GetDefaultUserActivityStatus(p), currentTimeline); break; } if (p.Permissions.EditMap) { p.Urls.ProjectMap = RootObject.ProjectMap(p.Id, p.IdCommunity, p.isPortal, p.isPersonal, currentPage, idContainerCommunity); } else if (p.Permissions.ViewMap) { p.Urls.ProjectMap = RootObject.ViewProjectMap(p.Id, p.IdCommunity, p.isPortal, p.isPersonal, currentPage, idContainerCommunity); } } View.LoadProjects(projects, currentPage); } else { View.LoadedNoProjects(currentPage); } View.SendUserAction(View.IdCurrentCommunityForList, CurrentIdModule, GetDefaultAction(currentPage)); }
private ModuleProjectManagement.ActionType GetDefaultAction(PageListType currentPage) { switch (currentPage) { case PageListType.ListResource: return(ModuleProjectManagement.ActionType.LoadProjectsPlainAsResource); case PageListType.ListManager: return(ModuleProjectManagement.ActionType.LoadProjectsPlainAsManager); case PageListType.ListAdministrator: return(ModuleProjectManagement.ActionType.LoadProjectsPlainAsAdministrator); default: return(ModuleProjectManagement.ActionType.LoadProjectsPlain); } }
public void UpdatePermissions(PmActivityPermission pPermissions, PageListType view) { if (view == PageListType.ListAdministrator || view == PageListType.ListManager) { Permissions.Edit = Deleted == BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.ManageProject) == PmActivityPermission.ManageProject); Permissions.EditMap = Deleted == BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.ManageProject) == PmActivityPermission.ManageProject); Permissions.EditResources = Deleted == BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.ManageResources) == PmActivityPermission.ManageResources); Permissions.PhisicalDelete = (Deleted != BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.PhisicalDelete) == PmActivityPermission.PhisicalDelete)); Permissions.VirtualDelete = (Deleted == BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.VirtualDelete) == PmActivityPermission.VirtualDelete)); Permissions.VirtualUndelete = (Deleted != BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.VirtualUnDelete) == PmActivityPermission.VirtualUnDelete)); Permissions.ViewAttachments = ((pPermissions & PmActivityPermission.DownloadAttacchments) == PmActivityPermission.DownloadAttacchments) || ((pPermissions & PmActivityPermission.ManageAttachments) == PmActivityPermission.ManageAttachments); Permissions.EditAttachments = (Deleted != BaseStatusDeleted.None && ((pPermissions & PmActivityPermission.ManageAttachments) == PmActivityPermission.ManageAttachments)); } Permissions.ViewMap = ((pPermissions & PmActivityPermission.ViewProjectMap) == PmActivityPermission.ViewProjectMap); Permissions.ViewMyCompletion = (GetMajorRole(view) == ActivityRole.Resource); }
public dtoDisplayTimelineSummary(dtoTimelineSummary item, dtoDisplayTimelineContext context) { DisplayAs = item.DisplayAs; ToPage = item.DashboardPage; Activities = item.Activities.Where(a => a.TimeLine == SummaryTimeLine.Today || a.TimeLine == context.ContainerTimeline).Select(a => new dtoDisplayTimelineActivity(a, GenerateUrl(a, context)) { ToPage = GetDashboardPageByContainer(context.Container, item.DashboardPage) }).ToList(); if (Activities.Count == 1) { Activities[0].DisplayAs = lm.Comol.Core.DomainModel.ItemDisplayOrder.first | lm.Comol.Core.DomainModel.ItemDisplayOrder.last; } else if (Activities.Any()) { Activities.First().DisplayAs = lm.Comol.Core.DomainModel.ItemDisplayOrder.first; Activities.Last().DisplayAs = lm.Comol.Core.DomainModel.ItemDisplayOrder.last; } }
public void InitView(dtoProjectContext context, dtoItemsFilter filter, PageListType currentPage) { Person p = CurrentManager.GetPerson(UserContext.CurrentUserID); View.CurrentPageType = currentPage; if (UserContext.isAnonymous || p == null) { View.DisplayPager(false); View.LoadedNoProjects(currentPage); } else { if (!View.IsInitialized && filter.GroupBy == ItemsGroupBy.EndDate) { filter.PageIndex = -1; } View.IsInitialized = true; View.IdCurrentCommunityForList = context.IdCommunity; if (filter.PageSize == 0) { filter.PageSize = View.CurrentPageSize; } switch (filter.GroupBy) { case ItemsGroupBy.Community: View.CurrentOrderBy = ProjectOrderBy.CommunityName; View.CurrentAscending = true; filter.OrderBy = ProjectOrderBy.CommunityName; filter.Ascending = true; break; case ItemsGroupBy.EndDate: View.CurrentOrderBy = ProjectOrderBy.EndDate; View.CurrentAscending = false; filter.OrderBy = ProjectOrderBy.EndDate; filter.Ascending = false; break; } View.CurrentGroupBy = filter.GroupBy; //View.CurrentAscending = filter.Ascending; LoadProjects(filter, filter.GroupBy, currentPage, context.IdCommunity, filter.PageIndex, filter.PageSize); } }
public dtoDisplayTimelineContext(dtoProjectContext context, Int32 idContainerCommunity, PageContainerType container, PageListType currentPage, PageListType fromPage, dtoItemsFilter filters, ItemsGroupBy groupBy = ItemsGroupBy.None) { FromPage = fromPage; ProjectContext = context; FromPage = fromPage; CurrentPage = currentPage; IdContainerCommunity = idContainerCommunity; Display = filters.Display; FilterBy = filters.FilterBy; ContainerTimeline = filters.TimeLine; Container = container; IdProject = filters.IdProject; if (groupBy != ItemsGroupBy.None) { GroupBy = groupBy; } else { GroupBy = filters.GroupBy; } }
private void SetBackUrls(PageListType fromPage, Int32 idContainerCommunity, dtoProject project, dtoProjectContext cContext) { switch (fromPage) { case PageListType.ListAdministrator: case PageListType.ListManager: case PageListType.ListResource: View.SetProjectsUrl(Service.GetBackUrl(fromPage, idContainerCommunity, project.Id)); break; case PageListType.DashboardManager: case PageListType.DashboardResource: case PageListType.DashboardAdministrator: View.SetDashboardUrl(RootObject.DashboardFromCookies(cContext, idContainerCommunity, fromPage, project.Id), fromPage); break; case PageListType.ProjectDashboardManager: case PageListType.ProjectDashboardResource: View.SetDashboardUrl(RootObject.ProjectDashboardFromCookies(cContext, idContainerCommunity, fromPage, project.Id), fromPage); break; } }
public void InitView(dtoProjectContext context, dtoItemsFilter filter, PageListType currentPage) { Person p = CurrentManager.GetPerson(UserContext.CurrentUserID); View.CurrentPageType = currentPage; if (UserContext.isAnonymous || p == null) { View.DisplayPager(false); View.LoadedNoProjects(currentPage); } else { View.IsInitialized = true; View.IdCurrentCommunityForList = context.IdCommunity; if (filter.PageSize == 0) { filter.PageSize = View.CurrentPageSize; } View.CurrentOrderBy = filter.OrderBy; View.CurrentAscending = filter.Ascending; LoadProjects(filter, currentPage, context.IdCommunity, filter.PageIndex, filter.PageSize); } }
private void SendDefaultAction(PageListType currentPage, long idProject, Int32 idCommunity) { ModuleProjectManagement.ActionType action = ModuleProjectManagement.ActionType.LoadTasks; switch (currentPage) { case PageListType.ProjectDashboardManager: action = ModuleProjectManagement.ActionType.LoadProjectTasksPlainAsManager; break; case PageListType.ProjectDashboardResource: action = ModuleProjectManagement.ActionType.LoadProjectTasksPlainAsResource; break; case PageListType.DashboardAdministrator: action = ModuleProjectManagement.ActionType.LoadTasksPlainAsAdministrator; break; case PageListType.DashboardManager: action = ModuleProjectManagement.ActionType.LoadTasksPlainAsManager; break; case PageListType.DashboardResource: action = ModuleProjectManagement.ActionType.LoadTasksPlainAsResource; break; } switch (currentPage) { case PageListType.ProjectDashboardManager: case PageListType.ProjectDashboardResource: View.SendUserAction(idCommunity, CurrentIdModule, idProject, action); break; default: View.SendUserAction(View.IdContainerCommunity, CurrentIdModule, action); break; } }
public static String MapBulk(long idProject, int idCommunity, Boolean forPortal, Boolean isPersonal, PageListType view, Int32 idContainerCommunity) { return(MapBulk(idProject, idCommunity, view, idContainerCommunity) + "&isPortal=" + forPortal.ToString() + "&isPersonal=" + isPersonal.ToString()); }
/// <summary> /// url di accesso all'editing del progetti /// </summary> /// <param name="idProject"></param> /// <param name="idCommunity"></param> /// <param name="forPortal"></param> /// <param name="isPersonal"></param> /// <param name="added">indica se il progetto è appena stato creato</param> /// <param name="rActions">numero di attività da creare</param> /// <param name="aActions">numero di attività aggiunte</param> /// <returns></returns> public static String EditProject(long idProject, int idCommunity, Boolean forPortal, Boolean isPersonal, Boolean added, long rActions, long aActions, PageListType view, Int32 idContainerCommunity) { return(EditProject(idProject, idCommunity, forPortal, isPersonal, view, idContainerCommunity) + "&cId=" + idCommunity.ToString() + "&added=" + added.ToString() + (rActions > 0 ? "&rActions=" + rActions.ToString() + "&aActions=" + aActions.ToString() : "")); }
public static String MapBulk(long idProject, int idCommunity, PageListType view, Int32 idContainerCommunity) { return(modulehome + "MapBulk.aspx?pId=" + idProject.ToString() + "&cId=" + idCommunity.ToString() + GetPageParameters(view, idContainerCommunity)); }
public static String PhisicalDeleteProject(long idProject, int idCommunity, Boolean forPortal, Boolean isPersonal, PageListType view, Int32 idContainerCommunity) { return(modulehome + "Delete.aspx?pId=" + idProject.ToString() + "&cId=" + idCommunity.ToString() + "&isPortal=" + forPortal.ToString() + "&isPersonal=" + isPersonal.ToString() + GetPageParameters(view, idContainerCommunity)); }
private static String GetPageParameters(PageListType pageType, Int32 idContainerCommunity) { return(((pageType == PageListType.None || pageType == PageListType.Ignore) ? "" : "&fromView=" + pageType.ToString()) + "&idCC=" + idContainerCommunity.ToString()); }
public static String ProjectDashboard(dtoProjectContext context, Int32 idContainerCommunity, long idProject, PageListType fromPageType, PageListType toPage, SummaryTimeLine timeline, UserActivityStatus actStatus = UserActivityStatus.Expired, SummaryTimeLine actTimeline = SummaryTimeLine.Week) { return(GetDashboardPage(context, idProject, toPage) + GetPageParameters(fromPageType, idContainerCommunity) + "&tml=" + timeline.ToString() + GetDashboardActivityParametes(actStatus, actTimeline)); }
public static String ProjectDashboard(dtoProjectContext context, Int32 idContainerCommunity, long idProject, PageListType fromPageType, PageListType toPage, ItemsGroupBy groupBy, ItemListStatus filterStatus, SummaryTimeLine timeline, UserActivityStatus actStatus = UserActivityStatus.Expired, SummaryTimeLine actTimeline = SummaryTimeLine.Week) { return(GetDashboardPage(context, idProject, toPage) + GetPageParameters(fromPageType, idContainerCommunity) + GetFilterParameters(groupBy, ProjectFilterBy.All, filterStatus, timeline, SummaryDisplay.Project) + GetDashboardActivityParametes(actStatus, actTimeline)); }
public static String ProjectDashboard(Int32 idCommunity, Boolean isPortal, Boolean isPersonal, Int32 idContainerCommunity, long idProject, PageListType fromPageType, PageListType toPage, SummaryTimeLine timeline, UserActivityStatus actStatus = UserActivityStatus.Expired, SummaryTimeLine actTimeline = SummaryTimeLine.Week) { return(ProjectDashboard(new dtoProjectContext() { IdCommunity = idCommunity, isForPortal = isPortal, isPersonal = isPersonal }, idContainerCommunity, idProject, fromPageType, toPage, timeline, actStatus, actTimeline)); }
public static String ProjectDashboardFromCookies(dtoProjectContext context, Int32 idContainerCommunity, PageListType toPage, long idProject) { string page = GetDashboardPlainPage(idProject, toPage); return(page + "?fromCookies=true" + GetPageParameters(PageListType.None, idContainerCommunity)); }
private static String GetDashboardPage(dtoProjectContext context, long idProject, PageListType toPage) { String url = GetDashboardPlainPage(idProject, toPage) + GetStartContextParameters(context); if (idProject > 0) { url = url + "&pId=" + idProject.ToString(); // +"&v=" + toPage.ToString(); } return(url); }
public static String GetDashboardPlainPage(long idProject, PageListType toPage) { return(modulehome + ((idProject == 0) ? (toPage == PageListType.DashboardResource? "ResourceDashboard.aspx" : "ManagerDashboard.aspx") : (toPage == PageListType.ProjectDashboardResource? "ProjectResourceDashboard.aspx" : "ProjectDashboard.aspx"))); }
public static String GetDashboardPlainPage(PageListType toPage) { return(GetDashboardPlainPage(0, toPage)); }