You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by S Munene <mu...@gmail.com> on 2022/05/06 10:07:57 UTC

The HR application tree does not display the correct names of the employees

The HR application tree does not display the correct names of the employees
Clicking on the incorrectly displayed name however brings up the correct employee profile

i believe there is a problem with fuction getCurrentEmployeeDetails in org/apache/ofbiz/humanres/HumanResEvents.java
carrying out the following changes on the function results in correct display
Let me know if i am missing something

Regards
Kamanu

if (UtilValidate.isNotEmpty(emlpfillCtxs)) {
    for (GenericValue emlpfillCtx : emlpfillCtxs ) {
        String memberId = emlpfillCtx.getString("partyId");
        //GenericValue memCtx = EntityQuery.use(delegator).from("Person").where("partyId", partyId).queryOne();
        GenericValue memCtx = EntityQuery.use(delegator).from("Person").where("partyId", memberId).queryOne();
        String title = null;
        if (UtilValidate.isNotEmpty(memCtx)) {
            String firstname = memCtx.getString("firstName");
            String lastname = memCtx.getString("lastName");
            if (UtilValidate.isEmpty(lastname)) {
                lastname = "";
            }
            if (UtilValidate.isEmpty(firstname)) {
                firstname = "";
            }
            title = firstname +" "+ lastname;
        }
        else {
            GenericValue memGroupCtx = EntityQuery.use(delegator).from("PartyGroup").where("partyId", partyId).queryOne();
            if (UtilValidate.isNotEmpty(memGroupCtx)) {
                title = memGroupCtx.getString("groupName");
            }
        }


Re: The HR application tree does not display the correct names of the employees

Posted by S Munene <mu...@gmail.com>.
Thanks a lot for your input.
I have confirmed that the problem is not there in the demo version.
I have also downloaded a fresh version 18:12.05 and could not reproduce the problem either.

I will check whether the problem i have is  related to the fact that i have a multi tenant setup (or even mysql database) and revert.

Thanks for the help

> On 7 May 2022, at 11:34, Hanu Dashottar <hd...@gmail.com> wrote:
> 
> facing same issue
> Thanks & Regards,
> Hanu Dashottar
> 
> 
> 
> 
> 
> 
> On Fri, May 6, 2022 at 3:35 PM S Munene <mu...@gmail.com> wrote:
> 
>> The HR application tree does not display the correct names of the employees
>> Clicking on the incorrectly displayed name however brings up the correct
>> employee profile
>> 
>> i believe there is a problem with fuction getCurrentEmployeeDetails in
>> org/apache/ofbiz/humanres/HumanResEvents.java
>> carrying out the following changes on the function results in correct
>> display
>> Let me know if i am missing something
>> 
>> Regards
>> Kamanu
>> 
>> if (UtilValidate.isNotEmpty(emlpfillCtxs)) {
>>    for (GenericValue emlpfillCtx : emlpfillCtxs ) {
>>        String memberId = emlpfillCtx.getString("partyId");
>>        //GenericValue memCtx =
>> EntityQuery.use(delegator).from("Person").where("partyId",
>> partyId).queryOne();
>>        GenericValue memCtx =
>> EntityQuery.use(delegator).from("Person").where("partyId",
>> memberId).queryOne();
>>        String title = null;
>>        if (UtilValidate.isNotEmpty(memCtx)) {
>>            String firstname = memCtx.getString("firstName");
>>            String lastname = memCtx.getString("lastName");
>>            if (UtilValidate.isEmpty(lastname)) {
>>                lastname = "";
>>            }
>>            if (UtilValidate.isEmpty(firstname)) {
>>                firstname = "";
>>            }
>>            title = firstname +" "+ lastname;
>>        }
>>        else {
>>            GenericValue memGroupCtx =
>> EntityQuery.use(delegator).from("PartyGroup").where("partyId",
>> partyId).queryOne();
>>            if (UtilValidate.isNotEmpty(memGroupCtx)) {
>>                title = memGroupCtx.getString("groupName");
>>            }
>>        }
>> 
>> 


Re: The HR application tree does not display the correct names of the employees

Posted by Hanu Dashottar <hd...@gmail.com>.
facing same issue
Thanks & Regards,
Hanu Dashottar






On Fri, May 6, 2022 at 3:35 PM S Munene <mu...@gmail.com> wrote:

> The HR application tree does not display the correct names of the employees
> Clicking on the incorrectly displayed name however brings up the correct
> employee profile
>
> i believe there is a problem with fuction getCurrentEmployeeDetails in
> org/apache/ofbiz/humanres/HumanResEvents.java
> carrying out the following changes on the function results in correct
> display
> Let me know if i am missing something
>
> Regards
> Kamanu
>
> if (UtilValidate.isNotEmpty(emlpfillCtxs)) {
>     for (GenericValue emlpfillCtx : emlpfillCtxs ) {
>         String memberId = emlpfillCtx.getString("partyId");
>         //GenericValue memCtx =
> EntityQuery.use(delegator).from("Person").where("partyId",
> partyId).queryOne();
>         GenericValue memCtx =
> EntityQuery.use(delegator).from("Person").where("partyId",
> memberId).queryOne();
>         String title = null;
>         if (UtilValidate.isNotEmpty(memCtx)) {
>             String firstname = memCtx.getString("firstName");
>             String lastname = memCtx.getString("lastName");
>             if (UtilValidate.isEmpty(lastname)) {
>                 lastname = "";
>             }
>             if (UtilValidate.isEmpty(firstname)) {
>                 firstname = "";
>             }
>             title = firstname +" "+ lastname;
>         }
>         else {
>             GenericValue memGroupCtx =
> EntityQuery.use(delegator).from("PartyGroup").where("partyId",
> partyId).queryOne();
>             if (UtilValidate.isNotEmpty(memGroupCtx)) {
>                 title = memGroupCtx.getString("groupName");
>             }
>         }
>
>

Re: The HR application tree does not display the correct names of the employees

Posted by Jacques Le Roux <ja...@les7arts.com>.
Ah, also you may have been confused by the fact that few demo data contain employees with partyId equal to name.
But you can't create such data with the OOTB UI. The partyId is a number automatically created.

Le 07/05/2022 à 09:57, Jacques Le Roux a écrit :
> Hi Kamanu,
>
> Fist please don't hijack a thread (here "CSP HTTP header causes console errors") to send your messages.
> Rather create a new one by sending your own created email and not responding to an existing one, TIA.
>
> I tried but could not reproduce. Please reproduce the issue on the demo site. When your do so remember that the changes are swiped every day at 3 UTC.
>
> Also then please follow https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Contributors+Best+Practices
> TL;DR: create a Jira and attach a patch. An uploaded image there could also fits rather than reproducing on demo site...
>
> HTH
>
> Jacques
>
> Le 06/05/2022 à 12:07, S Munene a écrit :
>> The HR application tree does not display the correct names of the employees
>> Clicking on the incorrectly displayed name however brings up the correct employee profile
>>
>> i believe there is a problem with fuction getCurrentEmployeeDetails in org/apache/ofbiz/humanres/HumanResEvents.java
>> carrying out the following changes on the function results in correct display
>> Let me know if i am missing something
>>
>> Regards
>> Kamanu
>>
>> if (UtilValidate.isNotEmpty(emlpfillCtxs)) {
>>      for (GenericValue emlpfillCtx : emlpfillCtxs ) {
>>          String memberId = emlpfillCtx.getString("partyId");
>>          //GenericValue memCtx = EntityQuery.use(delegator).from("Person").where("partyId", partyId).queryOne();
>>          GenericValue memCtx = EntityQuery.use(delegator).from("Person").where("partyId", memberId).queryOne();
>>          String title = null;
>>          if (UtilValidate.isNotEmpty(memCtx)) {
>>              String firstname = memCtx.getString("firstName");
>>              String lastname = memCtx.getString("lastName");
>>              if (UtilValidate.isEmpty(lastname)) {
>>                  lastname = "";
>>              }
>>              if (UtilValidate.isEmpty(firstname)) {
>>                  firstname = "";
>>              }
>>              title = firstname +" "+ lastname;
>>          }
>>          else {
>>              GenericValue memGroupCtx = EntityQuery.use(delegator).from("PartyGroup").where("partyId", partyId).queryOne();
>>              if (UtilValidate.isNotEmpty(memGroupCtx)) {
>>                  title = memGroupCtx.getString("groupName");
>>              }
>>          }
>>

Re: The HR application tree does not display the correct names of the employees

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Kamanu,

Fist please don't hijack a thread (here "CSP HTTP header causes console errors") to send your messages.
Rather create a new one by sending your own created email and not responding to an existing one, TIA.

I tried but could not reproduce. Please reproduce the issue on the demo site. When your do so remember that the changes are swiped every day at 3 UTC.

Also then please follow https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Contributors+Best+Practices
TL;DR: create a Jira and attach a patch. An uploaded image there could also fits rather than reproducing on demo site...

HTH

Jacques

Le 06/05/2022 à 12:07, S Munene a écrit :
> The HR application tree does not display the correct names of the employees
> Clicking on the incorrectly displayed name however brings up the correct employee profile
>
> i believe there is a problem with fuction getCurrentEmployeeDetails in org/apache/ofbiz/humanres/HumanResEvents.java
> carrying out the following changes on the function results in correct display
> Let me know if i am missing something
>
> Regards
> Kamanu
>
> if (UtilValidate.isNotEmpty(emlpfillCtxs)) {
>      for (GenericValue emlpfillCtx : emlpfillCtxs ) {
>          String memberId = emlpfillCtx.getString("partyId");
>          //GenericValue memCtx = EntityQuery.use(delegator).from("Person").where("partyId", partyId).queryOne();
>          GenericValue memCtx = EntityQuery.use(delegator).from("Person").where("partyId", memberId).queryOne();
>          String title = null;
>          if (UtilValidate.isNotEmpty(memCtx)) {
>              String firstname = memCtx.getString("firstName");
>              String lastname = memCtx.getString("lastName");
>              if (UtilValidate.isEmpty(lastname)) {
>                  lastname = "";
>              }
>              if (UtilValidate.isEmpty(firstname)) {
>                  firstname = "";
>              }
>              title = firstname +" "+ lastname;
>          }
>          else {
>              GenericValue memGroupCtx = EntityQuery.use(delegator).from("PartyGroup").where("partyId", partyId).queryOne();
>              if (UtilValidate.isNotEmpty(memGroupCtx)) {
>                  title = memGroupCtx.getString("groupName");
>              }
>          }
>