477 report tweaks
[freeside.git] / httemplate / view / elements / svc_Common.html
index 997ac14..b12d2dd 100644 (file)
@@ -50,6 +50,14 @@ function areyousure(href) {
 
 % } 
 
+% if ( $opt{radius_usage} ) {
+    <& svc_radius_usage.html,
+              'svc'      => $svc_x,
+              'part_svc' => $part_svc,
+              'cust_pkg' => $cust_pkg,
+    &>
+% }
+
 <% mt('Service #') |h %><B><% $svcnum %></B>
 % if ( $custnum ) {
 %   my $url = $opt{'edit_url'} || $p. 'edit/'. $opt{'table'}. '.cgi?';
@@ -70,12 +78,12 @@ function areyousure(href) {
 %       my $hack_strict_refs = \&{ $f->{'value_callback'} };
 %       $value = &$hack_strict_refs($svc_x);
 %     } else {
-%       $value = exists($f->{'value'}) ? $f->{'value'} : $svc_x->$field;
+%       $value = encode_entities($svc_x->$field);
 %     }
 %   } else {
 %     $field = $f;
 %     $type = 'text';
-%     $value = $svc_x->$field;
+%     $value = encode_entities($svc_x->$field);
 %   }
 %
 %   my $columndef = $part_svc->part_svc_column($field);
@@ -97,9 +105,14 @@ function areyousure(href) {
           %>
         </TD>
 
-%      $value = time2str($date_format,$value) if ( $type eq 'date' && $value );
-%      $value = time2str("$date_format %H:%M",$value) if ( $type eq 'datetime' && $value );
-%      $value = $value eq 'Y' ? emt('Yes') : emt('No') if ( $type eq 'checkbox' );
+%      $value = time2str($date_format,$value)
+%         if $type eq 'date' && $value;
+%      $value = time2str("$date_format %H:%M",$value)
+%         if $type eq 'datetime' && $value;
+%      $value = $value eq 'Y' ? emt('Yes') : emt('No')
+%         if $type eq 'checkbox';
+%       $value .= ' ('. (Net::MAC::Vendor::lookup($value))->[0]. ')'
+%         if $type =~ /mac_addr$/ && $value =~ /\w/i;
 %       #eventually more options for <SELECT>, etc. fields
 
         <TD BGCOLOR="#ffffff"><% $value %><TD>
@@ -119,6 +132,11 @@ function areyousure(href) {
 
 <BR>
 
+<& svc_devices.html,
+     'svc_x' => $svc_x,
+     'table' => $svc_x->device_table,
+&>
+
 % if ( defined($opt{'html_foot'}) ) {
 
   <% ref($opt{'html_foot'})
@@ -207,6 +225,20 @@ if ($pkgnum) {
   $custnum = '';
 }
 
+# attached routers
+if ( my $router = qsearchs('router', { svcnum => $svc_x->svcnum }) ) {
+  push @$fields, qw(router_routername router_block);
+  $labels->{'router_routername'} = 'Attached router';
+  $labels->{'router_block'} = 'Attached address block';
+  $svc_x->set('router_routername', $router->routername);
+  my $block = qsearchs('addr_block', { routernum => $router->routernum });
+  if ( $block ) {
+    $svc_x->set('router_block', $block->cidr);
+  } else {
+    $svc_x->set('router_block', '<i>(none)</i>');
+  }
+}
+
 &{ $opt{'svc_callback'} }( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, \%opt ) 
     if $opt{'svc_callback'};
 </%init>