[Bio] / Sprout / SearchSkeleton.pm Repository:
ViewVC logotype

Diff of /Sprout/SearchSkeleton.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Wed Sep 3 21:00:28 2008 UTC revision 1.2, Mon Jan 19 21:56:19 2009 UTC
# Line 20  Line 20 
20    
21      use strict;      use strict;
22      use Tracer;      use Tracer;
23      use CGI;      use CGI qw(-nosticky);
24      use Sprout;      use Sprout;
25      use SearchHelper;      use SearchHelper;
26      use POSIX qw(ceil);      use POSIX qw(ceil);
# Line 133  Line 133 
133  =cut  =cut
134    
135  # Global variable containing the names of the parameters that get stored in the status URL.  # Global variable containing the names of the parameters that get stored in the status URL.
136  my @Keepers = qw(SessionID Trace NoForm ResultCount ResultType Page PageSize Class SPROUT Download FavoredAlias);  my @Keepers = qw(SessionID Trace NoForm ResultCount ResultType Page PageSize Class
137                     SPROUT Download FavoredAlias);
138  # Map of old class names to new class names.  # Map of old class names to new class names.
139  my %ClassMap = (BlastSearch => 'ToolSearch', FidSearch => 'GeneSearch');  my %ClassMap = (BlastSearch => 'ToolSearch', FidSearch => 'GeneSearch');
140  # List of searches we want to hide from users. This will go away when we've fixed up the wiki.  # List of searches we want to hide from users. This will go away when we've fixed up the wiki.
141  my %Hidden = (PropSearch => 1);  my %Hidden = (PropSearch => 1, DrugSearch => 1);
142    
143  =head3 Package Methods  =head3 Package Methods
144    
# Line 187  Line 188 
188          # Check for advanced mode.          # Check for advanced mode.
189          if ($cgi->param("Alternate")) {          if ($cgi->param("Alternate")) {
190              Trace("Advanced mode selected.") if T(3);              Trace("Advanced mode selected.") if T(3);
191              # In advanced mode, we list all the search forms listed in              # In advanced mode, we list all the search forms in
192              # $FIG_Config::advanced_class.              # $FIG_Config::advanced_class.
193              my @classes = split(/\s+/, $FIG_Config::advanced_class);              my @classes = split(/\s+/, $FIG_Config::advanced_class);
194              # Set the page size to the default.              # Set the page size to the default.
# Line 197  Line 198 
198              $varHash->{class} = "";              $varHash->{class} = "";
199              # Loop through the classes, creating the table of contents and              # Loop through the classes, creating the table of contents and
200              # the forms.              # the forms.
201              $varHash->{formIndex} = $cgi->h3("Contents") . $cgi->start_ul();              $varHash->{formIndex} = CGI::h3("Contents") . CGI::start_ul();
202              for my $className (@classes) {              for my $className (@classes) {
203                  my $shelp = SearchHelper::GetHelper($cgi, SH => $className);                  my $shelp = SearchHelper::GetHelper($cgi, SH => $className);
204                  # Produce the contents entry.                  # Produce the contents entry.
205                  $varHash->{formIndex} .= $cgi->li($cgi->a({href => "#X$className"}, $className) .                  $varHash->{formIndex} .= CGI::li(CGI::a({href => "#X$className"}, $className) .
206                                                    ": " . $shelp->Description());                                                    ": " . $shelp->Description());
207                  # Produce the bookmark.                  # Produce the bookmark.
208                  $varHash->{form} .= $cgi->a({ name => "X$className" });                  $varHash->{form} .= CGI::a({ name => "X$className" });
209                  # Produce the form.                  # Produce the form.
210                  $varHash->{form} .= $shelp->Form();                  $varHash->{form} .= $shelp->Form();
211                  # Produce the help text.                  # Produce the help text.
# Line 218  Line 219 
219                  $varHash->{formIndex} = "";                  $varHash->{formIndex} = "";
220              } else {              } else {
221                  # Multiple classes, so close the table of contents.                  # Multiple classes, so close the table of contents.
222                  $varHash->{formIndex} .= $cgi->end_ul();                  $varHash->{formIndex} .= CGI::end_ul();
223              }              }
224          } elsif (! $class) {          } elsif (! $class) {
225              Trace("Producing index of search tools.") if T(3);              Trace("Producing index of search tools.") if T(3);
# Line 236  Line 237 
237                  } else {                  } else {
238                      Trace("Processing $className") if T(3);                      Trace("Processing $className") if T(3);
239                      my $shelp = SearchHelper::GetHelper($cgi, SH => $className);                      my $shelp = SearchHelper::GetHelper($cgi, SH => $className);
240                      push @contents, "<a href=\"${selfURL}Class=$className\">$className</a>: " . $shelp->Description();                      push @contents, "<a href=\"${selfURL}Class=$className\">$className</a>: " .
241                            $shelp->Description();
242                  }                  }
243              }              }
244              # Create the table of contents.              # Create the table of contents.
245              Trace("Building index.") if T(3);              Trace("Building index.") if T(3);
246              my $index = $cgi->h3("Index of Search Tools") .              my $index = CGI::h3("Index of Search Tools" .
247                          $cgi->ul($cgi->li(\@contents));                                  SearchHelper::Hint('NmpdrSearch', 'Click for search help.')) .
248                            CGI::ul(CGI::li(\@contents));
249                # Add the main help link.
250              # Store it as the results.              # Store it as the results.
251              $varHash->{results} = $index;              $varHash->{results} = $index;
252              # Tell the template we don't have a class.              # Tell the template we don't have a class.
# Line 260  Line 264 
264              $shelp = SearchHelper::GetHelper($cgi, SH => $class);              $shelp = SearchHelper::GetHelper($cgi, SH => $class);
265              # Tell the template what the class is.              # Tell the template what the class is.
266              $varHash->{class} = $class;              $varHash->{class} = $class;
267                # Generate its header stuff.
268                $varHash->{head} = $shelp->HeaderHtml();
269              # Insure we have a page size.              # Insure we have a page size.
270              if (! $cgi->param("PageSize")) {              if (! $cgi->param("PageSize")) {
271                  $cgi->param(-name => 'PageSize', -value => $FIG_Config::results_per_page);                  $cgi->param(-name => 'PageSize', -value => $FIG_Config::results_per_page);
# Line 296  Line 302 
302                  } else {                  } else {
303                      # If we have a saved search, load its parameters so they show up in the form.                      # If we have a saved search, load its parameters so they show up in the form.
304                      LoadSearchParms($cgi, $shelp);                      LoadSearchParms($cgi, $shelp);
305                      # Display the form, if desired. This absolutely must happen before we do the ShowURL                      # Display the form, if desired. This absolutely must happen before we do the
306                      # thing when we display the results. The form can actually appear after the results,                      # ShowURL thing when we display the results. The form can actually appear
307                      # however, thanks to the template.                      # after the results, however, thanks to the template.
308                      my $formShown = ! $cgi->param("NoForm");                      my $formShown = ! $cgi->param("NoForm");
309                      if (! $cgi->param("NoForm")) {                      if (! $cgi->param("NoForm")) {
310                          Trace("Displaying form.") if T(3);                          Trace("Displaying form.") if T(3);
311                          $varHash->{form} = $shelp->Form();                          $varHash->{form} = $shelp->Form();
312                      }                      }
313                      if (! $shelp->IsNew()) {                      if (! $shelp->IsNew()) {
314                          # We have results                          # We have results, so display them.
315                          $varHash->{results} = DisplayResults($shelp, $rhelp, $cgi);                          $varHash->{results} = DisplayResults($shelp, $rhelp, $cgi);
316                      }                      }
317                      # Save the result count so that the results helper text appears if it                      # Save the result count so that the results helper text appears if it
# Line 320  Line 326 
326                  # results. This prevents the server from giving up if the search takes a long                  # results. This prevents the server from giving up if the search takes a long
327                  # time.                  # time.
328                  Trace("Performing the search.") if T(3);                  Trace("Performing the search.") if T(3);
329                  # Denote we're in searching mode. This means we'll be displaying the HTML as we go along.                  # Save the search parameters so we can display them on the result pages.
330                    Trace("Saving search parameters.") if T(3);
331                    SaveSearchParms($cgi, $shelp);
332                    # Denote we're in searching mode. This means we'll be displaying the HTML
333                    # as we go along.
334                  $mode = "Searching";                  $mode = "Searching";
335                  # Make sure the output is unbuffered.                  # Make sure the output is unbuffered.
336                  $| = 1;                  $| = 1;
337                  # Start the HTML page.                  # Start the HTML page.
338                  print $cgi->header();                  print CGI::header();
339                  print $cgi->start_html(-title => 'NMPDR Search in Progress',                  print CGI::start_html(-title => 'NMPDR Search in Progress',
340                                         -style => { src => "$FIG_Config::cgi_url/wiki/pub/Main/TWikiPreferences/NmpdrStyleOverrides.css" }                                         -style => { src => "$FIG_Config::cgi_url/wiki/pub/Main/TWikiPreferences/NmpdrStyleOverrides.css" }
341                                        );                                        );
342                  # Print the banner.                  # Print the banner.
343                  print $cgi->img({ src => "$FIG_Config::cgi_url/wiki/pub/Main/TWikiPreferences/banner2.png" });                  print CGI::img({ src => "$FIG_Config::cgi_url/wiki/pub/Main/TWikiPreferences/banner2.png" });
344                  # Tell the user the type of this search.                  # Tell the user the type of this search.
345                  print $cgi->h2($shelp->Description()) . "\n";                  print CGI::h2($shelp->SearchTitle()) . "\n";
346                  # Start a paragraph.                  # Start a paragraph.
347                  print "<p>\n";                  print "<p>\n";
348                  # Perform the search.                  # Perform the search.
# Line 341  Line 351 
351                  Trace("Processing results.") if T(3);                  Trace("Processing results.") if T(3);
352                  # End the paragraph.                  # End the paragraph.
353                  print "</p>\n";                  print "</p>\n";
                 # Save the search parameters so we can display them on the result pages.  
                 Trace("Saving search parameters.") if T(3);  
                 SaveSearchParms($cgi, $shelp);  
354                  # Check to see what kind of results we got.                  # Check to see what kind of results we got.
355                  if (! defined($result_count)) {                  if (! defined($result_count)) {
356                      # Here an error occurred, so we display the error message.                      # Here an error occurred, so we display the error message.
357                      $shelp->PrintLine($cgi->h3("ERROR: " . $shelp->Message()));                      $shelp->PrintLine(CGI::h3("ERROR: " . $shelp->Message()));
358                      $result_count = 0;                      $result_count = 0;
359                      $shelp->PrintLine($cgi->p("Use your browser's BACK button to try again."));                      $shelp->PrintLine(CGI::p("Use your browser's BACK button to try again."));
360                  } else {                  } else {
361                      # Here we have results (even though there may be zero of them. Save                      # Here we have results (even though there may be zero of them. Save
362                      # the result count and set up to display the first page of results.                      # the result count and set up to display the first page of results.
# Line 366  Line 373 
373          }          }
374      };      };
375      if ($@) {      if ($@) {
376          my $errorMessage = $@;          # Compute the error message HTML.
377          # Trace the error.          my $message = $@;
378          Trace("Script Error: $errorMessage") if T(0);          $varHash->{results} = FIGRules::NmpdrErrorPage(SearchSkeleton => $message);
         # Store the HTML version of the error message.  
         $varHash->{results} = $cgi->h3("Script Error: $errorMessage");  
379          if ($mode eq "Searching") {          if ($mode eq "Searching") {
380              # Here we've already started the page, so we output the error message immediately.              # Here we've already started the page, so we output the error message immediately.
381              $shelp->PrintLine($varHash->{results});              $shelp->PrintLine($varHash->{results});
382          } elsif ($mode eq "Download") {          } elsif ($mode eq "Download") {
383              print "\n\n*** ERROR: $errorMessage\n";              # A download is in progress, so we have to put an error message in
384                # the download file. Note that we trim off the extra trace garbage
385                # to reduce the yuckiness.
386                my ($realMessage) = split /\n/, $message, 2;
387                print "\n\n*** ERROR: Download failed: $realMessage\n";
388          }          }
389      }      }
390      if ($mode eq "Searching") {      if ($mode eq "Searching") {
391          # We've already started the page, so all we have to do is terminate it.          # We've already started the page, so all we have to do is terminate it.
392          $shelp->PrintLine($cgi->end_html());          $shelp->PrintLine(CGI::end_html());
393      } elsif ($mode eq "Display") {      } elsif ($mode eq "Display") {
394          # Here there's been no output. Print the CGI header.          # Here there's been no output, so we're showing either a form or results.
395            # Print the CGI header. We suppress browser caches so that the javascript
396            # doesn't go haywire on us.
397            print "Cache-Control: no-cache\n";
398          print $cgi->header();          print $cgi->header();
399          # Produce the output using a template.          # Produce the output using a template.
400          print MyPage($varHash);          print MyPage($varHash);
# Line 464  Line 476 
476                  }                  }
477              }              }
478              # Record the parameter.              # Record the parameter.
             Trace("Variable $varKey has value \"$varValue\".") if T(3);  
479              $templateObject->param($varKey => $varValue);              $templateObject->param($varKey => $varValue);
480          }          }
481      }      }
# Line 475  Line 486 
486      # Set the meta-variable values.      # Set the meta-variable values.
487      $template =~ s/%TEXT%/$text/g;      $template =~ s/%TEXT%/$text/g;
488      $template =~ s/%REVTITLE%//g;      $template =~ s/%REVTITLE%//g;
     Trace("Template string is:\n$template") if T(3);  
489      # Expand it.      # Expand it.
490      my $raw = TWiki::Func::expandCommonVariables($template, $title, 'Main');      my $raw = TWiki::Func::expandCommonVariables($template, $title, 'Main');
491      # Render it into HTML.      # Render it into HTML.
# Line 533  Line 543 
543          Confess("Search session has expired. Please resubmit your query.");          Confess("Search session has expired. Please resubmit your query.");
544      } else {      } else {
545          # Write the CGI header.          # Write the CGI header.
546          print $cgi->header(-type => 'application/octet-stream',          print CGI::header(-type => 'application/octet-stream',
547                             -attachment => $defaultName);                             -attachment => $defaultName);
548          # Put us in binary mode so that the output doesn't do screwy stuff with new-lines.          # Put us in binary mode so that the output doesn't do screwy stuff with new-lines.
549          binmode(STDOUT);          binmode(STDOUT);
# Line 648  Line 658 
658      # Check for a title.      # Check for a title.
659      my $title = $shelp->SearchTitle();      my $title = $shelp->SearchTitle();
660      if ($title) {      if ($title) {
661          $title = $cgi->h3($title);          $title = CGI::h3($title);
662      }      }
663      # Extract the result parameters.      # Extract the result parameters.
664      my ($pageSize, $pageNum, $resultCount) = ($cgi->param('PageSize'),      my ($pageSize, $pageNum, $resultCount) = map { $cgi->param($_) } qw(PageSize Page ResultCount);
665                                                $cgi->param('Page'),      my $rhelperClass = $cgi->param('ResultType');
666                                                $cgi->param('ResultCount'));      my $shelperClass = $cgi->param('Class');
667      Trace("Result count is $resultCount on page $pageNum for $pageSize/page.") if T(3);      Trace("Result count is $resultCount on page $pageNum for $pageSize/page.") if T(3);
668      Trace("Preferred ID style is " . $shelp->GetPreferredAliasType() . ".") if T(3);      Trace("Preferred ID style is " . $shelp->GetPreferredAliasType() . ".") if T(3);
669      # Only proceed if there are actual results.      # Only proceed if there are actual results.
670      if ($resultCount <= 0) {      if ($resultCount <= 0) {
671          $retVal .= $cgi->h3("No matches found.");          $retVal .= CGI::h3("No matches found.");
672      } else {      } else {
673          # Check the state of the session file.          # Check the state of the session file.
674          my $fileName = $shelp->GetCacheFileName();          my $fileName = $shelp->GetCacheFileName();
675          if (! -e $fileName) {          if (! -e $fileName) {
676              $retVal .= $cgi->h3("Search session has expired. Please resubmit your query.");              $retVal .= CGI::h3("Search session has expired. Please resubmit your query.");
677          } else {          } else {
678              # The file is here, so we can open it.              # The file is here, so we can open it.
679              my $sessionH = Open(undef, "<$fileName");              my $sessionH = Open(undef, "<$fileName");
# Line 673  Line 683 
683              }              }
684              # Read the column headers.              # Read the column headers.
685              my @colHdrs = $shelp->ReadColumnHeaders($sessionH);              my @colHdrs = $shelp->ReadColumnHeaders($sessionH);
686                if (T(3)) {
687                    Trace(scalar(@colHdrs) . " column headers found.");
688                    for (my $i = 0; $i <= $#colHdrs; $i++) {
689                        my $col = $colHdrs[$i];
690                        $col = "X=$col->{name}" if (ref $col eq 'HASH');
691                        Trace("Column $i is $col.");
692                    }
693                }
694              # Compute the page navigation string.              # Compute the page navigation string.
695              my $formFlag = ($cgi->param('NoForm') ? 0 : 1);              my $formFlag = ($cgi->param('NoForm') ? 0 : 1);
696              my $pageNavigator = PageNavigator($shelp, $formFlag);              my $pageNavigator = PageNavigator($shelp, $formFlag);
# Line 709  Line 727 
727                  }                  }
728              }              }
729              # Start the list of links. The first one is the URL-save link.              # Start the list of links. The first one is the URL-save link.
730              my $downloadScript = $cgi->start_table({ border => "2" });              my $downloadScript = CGI::start_table({ border => "2" });
731              if (! $cgi->param("NoForm")) {              if (! $cgi->param("NoForm")) {
732                  my $searchURL = $shelp->ComputeSearchURL();                  my $searchURL = $shelp->ComputeSearchURL();
733                  $downloadScript .= $cgi->Tr($cgi->td("URL to repeat this search"), $cgi->td($cgi->a({ href => $searchURL }, "Save"))) . "\n";                  # This will only work if the URL is short enough.
734                    if (length $searchURL < 2048) {
735                        $downloadScript .= CGI::Tr(CGI::td("URL to repeat this search (right-click to save)"),
736                                                   CGI::td({ style => 'text-align: center; font-weight: bold' },
737                                                           CGI::a({ href => $searchURL }, "Repeat"))) . "\n";
738                    }
739                }
740                # The remaining links are disguised in buttons using this style string.
741                my $buttonClass = "button button2";
742                # Next is the optional download-to-seedviewer thing.
743                if ($resultCount <= $FIG_Config::max_seedviewer_table) {
744                    my $sessionID = $shelp->ID();
745                    my $svURL = "$FIG_Config::cgi_url/wiki/rest.cgi/NmpdrPlugin/SeedViewer?" .
746                                "page=NmpdrGeneTable;SessionID=$sessionID;PageSize=$pageSize;" .
747                                "Class=$shelperClass;ResultType=$rhelperClass";
748                    $downloadScript .= CGI::Tr(CGI::td("View these results in a [[FIG.InteractiveTable][sortable, expandable table]]"),
749                                               CGI::td({ class => $buttonClass }, CGI::a({ href => $svURL }, "Table View"))) . "\n";
750              }              }
751              # Now compute the download links. This is actually a JavaScript thing, because we need to know              # Now compute the download links. This is actually a JavaScript thing, because we need to know
752              # name of the user's operating system and handle fields inside the link text.              # name of the user's operating system and handle fields inside the link text.
# Line 730  Line 764 
764                      $data =~ /\[(\w+)\]/;                      $data =~ /\[(\w+)\]/;
765                      my ($fieldName) = ($1, $2);                      my ($fieldName) = ($1, $2);
766                      # Generate the text field HTML.                      # Generate the text field HTML.
767                      my $textField = $cgi->textfield(-name => $fieldName, -size => 5,                      my $textField = CGI::textfield(-name => $fieldName, -size => 5,
768                                                      -onKeyUp => "updateAnchor('$dlType', '$fieldName', this.value)");                                                      -onKeyUp => "updateAnchor('$dlType', '$fieldName', this.value)");
769                      # Put it all together.                      # Put it all together.
770                      $dlDesc = "$prefix$textField$suffix";                      $dlDesc = "$prefix$textField$suffix";
771                  }                  }
772                  $downloadScript .= $cgi->Tr($cgi->td("$dlDesc"), $cgi->td($cgi->a({ id => "dlLink$dlType", class => "button2 button" }, "Download"))) . "\n";                  $downloadScript .= CGI::Tr(CGI::td("$dlDesc"), CGI::td({ class => $buttonClass },
773                                                                           CGI::a({ id => "dlLink$dlType" }, "Download"))) . "\n";
774              }              }
775              $downloadScript .=     $cgi->end_table();              $downloadScript .=     CGI::end_table();
776              # Now we create the javascript to fill the URLs into the link anchors. Each URL adds the download              # Now we create the javascript to fill the URLs into the link anchors. Each URL adds the download
777              # type, operating system ID, and data-thing parameters to the link URL. We have one method that              # type, operating system ID, and data-thing parameters to the link URL. We have one method that
778              # initializes all the links, and another that updates a link when a parameter changes.              # initializes all the links, and another that updates a link when a parameter changes.
# Line 765  Line 800 
800              # Now we build the table. Create an array for the row styles.              # Now we build the table. Create an array for the row styles.
801              my @styles = ('even', 'odd');              my @styles = ('even', 'odd');
802              # Start the table.              # Start the table.
803              my @tableLines = ($cgi->start_table({border => 0}));              my @tableLines = (CGI::start_table({border => 0}));
804              # Put in the column headers.              # Put in the column headers.
805              push @tableLines, $cgi->Tr({class => $styles[1]}, map { $cgi->th({ class => $rhelp->ColumnStyle($_) },              push @tableLines, CGI::Tr({class => $styles[1]}, map { CGI::th({ class => $rhelp->ColumnStyle($_) },
806                                                                               $rhelp->ColumnTitle($_)) } @colHdrs );                                                                               $rhelp->ColumnTitle($_)) } @colHdrs );
807              # Start the first data row with the even style.              # Start the first data row with the even style.
808              my $styleMode = 0;              my $styleMode = 0;
# Line 778  Line 813 
813                  # Loop through the cells in this row. We use a numeric index because we're moving through                  # Loop through the cells in this row. We use a numeric index because we're moving through
814                  # the column headers list and the row list in parallel.                  # the column headers list and the row list in parallel.
815                  for (my $i = 0; $i <= $#colHdrs; $i++) {                  for (my $i = 0; $i <= $#colHdrs; $i++) {
816                      push @cells, $cgi->td({class => $rhelp->ColumnStyle($colHdrs[$i]) }, $row->[$i]);                      push @cells, CGI::td({class => $rhelp->ColumnStyle($colHdrs[$i]) }, $row->[$i]);
817                  }                  }
818                  # Push this row into the result list.                  # Push this row into the result list.
819                  push @tableLines, $cgi->Tr({class => $styles[$styleMode]}, @cells);                  push @tableLines, CGI::Tr({class => $styles[$styleMode]}, @cells);
820                  # Flip the style.                  # Flip the style.
821                  $styleMode = 1 - $styleMode;                  $styleMode = 1 - $styleMode;
822              }              }
823              # Close the table.              # Close the table.
824              push @tableLines, $cgi->end_table();              push @tableLines, CGI::end_table();
825              # Assemble the result.              # Assemble the result.
826              my $tableText = join("\n", @tableLines);              my $tableText = join("\n", @tableLines);
827              # Finally, we compute the page label, which contains the page number, the number of results              # Finally, we compute the page label, which contains the page number, the number of results
# Line 802  Line 837 
837              } else {              } else {
838                  $resultCountLine = "Search Results Page $pageNum: $linesFound of $resultCount Results Displayed.";                  $resultCountLine = "Search Results Page $pageNum: $linesFound of $resultCount Results Displayed.";
839              }              }
840              # Now we're ready. We do a the results counter, a page navigator, a spacer, the table, a spacer,              # Check for notices.
841              # and another page navigator.              my $noticeLines = "";
842                my $noticeFileName = $shelp->GetTempFileName('notices');
843                if (-s $noticeFileName) {
844                    # Read them in and format them into a bullet list.
845                    my @lines = Tracer::GetFile($noticeFileName);
846                    $noticeLines = CGI::h4('Notices') . CGI::ul(CGI::li(\@lines));
847                }
848                # Now we're ready. All the little pieces are put together. Note that
849                # the page navigator appears twice.
850              $retVal = join("\n",              $retVal = join("\n",
851                                   $title,                                   $title,
852                                   $downloadScript,                                   $downloadScript,
853                                     $noticeLines,
854                                   $pageNavigator,                                   $pageNavigator,
855                                   $cgi->p("&nbsp;"),                                   CGI::p("&nbsp;"),
856                                   $cgi->h3($resultCountLine),                                   CGI::h3($resultCountLine),
857                                   $tableText,                                   $tableText,
858                                   $cgi->p("&nbsp;"),                                   CGI::p("&nbsp;"),
859                                   $pageNavigator,                                   $pageNavigator,
860                                   "");                                   "");
861          }          }
# Line 1091  Line 1135 
1135  sub LoadSearchParms {  sub LoadSearchParms {
1136      # Get the parameters.      # Get the parameters.
1137      my ($cgi, $shelp) = @_;      my ($cgi, $shelp) = @_;
     # Only proceed if this is an old session. A new session won't have saved parameters.  
     if (! $shelp->IsNew()) {  
1138          # Get the name for the parameters file.          # Get the name for the parameters file.
1139          my $parmFileName = $shelp->GetTempFileName('parms');          my $parmFileName = $shelp->GetTempFileName('parms');
1140          # Only proceed if this is an old  file exists. If the file does not exist,      # Only proceed if the parameter file exists. If the file does not exist,
1141          # we assume all the parameter values are blank and do nothing.          # we assume all the parameter values are blank and do nothing.
1142          if (-f $parmFileName) {          if (-f $parmFileName) {
1143              # Read the parameters file.              # Read the parameters file.
# Line 1113  Line 1155 
1155              }              }
1156          }          }
1157      }      }
 }  
1158    
1159  1;  1;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3