/[local]/search/Search.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /search/Search.cgi

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

revision 1.18 by dpavlin, Tue Jun 25 17:04:18 2002 UTC revision 1.19 by dpavlin, Tue Jun 25 17:48:55 2002 UTC
# Line 1519  sub sMakeSearchString { Line 1519  sub sMakeSearchString {
1519                    
1520                  my ($FieldName) = "FieldName" . $Value;                  my ($FieldName) = "FieldName" . $Value;
1521                  my ($FieldContent) = "FieldContent" . $Value;                  my ($FieldContent) = "FieldContent" . $Value;
1522    
1523                    
1524                            if ( defined($Content{$FieldName}) && defined($Content{$FieldContent}) ) {
1525                  if ( defined($Content{$FieldName}) ) {                          # nuke accented chars
1526                          $SearchString .= defined($Content{$FieldContent}) ?                          $Content{$FieldContent} =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´­½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/;
1527                                          (($SearchString ne "") ? " AND " : "") . "$Content{$FieldName}=(" . $Content{$FieldContent} . ")" : "";                          # convert search string to lower case -> make search case insensitive
1528                            $Content{$FieldContent} =~ tr/A-Z/a-z/;
1529    
1530                            if ($Content{$FieldName} eq "ISBN") {
1531                                    # fix stupid problem with dashes in data
1532                                    $Content{$FieldContent} .= "*";
1533                            }
1534    
1535                            $SearchString .=  ($SearchString ne "") ? " AND " : "";
1536                            $SearchString .= "$Content{$FieldName}=(" . $Content{$FieldContent} . ")";
1537                  }                  }
1538          }          }
1539    
         # nuke accented chars  
         $SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´­½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/;  
         # convert search string to lower case -> make search case insensitive  
         $SearchString =~ tr/A-Z/a-z/;  
   
1540          # Add the internal search terms          # Add the internal search terms
1541    
   
1542          # Add the date restriction on the load time          # Add the date restriction on the load time
1543          if ( defined($Content{'LastRunTime'}) && ($Content{'LastRunTime'} > 0) ) {          if ( defined($Content{'LastRunTime'}) && ($Content{'LastRunTime'} > 0) ) {
1544                  $SearchString .= (($SearchString ne "") ? " AND " : "") . "time_t>=$Content{'LastRunTime'}";                  $SearchString .= (($SearchString ne "") ? " AND " : "") . "time_t>=$Content{'LastRunTime'}";
# Line 5016  sub vListSavedSearch { Line 5020  sub vListSavedSearch {
5020                    
5021                  print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=3> \n");                  print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=3> \n");
5022                  print("<SELECT NAME=\"Action\">\n");                  print("<SELECT NAME=\"Action\">\n");
5023                  print("<OPTION VALUE=\"ActivateSavedSearch\">Aktiviraj oznaèena saèuvana pretra¾ivanja\n");                  print("<OPTION VALUE=\"ActivateSavedSearch\">Ukljuèi periodièno automatsko pretra¾ivanje oznaèenih pretra¾ivanja\n");
5024                  print("<OPTION VALUE=\"SuspendSavedSearch\">Stavi u mirovanje oznaèena saèuvana pretra¾ivanja\n");                  print("<OPTION VALUE=\"SuspendSavedSearch\">Iskljuèi periodièno automatsko pretra¾ivanje oznaèenih pretra¾ivanja\n");
5025                  print("<OPTION VALUE=\"DeleteSavedSearch\">Obri¹i oznaèena saèuvana pretra¾ivanja\n");                  print("<OPTION VALUE=\"DeleteSavedSearch\">Obri¹i oznaèena pretra¾ivanja\n");
5026                  print("</SELECT>\n");                  print("</SELECT>\n");
5027                  print("<INPUT TYPE=SUBMIT VALUE=\"Do It!\">\n");                  print("<INPUT TYPE=SUBMIT VALUE=\"Do It!\">\n");
5028                  print("</TD></TR>\n");                  print("</TD></TR>\n");
# Line 5253  sub vProcessSavedSearch { Line 5257  sub vProcessSavedSearch {
5257                    
5258          # Set the title          # Set the title
5259          if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {          if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {
5260                  $Title = "Obri¹i saèuvana pretra¾ivanja";                  $Title = "Brisanje saèuvanih pretra¾ivanja";
5261          }          }
5262          elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) {          elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) {
5263                  $Title = "Aktiviraj saèuvana pretra¾ivanja";                  $Title = "Ukljuèivanje automatskog periodiènog pretra¾ivanja";
5264          }          }
5265          elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) {          elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) {
5266                  $Title = "Stavi u mirovanje saèuvana pretra¾ivanja";                  $Title = "Iskljuèivanje automatskog periodiènog pretra¾ivanja";
5267          }          }
5268                    
5269                    
# Line 5274  sub vProcessSavedSearch { Line 5278  sub vProcessSavedSearch {
5278          # Check to see if the saved search object is defined          # Check to see if the saved search object is defined
5279          if ( ! defined($main::FormData{'SavedSearchObject'}) ) {          if ( ! defined($main::FormData{'SavedSearchObject'}) ) {
5280                  # Could not find the saved search object                  # Could not find the saved search object
5281                  print("<H3><CENTER> Sorry, no searches were selected. </CENTER></H3>\n");                  print("<H3><CENTER>Niste odabrali niti jedno pretra¾ivanje. </CENTER></H3>\n");
5282                  print("<P>\n");                  print("<P>\n");
5283                  print("You need to select at least one saved search in order to be able to perform an action on it.\n");                  print("Potrebno je odabrati barem jedno pretra¾ivanje nad kojim æe se izvr¹iti akcija.\n");
5284                  print("<P>\n");                  print("<P>\n");
5285                  goto bailFromProcessSavedSearch;                  goto bailFromProcessSavedSearch;
5286          }          }
# Line 5305  sub vProcessSavedSearch { Line 5309  sub vProcessSavedSearch {
5309    
5310                  if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {                  if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {
5311                          if ( unlink($SavedSearchFilePath) ) {                          if ( unlink($SavedSearchFilePath) ) {
5312                                  printf("<P>Successfully deleted: %s\n", $Value{'SearchName'});                                  printf("<P>Uspje¹no pobrisano: %s\n", $Value{'SearchName'});
5313                          }                          }
5314                          else {                          else {
5315                                  printf("<P>Failed to delete: %s\n", $Value{'SearchName'});                                  printf("<P>Nije pobrisano: %s\n", $Value{'SearchName'});
5316                          }                          }
5317                  }                  }
5318                  elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) {                  elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) {
# Line 5322  sub vProcessSavedSearch { Line 5326  sub vProcessSavedSearch {
5326                                  $Value{'SearchStatus'} =  ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ;                                  $Value{'SearchStatus'} =  ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ;
5327                                                                    
5328                                  if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) {                                  if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) {
5329                                          printf("<P>Successfully %s: %s\n",                                          printf("<P>Uspje¹no %s: %s\n",
5330                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'});                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "ukljuèeno" : "iskljuèeno", $Value{'SearchName'});
5331                                  }                                  }
5332                                  else {                                  else {
5333                                          printf("<P>Failed to %s: %s\n",                                          printf("<P>Nije %s: %s\n",
5334                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'});                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "ukljuèeno" : "iskljuèeno", $Value{'SearchName'});
5335                                  }                                  }
5336                          }                          }
5337                  }                  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.26