use of com.qcadoo.mes.cmmsMachineParts.plannedEvents.fieldsForType.FieldsForType in project mes by qcadoo.
the class PlannedEventDetailsHooks method toggleActionsFieldsVisible.
public void toggleActionsFieldsVisible(final ViewDefinitionState view) {
FormComponent plannedEventForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity plannedEvent = plannedEventForm.getPersistedEntityWithIncludedFormValues();
PlannedEventType type = PlannedEventType.from(plannedEvent);
FieldsForType fieldsForType = eventFieldsForTypeFactory.createFieldsForType(type);
if (fieldsForType == null) {
return;
}
toggleAddMultipleActions(view, fieldsForType, plannedEvent);
}
use of com.qcadoo.mes.cmmsMachineParts.plannedEvents.fieldsForType.FieldsForType in project mes by qcadoo.
the class PlannedEventDetailsHooks method toggleFieldsVisible.
public void toggleFieldsVisible(final ViewDefinitionState view) {
FormComponent plannedEventForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity plannedEvent = plannedEventForm.getPersistedEntityWithIncludedFormValues();
PlannedEventType type = PlannedEventType.from(plannedEvent);
FieldsForType fieldsForType = eventFieldsForTypeFactory.createFieldsForType(type);
if (fieldsForType == null) {
return;
}
hideFields(view, plannedEvent, fieldsForType);
hideTabs(view, fieldsForType);
clearGrids(view, fieldsForType);
setAndLockBasedOn(view, fieldsForType);
actionsButtonProcess(plannedEvent, view, fieldsForType);
}
use of com.qcadoo.mes.cmmsMachineParts.plannedEvents.fieldsForType.FieldsForType in project mes by qcadoo.
the class PlannedEventHooks method clearHiddenFields.
private void clearHiddenFields(final Entity event) {
FieldsForType fieldsForType = fieldsForTypeFactory.createFieldsForType(PlannedEventType.from(event));
List<String> fieldsToClear = fieldsForType.getHiddenFields();
for (String fieldName : fieldsToClear) {
if (fieldName.equals(PlannedEventFields.REQUIRES_SHUTDOWN) || fieldName.equals(PlannedEventFields.PLANNED_SEPARATELY)) {
event.setField(fieldName, false);
} else {
event.setField(fieldName, null);
}
}
}
use of com.qcadoo.mes.cmmsMachineParts.plannedEvents.fieldsForType.FieldsForType in project mes by qcadoo.
the class PlannedEventStateValidationService method tabIsNotHidden.
private boolean tabIsNotHidden(Entity plannedEvent, String tabName) {
PlannedEventType type = PlannedEventType.from(plannedEvent);
FieldsForType fieldsForType = eventFieldsForTypeFactory.createFieldsForType(type);
return !fieldsForType.getHiddenTabs().contains(tabName);
}
use of com.qcadoo.mes.cmmsMachineParts.plannedEvents.fieldsForType.FieldsForType in project mes by qcadoo.
the class TimeUsageXlsService method updatePartsAndDescription.
private void updatePartsAndDescription(List<TimeUsageDTO> usages, Locale locale) {
for (TimeUsageDTO usage : usages) {
if ("planned".equals(usage.getEventType())) {
PlannedEventType type = PlannedEventType.parseString(usage.getType());
FieldsForType fields = fieldsForTypeFactory.createFieldsForType(type);
if (fields.getHiddenTabs().contains(PlannedEventFields.MACHINE_PARTS_TAB)) {
String notApplicable = translationService.translate("cmmsMachineParts.timeUsageReport.na", locale);
usage.setParts(notApplicable);
}
if (fields.getHiddenTabs().contains(PlannedEventFields.SOLUTION_DESCRIPTION_TAB)) {
String notApplicable = translationService.translate("cmmsMachineParts.timeUsageReport.na", locale);
usage.setDescription(notApplicable);
}
}
}
}
Aggregations