fix links for previous/next period inbound calls, RT#73652
[freeside.git] / fs_selfservice / FS-SelfService / cgi / view_cdr_details.html
index 6d4d847..40eed80 100644 (file)
@@ -1,5 +1,5 @@
-<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('header', 'Call usage for '.
+<%= include('header', ($inbound ? 'Received calls' : 'Dialed calls' ) . 
+                       ' for '.
                        Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $beginning).
                        ' - '.
                        Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $ending)
@@ -9,32 +9,39 @@
 <%= if ( $error ) {
   $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
 } ''; %>
+
 <TABLE WIDTH="100%">
   <TR>
     <TD WIDTH="50%">
-<%= if ($previous < $beginning) {
-    $OUT .= qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;beginning=!;
-    $OUT .= qq!$previous;ending=$beginning">Previous period</A>!;
-    }else{
+<%=
+    $ahref = qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;!;
+    $ahref = qq!inbound=1;! if $inbound;
+    if ($previous < $beginning) {
+      $OUT .= $ahref.
+              qq!beginning=$previous;ending=$beginning">Previous period</A>!;
+    } else {
       '';
-    } %>
+    }
+%>
     </TD>
     <TD  WIDTH="50%" ALIGN="right">
-<%= if ($next > $ending) {
-    $OUT .= qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;beginning=!;
-    $OUT .= qq!$ending;ending=$next">Next period</A>!;
-    }else{
+<%= 
+    if ($next > $ending) {
+      $OUT .= $ahref. qq!beginning=$ending;ending=$next">Next period</A>!;
+    } else {
       '';
-    }%>
+    }
+%>
     </TD>
   </TR>
 </TABLE>
 <TABLE BGCOLOR="#cccccc">
   <TR>
-<%= foreach my $header (@header) {
-      $OUT .= qq(<TH ALIGN="right">$header</TH>);
-    }
+<%= $space = '<TD>&nbsp;</TD>';
+  $OUT .= join($space, 
+    map { '<TH ALIGN="right">'.$_.'</TH>' } 
+    @header
+  )
 %>
   </TR>
 <%= my $total = 0;
@@ -42,7 +49,9 @@
     my $dtotal = 0;
     foreach my $usage ( @usage ) {
       $OUT .= '<TR>';
-      $OUT .= qq(<TD>$_</TD>) foreach @{$usage};
+      $OUT .= join($space,
+        map { "<TD>$_</TD>" } @{$usage}
+      );
       $OUT .= '</TR>';
     }
 %>
@@ -50,5 +59,4 @@
 </TABLE>
 <BR>
 
-</TD></TR></TABLE>
 <%= include('footer') %>