date editing fix, fallout from date_format
[freeside.git] / httemplate / view / svc_phone.cgi
index 09d5be4..76ee739 100644 (file)
@@ -1,15 +1,11 @@
 <% include('elements/svc_Common.html',
               'table'     => 'svc_phone',
-              'fields'    => [qw(
-                                  countrycode
-                                  phonenum
-                                  sip_password
-                                  pin
-                                  phone_name
-                             )],
+              'fields'    => \@fields,
               'labels'    => {
                                'countrycode'  => 'Country code',
                                'phonenum'     => 'Phone number',
+                               'domain'       => 'Domain',
+                               'pbx_title'    => 'PBX',
                                'sip_password' => 'SIP password',
                                'pin'          => 'PIN',
                                'phone_name'   => 'Name',
 %>
 <%init>
 
+my $conf = new FS::Conf;
+
+my @fields = qw( countrycode phonenum );
+push @fields, 'domain' if $conf->exists('svc_phone-domain');
+push @fields, qw( pbx_title sip_password pin phone_name );
+
 my $html_foot = sub {
   my $svc_phone = shift;
 
@@ -56,6 +58,7 @@ my $html_foot = sub {
             '<TH CLASS="grid" BGCOLOR="#cccccc">Type</TH>'.
             '<TH CLASS="grid" BGCOLOR="#cccccc">MAC Addr</TH>'.
             '<TH CLASS="grid" BGCOLOR="#cccccc"></TH>'.
+            '<TH CLASS="grid" BGCOLOR="#cccccc"></TH>'.
           '</TR>';
       my $bgcolor1 = '#eeeeee';
       my $bgcolor2 = '#ffffff';
@@ -71,10 +74,12 @@ my $html_foot = sub {
         my $td = qq(<TD CLASS="grid" BGCOLOR="$bgcolor">);
 
         my $devicenum = $phone_device->devicenum;
+        my $export_links = join( '<BR>', @{ $phone_device->export_links } );
 
         $devices .= '<TR>'.
                       $td. $phone_device->part_device->devicename. '</TD>'.
                       $td. $phone_device->mac_addr. '</TD>'.
+                      $td. $export_links. '</TD>'.
                       "$td( ".
                         qq(<A HREF="${p}edit/phone_device.html?$devicenum">edit</A> | ).
                         qq(<A HREF="javascript:areyousure('${p}misc/delete-phone_device.html?$devicenum')">delete</A>).
@@ -107,11 +112,11 @@ my $html_foot = sub {
   #  "View $_ CDRs</A>";
   #} keys(%what);
   my @links = map {
-    qq(<A HREF="${p}search/cdr.html?cdrbatch=__ALL__;charged_party=$number;freesidestatus=$what{$_}">).
+    qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;charged_party=$number;freesidestatus=$what{$_}">).
     "View $_ CDRs</A>";
   } keys(%what);
 
-  my @ilinks = ( qq(<A HREF="${p}search/cdr.html?cdrbatch=__ALL__;dst=$number">).
+  my @ilinks = ( qq(<A HREF="${p}search/cdr.html?cdrbatchnum=__ALL__;dst=$number">).
                  'View incoming CDRs</A>' );
 
   ###