[Rt-commit] r5124 - in rtir/branches/1.9-EXPERIMENTAL:
html/RTIR/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Wed Apr 26 20:11:56 EDT 2006
Author: ruz
Date: Wed Apr 26 20:11:56 2006
New Revision: 5124
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents
Log:
r1391 at cubic-pc: cubic | 2006-04-27 04:19:44 +0400
* don't display 'unlink' action when Block is linked to one incident only
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents Wed Apr 26 20:11:56 2006
@@ -24,7 +24,7 @@
%# END LICENSE BLOCK
% while (my $incident = $incidents->Next) {
% $count++;
-% unless ( $action ) {
+% if ( $show_unlink ) {
<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $Ticket->Id %>&DeleteLink--MemberOf-<% $incident->Id %>=1">[<% loc('Unlink') %>]</a>
% }
<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $incident->Id %>"><% $incident->Id %>: <% $incident->Subject %></a> <i>(<& /RTIR/Elements/ShowRTIRField, Ticket => $incident, Name => 'State' &>)</i>
@@ -62,6 +62,14 @@
}
}
+my $show_unlink = !$action;
+if ( $show_unlink && $Ticket->QueueObj->Name eq 'Blocks' ) {
+ my $query = "Queue = 'Incidents' AND HasMember = " . $Ticket->Id;
+ my $incidents = new RT::Tickets( $session{'CurrentUser'} );
+ $incidents->FromSQL( $query );
+ $show_unlink = 0 unless $incidents->Count > 1;
+}
+
</%INIT>
<%ARGS>
More information about the Rt-commit
mailing list