예제 #1
0
 /**
  * Gets the entity.
  *
  * @return the SUCCESS result
  */
 public String get() throws Exception {
   if (this.getId() != null) {
     UserUtil.permissionCheck("view_call");
     call = baseService.getEntityById(Call.class, this.getId());
     UserUtil.scopeCheck(call, "scope_call");
     CallStatus status = call.getStatus();
     if (status != null) {
       statusID = status.getId();
     }
     CallDirection direction = call.getDirection();
     if (direction != null) {
       directionID = direction.getId();
     }
     ReminderOption reminderOptionEmail = call.getReminder_option_email();
     if (reminderOptionEmail != null) {
       reminderOptionEmailID = reminderOptionEmail.getId();
     }
     EmailTemplate reminderTemplate = call.getReminder_template();
     if (reminderTemplate != null) {
       reminderTemplateID = reminderTemplate.getId();
     }
     User assignedTo = call.getAssigned_to();
     if (assignedTo != null) {
       this.setAssignedToID(assignedTo.getId());
       this.setAssignedToText(assignedTo.getName());
     }
     Date start_date = call.getStart_date();
     SimpleDateFormat dateFormat = new SimpleDateFormat(Constant.DATE_TIME_FORMAT);
     if (start_date != null) {
       startDate = dateFormat.format(start_date);
     }
     String relatedObject = call.getRelated_object();
     Integer relatedRecord = call.getRelated_record();
     if (relatedRecord != null) {
       setRelatedRecord(relatedObject, relatedRecord);
     }
     this.getBaseInfo(call, Call.class.getSimpleName(), Constant.CRM_NAMESPACE);
   } else {
     this.initBaseInfo();
     if (!CommonUtil.isNullOrEmpty(this.getRelationKey())) {
       call.setRelated_object(this.getRelationKey());
       setRelatedRecord(this.getRelationKey(), Integer.parseInt(this.getRelationValue()));
     }
   }
   return SUCCESS;
 }
예제 #2
0
 /**
  * Gets the entity.
  *
  * @return the SUCCESS result
  */
 public String get() throws Exception {
   if (this.getId() != null) {
     call = baseService.getEntityById(Call.class, this.getId());
     CallStatus status = call.getStatus();
     if (status != null) {
       statusID = status.getId();
     }
     CallDirection direction = call.getDirection();
     if (direction != null) {
       directionID = direction.getId();
     }
     ReminderOption reminderOptionPop = call.getReminder_option_pop();
     if (reminderOptionPop != null) {
       reminderOptionPopID = reminderOptionPop.getId();
     }
     ReminderOption reminderOptionEmail = call.getReminder_option_email();
     if (reminderOptionEmail != null) {
       reminderOptionEmailID = reminderOptionEmail.getId();
     }
     User user = call.getAssigned_to();
     if (user != null) {
       assignedToID = user.getId();
     }
     Date start_date = call.getStart_date();
     SimpleDateFormat dateFormat = new SimpleDateFormat("M/d/yyyy HH:mm:ss");
     if (start_date != null) {
       startDate = dateFormat.format(start_date);
     }
     String relatedObject = call.getRelated_object();
     Integer relatedRecord = call.getRelated_record();
     setRelatedRecord(relatedObject, relatedRecord);
   } else {
     ActionContext context = ActionContext.getContext();
     Map<String, Object> session = context.getSession();
     User loginUser = (User) session.get(AuthenticationSuccessListener.LOGIN_USER);
     this.assignedToID = loginUser.getId();
     if (!CommonUtil.isNullOrEmpty(this.getRelationKey())) {
       call.setRelated_object(this.getRelationKey());
       setRelatedRecord(this.getRelationKey(), Integer.parseInt(this.getRelationValue()));
     }
   }
   return SUCCESS;
 }