| | |
| | | |
| | | // 옵션 값 유효 체크 |
| | | private void verifyOptions(CustomFieldForm customFieldForm) { |
| | | // 사용자 정의 필드 유형이 텍스트 일때는 옵션 값이 존재하면 안된다. |
| | | if (CustomFieldType.valueOf(customFieldForm.getCustomFieldType()).equals(CustomFieldType.INPUT)) { |
| | | // 사용자 정의 필드 유형이 텍스트 일때는 옵션 값이 존재하면 안된다. => 단일선택 또는 다중선택 필드가 아닐 경우 옵션 값 존재 하면 안되는 것으로 변경 |
| | | if (!CustomFieldType.valueOf(customFieldForm.getCustomFieldType()).equals(CustomFieldType.MULTI_SELECT) && !CustomFieldType.valueOf(customFieldForm.getCustomFieldType()).equals(CustomFieldType.SINGLE_SELECT)) { |
| | | if (customFieldForm.getOptions().size() > 0) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_OPTIONS_NOT_USE_INPUT_FIELD)); |
| | |
| | | } |
| | | // 기본 값으로 지정한 값이 옵션에 있는지 확인한다. |
| | | this.verifyOptionsDefaultValue(customFieldForm); |
| | | |
| | | break; |
| | | case MULTI_SELECT: |
| | | // 기본 값으로 지정한 값이 옵션에 있는지 확인한다. |
| | |
| | | |
| | | // 사용자 정의 필드 유형이 단일, 다중 선택에서 문자열로 변경될 경우 사용자 정의 필드 값을 초기화한다. |
| | | private void checkChangeCustomFieldType(CustomFieldForm customFieldForm, CustomField customField) { |
| | | if (!customField.getCustomFieldType().equals(CustomFieldType.INPUT)) { |
| | | if (customField.getCustomFieldType().equals(CustomFieldType.MULTI_SELECT) || customField.getCustomFieldType().equals(CustomFieldType.SINGLE_SELECT)) { |
| | | // 단일, 다중 선택에서 문자열 필드로 변경된 경우 |
| | | if (CustomFieldType.valueOf(customFieldForm.getCustomFieldType()).equals(CustomFieldType.INPUT)) { |
| | | if (!CustomFieldType.valueOf(customFieldForm.getCustomFieldType()).equals(CustomFieldType.MULTI_SELECT) && !CustomFieldType.valueOf(customFieldForm.getCustomFieldType()).equals(CustomFieldType.SINGLE_SELECT)) { |
| | | customField.getCustomFieldValues().clear(); |
| | | } |
| | | } |
| | |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_NOT_EXIST)); |
| | | } |
| | | |
| | | |
| | | CustomField customField = this.findOne(id); |
| | | |
| | |
| | | case "MULTI_SELECT" : |
| | | customFieldTypeName = this.messageAccessor.message("common.multipleSelectionField"); // 다중 선택 필드 |
| | | break; |
| | | case "NUMBER" : |
| | | customFieldTypeName = this.messageAccessor.message("common.numberField"); // 숫자 필드 |
| | | break; |
| | | case "DATETIME" : |
| | | customFieldTypeName = this.messageAccessor.message("common.datetimeField"); // 날짜 필드 |
| | | break; |
| | | case "IP_ADDRESS" : |
| | | customFieldTypeName = this.messageAccessor.message("common.ipAddressField"); // IP 주소 필드 |
| | | break; |
| | | case "EMAIL" : |
| | | customFieldTypeName = this.messageAccessor.message("common.emailField"); // 이메일 필드 |
| | | break; |
| | | case "SITE" : |
| | | customFieldTypeName = this.messageAccessor.message("common.siteField"); // 홈페이지 주소 필드 |
| | | break; |
| | | case "TEL" : |
| | | customFieldTypeName = this.messageAccessor.message("common.telField"); // 전화번호 필드 |
| | | break; |
| | | } |
| | | } |
| | | |