[freeside-commits] branch FREESIDE_3_BRANCH updated. 1d1150eeab69e20126c2431500cdefd3157e374e

Mark Wells mark at 420.am
Tue Oct 1 12:32:16 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  1d1150eeab69e20126c2431500cdefd3157e374e (commit)
       via  7c98ebae682487cc2918cee25977b828810b5244 (commit)
      from  2581f5e097f2c4fc95902514bfe473014ce94018 (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 1d1150eeab69e20126c2431500cdefd3157e374e
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Oct 1 12:30:26 2013 -0700

    when a service is deleted, transfer its tickets to the owning customer, #25180

diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index b48e146..002df54 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -113,6 +113,10 @@ my $rt_session;
 
 sub delete {
   my $self = shift;
+
+  my $cust_pkg = $self->cust_pkg;
+  my $custnum = $cust_pkg->custnum if $cust_pkg;
+
   my $error = $self->SUPER::delete;
   return $error if $error;
 
@@ -126,7 +130,15 @@ sub delete {
     $links->Limit(FIELD => 'Target', 
                   VALUE => 'freeside://freeside/cust_svc/'.$svcnum);
     while ( my $l = $links->Next ) {
-      my ($val, $msg) = $l->Delete;
+      my ($val, $msg);
+      if ( $custnum ) {
+        # re-link to point to the customer instead
+        ($val, $msg) =
+          $l->SetTarget('freeside://freeside/cust_main/'.$custnum);
+      } else {
+        # unlinked service
+        ($val, $msg) = $l->Delete;
+      }
       # can't do anything useful on error
       warn "error unlinking ticket $svcnum: $msg\n" if !$val;
     }

commit 7c98ebae682487cc2918cee25977b828810b5244
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Oct 1 12:23:21 2013 -0700

    fix upgrade warning

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 05699de..7412232 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -4252,6 +4252,7 @@ sub tables_hashref {
       ],
       'primary_key' => 'confnum',
       'unique' => [ [ 'modenum', 'locale' ] ],
+      'index'  => [ ],
     },
 
     # name type nullability length default local

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

Summary of changes:
 FS/FS/Schema.pm   |    1 +
 FS/FS/cust_svc.pm |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list