コード例 #1
0
  private int saveMilestone(Milestone milestone) {
    MilestoneService milestoneService =
        ApplicationContextUtil.getSpringBean(MilestoneService.class);
    milestone.setProjectid(CurrentProjectVariables.getProjectId());
    milestone.setSaccountid(AppContext.getAccountId());

    if (milestone.getId() == null) {
      milestone.setCreateduser(AppContext.getUsername());
      milestoneService.saveWithSession(milestone, AppContext.getUsername());
    } else {
      milestoneService.updateWithSession(milestone, AppContext.getUsername());
    }
    return milestone.getId();
  }
コード例 #2
0
  @Override
  protected void onGo(ComponentContainer container, ScreenData<?> data) {
    if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)) {
      MilestoneContainer milestoneContainer = (MilestoneContainer) container;
      milestoneContainer.navigateToContainer(ProjectTypeConstants.MILESTONE);
      milestoneContainer.removeAllComponents();
      milestoneContainer.addComponent(view.getWidget());

      Milestone milestone = (Milestone) data.getParams();
      view.editItem(milestone);

      ProjectBreadcrumb breadcrumb = ViewManager.getCacheComponent(ProjectBreadcrumb.class);
      if (milestone.getId() == null) {
        breadcrumb.gotoMilestoneAdd();
      } else {
        breadcrumb.gotoMilestoneEdit(milestone);
      }
    } else {
      NotificationUtil.showMessagePermissionAlert();
    }
  }