details: https://code.openbravo.com/erp/devel/pi/rev/80067e160ad9 changeset: 24460:80067e160ad9 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Tue Sep 23 09:13:17 2014 +0200 summary: fixed bug 27237: inconsistent alert count and list visualization
When visualizing alerts in Alert Management window, only those rules visible (client/org) from current role were shown. But when counting active alerts to display in the nav bar icon, all rules were taken into account. Now rules taken into account are consistently filtering out non visible ones. diffstat: modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java | 13 +++++++-- 1 files changed, 10 insertions(+), 3 deletions(-) diffs (31 lines): diff -r db69b5dae58e -r 80067e160ad9 modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java Mon Sep 15 14:22:18 2014 +0530 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java Tue Sep 23 09:13:17 2014 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2009-2012 Openbravo SLU + * All portions are Copyright (C) 2009-2014 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -84,9 +84,16 @@ Long total = 0L; if (!"Y".equals(vars.getSessionValue("ApplyModules|BuildRunning"))) { // select the alert rules - final String hql = "select distinct(e.alertRule) from " + AlertRecipient.ENTITY_NAME + final String hql = "select distinct(e.alertRule) from " + + AlertRecipient.ENTITY_NAME + " e where e.alertRule.active = true and (e.userContact.id=? " - + " or (e.userContact.id = null and e.role.id = ?))"; + + " or (e.userContact.id = null and e.role.id = ?))" + + // select only those rules that are client/org visible from current role + + " and e.alertRule.client.id " + OBDal.getInstance().getReadableClientsInClause() + + " and e.alertRule.organization.id " + + OBDal.getInstance().getReadableOrganizationsInClause(); + final Query qry = OBDal.getInstance().getSession().createQuery(hql); qry.setParameter(0, OBContext.getOBContext().getUser().getId()); qry.setParameter(1, OBContext.getOBContext().getRole().getId()); ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits