Search in sources :

Example 1 with Section

use of org.kuali.kfs.kns.web.ui.Section in project cu-kfs by CU-CommunityApps.

the class UserProcurementProfileMaintainableImpl method getCoreSections.

@Override
public List<Section> getCoreSections(MaintenanceDocument document, Maintainable oldMaintainable) {
    boolean hasRole = SpringContext.getBean(UserProcurementProfileValidationService.class).canMaintainUserProcurementProfile();
    List<Section> sections = super.getCoreSections(document, oldMaintainable);
    // if it is not 'super user', then default to user him/herself and disable person lookup
    if (StringUtils.equals(document.getNewMaintainableObject().getMaintenanceAction(), KRADConstants.MAINTENANCE_EDIT_ACTION) || (!hasRole && StringUtils.equals(KRADConstants.MAINTENANCE_NEW_ACTION, document.getNewMaintainableObject().getMaintenanceAction()))) {
        for (Section section : sections) {
            for (Row row : section.getRows()) {
                for (Field field : row.getFields()) {
                    if (StringUtils.equalsIgnoreCase(field.getPropertyName(), "profileUser.principalName")) {
                        field.setReadOnly(true);
                        field.setQuickFinderClassNameImpl("");
                    }
                }
            }
        }
    }
    return sections;
}
Also used : Field(org.kuali.kfs.kns.web.ui.Field) Row(org.kuali.kfs.kns.web.ui.Row) UserProcurementProfileValidationService(edu.cornell.kfs.sys.service.UserProcurementProfileValidationService) Section(org.kuali.kfs.kns.web.ui.Section)

Example 2 with Section

use of org.kuali.kfs.kns.web.ui.Section in project cu-kfs by CU-CommunityApps.

the class WebUtils method reopenInactiveRecords.

/**
 * Attempts to reopen sub tabs which would have been closed for inactive records
 *
 * @param sections       the list of Sections whose rows and fields to set the open tab state on
 * @param tabStates      the map of tabKey->tabState.  This map will be modified to set entries to "OPEN"
 * @param collectionName the name of the collection reopening
 */
public static void reopenInactiveRecords(List<Section> sections, Map<String, String> tabStates, String collectionName) {
    for (Section section : sections) {
        for (Row row : section.getRows()) {
            for (Field field : row.getFields()) {
                if (field != null) {
                    if (Field.CONTAINER.equals(field.getFieldType()) && StringUtils.startsWith(field.getContainerName(), collectionName)) {
                        final String tabKey = WebUtils.generateTabKey(FieldUtils.generateCollectionSubTabName(field));
                        tabStates.put(tabKey, KualiForm.TabState.OPEN.name());
                    }
                }
            }
        }
    }
}
Also used : Field(org.kuali.kfs.kns.web.ui.Field) Row(org.kuali.kfs.kns.web.ui.Row) Section(org.kuali.kfs.kns.web.ui.Section)

Example 3 with Section

use of org.kuali.kfs.kns.web.ui.Section in project cu-kfs by CU-CommunityApps.

the class AccountReversionInquirable method getSections.

/**
 * Overridden to take out details with inactive categories
 * @see org.kuali.kfs.kns.inquiry.KualiInquirableImpl#getSections(org.kuali.kfs.kns.bo.BusinessObject)
 */
@Override
public List<Section> getSections(BusinessObject bo) {
    List<Section> sections = super.getSections(bo);
    if (accountReversionService == null) {
        accountReversionService = SpringContext.getBean(AccountReversionService.class);
    }
    for (Section section : sections) {
        for (Row row : section.getRows()) {
            List<Field> updatedFields = new ArrayList<Field>();
            for (Field field : row.getFields()) {
                if (shouldIncludeField(field)) {
                    updatedFields.add(field);
                }
            }
            row.setFields(updatedFields);
        }
    }
    return sections;
}
Also used : Field(org.kuali.kfs.kns.web.ui.Field) ArrayList(java.util.ArrayList) Row(org.kuali.kfs.kns.web.ui.Row) Section(org.kuali.kfs.kns.web.ui.Section) AccountReversionService(edu.cornell.kfs.coa.service.AccountReversionService)

Example 4 with Section

use of org.kuali.kfs.kns.web.ui.Section in project cu-kfs by CU-CommunityApps.

the class CuPaymentDetailInquirableTest method assertSectionStaysUnalteredWhenCountryPropertyIsNotPresent.

private void assertSectionStaysUnalteredWhenCountryPropertyIsNotPresent() {
    Map<String, String> expectedPropertyValues = Collections.singletonMap(PdpPropertyConstants.PaymentDetail.PAYMENT_PAYEE_ID, TEST_PAYEE_ID);
    Section section = buildSection("Payment", buildRow(buildField(PdpPropertyConstants.PaymentDetail.PAYMENT_PAYEE_ID, TEST_PAYEE_ID)));
    assertSectionIsUpdatedProperly(expectedPropertyValues, section);
}
Also used : Section(org.kuali.kfs.kns.web.ui.Section)

Example 5 with Section

use of org.kuali.kfs.kns.web.ui.Section in project cu-kfs by CU-CommunityApps.

the class AccountReversionMaintainableImpl method getSections.

/**
 * @see org.kuali.kfs.kns.maintenance.KualiMaintainableImpl#getSections(org.kuali.kfs.kns.document.MaintenanceDocument, org.kuali.kfs.kns.maintenance.Maintainable)
 */
@Override
public List getSections(MaintenanceDocument document, Maintainable oldMaintainable) {
    List<Section> sections = super.getSections(document, oldMaintainable);
    if (accountReversionService == null) {
        accountReversionService = SpringContext.getBean(AccountReversionService.class);
    }
    for (Section section : sections) {
        for (Row row : section.getRows()) {
            List<Field> updatedFields = new ArrayList<Field>();
            for (Field field : row.getFields()) {
                if (shouldIncludeField(field)) {
                    updatedFields.add(field);
                }
            }
            row.setFields(updatedFields);
        }
    }
    return sections;
}
Also used : Field(org.kuali.kfs.kns.web.ui.Field) ArrayList(java.util.ArrayList) Row(org.kuali.kfs.kns.web.ui.Row) Section(org.kuali.kfs.kns.web.ui.Section) AccountReversionService(edu.cornell.kfs.coa.service.AccountReversionService)

Aggregations

Section (org.kuali.kfs.kns.web.ui.Section)8 Field (org.kuali.kfs.kns.web.ui.Field)5 Row (org.kuali.kfs.kns.web.ui.Row)5 AccountReversionService (edu.cornell.kfs.coa.service.AccountReversionService)2 ArrayList (java.util.ArrayList)2 UserProcurementProfileValidationService (edu.cornell.kfs.sys.service.UserProcurementProfileValidationService)1 HashMap (java.util.HashMap)1 MaintenanceDocumentRestrictions (org.kuali.kfs.kns.document.authorization.MaintenanceDocumentRestrictions)1