From 61a65ecdb3fa33392a258df1e38fc9a37d750b52 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 28 Jun 2011 20:28:32 +0000 Subject: fix fallout from selfservice priority, #13199 --- FS/FS/TicketSystem/RT_Internal.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'FS') diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm index 220b4a011..67554151f 100644 --- a/FS/FS/TicketSystem/RT_Internal.pm +++ b/FS/FS/TicketSystem/RT_Internal.pm @@ -50,7 +50,7 @@ sub access_right { sub session { my( $self, $session ) = @_; - if ( $session && $session->{'Current_User'} ) { + if ( $session && $session->{'Current_User'} ) { # does this even work? warn "$me session: using existing session and CurrentUser: \n". Dumper($session->{'CurrentUser'}) if $DEBUG; @@ -123,16 +123,23 @@ sub _customer_tickets_search { if ( defined( $priority ) ) { my $custom_priority = FS::Conf->new->config('ticket_system-custom_priority_field'); - $rtql .= " AND CF.{$custom_priority} = '$priority'"; + if ( length( $priority ) ) { + $rtql .= " AND CF.{$custom_priority} = '$priority'"; + } + else { + $rtql .= " AND CF.{$custom_priority} IS NULL"; + } } $rtql .= ' AND ( ' . join(' OR ', map { "Status = '$_'" } $self->statuses) . ' )'; + warn "$me _customer_tickets_search:\n$rtql\n" if $DEBUG; $Tickets->FromSQL($rtql); $Tickets->RowsPerPage($limit); + warn "\n\n" . $Tickets->BuildSelectQuery . "\n\n" if $DEBUG > 1; return $Tickets; } @@ -192,7 +199,7 @@ sub _ticket_info { } # make this easy to find if ( $custom_priority ) { - $ticket_info{'_custom_priority'} = $ticket_info{"CF.{$custom_priority}"}; + $ticket_info{'content'} = $ticket_info{"CF.{$custom_priority}"}; } if ( $ss_priority ) { $ticket_info{'_selfservice_priority'} = $ticket_info{"CF.{$ss_priority}"}; -- cgit v1.2.1