[Rt-commit] [svn] r1333 - rtir/branches/1.1/html/RTIR/Elements

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Tue Aug 17 10:32:50 EDT 2004


Author: leira
Date: Tue Aug 17 10:32:50 2004
New Revision: 1333

Modified:
   rtir/branches/1.1/html/RTIR/Elements/Type
Log:
Type component should support Queues, not just tickets.

It also now returns the list of states for an "open" ticket...but should this be moved?


Modified: rtir/branches/1.1/html/RTIR/Elements/Type
==============================================================================
--- rtir/branches/1.1/html/RTIR/Elements/Type	(original)
+++ rtir/branches/1.1/html/RTIR/Elements/Type	Tue Aug 17 10:32:50 2004
@@ -22,25 +22,37 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<%$Type%>
 <%INIT>
-my $TicketObj = new RT::Ticket($session{'CurrentUser'});
-$TicketObj = LoadTicket($Ticket);
-my $name = $TicketObj->QueueObj->Name;
-my $Type;
+my $name;
 
-if ($name eq "Incidents") {
-  $Type = "Incident";
-} elsif ($name eq "Incident Reports") {
-  $Type = "Report";
-} elsif ($name eq "Investigations") {
-  $Type = "Investigation";
-} elsif ($name eq "Blocks") {
-  $Type = "Block";
+if ($Ticket) {
+    my $TicketObj = new RT::Ticket($session{'CurrentUser'});
+    $TicketObj = LoadTicket($Ticket);
+    $name = $TicketObj->QueueObj->Name;
+} else {
+    $name = $Queue;
 }
 
+my ($Type, @states);
+if ($Queue eq "Incidents") {
+  $Type = 'Incident';
+  @states = ('new', 'open');
+} elsif ($Queue eq "Incident Reports") {
+  $Type = 'Report';
+  @states = ('new', 'open');
+} elsif ($Queue eq "Investigations") {
+  $Type = 'Investigation';
+  @states = ('open');
+} if ($Queue eq "Blocks") {
+  $Type = 'Block';
+  @states = ('pending activation', 'active', 'pending removal');
+}
+
+return ($Type, @states);
+
 </%INIT>
 
 <%ARGS>
 $Ticket => undef
-</%ARGS>
\ No newline at end of file
+$Queue => undef
+</%ARGS>


More information about the Rt-commit mailing list