--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/c649c015-c413-495e-bb94-e492b2fbb41fn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/4dac326d-a59c-4cc7-84b1-100437fe5977n%40googlegroups.com.
private final static String AFFAIRE_REGISTRE_READ_ONLY_PREFIX = "XXA_AffaireRegistreReadOnly";
private void affaireRegistreItem(Properties ctx, int WindowNo, GridTab mTab, Object value) {
String readOnlyLogic = MTab.get(mTab.getAD_Tab_ID()).getReadOnlyLogic();
if (!Util.isEmpty(readOnlyLogic) && readOnlyLogic.startsWith("@" + AFFAIRE_REGISTRE_READ_ONLY_PREFIX)) {
int pos = readOnlyLogic.indexOf("@", AFFAIRE_REGISTRE_READ_ONLY_PREFIX.length());
String context = readOnlyLogic.substring(1, pos);
if (!Util.isEmpty(Env.getContext(Env.getCtx(), WindowNo, context)))
return;
String type = readOnlyLogic.substring(AFFAIRE_REGISTRE_READ_ONLY_PREFIX.length() + 1, pos);
int registreCatID = MXXARegistreCategory.get(ctx, Env.getAD_Client_ID(ctx), type, null).getXXA_RegistreCategory_ID();
boolean canUpdate = MXXAAffaireUser.canUpdate(ctx, Env.getContextAsInt(ctx, WindowNo, "XXA_Affaire_ID"), Env.getAD_User_ID(ctx), registreCatID, null);
Env.setContext(Env.getCtx(), WindowNo, context, canUpdate);
}
}