protected boolean isFieldRequired(FieldLayout fieldLayout, String fieldId) { if (MappingConstants.nonSystemFieldsFieldIds.contains(fieldId)) { return false; } return fieldLayout.getFieldLayoutItem(fieldId).isRequired(); }
private static boolean isFieldHidden(final Set<FieldLayout> fieldLayouts, final OrderableField field) { for (final FieldLayout fieldLayout : fieldLayouts) { final FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(field); if (!fieldLayoutItem.isHidden()) { return false; } } // The field is hidden in all field layouts return true; }
public FieldLayoutItem getIssueTypeField(final Project project){ FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(project, null); return fieldLayout.getFieldLayoutItem(IssueFieldConstants.ISSUE_TYPE); }
protected FieldScreenRenderLayoutItem buildFieldScreenRenderLayoutItem(final OrderableField field, GenericValue issue) { return new FieldScreenRenderLayoutItemImpl(null, fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(field)); }
protected FieldScreenRenderLayoutItem buildFieldScreenRenderLayoutItem(final OrderableField field, final GenericValue issue) { return new FieldScreenRenderLayoutItemImpl(null, fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(field)); }
public String getMappingViewHtml(final BulkEditBean bulkEditBean, final OrderableField field, final Long id, final boolean showProject) { final FieldLayoutItem fieldLayoutItem = bulkEditBean.getTargetFieldLayout().getFieldLayoutItem(field); final Issue baseIssue = bulkEditBean.getFirstTargetIssueObject(); return getViewHtmlForId(baseIssue, fieldLayoutItem, field, id, showProject); }
public boolean isVisible(GenericValue issue, String fieldname) throws FieldLayoutStorageException { FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue); return !fieldLayout.getFieldLayoutItem(fieldManager.getOrderableField(fieldname)).isHidden(); }
public static boolean isFieldRequiredForIssue(Issue issue, CustomField customField) throws FieldLayoutStorageException { FieldLayout fieldLayout = getFieldLayoutManager().getFieldLayout(issue); FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(customField); return fieldLayoutItem.isRequired(); }
public String getCustomFieldView(final CustomField customField) throws FieldValidationException { final Object value = getFieldValues().get(customField.getId()); // There is a validation that will not allow an edit to occur on a field that has different renderer types // defined in the field layout item so if we get here then we know it is safe to grab the first layout // item we can find for the field and that this will imply the correct renderer type. FieldLayoutItem layoutItem = null; if (!getFieldLayouts().isEmpty()) { layoutItem = (getFieldLayouts().iterator().next()).getFieldLayoutItem(customField); } return customField.getCustomFieldType().getDescriptor().getViewHtml(customField, value, null, layoutItem); }
private String getBulkMoveHtml(final OperationContext operationContext, final Action action, final BulkEditBean bulkEditBean, final Map displayParameters) { final FieldLayoutItem fieldLayoutItem = bulkEditBean.getTargetFieldLayout().getFieldLayoutItem(this); final Issue issue = bulkEditBean.getFirstTargetIssueObject(); final Map velocityParams = getVelocityParams(fieldLayoutItem, action, issue, displayParameters); velocityParams.put(getId(), operationContext.getFieldValuesHolder().get(getId())); getOurSpecificVelocityParams(issue, velocityParams, operationContext.getFieldValuesHolder()); return renderTemplate("timetracking-bulkmove.vm", velocityParams); }
public static boolean isVisible(GenericValue issue, String fieldname) throws FieldLayoutStorageException { FieldLayout fieldLayout = ComponentAccessor.getFieldLayoutManager().getFieldLayout(issue); return !fieldLayout.getFieldLayoutItem(ComponentAccessor.getFieldManager().getOrderableField(fieldname)).isHidden(); }
public boolean isVisible(Issue issue, String fieldname) throws FieldLayoutStorageException { FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue.getProject(), issue.getIssueTypeObject().getId()); return !fieldLayout.getFieldLayoutItem(fieldManager.getOrderableField(fieldname)).isHidden(); }
private String getCommentHtml(Issue issue, Action action) { final OperationContext context = (OperationContext) action; final MapBuilder<String, Object> displayParams = MapBuilder.newBuilder(); displayParams.add("theme", "aui"); displayParams.add("noHeader", true); final FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(issue); final FieldLayoutItem commentFieldLayoutItem = fieldLayout.getFieldLayoutItem("comment"); final OrderableField commentField = commentFieldLayoutItem.getOrderableField(); return commentField.getCreateHtml(commentFieldLayoutItem, context, action, issue, displayParams.toMap()); }
public String getNewViewHtml(final OrderableField field) { final Map displayParameters = MapBuilder.newBuilder("readonly", Boolean.TRUE).add("nolink", Boolean.TRUE).toMap(); return field.getViewHtml(getBulkEditBean().getTargetFieldLayout().getFieldLayoutItem(field), this, getBulkEditBean().getFirstTargetIssueObject(), displayParameters); }
public String getOldViewHtml(OrderableField field) { FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(getIssueObject()); FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(field); final Map<String, Object> displayParams = MapBuilder.<String, Object>newBuilder("nolink", Boolean.TRUE) .add("readonly", Boolean.TRUE) .add("prefix", "old_").toMutableMap(); return field.getViewHtml(fieldLayoutItem, this, getIssueObject(getIssue()), displayParams); }
public Html renderIssueFieldValue(Issue issue, String fieldId, String value) { FieldLayoutItem fieldLayoutItem = fieldLayoutManager.getFieldLayout(issue.getProjectObject(), issue.getIssueTypeObject().getId()).getFieldLayoutItem(fieldId); if (fieldLayoutItem == null) { return new Html(value); } return new Html(rendererManager.getRenderedContent(fieldLayoutItem.getRendererType(), value, issue.getIssueRenderContext())); }
public String getFieldViewHtml(final OrderableField orderableField) { final Map<String, Object> displayParams = MapBuilder.<String, Object>newBuilder("readonly", Boolean.TRUE) .add("nolink", Boolean.TRUE) .add("bulkoperation", getBulkEditBean().getOperationName()).toMutableMap(); // Use the layout item of where we are going since we are moving to that space final FieldLayoutItem layoutItem = getBulkEditBean().getTargetFieldLayout().getFieldLayoutItem(orderableField); return orderableField.getViewHtml(layoutItem, this, getBulkEditBean().getFirstTargetIssueObject(), getBulkEditBean().getFieldValues().get(orderableField.getId()), displayParams); }
public String getNewViewHtml(OrderableField field) { MutableIssue updatedIssue = getMoveIssueBean().getUpdatedIssue(); FieldLayout fieldLayout = fieldLayoutManager.getFieldLayout(updatedIssue.getProjectObject(), updatedIssue.getIssueTypeId()); FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(field); final Map<String, Object> displayParams = MapBuilder.<String, Object>newBuilder("nolink", Boolean.TRUE) .add("readonly", Boolean.TRUE) .add("prefix", "new_").toMutableMap(); return field.getViewHtml(fieldLayoutItem, this, updatedIssue, displayParams); }
public String getRenderedContent(FieldRenderContext fieldRenderContext) { Issue issue = fieldRenderContext.getIssue(); String fieldId = fieldRenderContext.getFieldId(); FieldLayoutManager fieldLayoutManager = ComponentAccessor.getComponentOfType(FieldLayoutManager.class); // can't put into constructor due to cyclic dependency FieldLayoutItem fieldLayoutItem = fieldLayoutManager.getFieldLayout(issue.getProjectObject(), issue.getIssueTypeId()).getFieldLayoutItem(fieldId); if (fieldLayoutItem != null) { return getRenderedContent(fieldLayoutItem.getRendererType(), fieldRenderContext.getBody(), issue.getIssueRenderContext()); } return null; }
public String getNewViewHtml(final BulkEditBean bulkEditBean, final OrderableField field) { final Map<String, Object> displayParameters = MapBuilder.<String, Object>newBuilder("readonly", Boolean.TRUE) .add("nolink", Boolean.TRUE) .add("prefix", bulkEditBean.getProject().getId() + "_" + bulkEditBean.getIssueType().getId() + "_") .toMap(); return field.getViewHtml(bulkEditBean.getTargetFieldLayout().getFieldLayoutItem(field), this, bulkEditBean.getFirstTargetIssueObject(), displayParameters); }