From cb8b8e72d186cca8335f78069062ff99013173cb Mon Sep 17 00:00:00 2001 From: Sander van der Heyden Date: Tue, 19 Mar 2013 12:08:48 +0100 Subject: [PATCH] MIFOSX-230-1: Extended datatables functionality to Groups and Offices --- .../service/ReadWriteNonCoreDataServiceImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java index 8448f03ec..11d618210 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java @@ -362,6 +362,14 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ dataScopeCriteria = " join m_client c on c.id = t.client_id " + " join m_office o on o.id = c.office_id and o.hierarchy like '" + currentUser.getOffice().getHierarchy() + "%'"; } + if (appTable.equalsIgnoreCase("m_group")) { + dataScopeCriteria = " join m_office o on o.id = t.office_id and o.hierarchy like '" + + currentUser.getOffice().getHierarchy() + "%'"; + } + if (appTable.equalsIgnoreCase("m_office")) { + dataScopeCriteria = " join m_office o on o.id = t.id and o.hierarchy like '" + + currentUser.getOffice().getHierarchy() + "%'"; + } if (dataScopeCriteria == null) { throw new PlatformDataIntegrityException("error.msg.invalid.dataScopeCriteria", "Application Table: " + appTable + " not catered for in data Scoping"); } @@ -374,6 +382,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ if (appTable.equalsIgnoreCase("m_client")) return; if (appTable.equalsIgnoreCase("m_loan")) return; + if (appTable.equalsIgnoreCase("m_group")) return; + if (appTable.equalsIgnoreCase("m_office")) return; throw new PlatformDataIntegrityException("error.msg.invalid.application.table", "Invalid Application Table: " + appTable); }