This commit was generated by cvs2svn to compensate for changes in r8593,
[freeside.git] / FS / FS / part_export / prizm.pm
index 3ba1b27..9705440 100644 (file)
@@ -88,7 +88,7 @@ EOT
 sub prizm_command {
   my ($self,$namespace,$method) = (shift,shift,shift);
 
-  eval "use Net::Prizm qw(CustomerInfo PrizmElement);";
+  eval "use Net::Prizm 0.04 qw(CustomerInfo PrizmElement);";
   die $@ if $@;
 
   my $prizm = new Net::Prizm (
@@ -104,7 +104,7 @@ sub prizm_command {
 sub queued_prizm_command {  # subroutine
   my( $url, $user, $password, $namespace, $method, @args ) = @_;
 
-  eval "use Net::Prizm qw(CustomerInfo PrizmElement);";
+  eval "use Net::Prizm 0.04 qw(CustomerInfo PrizmElement);";
   die $@ if $@;
 
   my $prizm = new Net::Prizm (
@@ -200,6 +200,9 @@ sub _export_insert {
 #    }
 #  }
 
+  my $performance_profile = $svc->performance_profile;
+  $performance_profile ||= $svc->cust_svc->cust_pkg->part_pkg->pkg;
+
   my $element_name_length = 50;
   $element_name_length = $1
     if $self->option('element_name_length') =~ /^\s*(\d+)\s*$/;
@@ -211,7 +214,7 @@ sub _export_insert {
                                       $location,
                                       $contact,
                                       sprintf("%032X", $svc->authkey),
-                                      $svc->cust_svc->cust_pkg->part_pkg->pkg,
+                                      $performance_profile,
                                       $svc->vlan_profile,
                                       ($self->option('ems') ? 1 : 0 ),
                                      );
@@ -256,7 +259,7 @@ sub _export_insert {
 
   $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet',
                                      [ $element ],
-                                     $svc->cust_svc->cust_pkg->part_pkg->pkg,
+                                     $performance_profile,
                                      0,
                                      1,
                                     );
@@ -395,6 +398,18 @@ sub _export_replace {
   return $err_or_som
     unless ref($err_or_som);
 
+  my $performance_profile = $new->performance_profile;
+  $performance_profile ||= $new->cust_svc->cust_pkg->part_pkg->pkg;
+
+  $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet',
+                                     [ $element ],
+                                     $performance_profile,
+                                     0,
+                                     1,
+                                    );
+  return $err_or_som
+    unless ref($err_or_som);
+
   '';
 
 }
@@ -463,6 +478,14 @@ sub _export_unsuspend {
   '';
 }
 
+sub export_links {
+  my( $self, $svc, $arrayref ) = ( shift, shift, shift );
+
+  push @$arrayref, '<A HREF="http://'. $svc->ip_addr. '">SM</A>';
+
+  '';
+}
+
 sub queue_statuschange {
   my( $self, $method, $jobs, $svc, @args ) = @_;
 
@@ -492,7 +515,7 @@ sub queue_statuschange {
 sub statuschange {  # subroutine
   my( $url, $user, $password, $method, $mac_addr, @args) = @_;
 
-  eval "use Net::Prizm qw(CustomerInfo PrizmElement);";
+  eval "use Net::Prizm 0.04 qw(CustomerInfo PrizmElement);";
   die $@ if $@;
 
   my $prizm = new Net::Prizm (