Log in / create account
View source | Discuss page | Page history | Printable version   
ADVERTISEMENT
Accounting eLearning Courses
Partnerships
SourceForge.net Logo
Openbravo ERP at SourceForge

SourceForge.net Logo
Openbravo POS at SourceForge

Open Solution Alliance Logo
Openbravo at Open Solutions Alliance

DisplayRoleInMenu

Code snippet

Name: Display Role Name in the Menu
Version: Openbravo 2.35 & 2.40
Author: Rok Lenardic



Rating :
5.00/5
(1 votes cast)
You have to be registered to be able to vote

To display the rolename currently selected by the logged in user next to the username in the leftside menu, update the following two files:

<SqlMethod name="getRoleName" type="preparedStatement" return="String" default="">
  <SqlMethodComment></SqlMethodComment>
  <Sql>
    SELECT NAME
    FROM AD_ROLE
    WHERE AD_Role_ID = ?
  </Sql>
  <Parameter name="adRoleId"/>
</SqlMethod>
xmlDocument.setParameter("userName", MenuData.getUserName(this, vars.getUser()) + " (" + MenuData.getRoleName(this, vars.getRole()) + ")");

Then, compile the manual code from the commandline, positioned inside the OpenbravoERP/AppsOpenbravo:

ant compile.development -Dtab=XXX


Enjoy!

Retrieved from "http://wiki.openbravo.com/wiki/DisplayRoleInMenu"

This page has been accessed 386 times. This page was last modified 08:36, 22 June 2008. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.


Category: Code Snippets