From 52dbc041b5ba187cc2a503e5ad2d800b1a2e5a1f Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 12 Jan 2007 23:27:09 +0000 Subject: [PATCH] added svc_broadband description which is appended to Site Name in prizm export --- FS/FS/Schema.pm | 1 + FS/FS/part_export/prizm.pm | 12 +++++++++++- FS/FS/svc_broadband.pm | 10 ++++++---- httemplate/edit/svc_broadband.cgi | 17 ++++++++++++++++- httemplate/view/svc_broadband.cgi | 6 ++++++ 5 files changed, 40 insertions(+), 6 deletions(-) diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 9d3eb8060..88bb6acc3 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1161,6 +1161,7 @@ sub tables_hashref { 'svc_broadband' => { 'columns' => [ 'svcnum', 'int', '', '', '', '', + 'description', 'varchar', 'NULL', $char_d, '', '', 'blocknum', 'int', '', '', '', '', 'speed_up', 'int', '', '', '', '', 'speed_down', 'int', '', '', '', '', diff --git a/FS/FS/part_export/prizm.pm b/FS/FS/part_export/prizm.pm index 92f1aec55..711888d1f 100644 --- a/FS/FS/part_export/prizm.pm +++ b/FS/FS/part_export/prizm.pm @@ -118,7 +118,7 @@ sub _export_insert { $err_or_som = $self->prizm_command('NetworkIfService', 'addProvisionedElement', $networkid, $svc->mac_addr, - $name, + $name . " " . $svc->description, $location, $contact, sprintf("%032X", $svc->authkey), @@ -266,7 +266,17 @@ sub _export_replace { grep { exists($freeside2prizm{$_}) } fields( 'svc_broadband' ); + if ($old->description ne $new->description) { + my $cust_main = $old->cust_svc->cust_pkg->cust_main; + my $name = defined($cust_main->dbdef_table->column('ship_last')) + ? $cust_main->ship_name + : $cust_main->name; + push @values, $name . " " . $new->description; + push @names, "Site Name"; + } + my $element = $err_or_som->result->[0]->elementId; + $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfig', [ $element ], \@names, diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm index b047c9a73..ab97ac82c 100755 --- a/FS/FS/svc_broadband.pm +++ b/FS/FS/svc_broadband.pm @@ -93,10 +93,11 @@ sub table_info { 'display_weight' => 50, 'cancel_weight' => 70, 'fields' => { - 'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.', - 'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.', - 'ip_addr' => 'IP address. Leave blank for automatic assignment.', - 'blocknum' => 'Address block.', + 'description' => 'Descriptive label for this particular device.', + 'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.', + 'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.', + 'ip_addr' => 'IP address. Leave blank for automatic assignment.', + 'blocknum' => 'Address block.', }, }; } @@ -193,6 +194,7 @@ sub check { my $error = $self->ut_numbern('svcnum') || $self->ut_foreign_key('blocknum', 'addr_block', 'blocknum') + || $self->ut_textn('description') || $self->ut_number('speed_up') || $self->ut_number('speed_down') || $self->ut_ipn('ip_addr') diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi index 30eb6319f..2a5a6509a 100644 --- a/httemplate/edit/svc_broadband.cgi +++ b/httemplate/edit/svc_broadband.cgi @@ -67,7 +67,8 @@ %my $p1 = popurl(1); % %my ($ip_addr, $speed_up, $speed_down, $blocknum, $mac_addr, -% $latitude, $longitude, $altitude, $vlan_profile, $auth_key) = +% $latitude, $longitude, $altitude, $vlan_profile, $auth_key, +% $description) = % ($svc_broadband->ip_addr, % $svc_broadband->speed_up, % $svc_broadband->speed_down, @@ -78,6 +79,7 @@ % $svc_broadband->altitude, % $svc_broadband->vlan_profile, % $svc_broadband->auth_key, +% $svc_broadband->description, % ); % % @@ -99,6 +101,19 @@ Service #<%$svcnum ? $svcnum : "(NEW)"%>

<%&ntable("#cccccc",2)%> + Description + +% if ( $part_svc->part_svc_column('description')->columnflag eq 'F' ) { + + <%$description%> +% } else { + + +% } + + + + IP Address % if ( $part_svc->part_svc_column('ip_addr')->columnflag eq 'F' ) { diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 010439e90..cfece5cb4 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -39,6 +39,7 @@ % $altitude, % $vlan_profile, % $auth_key, +% $description, % ) = ( % $router->getfield('routername'), % $router->getfield('routernum'), @@ -53,6 +54,7 @@ % $svc_broadband->altitude, % $svc_broadband->vlan_profile, % $svc_broadband->auth_key, +% $svc_broadband->description, % ); % @@ -79,6 +81,10 @@ <%$svcnum%> + Description + <%$description%> + + Router <%$routernum%>: <%$routername%> -- 2.11.0