Exemplo n.º 1
0
 @Override
 public Integer saveWithSession(Milestone record, String username) {
   if (record.getStatus() == null) {
     record.setStatus(OptionI18nEnum.MilestoneStatus.InProgress.name());
   }
   Integer recordId = super.saveWithSession(record, username);
   asyncEventBus.post(
       new CleanCacheEvent(
           record.getSaccountid(),
           new Class[] {ProjectService.class, GanttAssignmentService.class}));
   return recordId;
 }
Exemplo n.º 2
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();
  }
Exemplo n.º 3
0
 @Override
 public Integer updateWithSession(Milestone record, String username) {
   int result = super.updateWithSession(record, username);
   asyncEventBus.post(
       new CleanCacheEvent(
           record.getSaccountid(),
           new Class[] {ProjectService.class, GanttAssignmentService.class}));
   return result;
 }
Exemplo n.º 4
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();
    }
  }
Exemplo n.º 5
0
 @Override
 public Integer updateWithSession(Milestone record, String username) {
   CacheUtils.cleanCaches(record.getSaccountid(), ProjectService.class);
   return super.updateWithSession(record, username);
 }
Exemplo n.º 6
0
 @Override
 public Integer saveWithSession(Milestone record, String username) {
   Integer recordId = super.saveWithSession(record, username);
   CacheUtils.cleanCaches(record.getSaccountid(), ProjectService.class);
   return recordId;
 }