Possible bug with Multiple Customer IDs?

I am playing with the multiple customer id feaute. I have noticed that any ticket I submit shows up in both "My Tickets" and "Company Tickets", regardless of the customer id. Example User: Tyler Hepworth Email: tylerh@natr.com CustomerID: tylerh@natr.com CustomerIDs: web Ticket1, From: tylerh@natr.com, customer id: tylerh@natr.com Ticket2, From: tylerh@natr.com, customer id: web Tickets shown in "My Tickets" ------------------------------------------ Ticket1, Ticket2 Tickets shown in "Company Tickets" --------------------------------------------------- Ticket1, Ticket2 Should the correct way to display tickets be?: --------------------------------------------------------------- "My Tickets" - Ticket1 "Company Tickets" - Ticket2 or since Ticket2 technically is my ticket: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2 If there some other explanation for this behavior, please let me know. If this is a bug, I am willing to work up a patch and submit it if you are agreeable to that. Thanks, Tyler Hepworth

Hi Tyler, Tyler Hepworth wrote:
I am playing with the multiple customer id feaute. I have noticed that any ticket I submit shows up in both "My Tickets" and "Company Tickets", regardless of the customer id.
Example
User: Tyler Hepworth Email: tylerh@natr.com CustomerID: tylerh@natr.com CustomerIDs: web
Ticket1, From: tylerh@natr.com, customer id: tylerh@natr.com Ticket2, From: tylerh@natr.com, customer id: web
Tickets shown in "My Tickets" ------------------------------------------ Ticket1, Ticket2
Tickets shown in "Company Tickets" --------------------------------------------------- Ticket1, Ticket2
Should the correct way to display tickets be?: --------------------------------------------------------------- "My Tickets" - Ticket1 "Company Tickets" - Ticket2
or since Ticket2 technically is my ticket: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2
IMO the latest one would be ok. The problem is, in OTRS 1.3 the CustomerIDs includes the primary customer id (see Kernel/System/CustomerUser/*.pm -> CustomerIDs()). I updated the CVS head to work also "just" with secundary customer id's in CustomerIDs(). -=> So if you write you own Kernel/System/CustomerUser/XXX.pm where CustomerIDs() returns just "secundary" customer id's. Or if you modify Kernel/System/CustomerUser/*.pm to not return the primary customer id, the the example would be like this: User: Tyler Hepworth Email: tylerh@natr.com CustomerID: tylerh@natr.com CustomerIDs: web Ticket1, From: tylerh@natr.com, customer id: tylerh@natr.com Ticket2, From: tylerh@natr.com, customer id: web Then the cp view is: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2
If there some other explanation for this behavior, please let me know.
If this is a bug, I am willing to work up a patch and submit it if you are agreeable to that.
Any patches are welcome. (Just in this case i was think that it was easier to do it driectly.) :)
Tyler Hepworth
Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

or since Ticket2 technically is my ticket: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2
IMO the latest one would be ok.
The problem is, in OTRS 1.3 the CustomerIDs includes the primary customer id (see Kernel/System/CustomerUser/*.pm -> CustomerIDs()).
I updated the CVS head to work also "just" with secundary customer id's in CustomerIDs().
-=> So if you write you own Kernel/System/CustomerUser/XXX.pm where CustomerIDs() returns just "secundary" customer id's. Or if you modify Kernel/System/CustomerUser/*.pm to not return the primary customer id, the the example would be like this:
User: Tyler Hepworth Email: tylerh@natr.com CustomerID: tylerh@natr.com CustomerIDs: web
Ticket1, From: tylerh@natr.com, customer id: tylerh@natr.com Ticket2, From: tylerh@natr.com, customer id: web
Then the cp view is: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2
If there some other explanation for this behavior, please let me know.
If this is a bug, I am willing to work up a patch and submit it if you are agreeable to that.
Any patches are welcome. (Just in this case i was think that it was easier to do it driectly.) :)
Hi Martin, I have created a patch that gives the view that you think is okay (and I like as well). My Tickets: ticket 1,2 Company Tickets: ticket 2 Instead of messing with CustomerUser/*.pm, I just added an extra param to CustomerTicketOverview. If the param exists when Ticket.pm is generating @CustomerIDs, pop off the end value (which is the primary id). It works a treat! I hope you like it. Tyler

Hi Tyler, fine. I added a config option to the CustomerUser config options where you can turn on/off this: [...] $Self->{CustomerUser} = { Name => 'Database Backend', Module => 'Kernel::System::CustomerUser::DB', [...] # show now own tickets in customer panel, CompanyTickets CustomerUserExcludePrimaryCustomerID => 1, [...] }; [...] (in cvs head) Thanks, -Martin Tyler Hepworth wrote:
or since Ticket2 technically is my ticket: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2
IMO the latest one would be ok.
The problem is, in OTRS 1.3 the CustomerIDs includes the primary customer id (see Kernel/System/CustomerUser/*.pm -> CustomerIDs()).
I updated the CVS head to work also "just" with secundary customer id's in CustomerIDs().
-=> So if you write you own Kernel/System/CustomerUser/XXX.pm where CustomerIDs() returns just "secundary" customer id's. Or if you modify Kernel/System/CustomerUser/*.pm to not return the primary customer id, the the example would be like this:
User: Tyler Hepworth Email: tylerh@natr.com CustomerID: tylerh@natr.com CustomerIDs: web
Ticket1, From: tylerh@natr.com, customer id: tylerh@natr.com Ticket2, From: tylerh@natr.com, customer id: web
Then the cp view is: ----------------------------------------------------------- "My Tickets" - Ticket1, Ticket2 "Company Tickets" - Ticket2
If there some other explanation for this behavior, please let me know.
If this is a bug, I am willing to work up a patch and submit it if you are agreeable to that.
Any patches are welcome. (Just in this case i was think that it was easier to do it driectly.) :)
Hi Martin,
I have created a patch that gives the view that you think is okay (and I like as well).
My Tickets: ticket 1,2 Company Tickets: ticket 2
Instead of messing with CustomerUser/*.pm, I just added an extra param to CustomerTicketOverview. If the param exists when Ticket.pm is generating @CustomerIDs, pop off the end value (which is the primary id). It works a treat! I hope you like it.
Tyler
------------------------------------------------------------------------
Index: Kernel/Modules/CustomerTicketOverView.pm =================================================================== --- Kernel/Modules/CustomerTicketOverView.pm (revision 4) +++ Kernel/Modules/CustomerTicketOverView.pm (working copy) @@ -126,6 +126,7 @@ SortBy => $Self->{SortBy},
CustomerUserID => $Self->{UserID}, + ExcludePrimaryCustID => '1', Permission => 'ro', ); }
------------------------------------------------------------------------
Index: Kernel/System/Ticket.pm =================================================================== --- Kernel/System/Ticket.pm (revision 4) +++ Kernel/System/Ticket.pm (working copy) @@ -1762,6 +1762,7 @@ Cached => 1, ); my @CustomerIDs = $Self->{CustomerUserObject}->CustomerIDs(User => $Param{CustomerUserID}); + pop @CustomerIDs if $Param{ExcludePrimaryCustID}; $SQLExt .= " AND st.customer_id IN ('${\(join '\', \'' , @CustomerIDs)}') "; } if ($Param{UserID} && $Param{UserID} == 1) {
------------------------------------------------------------------------
_______________________________________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
-- Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

Quoting Martin Edenhofer

Hi Joaquim, Joaquim Homrighausen wrote:
Quoting Martin Edenhofer
: Martin, is CVS-HEAD stable as far as the database is concerned? i.e. is it frozen?
No, the current cvs head is ot stable. Because of many new features. And there are a few new feature in the pipe (e. g. otrs package manager [install/deinstall/update otrs applications like calender, file manager] and a web based config editor.). I would say it's stable in around two months.
-joho
Martin -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
participants (3)
-
Joaquim Homrighausen
-
Martin Edenhofer
-
Tyler Hepworth