[Rt-commit] r6282 - in rtir/branches/2.1-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 25 07:44:17 EDT 2006


Author: ruz
Date: Wed Oct 25 07:44:16 2006
New Revision: 6282

Modified:
   rtir/branches/2.1-EXPERIMENTAL/   (props changed)
   rtir/branches/2.1-EXPERIMENTAL/UPGRADING
   rtir/branches/2.1-EXPERIMENTAL/etc/upgrade/1.9.0/content

Log:
 r1689 at cubic-pc (orig r6151):  ruz | 2006-10-04 05:03:43 +0400
 * autoreply scrips apgrade


Modified: rtir/branches/2.1-EXPERIMENTAL/UPGRADING
==============================================================================
--- rtir/branches/2.1-EXPERIMENTAL/UPGRADING	(original)
+++ rtir/branches/2.1-EXPERIMENTAL/UPGRADING	Wed Oct 25 07:44:16 2006
@@ -47,7 +47,12 @@
 the NewMessage template.
 
 3) A new template has been added - 'BlockRemoved' in the Blocks
-queue.
+queue. Check its content.
+
+4) NotifyOnLaunch and NotifyOnCreate scrips have been deleted in
+the Implementations and the Blocks queues respectively. You have to
+use the default RT's Autoreply scrip instead or create autoreply
+scrips in these queues.
 
 Upgrading from RTIR 1.1.3
 -------------------------

Modified: rtir/branches/2.1-EXPERIMENTAL/etc/upgrade/1.9.0/content
==============================================================================
--- rtir/branches/2.1-EXPERIMENTAL/etc/upgrade/1.9.0/content	(original)
+++ rtir/branches/2.1-EXPERIMENTAL/etc/upgrade/1.9.0/content	Wed Oct 25 07:44:16 2006
@@ -1,8 +1,49 @@
+sub get_queue {
+    my $meta = shift;
+    my $obj = RT::Queue->new( $RT::SystemUser );
+    $obj->LoadByCols( ref $meta? %$meta: ( Name => $meta ) );
+    unless( $obj->id ) {
+        print STDERR "Couldn't load queue.";
+        return;
+    }
+    return $obj;
+
+}
+sub get_scrip {
+    my $meta = shift;
+    $meta = { Description => $meta } unless ref $meta;
+
+    if ( $meta->{'Queue'} && $meta->{'Queue'} !~ /^\d+$/ ) {
+        my $queue = get_queue( $meta->{'Queue'} ) or return;
+        $meta->{'Queue'} = $queue->id;
+    }
+
+    my $obj = RT::Scrip->new( $RT::SystemUser );
+    $obj->LoadByCols( %$meta );
+    unless( $obj->id ) {
+        print STDERR "Couldn't load scrip.";
+        return;
+    }
+    return $obj;
+}
+
+sub delete_scrip {
+    my $obj = get_scrip( @_ ) or return;
+    # Delete has no return value
+    my ($status, $msg) = $obj->Delete;
+    print "Deleted scrip #". $obj->id .": ". $obj->Description ."\n";
+}
+
 @Initial = ( sub {
     eval { require RT::FM; };
     if ($@) {
         die "RTIR is built on top of RTFM; please install RTFM before continuing.\n";
     }
+}, sub {
+    delete_scrip( { Description => 'NotifyOnLaunch', Queue => 'Investigations' } );
+    delete_scrip( { Description => 'NotifyOnCreate', Queue => 'Blocks' } );
+
+    
 } );
 
 @CustomFields = (


More information about the Rt-commit mailing list