details: https://code.openbravo.com/erp/devel/pi/rev/a49574c6de23 changeset: 31978:a49574c6de23 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Mon Apr 24 18:41:02 2017 +0200 summary: fixes bug 35825: Default org/warehouse not sorted properly in profile widget
After the changes introduced on issue #35553, the content of the profile widget fields (role, organization, warehouse) is sorted in the client side. The sorting was already being done when displaying the pick lists, but the value map used by those fields was not being sorted. The default value of the org/warehouse fields when changing the role is the first value of their respective value maps. For this reason, since now the value maps for those fields is always sorted: the OB.User.userInfo object is instantiated with the mentioned value maps sorted by identifier, thanks to the call to 'sortByProperty' added in the user-info.js.ftl template. diffstat: modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/user-info.js.ftl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (21 lines): diff -r 9b4f2a32e438 -r a49574c6de23 modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/user-info.js.ftl --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/user-info.js.ftl Mon Apr 24 12:06:00 2017 +0200 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/user-info.js.ftl Mon Apr 24 18:41:02 2017 +0200 @@ -61,7 +61,7 @@ _identifier: '${roleInfo.organizations[organizationId]}' } <#if organizationId_has_next>,</#if> </#list> - ], + ].sortByProperty('_identifier', true), warehouseOrgMap: [ <#list roleInfo.organizationWarehouses?keys as key> { @@ -73,7 +73,7 @@ _identifier: '${warehouse.warehouseName}' } <#if warehouse_has_next>,</#if> </#list> - ] + ].sortByProperty('_identifier', true) } <#if key_has_next>,</#if> </#list> ] ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits