示例#1
0
        public static List <ProjectCommonModule> GetModules(Project project)
        {
            var modules = new List <ProjectCommonModule>
            {
                new MilestonesModule(project),
                new TasksModule(project),
                new ProjectTeamModule(project)
            };

            if (ProjectSecurity.CanReadFiles(project))
            {
                modules.Add(new DocumentsModule(project));
            }

            if (ProjectSecurity.CanReadMessages(project))
            {
                modules.Add(new MessagesModule(project));
            }

            if (ProjectSecurity.CanCreateTimeSpend(project))
            {
                modules.Add(new TimeTrackingModule(project));
            }


            var crmEnabled = WebItemManager.Instance[new Guid("6743007C-6F95-4d20-8C88-A8601CE5E76D")];

            if (crmEnabled != null && !crmEnabled.IsDisabled() && ProjectSecurity.CanReadContacts(project))
            {
                modules.Add(new ContactsModule(project));
            }

            return(modules.OrderBy(r => r.Context.DefaultSortOrder).ToList());
        }
示例#2
0
        public ProjectSecurityInfo(Project project)
        {
            CanCreateMilestone = ProjectSecurity.CanCreateMilestone(project);
            CanCreateMessage   = ProjectSecurity.CanCreateMessage(project);
            CanCreateTask      = ProjectSecurity.CanCreateTask(project);
            CanCreateTimeSpend = ProjectSecurity.CanCreateTimeSpend(project);

            CanEditTeam       = ProjectSecurity.CanEditTeam(project);
            CanReadFiles      = ProjectSecurity.CanReadFiles(project);
            CanReadMilestones = ProjectSecurity.CanReadMilestones(project);
            CanReadMessages   = ProjectSecurity.CanReadMessages(project);
            CanReadTasks      = ProjectSecurity.CanReadTasks(project);
            IsInTeam          = ProjectSecurity.IsInTeam(project, SecurityContext.CurrentAccount.ID, false);
            CanLinkContact    = ProjectSecurity.CanLinkContact(project);
            CanReadContacts   = ProjectSecurity.CanReadContacts(project);
        }
示例#3
0
        protected override void PageLoad()
        {
            if (!ProjectSecurity.CanReadContacts(Project))
            {
                Response.Redirect("projects.aspx?prjID=" + Project.ID, true);
            }

            var crmEnabled = WebItemManager.Instance[new Guid("6743007C-6F95-4d20-8C88-A8601CE5E76D")];

            if (crmEnabled == null || crmEnabled.IsDisabled())
            {
                Response.Redirect(String.Concat(PathProvider.BaseAbsolutePath, "tasks.aspx?prjID=" + RequestContext.GetCurrentProjectId()));
            }

            CanLinkContact = ProjectSecurity.CanLinkContact(Project);

            var button = "";

            if (CanLinkContact)
            {
                button = "<a class='link-with-entity baseLinkAction'>" + ProjectsCommonResource.EmptyScreenContactsButton + "</a>";
            }

            var escNoContacts = new Studio.Controls.Common.EmptyScreenControl
            {
                Header     = ProjectsCommonResource.EmptyScreenContasctsHeader,
                ImgSrc     = WebImageSupplier.GetAbsoluteWebPath("empty_screen_persons.png", ProductEntryPoint.ID),
                Describe   = ProjectsCommonResource.EmptyScreenContactsDescribe,
                ID         = "escNoContacts",
                ButtonHTML = button,
                CssClass   = "display-none"
            };

            emptyScreen.Controls.Add(escNoContacts);

            Page.Title = HeaderStringHelper.GetPageTitle(ProjectsCommonResource.ModuleContacts);

            Master.RegisterCRMResources();
            Page.RegisterBodyScripts(PathProvider.GetFileStaticRelativePath("contacts.js"));
        }