IDEMPIERE-357 Ticket #1001002 Move the Menu to be a Portlet / enable dashboard for System user
This commit is contained in:
parent
c77297c201
commit
e7aee3e466
|
@ -49,17 +49,9 @@ public class MDashboardPreference extends X_PA_DashboardPreference
|
|||
{
|
||||
Properties ctx = Env.getCtx();
|
||||
|
||||
StringBuilder whereClause = new StringBuilder(COLUMNNAME_IsShowInDashboard).append("=?");
|
||||
|
||||
if (AD_Role_ID == 0)
|
||||
whereClause.append(" AND (").append(COLUMNNAME_AD_Role_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_Role_ID).append("=?)");
|
||||
else
|
||||
whereClause.append(" AND ").append(COLUMNNAME_AD_Role_ID).append("=?");
|
||||
|
||||
if (AD_User_ID == 0)
|
||||
whereClause.append(" AND (").append(COLUMNNAME_AD_User_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_User_ID).append("=?)");
|
||||
else
|
||||
whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?");
|
||||
StringBuilder whereClause = new StringBuilder(COLUMNNAME_IsShowInDashboard).append("=?")
|
||||
.append(" AND ").append(COLUMNNAME_AD_Role_ID).append("=?")
|
||||
.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?");
|
||||
|
||||
List<Object> parameters = new ArrayList<Object>();
|
||||
parameters.add(isShowInDashboard);
|
||||
|
@ -83,17 +75,9 @@ public class MDashboardPreference extends X_PA_DashboardPreference
|
|||
{
|
||||
Properties ctx = Env.getCtx();
|
||||
|
||||
StringBuilder whereClause = new StringBuilder();
|
||||
|
||||
if (AD_Role_ID == 0)
|
||||
whereClause.append("(").append(COLUMNNAME_AD_Role_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_Role_ID).append("=?)");
|
||||
else
|
||||
whereClause.append(COLUMNNAME_AD_Role_ID).append("=?");
|
||||
|
||||
if (AD_User_ID == 0)
|
||||
whereClause.append(" AND (").append(COLUMNNAME_AD_User_ID).append(" IS NULL OR ").append(COLUMNNAME_AD_User_ID).append("=?)");
|
||||
else
|
||||
whereClause.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?");
|
||||
StringBuilder whereClause = new StringBuilder()
|
||||
.append(COLUMNNAME_AD_Role_ID).append("=?")
|
||||
.append(" AND ").append(COLUMNNAME_AD_User_ID).append("=?");
|
||||
|
||||
List<Object> parameters = new ArrayList<Object>();
|
||||
parameters.add(AD_Role_ID);
|
||||
|
|
|
@ -516,16 +516,13 @@ public class DashboardController implements EventListener<Event> {
|
|||
|
||||
private void createDashboardPreference()
|
||||
{
|
||||
if (Env.getAD_User_ID(Env.getCtx()) == 0 && Env.getAD_Role_ID(Env.getCtx()) == 0)
|
||||
return;
|
||||
|
||||
MDashboardContent[] dcs = MDashboardContent.getForSession(0, 0);
|
||||
for (MDashboardContent dc : dcs)
|
||||
{
|
||||
MDashboardPreference preference = new MDashboardPreference(Env.getCtx(), 0, null);
|
||||
preference.setAD_Org_ID(Env.getAD_Org_ID(Env.getCtx()));
|
||||
preference.setAD_Role_ID(Env.getAD_Role_ID(Env.getCtx()));
|
||||
preference.setAD_User_ID(Env.getAD_User_ID(Env.getCtx()));
|
||||
preference.set_ValueNoCheck("AD_User_ID", Env.getAD_User_ID(Env.getCtx()));
|
||||
preference.setColumnNo(dc.getColumnNo());
|
||||
preference.setIsCollapsedByDefault(dc.isCollapsedByDefault());
|
||||
preference.setIsShowInDashboard(dc.isShowInDashboard());
|
||||
|
|
Loading…
Reference in New Issue