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;
}
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());
}
}
}
}
}
}
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;
}
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);
}
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;
}
Aggregations