[Rt-commit] r7377 -
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Tue Mar 27 14:48:27 EDT 2007
Author: ruz
Date: Tue Mar 27 14:48:26 2007
New Revision: 7377
Modified:
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/UpdateData
Log:
* search for siblings only when there is a parent
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/UpdateData
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/UpdateData (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/UpdateData Tue Mar 27 14:48:26 2007
@@ -74,14 +74,19 @@
}
}
-my $siblings_query = "Queue = 'Incident Reports'"
- ." AND (". join( ' OR ', map "MemberOf = $_", @parents ) . ")";
-if ( $type eq 'Report' ) {
- $siblings_query .= " AND id != ". $Ticket->id;
-}
-
my $siblings = RT::Tickets->new( $Ticket->CurrentUser );
-$siblings->FromSQL( $siblings_query );
+if ( @parents ) {
+ my $siblings_query = "Queue = 'Incident Reports'"
+ ." AND (". join( ' OR ', map "MemberOf = $_", @parents ) . ")";
+
+ if ( $type eq 'Report' ) {
+ $siblings_query .= " AND id != ". $Ticket->id;
+ }
+
+ $siblings->FromSQL( $siblings_query );
+} else {
+ $siblings->FromSQL("id = 0");
+}
my $Format = q{
'<b><a HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
More information about the Rt-commit
mailing list