IDEMPIERE-1311: Only visible org and warehouse combo-box on role window if combo-box has more than one value.
This commit is contained in:
parent
a5597e65c1
commit
10a51f9586
|
@ -0,0 +1,9 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Oct 13, 2018 4:35:41 PM IST
|
||||
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200146,0,0,TO_DATE('2018-10-13 16:35:40','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2018-10-13 16:35:40','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ALogin_ShowDate','Y','Defaulted to Y. If value changed to N, date field is not displayed on role window.','U','S','54085add-8245-4bfe-a978-3583bbe2cc2a')
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201810131655_IDEMPIERE-1311.sql') FROM dual
|
||||
;
|
|
@ -0,0 +1,6 @@
|
|||
-- Oct 13, 2018 4:35:41 PM IST
|
||||
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200146,0,0,TO_TIMESTAMP('2018-10-13 16:35:40','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2018-10-13 16:35:40','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ALogin_ShowDate','Y','Defaulted to Y. If value changed to N, date field is not displayed on role window.','U','S','54085add-8245-4bfe-a978-3583bbe2cc2a')
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201810131655_IDEMPIERE-1311.sql') FROM dual
|
||||
;
|
|
@ -87,6 +87,7 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
|||
*/
|
||||
private static final long serialVersionUID = 372661654078492488L;
|
||||
|
||||
private static final String ALOGIN_SHOWDATE = "ALogin_ShowDate";
|
||||
protected LoginWindow wndLogin;
|
||||
protected Login login;
|
||||
|
||||
|
@ -381,6 +382,14 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
|||
lblClient.setVisible(true);
|
||||
lstClient.setVisible(true);
|
||||
}
|
||||
|
||||
// Disable date combo-box at login screen
|
||||
if (!MSysConfig.getBooleanValue(ALOGIN_SHOWDATE, true))
|
||||
{
|
||||
lblDate.setVisible(false);
|
||||
lstDate.setVisible(false);
|
||||
}
|
||||
|
||||
setUserID();
|
||||
updateRoleList();
|
||||
|
||||
|
@ -472,6 +481,20 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
|||
lstOrganisation.setSelectedItem(ci);
|
||||
|
||||
}
|
||||
|
||||
// If we have only one org, we can hide combo-box at login - logilite
|
||||
if (lstOrganisation.getItemCount() <= 1)
|
||||
{
|
||||
lstOrganisation.setSelectedIndex(0);
|
||||
lstOrganisation.setVisible(false);
|
||||
lblOrganisation.setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
lstOrganisation.setVisible(true);
|
||||
lblOrganisation.setVisible(true);
|
||||
}
|
||||
|
||||
if (lstOrganisation.getSelectedIndex() == -1 && lstOrganisation.getItemCount() > 0) {
|
||||
m_show = true; // didn't find default organisation
|
||||
lstOrganisation.setSelectedIndex(0);
|
||||
|
@ -479,6 +502,12 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
|||
}
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
lstOrganisation.setVisible(false);
|
||||
lblOrganisation.setVisible(false);
|
||||
}
|
||||
|
||||
updateWarehouseList();
|
||||
}
|
||||
|
||||
|
@ -508,13 +537,37 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
|
|||
if(warehouseKNPairs[i].getID().equals(initDefault))
|
||||
lstWarehouse.setSelectedItem(ci);
|
||||
}
|
||||
|
||||
// we can hide ware house combo-box on selection of org
|
||||
if (lstWarehouse.getItemCount() <= 1)
|
||||
{
|
||||
lstWarehouse.setSelectedIndex(0);
|
||||
lstWarehouse.setVisible(false);
|
||||
lblWarehouse.setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
lstWarehouse.setVisible(true);
|
||||
lblWarehouse.setVisible(true);
|
||||
}
|
||||
|
||||
if (lstWarehouse.getSelectedIndex() == -1 && lstWarehouse.getItemCount() > 0) {
|
||||
m_show = true; // didn't find default warehouse
|
||||
lstWarehouse.setSelectedIndex(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lstWarehouse.setVisible(false);
|
||||
lblWarehouse.setVisible(false);
|
||||
}
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
lstWarehouse.setVisible(false);
|
||||
lblWarehouse.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
|
|
Loading…
Reference in New Issue