public FollowerController(
     IExtendedProjectService projectService,
     IIndexProvider indexProvider,
     IContentOwnershipHelper contentOwnershipHelper,
     ICRMContentOwnershipService crmContentOwnershipService,
     IExtendedContentManager extendedContentManager,
     ITransactionManager transactionManager,
     IWidgetService widgetService,
     IThemeAwareViewEngine themeAwareViewEngine,
     IShapeFactory shapeFactory,
     IContentManager contentManager,
     IOrchardServices services,
     IDisplayHelperFactory displayHelperFactory,
     IBusinessUnitService businessUnitService,
     ISiteService siteService,
     IBasicDataService basicDataService,
     IContentDefinitionManager contentDefinitionManager,
     IIndexManager indexManager,
     IWorkContextAccessor workContextAccessor,
     IActivityStreamService activityStreamService,
     IContentItemDescriptorManager contentItemDescriptorManager)
     : base(ContentTypes.ProjectContentType, "Followers_Edit", indexProvider, services, crmContentOwnershipService, transactionManager, extendedContentManager, contentManager, widgetService, themeAwareViewEngine, shapeFactory, displayHelperFactory, basicDataService, contentOwnershipHelper, activityStreamService, contentItemDescriptorManager)
 {
     this.T      = NullLocalizer.Instance;
     this.Logger = NullLogger.Instance;
 }
示例#2
0
        public UserController(
            IMasterDetailPermissionManager masterDetailPermissionManager,
            IIndexProvider indexProvider,
            IContentOwnershipHelper contentOwnershipHelper,
            IExtendedProjectService projectService,
            IHelperService helperService,
            IOrchardServices services,
            IActivityStreamService activityStreamService,
            ICRMContentOwnershipService contentOwnershipService,
            IBasicDataService basicDataService,
            IMembershipService membershipService,
            IUserService userService,
            IShapeFactory shapeFactory,
            IEnumerable <IUserEventHandler> userEventHandlers,
            ISiteService siteService)
        {
            this.masterDetailPermissionManager = masterDetailPermissionManager;
            this.indexProvider           = indexProvider;
            this.contentOwnershipHelper  = contentOwnershipHelper;
            this.projectService          = projectService;
            this.activityStreamService   = activityStreamService;
            this.contentOwnershipService = contentOwnershipService;
            this.basicDataService        = basicDataService;
            this.services      = services;
            this.helperService = helperService;
            _membershipService = membershipService;
            _userService       = userService;
            _userEventHandlers = userEventHandlers;
            _siteService       = siteService;

            T     = NullLocalizer.Instance;
            Shape = shapeFactory;
        }
示例#3
0
 public FolderDriver(
     IExtendedProjectService projectService,
     IHelperService helperService,
     IFolderService folderService,
     ICRMContentOwnershipService contentOwnershipService,
     IOrchardServices services) : base(contentOwnershipService, projectService, services, helperService, folderService)
 {
 }
示例#4
0
 public ProjectController(IProjectService projectService, IEmployeeService employeeService, 
     IExtendedProjectService extendedProjectService, IAutocompleteProjectService autocompleteProjectService)
 {
     this.extendedProjectService = extendedProjectService;
     this.employeeService = employeeService;
     this.projectService = projectService;
     this.autocompleteProjectService = autocompleteProjectService;
 }
示例#5
0
 public ProjectController(IProjectService projectService, IEmployeeService employeeService,
                          IExtendedProjectService extendedProjectService, IAutocompleteProjectService autocompleteProjectService)
 {
     this.extendedProjectService     = extendedProjectService;
     this.employeeService            = employeeService;
     this.projectService             = projectService;
     this.autocompleteProjectService = autocompleteProjectService;
 }
示例#6
0
 public ProjectTitleAndMenuDriver(
     IFolderService folderService,
     IOrchardServices services,
     IExtendedProjectService projectService,
     IHelperService helperService,
     ICRMContentOwnershipService contentOwnershipService)
     : base(contentOwnershipService, projectService, services, helperService, folderService)
 {
     this.extendedProjectService = projectService;
 }
 public AttachToMilestoneDriver(
     IMilestoneService milestoneService,
     ICRMContentOwnershipService contentOwnershipService,
     IExtendedProjectService projectService,
     IOrchardServices services,
     IHelperService helperService,
     IFolderService folderService)
     : base(contentOwnershipService, projectService, services, helperService, folderService)
 {
     this.milestoneService = milestoneService;
 }
示例#8
0
 public MilestoneDriver(
     IBasicDataService basicDataService,
     IMilestoneService milestoneService,
     IExtendedProjectService projectService,
     IHelperService helperService,
     IFolderService folderService,
     ICRMContentOwnershipService contentOwnershipService,
     IOrchardServices services)
     : base(contentOwnershipService, projectService, services, helperService, folderService)
 {
     this.basicDataService = basicDataService;
     this.milestoneService = milestoneService;
 }
示例#9
0
 /// <summary>
 /// The base class for FolderDriver and ProjectTitleAndMenuDriver.
 /// </summary>
 public MenuBaseDriver(
     ICRMContentOwnershipService contentOwnershipService,
     IExtendedProjectService projectService,
     IOrchardServices services,
     IHelperService helperService,
     IFolderService folderService)
 {
     this.contentOwnershipService = contentOwnershipService;
     this.projectService          = projectService;
     this.helperService           = helperService;
     this.folderService           = folderService;
     this.services = services;
     this.T        = NullLocalizer.Instance;
 }
示例#10
0
 public ProjectDriver(
     IMenuService menuService,
     IExtendedProjectService projectService,
     IProjectionManagerWithDynamicSort projectionWithDynamicSort,
     IActivityStreamService activityStreamService,
     ICRMContentOwnershipService contentOwnershipService,
     IOrchardServices services)
 {
     this.menuService               = menuService;
     this.contentOwnershipService   = contentOwnershipService;
     this.projectionWithDynamicSort = projectionWithDynamicSort;
     this.services = services;
     this.activityStreamService = activityStreamService;
     this.projectService        = projectService;
 }
 public SuiteCRMSyncService(
     IActivityStreamService streamService,
     IRepository <PriorityRecord> priorityRepository,
     IRepository <StatusRecord> statusRepository,
     ISuiteCRMDataService suiteCRMProjectService,
     IOrchardServices services,
     ISearchTicketService searchTicketService,
     IExtendedProjectService projectService)
 {
     this.streamService          = streamService;
     this.priorityRepository     = priorityRepository;
     this.statusRepository       = statusRepository;
     this.projectService         = projectService;
     this.searchTicketService    = searchTicketService;
     this.suiteCRMProjectService = suiteCRMProjectService;
     this.services = services;
     Logger        = NullLogger.Instance;
 }
示例#12
0
 public SyncController(
     ICRMContentOwnershipService contentOwnershipService,
     ISuiteCRMSyncUserService suiteCRMSyncUserService,
     IExtendedProjectService projectService,
     ISiteService siteService,
     ISuiteCRMDataService suiteCRMDataService,
     IOrchardServices services,
     ISuiteCRMSyncService syncService)
 {
     this.contentOwnershipService = contentOwnershipService;
     this.suiteCRMSyncUserService = suiteCRMSyncUserService;
     this.projectService          = projectService;
     this.siteService             = siteService;
     this.syncService             = syncService;
     this.services            = services;
     this.suiteCRMDataService = suiteCRMDataService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
示例#13
0
        public ProjectSetup(
            IExtendedProjectService projectService,
            IOrchardServices services,
            IRepository <SortCriterionRecord> sortRepository,
            IRepository <EmailTemplateRecord> emailTemplatesRepository,
            IRepository <WorkflowDefinitionRecord> workflowDefinitionRepository,
            IRepository <ActivityRecord> activityRepository,
            IRepository <TransitionRecord> transitionRepository,
            IContentManager contentManager,
            IRepository <FilterRecord> filterRepository,
            IRepository <LayoutRecord> layoutRepository,
            IRepository <FilterGroupRecord> filterGroupRepository,
            IRepository <ReportRecord> reportRepository,
            IBasicDataService basicDataService)
        {
            this.projectService = projectService;
            this.services       = services;

            this.projectCommand = new ProjectCommand(sortRepository, emailTemplatesRepository, workflowDefinitionRepository, activityRepository, transitionRepository, reportRepository, layoutRepository, contentManager, filterRepository, filterGroupRepository, basicDataService);
            this.portletCommand = new PortletCommand(services, reportRepository, layoutRepository);
        }
 public ProjectDashboardEditorDriver(IOrchardServices services, IExtendedProjectService projectService)
 {
     this.projectService = projectService;
     this.services       = services;
 }
示例#15
0
        public ProjectHandler(
            ISearchTicketService searchTicketService,
            IContentManager contentManager,
            IMenuService menuService,
            IRepository <ProjectPartRecord> repository,
            IRepository <AttachToProjectPartRecord> attachToProjectRepository,
            IExtendedProjectService projectService)
        {
            OnCreated <ProjectPart>((context, projectPart) =>
            {
                projectService.CreateProjectDependencies(projectPart);
            });

            OnRemoved <ProjectPart>((context, projectPart) =>
            {
                // Delete menu and menu widget
                var menu = menuService.GetMenu(projectPart.MenuId);
                if (menu != null)
                {
                    contentManager.Remove(menu.ContentItem);

                    var projectMenuWidget = projectService.GetProjectMenuWidget(projectPart.Id);
                    if (projectMenuWidget != null)
                    {
                        contentManager.Remove(projectMenuWidget);
                    }
                }

                // update all tickets who are attached to the project
                var attachToProjects = contentManager.HqlQuery <AttachToProjectPart>().Where(c => c.ContentPartRecord <AttachToProjectPartRecord>(), c => c.Eq("Project.Id", projectPart.Record.Id)).List();
                foreach (var attachToProject in attachToProjects)
                {
                    contentManager.Remove(attachToProject.ContentItem);
                }
            });

            OnLoaded <ProjectPart>((context, projectPart) =>
            {
                if (projectPart.RelatedItemsHaveBeenInitialized == false)
                {
                    projectService.CreateMilestoneAndBacklogForProject(projectPart);
                    projectPart.RelatedItemsHaveBeenInitialized = true;
                }

                // if the project doesn't have a menu, create a new one for it.
                if (projectPart.MenuId == default(int))
                {
                    projectService.CreateProjectMenu(projectPart);
                }
            });

            OnPublished <ProjectPart>((context, projectPart) =>
            {
                ProjectDashboardEditorPart dashboardPart = projectPart.As <ProjectDashboardEditorPart>();
                int[] portletIds          = dashboardPart.PortletList ?? new int[] { };
                ContentItem projectDetail = contentManager
                                            .Query()
                                            .ForType(ContentTypes.ProjectDetailContentType)
                                            .Where <AttachToProjectPartRecord>(c => c.Project.Id == projectPart.Id)
                                            .Slice(1)
                                            .FirstOrDefault();

                if (projectDetail == null)
                {
                    return;
                }

                // portlets
                var currentPortlets = contentManager.Query().Where <CommonPartRecord>(c => c.Container.Id == projectDetail.Id).List();

                var portletTemplates = contentManager.GetMany <ContentItem>(portletIds, VersionOptions.Published, new QueryHints());

                // add new portlets
                int position = -1;
                foreach (var portletId in portletIds)
                {
                    position++;
                    var currentPortlet = currentPortlets.FirstOrDefault(c => c.As <InfosetPart>().Retrieve <int>(FieldNames.ProjectDashboardPortletTemplateId) == portletId);
                    if (currentPortlet != null)
                    {
                        ContainablePart containablePart = currentPortlet.As <ContainablePart>();
                        containablePart.Position        = position;
                        continue;
                    }

                    var portletTemplate = portletTemplates.FirstOrDefault(c => c.Id == portletId);

                    if (portletTemplate == null)
                    {
                        continue;
                    }

                    projectService.AddPortlet(projectDetail, portletTemplate, position);
                }

                // delete existing portlets that are not exist in the portletIds
                foreach (var portlet in currentPortlets)
                {
                    var templateId = portlet.As <InfosetPart>().Retrieve <int>(FieldNames.ProjectDashboardPortletTemplateId);

                    if (!portletIds.Contains(templateId))
                    {
                        contentManager.Remove(portlet);
                    }
                }
            });
        }