Hello,

I was testing some of the RTIR_CustomFieldsDefaults->{'How Reported'} functionality, and noticed that it didn't work at all (not even as specified).

1. It didn't even set to the default in RTIR_SetHowReported.pm
2. It didn't use RTIR_CustomFieldsDefaults->{'How Reported'}
3. Minor inconsistencies with lib/RT/IR/AdministrationTutorial.pod

I'm using RTIR-2.6 (not the rc), and no upgrades done (plain 2.6 install).

I've attached a diff that
1. reenables the RTIR_SetHowReported.pm functionality per the new CF names
2. enables usage of RTIR_CustomFieldsDefaults->{'How Reported'} (and not just an 
"Email" static value).
3. sets the "Email" value in RTIR_Config.pm, so the default is kept as it was
4. addresses some of the minor inconsistencies in AdministrationTutorial.pod

--
Kind regards
Michal Wodzinski, DK-CERT (UNI-C)
3587 8817 / 2483 2451
PGP Key ID: 0x67AF700C (hkp://pgp.mit.edu)
diff -r -u RT-IR-2.6.0.old/etc/RTIR_Config.pm RT-IR-2.6.0/etc/RTIR_Config.pm
--- RT-IR-2.6.0.old/etc/RTIR_Config.pm	2010-11-05 01:24:39.000000000 +0100
+++ RT-IR-2.6.0/etc/RTIR_Config.pm	2011-01-07 13:45:45.242119561 +0100
@@ -71,7 +71,7 @@
         InHours    => 'Full service',
         OutOfHours => 'Full service: out of hours',
     },
-    'How Reported'  => "",
+    'How Reported'  => "Email",
     'Reporter Type' => "",
     IP              => "",
     Netmask         => "",
diff -r -u RT-IR-2.6.0.old/lib/RT/Action/RTIR_SetHowReported.pm RT-IR-2.6.0/lib/RT/Action/RTIR_SetHowReported.pm
--- RT-IR-2.6.0.old/lib/RT/Action/RTIR_SetHowReported.pm	2010-11-05 01:24:39.000000000 +0100
+++ RT-IR-2.6.0/lib/RT/Action/RTIR_SetHowReported.pm	2011-01-07 13:35:08.262709886 +0100
@@ -73,12 +73,12 @@
     my $self = shift;
 
     my $cf = RT::CustomField->new($self->TransactionObj->CurrentUser);
-    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => 'HowReported');
+    $cf->LoadByNameAndQueue(Queue => $self->TicketObj->QueueObj->Id, Name => 'How Reported');
     return unless $cf->Id;
 
     my $Values = $self->TicketObj->CustomFieldValues( $cf->id );
     unless ( $Values->Count ) {
-        $self->TicketObj->AddCustomFieldValue( Field => $cf->id, Value => "Email" );
+        $self->TicketObj->AddCustomFieldValue( Field => $cf->id, Value => RT->Config->Get('RTIR_CustomFieldsDefaults')->{'How Reported'} );
     }
     return 1;
 }
diff -r -u RT-IR-2.6.0.old/lib/RT/IR/AdministrationTutorial.pod RT-IR-2.6.0/lib/RT/IR/AdministrationTutorial.pod
--- RT-IR-2.6.0.old/lib/RT/IR/AdministrationTutorial.pod	2010-11-05 01:24:39.000000000 +0100
+++ RT-IR-2.6.0/lib/RT/IR/AdministrationTutorial.pod	2011-01-07 13:29:42.430126555 +0100
@@ -54,7 +54,7 @@
 
 The type of Incident, such as system compromise or denial of service
 
-=item HowReported
+=item How Reported
 
 How the IR got into RTIR
 
@@ -219,7 +219,7 @@
 =item SetHowReported
 
 Applies to the Incident Reports queue.
-On Ticket creation, set the HowReported Custom Field to a default
+On Ticket creation, set the How Reported Custom Field to a default
 value of Email if it wasn't otherwise specified.
 
 =item SetRTIRState
_______________________________________________
Rtir mailing list
[email protected]
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rtir

Reply via email to