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: [EMAIL PROTECTED]
 CustomerID: [EMAIL PROTECTED]
 CustomerIDs: web

 Ticket1, From: [EMAIL PROTECTED], customer id: [EMAIL PROTECTED]
 Ticket2, From: [EMAIL PROTECTED], 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!

_______________________________________________
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

Reply via email to