def get_project_create_form(self, request, projectid, iscreate): result = "" if projectid: dm_project = Project.objects.get(projectid) else: dm_project = Project() page = VM_Project(request.user, iscreate, dm_project, projectid) context_instance = RequestContext(request) user_common_page_worker = UserCommonControllPageWorker(request) project_common_page_worker = ProjectCommonControllPageWorker(request) project_lead_controll = user_common_page_worker.get_user_dropdown_list( dm_project.PBLead) platform_control = project_common_page_worker.get_platform_dropdown_list( projectid) product_controll = project_common_page_worker.get_product_dropdown_list( request.user.id, dm_project.Product) pagefileds = { 'page': page, 'context_instance': context_instance, "project_lead_controll": project_lead_controll, "platform_control": platform_control, "product_controll": product_controll } result = self.get_webpart(pagefileds, ProjectSettingsPath.project_create_form_path) return result
def get_module_list(request, project_id): result = "" project = Project.objects.get(int(project_id)) if project: page_worker = ProjectCommonControllPageWorker(request) result = page_worker.get_module_dropdown_list(project.id, 0) print(result) return HttpResponse(result)
def get_member_list(request, project_id): result = "" project = Project.objects.get(int(project_id)) if project: page_worker = ProjectCommonControllPageWorker(request) member_users = MemberService.get_member_users(project_id) result = page_worker.get_member_dropdownlist(member_users, project.id) return HttpResponse(result)
def get_version_list(request, project_id): result = "" default_none = request.POST.get("default_none") if str(default_none) == "0": default_none = True else: default_none = False project = Project.objects.get(int(project_id)) if project: page_worker = ProjectCommonControllPageWorker(request) result = page_worker.get_version_dropdown_list(project.id, 0, default_none) return HttpResponse(result)
def get_fortesting_form_controll(self, request, projectid, vm_fortesting): project_dorpdownlist = ProjectCommonControllPageWorker.get_myproject_dropdown_list( self, request, projectid) module_dorpdownlist = ProjectCommonControllPageWorker.get_module_dropdown_list( self, projectid, vm_fortesting.fortesting.ProjectModuleID) version_dorpdownlist = ProjectCommonControllPageWorker.get_version_dropdown_list( self, projectid) pagefileds = { 'fortesting': vm_fortesting, "module_dorpdownlist": module_dorpdownlist, "project_dorpdownlist": project_dorpdownlist } pagefileds['version_dorpdownlist'] = version_dorpdownlist return self.get_webpart( pagefileds, ProjectFortestingPath.fortesting_create_form_path)
def get_ci_task_config_basic(self, request, task_id): dm_ci_task = CITask.objects.get(task_id) vm_ci_task = VM_CITask(dm_ci_task, None, False, True) common_page_worker = CICommonControllPageWorker(request) deploy_services = common_page_worker.get_deploy_service_dropdown_list( dm_ci_task.DeployService) my_projects = ProjectCommonControllPageWorker.get_myproject_dropdown_list( self, request, dm_ci_task.Project) ci_agent_list = CICommonControllPageWorker.get_agent_asgin_dropdown_list( self, vm_ci_task.task_config.get_basic_section().get_asgin_agent()) ci_agent_filter_condations = CICommonControllPageWorker.get_agent_filter_dropdown_list( self, vm_ci_task.task_config.get_basic_section(). get_agent_filter_condations()) case_tag_list = CICommonControllPageWorker.get_casetag_dropdown_list( self, vm_ci_task.task_config.get_basic_section().get_case_filters()) pagefileds = { "ci_task_project": my_projects, "task": vm_ci_task, "ci_deploy_services": deploy_services } pagefileds["ci_agent_filter_condations"] = ci_agent_filter_condations pagefileds['basic_section'] = vm_ci_task.task_config.get_basic_section( ) pagefileds['ci_agent_list'] = ci_agent_list pagefileds['case_tag_list'] = case_tag_list return self.get_webpart(pagefileds, CITaskPath.task_config_basic)
def get_issue_operation_dialog(self, request, issue_id, operation_type): solution_dorpdownlist = ProjectCommonControllPageWorker.get_issue_field_dropdown_list( self, models.ProjectIssueResolvedResult, 0) pagefileds = { "solution_dorpdownlist": solution_dorpdownlist, 'issue_id': issue_id, "operation_type": operation_type } return self.get_webpart(pagefileds, ProjectIssuePath.issue_operation_dialog)
def get_project_member_add_dialog(self, request, projectid): project_common_page_worker = ProjectCommonControllPageWorker(request) project_list_controll = project_common_page_worker.get_myproject_dropdown_list( request, 0) member_users = MemberService.get_member_users(projectid) member_user_ids = [user.id for user in member_users] not_member_users = UserService.all_users().exclude( id__in=member_user_ids) source_user_list = project_common_page_worker.get_user_listbox( not_member_users, projectid) member_user_list = project_common_page_worker.get_user_listbox( member_users, projectid) pagefileds = { "project_list_controll": project_list_controll, "source_user_list": source_user_list, 'member_user_list': member_user_list } return self.get_webpart(pagefileds, ProjectSettingsPath.project_member_add_dialog)
def ci_service_config_webpart(self, request, service_id): service = CIDeployService.objects.get(int(service_id)) vm_service = VM_CIDeployService(service, 0) ci_service_project = ProjectCommonControllPageWorker.get_myproject_dropdown_list( self, request, service.Project) pagefileds = { "service": vm_service, "ci_service_project": ci_service_project } return self.get_webpart(pagefileds, CIServicePath.service_config_page)
def get_task_create_form(self, request): my_projects = ProjectCommonControllPageWorker.get_myproject_dropdown_list( self, request, 0) common_page_worker = CICommonControllPageWorker(request) deploy_services = common_page_worker.get_deploy_service_dropdown_list( 0) ci_my_all_tasks = common_page_worker.my_ci_task_dropdown_list() pagefileds = { "ci_task_project": my_projects, "ci_deploy_services": deploy_services, "ci_my_all_tasks": ci_my_all_tasks } return self.get_webpart(pagefileds, CITaskPath.task_create_form)
def get_issue_form_controll(self, request, projectid, vm_issue): project_dorpdownlist = ProjectCommonControllPageWorker.get_myproject_dropdown_list( self, request, 0) module_dorpdownlist = ProjectCommonControllPageWorker.get_module_dropdown_list( self, projectid, 0) version_dorpdownlist = ProjectCommonControllPageWorker.get_version_dropdown_list( self, projectid, 0, False) issue_category = ProjectCommonControllPageWorker.get_issue_field_dropdown_list( self, models.ProjectIssueCategory, 0) issue_severity = ProjectCommonControllPageWorker.get_issue_field_dropdown_list( self, models.ProjectIssueSeverity, 0) member_users = MemberService.get_member_users(projectid) project_members = ProjectCommonControllPageWorker.get_member_dropdownlist( self, member_users, projectid, request.user.id) project_phase = ProjectCommonControllPageWorker.get_issue_field_dropdown_list( self, models.ProjectPhase, 0) os_dropdown_list = ProjectCommonControllPageWorker.get_issue_field_dropdown_list( self, models.ProjectOS, 0) os_version_dropdown_list = ProjectCommonControllPageWorker.get_os_version_dropdown_list( self, models.ProjectOSVersion, 1, 0) team_dropdown_list = ProjectCommonControllPageWorker.get_team_dropdown_list( self, 0) pagefileds = { 'issue': vm_issue, "module_dorpdownlist": module_dorpdownlist, "project_dorpdownlist": project_dorpdownlist } pagefileds['version_dorpdownlist'] = version_dorpdownlist pagefileds["issue_category"] = issue_category pagefileds["issue_severity"] = issue_severity pagefileds["project_phase"] = project_phase pagefileds["project_members"] = project_members pagefileds["os_dropdown_list"] = os_dropdown_list pagefileds["os_version_dropdown_list"] = os_version_dropdown_list pagefileds["team_dropdown_list"] = team_dropdown_list return self.get_webpart(pagefileds, ProjectIssuePath.issue_create_form_path)
def get_issue_filter_body(self, projectid, filter_id=0): if str(filter_id) != "0": issue_filter = IssueFilter.objects.get(int(filter_id)) vm_issue_filter = VM_IssueFilter(issue_filter, projectid) else: vm_issue_filter = VM_IssueFilter(None, projectid) project_dropdown_list = ProjectCommonControllPageWorker.get_myproject_dropdown_list( self, self.request, vm_issue_filter.project()) member_users = MemberService.get_member_users( vm_issue_filter.project()) processor_dropdown_list = ProjectCommonControllPageWorker.get_member_dropdownlist( self, member_users, vm_issue_filter.project(), vm_issue_filter.processors()) reporter_dropdown_list = ProjectCommonControllPageWorker.get_member_dropdownlist( self, member_users, vm_issue_filter.project(), vm_issue_filter.creators()) project_version_dropdown_list = ProjectCommonControllPageWorker.get_version_dropdown_list( self, vm_issue_filter.project(), vm_issue_filter.versions(), True) team_dropdown_list = ProjectCommonControllPageWorker.get_team_dropdown_list( self, 0) pagefileds = {"processor_dropdown_list": processor_dropdown_list} pagefileds['reporter_dropdown_list'] = reporter_dropdown_list pagefileds['project_dropdown_list'] = project_dropdown_list pagefileds['status_list'] = self.get_issue_field_list( models.ProjectIssueStatus.objects.all(), vm_issue_filter.status()) pagefileds['severity_list'] = self.get_issue_field_list( models.ProjectIssueSeverity.objects.all(), vm_issue_filter.severity()) pagefileds['solution_list'] = self.get_issue_field_list( models.ProjectIssueResolvedResult.objects.all(), vm_issue_filter.solution()) pagefileds[ 'project_version_dropdown_list'] = project_version_dropdown_list pagefileds['create_date'] = vm_issue_filter.create_date pagefileds['team_dropdown_list'] = team_dropdown_list return self.get_webpart(pagefileds, ProjectIssuePath.issue_filter_body)
def get_ci_settings_agent_create_form(self, agent_id): if str(agent_id) == "0": temp_agent = Agent() vm_agent = VM_CIAgent(temp_agent, agent_id) else: temp_agent = Agent.objects.get(agent_id) vm_agent = VM_CIAgent(temp_agent, agent_id) os_dropdown_list = ProjectCommonControllPageWorker.get_issue_field_dropdown_list( self, ProjectOS, temp_agent.OS) agent_tag_list = CICommonControllPageWorker.get_agent_filter_dropdown_list( self, temp_agent.AgentTags) page_fileds = { "agent": vm_agent, 'os_dropdown_list': os_dropdown_list, 'agent_tag_list': agent_tag_list } return self.get_webpart(page_fileds, CISettingsPath.settings_agent_create_form)
def get_statistics_chart_webpart(self,project_id,version_id): issue_status_summary=self.get_statistics_status_summary(project_id,version_id) version_dropdownlist=ProjectCommonControllPageWorker.get_version_dropdown_list(self, project_id,version_id) pagefileds={'issue_status_summary':issue_status_summary,'version_dropdownlist':version_dropdownlist} return self.get_webpart(pagefileds,ProjectStatisticsPath.statistics_chart)
def os_version_menu(request,os): page_worker=ProjectCommonControllPageWorker(request) result=page_worker.get_issue_device_version_dropdown_menu(int(os),0) return HttpResponse(result)
def get_issue_detail(self, issue_id): dm_issue = ProjectIssue.objects.get(issue_id) vm_issue = VM_ProjectIssue(self.request.user.id, dm_issue) status_dropdown_menu = ProjectCommonControllPageWorker.get_issue_field_dropdown_menu( self, models.ProjectIssueStatus, dm_issue.Status) solution_dropdown_menu = ProjectCommonControllPageWorker.get_issue_field_dropdown_menu( self, models.ProjectIssueResolvedResult, dm_issue.Solution) severity_dropdown_menu = ProjectCommonControllPageWorker.get_issue_field_dropdown_menu( self, models.ProjectIssueSeverity, dm_issue.Severity) category_dropdown_menu = ProjectCommonControllPageWorker.get_issue_field_dropdown_menu( self, models.ProjectIssueCategory, dm_issue.IssueCategory) phase_dropdown_menu = ProjectCommonControllPageWorker.get_issue_field_dropdown_menu( self, models.ProjectPhase, dm_issue.ProjectPhase) os_dropdown_menu = ProjectCommonControllPageWorker.get_issue_field_dropdown_menu( self, models.ProjectOS, dm_issue.DeviceOS) os_version_dropdown_menu = ProjectCommonControllPageWorker.get_issue_device_version_dropdown_menu( self, dm_issue.DeviceOS, dm_issue.OSVersion) member_users = MemberService.get_member_users(dm_issue.Project) member_dropdown_menu = ProjectCommonControllPageWorker.get_member_dropdown_menu( self, member_users, dm_issue.Project, dm_issue.Processor) module_dropdown_menu = ProjectCommonControllPageWorker.get_module_dropdown_menu( self, dm_issue.Project, dm_issue.Module) version_dropdown_menu = ProjectCommonControllPageWorker.get_version_dropdown_menu( self, dm_issue.Project, dm_issue.Version) issue_attachment_upload_dropdown_menu = ProjectCommonControllPageWorker.get_issue_upload_dropdown_menu( self) issue_detail_activity = self.get_issue_detail_activity(issue_id) team_dropdown_menu = ProjectCommonControllPageWorker.get_team_dropdown_menu( self, dm_issue.Team) pagefileds = { "issue": vm_issue, "status_dropdown_menu": status_dropdown_menu } pagefileds['member_dropdown_menu'] = member_dropdown_menu pagefileds['module_dropdown_menu'] = module_dropdown_menu pagefileds['version_dropdown_menu'] = version_dropdown_menu pagefileds['solution_dropdown_menu'] = solution_dropdown_menu pagefileds['severity_dropdown_menu'] = severity_dropdown_menu pagefileds['category_dropdown_menu'] = category_dropdown_menu pagefileds['phase_dropdown_menu'] = phase_dropdown_menu pagefileds['os_dropdown_menu'] = os_dropdown_menu pagefileds['os_version_dropdown_menu'] = os_version_dropdown_menu pagefileds[ 'issue_attachment_upload_dropdown_menu'] = issue_attachment_upload_dropdown_menu pagefileds['issue_detail_activity'] = issue_detail_activity pagefileds['team_dropdown_menu'] = team_dropdown_menu return self.get_webpart(pagefileds, ProjectIssuePath.issue_detail)
def os_version_dropdownlist(request,os): page_worker=ProjectCommonControllPageWorker(request) result=page_worker.get_os_version_dropdown_list(ProjectOSVersion,int(os),0) return HttpResponse(result)