[freeside-commits] branch FREESIDE_3_BRANCH updated. 985c3b8c9f29f25c57e4ae8b01cc0e8d19a78405

Ivan ivan at 420.am
Sun Sep 8 23:10:19 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  985c3b8c9f29f25c57e4ae8b01cc0e8d19a78405 (commit)
      from  6cd0b2ba573ff345de8093ab8c7caeb3f49cf033 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 985c3b8c9f29f25c57e4ae8b01cc0e8d19a78405
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Sep 8 23:10:16 2013 -0700

    don't reinitialized RT on service unprovision, RT#24767

diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index 6aa254f..7946a88 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -1,7 +1,7 @@
 package FS::cust_svc;
 
 use strict;
-use vars qw( @ISA $DEBUG $me $ignore_quantity );
+use vars qw( @ISA $DEBUG $me $ignore_quantity $conf $ticket_system );
 use Carp;
 #use Scalar::Util qw( blessed );
 use FS::Conf;
@@ -25,6 +25,12 @@ $me = '[cust_svc]';
 
 $ignore_quantity = 0;
 
+#ask FS::UID to run this stuff for us later
+FS::UID->install_callback( sub { 
+  $conf = new FS::Conf;
+  $ticket_system = $conf->config('ticket_system')
+});
+
 sub _cache {
   my $self = shift;
   my ( $hashref, $cache ) = @_;
@@ -103,15 +109,19 @@ record - you should probably use the B<cancel> method instead.
 
 =cut
 
+my $rt_session;
+
 sub delete {
   my $self = shift;
   my $error = $self->SUPER::delete;
   return $error if $error;
 
-  if ( FS::Conf->new->config('ticket_system') eq 'RT_Internal' ) {
-    FS::TicketSystem->init;
-    my $session = FS::TicketSystem->session;
-    my $links = RT::Links->new($session->{CurrentUser});
+  if ( $ticket_system eq 'RT_Internal' ) {
+    unless ( $rt_session ) {
+      FS::TicketSystem->init;
+      $rt_session = FS::TicketSystem->session;
+    }
+    my $links = RT::Links->new($rt_session->{CurrentUser});
     my $svcnum = $self->svcnum;
     $links->Limit(FIELD => 'Target', 
                   VALUE => 'freeside://freeside/cust_svc/'.$svcnum);

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_svc.pm |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list