[roleInheritance] Readable message in case of no modification
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 01 Oct 2015 11:00:59 +0200
changeset 27785 6a010d6939cd
parent 27784 046c0208ee72
child 27786 644cc4e982e2
[roleInheritance] Readable message in case of no modification
src-db/database/sourcedata/AD_MESSAGE.xml
src/org/openbravo/roleInheritance/RecalculatePermissionsHandler.java
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Oct 01 09:53:47 2015 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Oct 01 11:00:59 2015 +0200
@@ -18847,9 +18847,8 @@
 <!--41F4EE324D934018A3F18A7F7C3689AD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--41F4EE324D934018A3F18A7F7C3689AD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--41F4EE324D934018A3F18A7F7C3689AD-->  <VALUE><![CDATA[PermissionsNotModified]]></VALUE>
-<!--41F4EE324D934018A3F18A7F7C3689AD-->  <MSGTEXT><![CDATA[It did not require any change in the current role accesses]]></MSGTEXT>
-<!--41F4EE324D934018A3F18A7F7C3689AD-->  <MSGTIP><![CDATA[]]></MSGTIP>
-<!--41F4EE324D934018A3F18A7F7C3689AD-->  <MSGTYPE><![CDATA[S]]></MSGTYPE>
+<!--41F4EE324D934018A3F18A7F7C3689AD-->  <MSGTEXT><![CDATA[It was not required any change into the role accesses]]></MSGTEXT>
+<!--41F4EE324D934018A3F18A7F7C3689AD-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
 <!--41F4EE324D934018A3F18A7F7C3689AD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--41F4EE324D934018A3F18A7F7C3689AD-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--41F4EE324D934018A3F18A7F7C3689AD--></AD_MESSAGE>
@@ -26881,6 +26880,18 @@
 <!--FC546FBAF4434EFFBC42B2424A25C3D2-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--FC546FBAF4434EFFBC42B2424A25C3D2--></AD_MESSAGE>
 
+<!--FD35F6E43FF04237AFD5FD2D27539A0E--><AD_MESSAGE>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <AD_MESSAGE_ID><![CDATA[FD35F6E43FF04237AFD5FD2D27539A0E]]></AD_MESSAGE_ID>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <VALUE><![CDATA[TemplatePermissionsNotModified]]></VALUE>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <MSGTEXT><![CDATA[It was not required any change into the accesses of the roles which are inheriting from this template]]></MSGTEXT>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--FD35F6E43FF04237AFD5FD2D27539A0E--></AD_MESSAGE>
+
 <!--FD5CDA03260B436D832C49C33AD3BB66--><AD_MESSAGE>
 <!--FD5CDA03260B436D832C49C33AD3BB66-->  <AD_MESSAGE_ID><![CDATA[FD5CDA03260B436D832C49C33AD3BB66]]></AD_MESSAGE_ID>
 <!--FD5CDA03260B436D832C49C33AD3BB66-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/roleInheritance/RecalculatePermissionsHandler.java	Thu Oct 01 09:53:47 2015 +0200
+++ b/src/org/openbravo/roleInheritance/RecalculatePermissionsHandler.java	Thu Oct 01 11:00:59 2015 +0200
@@ -27,10 +27,13 @@
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.access.Role;
 import org.openbravo.roleInheritance.RoleInheritanceManager.AccessType;
+import org.openbravo.service.db.DalConnectionProvider;
 import org.openbravo.service.db.DbUtility;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -58,7 +61,9 @@
         if (updatedRoles.size() > 0) {
           textMessage = composeTemplateAccessMessageText(updatedRoles);
         } else {
-          textMessage = "PermissionsNotModified";
+          textMessage = Utility.messageBD(new DalConnectionProvider(false),
+              "TemplatePermissionsNotModified", OBContext.getOBContext().getLanguage()
+                  .getLanguage());
         }
         successMessage = "RecalculateTemplatePermissionsSuccess";
       } else {
@@ -66,7 +71,8 @@
             .recalculateAllAccessesForRole(role);
         textMessage = composeAccessMessageText(accessCount);
         if (StringUtils.isEmpty(textMessage)) {
-          textMessage = "PermissionsNotModified";
+          textMessage = Utility.messageBD(new DalConnectionProvider(false),
+              "PermissionsNotModified", OBContext.getOBContext().getLanguage().getLanguage());
         }
         successMessage = "RecalculatePermissionsSuccess";
       }