fix urls
authorjeff <jeff>
Sat, 5 Jun 2010 05:56:07 +0000 (05:56 +0000)
committerjeff <jeff>
Sat, 5 Jun 2010 05:56:07 +0000 (05:56 +0000)
httemplate/search/477.html
httemplate/search/477partV.html
httemplate/search/477partVI.html
httemplate/search/elements/search-html.html

index bd7fb2d..63eab7a 100755 (executable)
@@ -43,7 +43,7 @@
 %     if ( $part eq 'IA' ) {
 %       for ( my $tech = 0; $tech < scalar(@technology_option); $tech++ ) {
 %         next unless $technology_option[$tech];
-%         my $url = &{$url_mangler}($cgi->self_url, $part);
+%         my $url = &{$url_mangler}($part);
 %         if ( $type eq 'xml' ) {
 <<% 'Part_IA_'. chr(65 + $tech) %>>
 %         }
@@ -57,7 +57,7 @@
 %       if ( $type eq 'xml' ) {
 <<% 'Part_'. uc($part) %>>
 %       }
-%       my $url = &{$url_mangler}($cgi->self_url, $part);
+%       my $url = &{$url_mangler}($part);
 <% include( "477part${part}.html", 'url' => $url ) %>
 %       if ( $type eq 'xml' ) {
 </<% 'Part_'. uc($part) %>>
@@ -83,7 +83,8 @@ my $type = $cgi->param('_type') || 'html';
 my $xlsname = '477report';
 my @technology_option = &FS::Report::FCC_477::parse_technology_option($cgi);
 my $url_mangler = sub {
-  my ($url, $part) = (shift, shift);
+  my $part = shift;
+  my $url = $cgi->url('-path_info' => 1, '-full' => 1);
   $url =~ s/477\./477part$part./;
   $url;
 };
index c6ceac4..885294d 100755 (executable)
@@ -9,7 +9,7 @@
                   'xml_elements'      => [ 'zip codes' ],
                   'no_field_elements' => 1,
                   'fields'            => [ 'zip' ],
-                  'url'               => $opt{url} || $cgi->self_url,
+                  'url'               => $opt{url} || '',
 
               )
 %>
index dbd1703..db572bc 100755 (executable)
@@ -47,7 +47,7 @@
                     [ $link, $link_suffix ],
                     [ $link, $link_suffix ],
                   ],
-                  'url' => $opt{url} || $cgi->self_url,
+                  'url'          => $opt{url} || '',
                   'xml_row_element' => 'Datarow',
               )
 %>
index d8cc2fc..98f9c44 100644 (file)
 %                 $cgi->delete('maxrecords');
 %                 $cgi->param('_dummy', 1);
 
-                  ( show <SELECT NAME="maxrecords" onChange="window.location = '<% $self_url %>;maxrecords=' + this.options[this.selectedIndex].value;">
+                  ( show <SELECT NAME="maxrecords" onChange="window.location = '<% "$self_url?". $cgi->query_string %>;maxrecords=' + this.options[this.selectedIndex].value;">
 
 %                   foreach my $max ( map { $_ * $confmax } qw( 1 5 10 25 ) ) {
                   <OPTION VALUE="<% $max %>" <% ( $maxrecords == $max ) ? 'SELECTED' : '' %>><% $max %></OPTION>
                 Download full results<BR>
 
 %               $cgi->param('_type', "$xlsname.xls" ); 
-                as <A HREF="<% $cgi->self_url %>">Excel spreadsheet</A><BR>
+                as <A HREF="<% "$self_url?". $cgi->query_string %>">Excel spreadsheet</A><BR>
 
 %               $cgi->param('_type', 'csv'); 
-                as <A HREF="<% $cgi->self_url %>">CSV file</A><BR>
+                as <A HREF="<% "$self_url?". $cgi->query_string %>">CSV file</A><BR>
 
 %             if ( defined($opt{xml_elements}) ) {
 %               $cgi->param('_type', 'xml'); 
-                as <A HREF="<% $cgi->self_url %>">XML file</A><BR>
+                as <A HREF="<% "$self_url?". $cgi->query_string %>">XML file</A><BR>
 %             }
 
 %               $cgi->param('_type', 'html-print'); 
-                as <A HREF="<% $cgi->self_url %>">printable copy</A>
+                as <A HREF="<% "$self_url?". $cgi->query_string %>">printable copy</A>
 
               </TD>
 %             $cgi->param('_type', "html" ); 
@@ -464,7 +464,7 @@ my $confmax        = $args{'confmax'};
 my $maxrecords     = $args{'maxrecords'};
 my $offset         = $args{'offset'};
 my %opt            = %{ $args{'opt'} };
-my $self_url       = $opt{'url'} || $cgi->self_url;
+my $self_url       = $opt{'url'} || $cgi->url('-path_info' => 1, '-full' =>1);
 
 my $count_sth = dbh->prepare($opt{'count_query'})
   or die "Error preparing $opt{'count_query'}: ". dbh->errstr;