Hi,
I am using OTRS v3.0.8 configured so that Customers (LDAP-based) can view all other tickets under "Company tickets".
It is done by using a LDAP field, common to every customer, mapped to CustomerID.
Everything works: my only problem is that the Customer History (shown in AgentTicketCustomer, or in AgentTicketPhone after selecting a customer) seems filtered by CustomerID, and not by CustomerUserID.
So for any customer, in his history I get the full list of company tickets, which is slow, and quite useless.
How can I fix this? Is there a SysConfig setting somewhere or should I hack the code?
Thanks for your help.
Customer history filtered by CustomerID
Moderator: crythias
Re: Customer history filtered by CustomerID
I solved my problem by digging into the code and applying the following patch to /opt/otrs/Kernel/Output/HTML/CustomerUserGenericTicket.pm:
=========================================================================================
130c130
< $URL .= ';CustomerID=' . $Self->{LayoutObject}->LinkEncode( $Param{Data}->{UserCustomerID} );
---
> $URL .= ';CustomerUserLogin=' . $Self->{LayoutObject}->LinkEncode( $Param{Data}->{UserLogin} );
146c146
< CustomerID => $Param{Data}->{UserCustomerID},
---
> CustomerUserLogin => $Param{Data}->{UserLogin},
=========================================================================================
Now the customer history correctly shows the history of the customer, and not of all the customers sharing the same CustomerID.
Should I file this as a bug?
=========================================================================================
130c130
< $URL .= ';CustomerID=' . $Self->{LayoutObject}->LinkEncode( $Param{Data}->{UserCustomerID} );
---
> $URL .= ';CustomerUserLogin=' . $Self->{LayoutObject}->LinkEncode( $Param{Data}->{UserLogin} );
146c146
< CustomerID => $Param{Data}->{UserCustomerID},
---
> CustomerUserLogin => $Param{Data}->{UserLogin},
=========================================================================================
Now the customer history correctly shows the history of the customer, and not of all the customers sharing the same CustomerID.
Should I file this as a bug?
-
- Znuny newbie
- Posts: 1
- Joined: 21 Jul 2011, 01:11
- Znuny Version: 3.0
- Real Name: Scott
- Company: Rogue Federal Credit Union
Re: Customer history filtered by CustomerID
Thank you for posting, I was looking for a way to do that. I'm not sure it should be the default behavior, but I think it would be nice if it didn't require editing the source.
However, while that did fix the Open Ticket count under customer information when creating a new ticket, it didn't change the Customer History at the bottom of the page on my installation. All "company" tickets still show up in that list. I made the changes to a copy of the file in the Custom folder, then restarted the web server and OTRS daemons. Were there any other changes you made?
Thank you
However, while that did fix the Open Ticket count under customer information when creating a new ticket, it didn't change the Customer History at the bottom of the page on my installation. All "company" tickets still show up in that list. I made the changes to a copy of the file in the Custom folder, then restarted the web server and OTRS daemons. Were there any other changes you made?
Thank you
-
- Znuny expert
- Posts: 241
- Joined: 06 Feb 2009, 11:15
- Znuny Version: 3.0.x
- Company: Perl-Services.de
- Contact:
Re: Customer history filtered by CustomerID
This would be great: Make it configurable (via SysConfig), create a package and upload it to OPAR (http://opar.perl-services.de)
Need a Perl/OTRS developer? You can contact me at info@perl-services.de
Re: Customer history filtered by CustomerID
Actually I spent a lot of time looking for a solution: in the end I gave up and completely disabled the Customer History (Ticket::Frontend::ShowCustomerTickets).smsearcy wrote:Thank you for posting, I was looking for a way to do that. I'm not sure it should be the default behavior, but I think it would be nice if it didn't require editing the source.
However, while that did fix the Open Ticket count under customer information when creating a new ticket, it didn't change the Customer History at the bottom of the page on my installation. All "company" tickets still show up in that list. I made the changes to a copy of the file in the Custom folder, then restarted the web server and OTRS daemons. Were there any other changes you made?
Thank you
It's a pity because it could be useful to see the actual customer's tickets, and not the full ticket list instead.
The current implementation of the Customer History (when UserCustomerID is used) is definitely buggy IMHO. Should we file this as a bug?
Re: Customer history filtered by CustomerID
Hi,
i recently came across the same issue and found another solution which fixes both problems.
in Kernel/Modules/AgentCustomerSearch.pm
around line 157
inside @ViewableTickets = $Self->{TicketObject}->TicketSearch(
add the following line:
CustomerUserLogin => $CustomerUserID,
you'r file should now look like this:
@ViewableTickets = $Self->{TicketObject}->TicketSearch(
Result => 'ARRAY',
Limit => 250,
SortBy => [$SortBy],
OrderBy => [$OrderBy],
CustomerID => \@CustomerIDs,
CustomerUserLogin => $CustomerUserID,
UserID => $Self->{UserID},
Permission => 'ro',
);
it fixes customer history results
hope this helps
i recently came across the same issue and found another solution which fixes both problems.
in Kernel/Modules/AgentCustomerSearch.pm
around line 157
inside @ViewableTickets = $Self->{TicketObject}->TicketSearch(
add the following line:
CustomerUserLogin => $CustomerUserID,
you'r file should now look like this:
@ViewableTickets = $Self->{TicketObject}->TicketSearch(
Result => 'ARRAY',
Limit => 250,
SortBy => [$SortBy],
OrderBy => [$OrderBy],
CustomerID => \@CustomerIDs,
CustomerUserLogin => $CustomerUserID,
UserID => $Self->{UserID},
Permission => 'ro',
);
it fixes customer history results
hope this helps
Re: Customer history filtered by CustomerID
It definitely helps: with your simple solution the bug is actually fixed now. Thanks!bahavar wrote:Hi,
i recently came across the same issue and found another solution which fixes both problems.
in Kernel/Modules/AgentCustomerSearch.pm
around line 157
inside @ViewableTickets = $Self->{TicketObject}->TicketSearch(
add the following line:
CustomerUserLogin => $CustomerUserID,
hope this helps