/[webpac-proto]/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.2 by dpavlin, Sat Jun 15 17:37:32 2002 UTC revision 1.20 by dpavlin, Tue Jun 25 19:31:07 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  #*****************************************************************************  #*****************************************************************************
4  #       Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved          *  #       Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved      *
5  #                                                                                                                                                        *  #                                                                            *
6  #                                                                                                                                                        *  #                                                                            *
7  #  This notice is intended as a precaution against inadvertent publication       *  #  This notice is intended as a precaution against inadvertent publication   *
8  #  and does not constitute an admission or acknowledgement that publication      *  #  and does not constitute an admission or acknowledgement that publication  *
9  #  has occurred or constitute a waiver of confidentiality.                                       *  #  has occurred or constitute a waiver of confidentiality.                   *
10  #                                                                                                                                                        *  #                                                                            *
11  #  This software is the proprietary and confidential property                            *  #  This software is the proprietary and confidential property                *
12  #  of FS Consulting, Inc.                                                                                                        *  #  of FS Consulting, Inc.                                                    *
13  #*****************************************************************************  #*****************************************************************************
14    
15    #print "Content-type: text/plain\n\n";
16    
17    #use Data::Dumper;
18    
19  #--------------------------------------------------------------------------  #--------------------------------------------------------------------------
20  #  #
21  # Author: Francois Schiettecatte (FS Consulting, Inc.)  # Author: Francois Schiettecatte (FS Consulting, Inc.)
# Line 179  $main::MPSSession = 0; Line 183  $main::MPSSession = 0;
183  #  #
184    
185    
186  # List of default configuration settings  # read configuration fields
187  %main::DefaultSettings = (  require "config.pm";
         'lowest-year',  '1990',  
         'max-score',    '1000',  
         'allow-summary-displays','no',  
         'allow-similiar-search','no',  
         'allow-regular-searches','no',  
         'deliver-empty-results-from-regular-search','no',  
 #       'allow-relevance-feedback-searches','no',  
         'mailer-application','/usr/lib/sendmail',  
         'server-log','mps.log',  
         'output-colums','yes',  
         'show-nr-colums',3,  
 #       'show-past-date-list','yes',  
         'database-for-SearchFieldDescriptions','ps',  
 );  
   
 # DbP: Define which fields you have in normal and advanced search  
 # first define all available fields and then how many fields of that  
 # are visible.  
 @main::NormalSearchFieldNames = (  
         '700+',  
         '200+',  
         '610',  
         '210',  
         '10',  
   
 );  
 $main::NormalSearchDropdowns = 3 ;  
   
 @main::AdvancedSearchFieldNames = (  
         '700+',  
         '200+',  
         '610',  
         '210',  
         '225',  
         '300+',  
         '330',  
         '464',  
         '675',  
         '686',  
         '990',  
         '991',  
         '10',  
         '001',  
 );  
 $main::AdvancedSearchDropdowns = 4 ;  
   
188    
189  # List of required configuration settings  # List of required configuration settings
190  @main::RequiredSettings = (  @main::RequiredSettings = (
# Line 274  $main::QueryReportItemName = "document"; Line 232  $main::QueryReportItemName = "document";
232  $main::QueryReportMimeType = "application/x-wais-report";  $main::QueryReportMimeType = "application/x-wais-report";
233    
234    
   
 # Hash of icon/images names that we use  
 %main::ImageNames = (  
         'banner',                                       'banner.gif',  
         'collapse',                                     'collapse.gif',  
         'expand',                                       'expand.gif',  
         'inactive-search',                      'inactive-search.gif',  
         'active-search',                        'active-search.gif',  
         'inactive-search-history',      'inactive-search-history.gif',  
         'active-search-history',        'active-search-history.gif',  
         'inactive-saved-searches',      'inactive-saved-searches.gif',  
         'active-saved-searches',        'active-saved-searches.gif',  
         'inactive-document-folders','inactive-document-folders.gif',  
         'active-document-folders',      'active-document-folders.gif',  
         'inactive-settings',            'inactive-settings.gif',  
         'active-settings',                      'active-settings.gif',  
 );  
   
   
235  # Array of mime type names, we use this to map  # Array of mime type names, we use this to map
236  # mime types to mime type names (which are more readable)  # mime types to mime type names (which are more readable)
237  %main::MimeTypeNames = (  %main::MimeTypeNames = (
# Line 437  sub vSendHTMLHeader { Line 376  sub vSendHTMLHeader {
376          if ( ! $ENV{'GATEWAY_INTERFACE'} ) {          if ( ! $ENV{'GATEWAY_INTERFACE'} ) {
377                  return;                  return;
378          }          }
379            
380          # Bail if we have already sent the header          # Bail if we have already sent the header
381          if ( $main::HeaderSent ) {          if ( $main::HeaderSent ) {
382                  return;                  return;
# Line 453  sub vSendHTMLHeader { Line 392  sub vSendHTMLHeader {
392                  print("$JavaScript\n");                  print("$JavaScript\n");
393          }          }
394          print '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">';          print '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">';
395            print '<link rel="STYLESHEET" type="text/css" href="'.$main::ConfigurationData{'image-base-path'}.'/stil.css">';
396          print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n");          print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n");
397    
398    
# Line 462  sub vSendHTMLHeader { Line 402  sub vSendHTMLHeader {
402    
403          # Send the banner          # Send the banner
404          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");
405          print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'banner'}\" ALT=\"Return Home\" BORDER=0></A> </TD></TR>\n");  #       print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'banner'}\" ALT=\"Return Home\" BORDER=0></A> </TD></TR>\n");
406          print("</TABLE>\n");  
407            print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><H3>Katalozi knji¾nica Filozofskog fakulteta</H3> </A> </TD></TR>\n");
408    
409            print("</TABLE>\n");
410                                    
411    
412          # Set the flag saying that the header has been sent          # Set the flag saying that the header has been sent
# Line 560  sub vSendMenuBar { Line 503  sub vSendMenuBar {
503                  }                  }
504          }          }
505    
506          if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {          my $DISABLED;
                 print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search'}\" ALT=\"Search\" BORDER=0>");  
         }  
         else {  
                 print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");  
507    
508                    $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : "";
509          }          print("<INPUT NAME=\"GetSearch\" TYPE=SUBMIT VALUE=\"Pretra¾ivanje\" $DISABLED class=\"navigacija${DISABLED}\">");
510    
511          if ( defined($main::RemoteUser) ) {          if ( defined($main::RemoteUser) ) {
512                  if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) {                  $DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : "";
513                          print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search-history'}\" ALT=\"Search History\" BORDER=0>");                  print"<INPUT NAME=\"ListSearchHistory\" TYPE=SUBMIT VALUE=\"Prija¹nja pretra¾ivanja\" $DISABLED class=\"navigacija${DISABLED}\">";
                 }  
                 else {  
                         print("<INPUT NAME=\"ListSearchHistory\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search-history'}\" ALT=\"Search History\" BORDER=0>");  
                 }  
514    
515                  if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) {                  $DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : "";
516                          print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-saved-searches'}\" ALT=\"Saved Searches\" BORDER=0>");                  print"<INPUT NAME=\"ListSavedSearch\" TYPE=SUBMIT VALUE=\"Saèuvani upiti\" $DISABLED class=\"navigacija${DISABLED}\">";
                 }  
                 else {  
                         print("<INPUT NAME=\"ListSavedSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-saved-searches'}\" ALT=\"Saved Searches\" BORDER=0>");  
                 }  
517    
518                  if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) {                  $DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : "";
519                          print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-document-folders'}\" ALT=\"Doument Folders\" BORDER=0>");                  print"<INPUT NAME=\"ListFolder\" TYPE=SUBMIT VALUE=\"Korisnièki folderi\" $DISABLED class=\"navigacija${DISABLED}\">";
520                  }          
521                  else {                  $DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : "";
522                          print("<INPUT NAME=\"ListFolder\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-document-folders'}\" ALT=\"Document Folders\" BORDER=0>");                  print"<INPUT NAME=\"GetUserSettings\" TYPE=SUBMIT VALUE=\"Korisnièke postavke\" $DISABLED class=\"navigacija${DISABLED}\">";
                 }  
                   
                 if ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) {  
                         print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-settings'}\" ALT=\"My Preferences\" BORDER=0>");  
                 }  
                 else {  
                         print("<INPUT NAME=\"GetUserSettings\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-settings'}\" ALT=\"My Settings\" BORDER=0>");  
                 }  
523          }          }
524    
525    
# Line 1596  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/;  
   
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 2029  sub bDisplayDocuments { Line 1958  sub bDisplayDocuments {
1958          # Print the title          # Print the title
1959          if ( $HTML ) {          if ( $HTML ) {
1960                  printf("<TD ALIGN=LEFT VALIGN=TOP>%s%s:</TD><TD ALIGN=LEFT VALIGN=TOP>\n",                  printf("<TD ALIGN=LEFT VALIGN=TOP>%s%s:</TD><TD ALIGN=LEFT VALIGN=TOP>\n",
1961                                  defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");  #                               defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");
1962                                    $Title);
1963          }          }
1964          else {          else {
1965                  printf("%s%s:\n", defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");  #               printf("%s%s:\n", defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");
1966                    print $Title;
1967          }          }
1968    
1969    
# Line 2147  sub bsDisplaySearchResults { Line 2078  sub bsDisplaySearchResults {
2078          my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);          my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);
2079          my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);          my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);
2080          my ($Value, %Value, @Values, $ValueEntry);          my ($Value, %Value, @Values, $ValueEntry);
2081            
2082            
2083          # Check input parameters          # Check input parameters
2084          if ( !defined($SearchResults) || !%Content ) {          if ( !defined($SearchResults) || !%Content ) {
2085                  return (0);                  return (0);
2086          }          }
2087                    
   
           
2088          # Split the search results text into a search results list          # Split the search results text into a search results list
2089          @SearchResults = split(/\n/, $SearchResults);                            @SearchResults = split(/\n/, $SearchResults);                  
                   
2090                    
2091                    
2092          # First we count up the number of results and scoop up          # First we count up the number of results and scoop up
# Line 2266  sub bsDisplaySearchResults { Line 2194  sub bsDisplaySearchResults {
2194                          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");                          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");
2195                    
2196                          # Print the selector                          # Print the selector
2197                          print("<TR><TD ALIGN=LEFT VALIGN=TOP>Odabranima se smatraju svi rezultati ukoliko niste uèinili nikakav dodatan odabir.</TD><TD ALIGN=RIGHT VALIGN=TOP> \n");                          print("<TR><TD ALIGN=LEFT VALIGN=TOP>Odabrani su svi rezultati ukoliko niste uèinili nikakav dodatan odabir.</TD><TD ALIGN=RIGHT VALIGN=TOP> \n");
2198                                                    
2199                          if ( $ResultCount > 0 ) {                          if ( $ResultCount > 0 ) {
2200                                                                    
# Line 2281  sub bsDisplaySearchResults { Line 2209  sub bsDisplaySearchResults {
2209                                          if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) {                                          if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) {
2210                                                  print("<OPTION VALUE=\"GetSearchResults\">Run search with selected documents as relevance feedback\n");                                                  print("<OPTION VALUE=\"GetSearchResults\">Run search with selected documents as relevance feedback\n");
2211                                          }                                          }
2212                                          print("<OPTION VALUE=\"GetSaveSearch\">Saèuvaj rezultate pretra¾ivanja\n");                                          print("<OPTION VALUE=\"GetSaveSearch\">Saèuvaj upit\n");
2213                                          print("<OPTION VALUE=\"GetSaveFolder\">Saèuvaj odabrane rezultate u novi folder\n");                                          print("<OPTION VALUE=\"GetSaveFolder\">Saèuvaj odabrane rezultate u novi folder\n");
2214                                                    
2215                                          # Get the document folder hash                                          # Get the document folder hash
# Line 2468  sub bsDisplaySearchResults { Line 2396  sub bsDisplaySearchResults {
2396          }          }
2397    
2398    
2399            ### FIX:: ADD SORT HERE
2400          if ( $ResultCount > 0 ) {          if ( $ResultCount > 0 ) {
2401    
2402                  # Loop over each entry in the hits list                  # Loop over each entry in the hits list
# Line 2725  sub bsDisplaySearchResults { Line 2653  sub bsDisplaySearchResults {
2653                          # Put up the headline and the score, this one links to the document                          # Put up the headline and the score, this one links to the document
2654                          if ( $HTML ) {                          if ( $HTML ) {
2655                                  print("<!-- resultItem -->\n");                                  print("<!-- resultItem -->\n");
2656                                  print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD> <TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> <!-- relevance --> <B> $Score </B> <!-- /relevance --> </TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline <I> ( $main::DatabaseDescriptions{$Database} ) </I> </A> <BR> <FONT SIZE=-2>");                                  #print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD> <TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> <!-- relevance --> <B> $Score </B> <!-- /relevance --> </TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline <I> ( $main::DatabaseDescriptions{$Database} ) </I> </A> <BR> <FONT SIZE=-2>");
2657                          }                                  # decode some basic html from headline <b> <i>
2658                          else {                                  $Headline =~ s/&lt;(\/?[bi])&gt;/<$1>/g;
2659    
2660                                    print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline </A> <BR> <FONT SIZE=-2>&nbsp;");
2661                            } else {
2662                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);
2663                          }                          }
2664    
2665    if (0) { ## don't display description
2666    
2667                          # Put up the summary                          # Put up the summary
2668                          if ( defined($SummaryText) && ($SummaryText ne "") ) {                          if ( defined($SummaryText) && ($SummaryText ne "") ) {
# Line 2747  sub bsDisplaySearchResults { Line 2679  sub bsDisplaySearchResults {
2679                          if ( ! defined($Remainder) ) {                          if ( ! defined($Remainder) ) {
2680                                  if ( $HTML ) {                                  if ( $HTML ) {
2681                                          print("Formatttt: $MimeTypeName, ");                                          print("Formatttt: $MimeTypeName, ");
2682                            
2683                                  }                                  }
2684                                  else {                                  else {
2685                                          print("    Format: $MimeTypeName, ");                                          print("    Format: $MimeTypeName, ");
# Line 2755  sub bsDisplaySearchResults { Line 2688  sub bsDisplaySearchResults {
2688    
2689    
2690                          # Put up the date if we got it                          # Put up the date if we got it
2691                          if ( defined($Date) && ($Date ne "") ) {                           if ( defined($Date) && ($Date ne "") ) {
2692                                  print("Date: $Date");                                  print("Date: $Date");
2693                                                                    
2694                                  # Put up the time if we got it                                  # Put up the time if we got it
2695                                  if ( defined($Time) && ($Time ne "") ) {                                   if ( defined($Time) && ($Time ne "") ) {
2696                                          print(" $Time");                                          print(" $Time");
2697                                  }                                  }
2698                                                                    
# Line 2890  sub bsDisplaySearchResults { Line 2823  sub bsDisplaySearchResults {
2823                                  }                                  }
2824                                  print("\n");                                  print("\n");
2825    
2826    } #if
2827                                  # Finish off the entry                                  # Finish off the entry
2828                                  if ( $HTML ) {                                  if ( $HTML ) {
2829                                          print("</FONT></TD></TR>\n");                                          print("</FONT></TD></TR>\n");
# Line 3004  sub vGetSearch { Line 2938  sub vGetSearch {
2938    
2939    
2940          # Make sure that we send the header          # Make sure that we send the header
2941          $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Pretra¾ivanje s vi¹e kriterija" : "Jednostavno pretra¾ivanje";          $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Slo¾eno pretra¾ivanje" : "Jednostavno pretra¾ivanje";
2942          &vSendHTMLHeader($Value, undef);  
2943            &vSendHTMLHeader($Value, $main::JavaScript_SetChecked);
2944    
2945          undef(%Value);          undef(%Value);
2946          $Value{'GetSearch'} = "GetSearch";          $Value{'GetSearch'} = "GetSearch";
# Line 3044  sub vGetSearch { Line 2979  sub vGetSearch {
2979    
2980          if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) {          if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) {
2981                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetSimpleSearch\">\n");                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetSimpleSearch\">\n");
2982                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'collapse'}\" BORDER=0 TYPE=IMAGE> Kliknite na trokutiæ da biste suzili formu.\n");                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'collapse'}\" BORDER=0 TYPE=IMAGE> Jednostavo pretra¾ivanje (kliknite na trokutiæ)\n");
2983          }          }
2984          else {          else {
2985                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetExpandedSearch\">\n");                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetExpandedSearch\">\n");
2986                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'expand'}\" BORDER=0 TYPE=IMAGE>  Kliknite na trokutiæ da biste pro¹irili formu.\n");                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'expand'}\" BORDER=0 TYPE=IMAGE> Slo¾eno pretra¾ivanje (kliknite na trokutiæ)\n");
2987          }          }
2988          print("</FORM></TD>\n");          print("</FORM></TD>\n");
2989                    
# Line 3056  sub vGetSearch { Line 2991  sub vGetSearch {
2991    
2992          # Send the start of the form and the buttons          # Send the start of the form and the buttons
2993          print("<TD ALIGN=RIGHT VALIGN=TOP>\n");          print("<TD ALIGN=RIGHT VALIGN=TOP>\n");
2994          print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/GetSearchResults\" METHOD=POST> <INPUT TYPE=SUBMIT VALUE=\"Pretra¾i bazu\"> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\">\n");          print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/GetSearchResults\" NAME=\"Search\" METHOD=POST> <INPUT TYPE=SUBMIT VALUE=\"Pretra¾i bazu\"> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\">\n");
2995          print("</TD></TR>\n");          print("</TD></TR>\n");
2996    
2997          print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=3><BR></TD></TR>\n");          print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=3><BR></TD></TR>\n");
# Line 3076  sub vGetSearch { Line 3011  sub vGetSearch {
3011    
3012          for (my $field=1; $field<= $nr_fields; $field++) {          for (my $field=1; $field<= $nr_fields; $field++) {
3013    
3014                  print("<TR><TD ALIGN=LEFT VALIGN=TOP>");                  print "<TR>";
3015                  if ($field == 1 ) {                  if ($field == 1 ) {
3016                          print ("Pretra¾i u odreðenom polju:");                          print "<TD ALIGN=LEFT VALIGN=TOP ROWSPAN=$nr_fields>";
3017                            print "Pretra¾i u odabranom polju:";
3018                            print "</td>";
3019                  }                  }
3020                  print ("</TD><TD ALIGN=RIGHT VALIGN=TOP>");                  print ("<TD ALIGN=RIGHT VALIGN=TOP>");
3021    
3022                  print ("<SELECT NAME=\"FieldName${field}\">");                  print ("<SELECT NAME=\"FieldName${field}\">");
3023                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {
3024                          my $ItemEntry = $SearchFieldNames[$i];                          my $ItemEntry = $SearchFieldNames[$i];
3025                          my $Selected = ($main::FormData{"FieldName${field}"} == $ItemEntry || $i == ($field-1)) ? "SELECTED" : "";                          my $Selected = "";
3026                            if ($main::FormData{"FieldName${field}"} && $main::FormData{"FieldName${field}"} eq $ItemEntry) {
3027                                    $Selected = "SELECTED";
3028                            } elsif ($i == ($field - 1)) {
3029                                    $Selected = "SELECTED";
3030                            }
3031                                    
3032                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");
3033                  }                  }
3034                  my $Value = defined($main::FormData{"FieldContent${field}"}) ? "VALUE='".$main::FormData{"FieldContent${field}"}."'" : "";                  my $Value = "";
3035                  print("</SELECT></TD><TD ALIGN=LEFT><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n");                  if (defined($main::FormData{"FieldContent${field}"})) {
3036                            $Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'";
3037                    }
3038                    print("</SELECT></TD><TD ALIGN=LEFT VALIGN=TOP><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n");
3039          }          }
3040    
3041    
# Line 3111  sub vGetSearch { Line 3057  sub vGetSearch {
3057          # Database selection          # Database selection
3058          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3059    
3060                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju ¾elite pretra¾ivati: </TD> <TD ALIGN=LEFT VALIGN=TOP>\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite knji¾nicu èiji fond ¾elite pretra¾ivati:</TD></TR>
3061                    <TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
3062                    ");
3063                                    
3064                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
3065                  # hash table, they should be separated with a '\0'                  # hash table, they should be separated with a '\0'
# Line 3125  sub vGetSearch { Line 3073  sub vGetSearch {
3073                                  @ItemList = split(",", $SelectedDatabases);                                  @ItemList = split(",", $SelectedDatabases);
3074                          }                          }
3075                  }                  }
                 foreach $ItemEntry ( @ItemList ) {  
                         $Value{$ItemEntry} = $ItemEntry;  
                 }  
                   
   
   
                 $Flag = 0;  
                 print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");  
   
                 my @html_database;  
   
                 foreach my $key ( sort keys %main::DatabaseSort ) {  
                         $DatabaseName = $main::DatabaseSort{$key};  
                         $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : "";  
                         $ItemEntry = &lEncodeURLData($DatabaseName);  
                         if ($main::DatabaseDescriptions{$DatabaseName}) {  
                                 push @html_database,"<TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"Database\" VALUE=\"$DatabaseName\" $Value> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetDatabaseInfo?Database=$ItemEntry\" OnMouseOver=\"self.status='Informacije io bazi $main::DatabaseDescriptions{$DatabaseName} '; return true\"> $main::DatabaseDescriptions{$DatabaseName}  </A> </TD>\n";  
                         } else {  
                                 push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n";  
                         }  
                 }  
   
   
                 if ($main::ConfigurationData{'output-colums'}) {  
                         # create database names in columns  
   
                         my $cols = $main::ConfigurationData{'show-nr-colums'};  
                         my $next = int($#html_database/$cols) ;  
   
                         for(my $i=0; $i <= $next ; $i++) {  
                                 print("<tr>");  
                                 for(my $j=0; $j <= $cols; $j++) {  
                                         print($html_database[$i+$next*$j+$j]);  
                                 }  
                                 print("</tr>");  
                         }  
3076    
3077                  } else {                  &ShowDatabaseCheckBoxes(@ItemList);
                         for(my $i=0; $i <= $#html_database ; $i=$i+1) {  
                                 print("<tr>",$html_database[$i],"</tr>");  
                         }  
                 }  
   
                 print("</TABLE>\n");  
3078    
3079                  print("</TD></TR>\n");                  print("</TD></TR>\n");
3080                                    
# Line 3256  sub vGetSearch { Line 3162  sub vGetSearch {
3162          print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n");          print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n");
3163          $Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";          $Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";
3164          print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n");          print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n");
3165    ### FIX:: SORT
3166    #       print("<OPTION VALUE=\"SORT:700+:DESC\"> autor\n");
3167    #       print("<OPTION VALUE=\"SORT:200+:DESC\"> naslov\n");
3168          print("</SELECT> </TD></TR>\n");          print("</SELECT> </TD></TR>\n");
3169    
3170    
# Line 3373  sub vGetSearchResults { Line 3282  sub vGetSearchResults {
3282    
3283          # Check that at least one database was selected          # Check that at least one database was selected
3284          if ( !defined($main::FormData{'Database'}) ) {          if ( !defined($main::FormData{'Database'}) ) {
3285                  print("<H3>Database Search:</H3>\n");                  print("<H3>Pretra¾ivanje baza:</H3>\n");
3286                  print("<H3><CENTER>Sorry, no database(s) were selected for searching.</CENTER></H3>\n");                  print("<H3><CENTER>Niste odabrali knji¾nicu koju ¾elite pretra¾ivati.</CENTER></H3>\n");
3287                  print("<P>\n");                  print("<P>\n");
3288                  print("There needs to be a least one database selected in order to perform the search.\n");                  print("Potrebno je da barem jedna knji¾nica bude odabrana, kako biste mogli pretra¾ivati.\n");
3289                  print("Click <B>'back'</B> on your browser, select at least one database and try again.\n");                  print("Kliknite na <B>'back'</B> u svom browseru, odaberite barem jednu knji¾nicu i poku¹ajte ponovo.\n");
3290                  goto bailFromGetSearchResults;                  goto bailFromGetSearchResults;
3291          }          }
3292    
# Line 4050  sub vGetUserSettings { Line 3959  sub vGetUserSettings {
3959    
3960    
3961          # Make sure that we send the header          # Make sure that we send the header
3962          &vSendHTMLHeader("My Settings", undef);          &vSendHTMLHeader("My Settings", $main::JavaScript_SetChecked);
3963          undef(%Value);          undef(%Value);
3964          $Value{'GetUserSettings'} = "GetUserSettings";          $Value{'GetUserSettings'} = "GetUserSettings";
3965          &vSendMenuBar(%Value);          &vSendMenuBar(%Value);
# Line 4088  sub vGetUserSettings { Line 3997  sub vGetUserSettings {
3997          print("<H3> Postavke: </H3>\n");          print("<H3> Postavke: </H3>\n");
3998    
3999          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");
4000          print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetUserSettings\" METHOD=POST>\n");          print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetUserSettings\" NAME=\"Search\" METHOD=POST>\n");
4001                                    
4002          # Send the buttons          # Send the buttons
4003          print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=2> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\"> <INPUT TYPE=SUBMIT VALUE=\"Saèuvaj postavke\"> </TD></TR>\n");          print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=2> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\"> <INPUT TYPE=SUBMIT VALUE=\"Saèuvaj postavke\"> </TD></TR>\n");
# Line 4150  sub vGetUserSettings { Line 4059  sub vGetUserSettings {
4059    
4060                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <B> Odabrane baze: </B> </TD></TR>\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <B> Odabrane baze: </B> </TD></TR>\n");
4061    
4062                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Oznaèite baze koje uvijek ¾elite pretra¾ivati: </TD> <TD ALIGN=LEFT VALIGN=TOP>\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Oznaèite baze koje uvijek ¾elite pretra¾ivati:</TD></TR><TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2>\n");
4063                                    
4064                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
4065                  # hash table, they should be separated with a '\n'                  # hash table, they should be separated with a '\n'
                 undef(%Value);  
4066                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {
4067                          @ItemList = split(",", $SelectedDatabases);                          @ItemList = split(",", $SelectedDatabases);
                         foreach $ItemEntry ( @ItemList ) {  
                                 $Value{$ItemEntry} = $ItemEntry;  
                         }  
                 }  
                   
                 $Flag = 0;  
                 print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%\n");  
                   
                 foreach $DatabaseName ( sort(keys(%main::DatabaseDescriptions)) ) {  
                           
                         if ( $Flag == 0 ) {  
                                 print("<TR>");  
                         }  
                           
                         $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1)) ? "CHECKED" : "";  
                         $ItemEntry = &lEncodeURLData($DatabaseName);  
                         print("<TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"SelectedDatabases\" VALUE=\"$DatabaseName\" $Value> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetDatabaseInfo?Database=$ItemEntry\" OnMouseOver=\"self.status='Get Information about the $main::DatabaseDescriptions{$DatabaseName} database'; return true\">  $main::DatabaseDescriptions{$DatabaseName} </A></TD>\n");  
                           
                         if ( $Flag == 1 ) {  
                                 print("</TR>");  
                                 $Flag = 0;  
                         }  
                         else {  
                                 $Flag = 1;  
                         }  
4068                  }                  }
4069                  print("</TABLE>\n");  
4070                    &ShowDatabaseCheckBoxes(@ItemList);
4071            
4072                  print("</TD></TR>\n");                  print("</TD></TR>\n");
4073          }          }
4074    
# Line 4327  sub vSetUserSettings { Line 4212  sub vSetUserSettings {
4212          $Value{'UserName'} = $main::FormData{'UserName'};          $Value{'UserName'} = $main::FormData{'UserName'};
4213          $Value{'EmailAddress'} = $main::FormData{'EmailAddress'};          $Value{'EmailAddress'} = $main::FormData{'EmailAddress'};
4214          $Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'};          $Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'};
4215          $Value{'SelectedDatabases'} = $main::FormData{'SelectedDatabases'};          $Value{'SelectedDatabases'} = $main::FormData{'Database'};
4216          if ( defined($Value{'SelectedDatabases'}) ) {          if ( defined($Value{'SelectedDatabases'}) ) {
4217                  $Value{'SelectedDatabases'} =~ s/\0/,/g;                  $Value{'SelectedDatabases'} =~ s/\0/,/g;
4218          }          }
# Line 4755  sub vGetSaveSearch { Line 4640  sub vGetSaveSearch {
4640                    
4641    
4642          # Give the user a form to fill out          # Give the user a form to fill out
4643          print("<H3> Saving a search: </H3>\n");          print("<H3> Èuvanje upita: </H3>\n");
4644    
4645    
4646    
# Line 4808  sub vGetSaveSearch { Line 4693  sub vGetSaveSearch {
4693          print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><HR WIDTH=50%></TD></TR>\n");          print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><HR WIDTH=50%></TD></TR>\n");
4694    
4695          # Send the search name and search description fields          # Send the search name and search description fields
4696          print("<TR><TD ALIGN=LEFT VALIGN=TOP> Search Name (required): </TD> <TD ALIGN=LEFT VALIGN=TOP> <INPUT NAME=\"SearchName\" TYPE=TEXT SIZE=45> </TD></TR>\n");          print("<TR><TD ALIGN=LEFT VALIGN=TOP> Naziv (obavezno): </TD> <TD ALIGN=LEFT VALIGN=TOP> <INPUT NAME=\"SearchName\" TYPE=TEXT SIZE=45> </TD></TR>\n");
4697    
4698          print("<TR><TD ALIGN=LEFT VALIGN=TOP> Search Description: </TD> <TD ALIGN=LEFT VALIGN=TOP> <TEXTAREA INPUT NAME=\"SearchDescription\" COLS=45 ROWS=6 WRAP=VIRTUAL></TEXTAREA> </TD></TR>\n");          print("<TR><TD ALIGN=LEFT VALIGN=TOP> Opis: </TD> <TD ALIGN=LEFT VALIGN=TOP> <TEXTAREA INPUT NAME=\"SearchDescription\" COLS=45 ROWS=6 WRAP=VIRTUAL></TEXTAREA> </TD></TR>\n");
4699    
4700          if ( defined($main::FormData{'RfDocument'}) ) {          if ( defined($main::FormData{'RfDocument'}) ) {
4701                  print("<TR>\n");                  print("<TR>\n");
# Line 4821  sub vGetSaveSearch { Line 4706  sub vGetSaveSearch {
4706    
4707          print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><HR WIDTH=50%></TD></TR>\n");          print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><HR WIDTH=50%></TD></TR>\n");
4708    
4709          print("<TR><TD ALIGN=LEFT VALIGN=TOP> Kliknite na ovaj kvadratiæ ako ¾elite postojeæi folder s istim imenom zamijeniti ovim novim: </TD> <TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"OverWrite\" VALUE=\"yes\"> </TD></TR>\n");          print("<TR><TD ALIGN=LEFT VALIGN=TOP> Kliknite na ovaj kvadratiæ ako ¾elite postojeæi upit s istim imenom zamijeniti ovim novim: </TD> <TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"OverWrite\" VALUE=\"yes\"> </TD></TR>\n");
4710                    
4711                    
4712                    
# Line 4830  sub vGetSaveSearch { Line 4715  sub vGetSaveSearch {
4715                    
4716                  print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><HR WIDTH=50%></TD></TR>\n");                  print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2><HR WIDTH=50%></TD></TR>\n");
4717    
4718                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Check to run this search on a regular basis: </TD> <TD ALIGN=LEFT VALIGN=TOP> <INPUT TYPE=CHECKBOX VALUE=\"yes\" NAME=\"Regular\"> </TD></TR>\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Kliknite ovaj kvadratiæ ukoliko ¾elite automatsko periodièko pretra¾ivanje po ovom upitu: </TD> <TD ALIGN=LEFT VALIGN=TOP> <INPUT TYPE=CHECKBOX VALUE=\"yes\" NAME=\"Regular\"> </TD></TR>\n");
4719    
4720                  # Send a pull-down which allows the user to select the automatic search frequency                  # Send a pull-down which allows the user to select the automatic search frequency
4721                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Select the search frequency: </TD> <TD ALIGN=LEFT VALIGN=TOP> <SELECT NAME=\"SearchFrequency\">\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Odaberite frekvenciju automatskog pretra¾ivanja: </TD> <TD ALIGN=LEFT VALIGN=TOP> <SELECT NAME=\"SearchFrequency\">\n");
4722                  foreach $ValueEntry ( @main::SearchFrequencies ) {                  foreach $ValueEntry ( @main::SearchFrequencies ) {
4723                          $Value = (defined($SearchFrequency) && ($SearchFrequency eq $ValueEntry)) ? "SELECTED" : "";                          $Value = (defined($SearchFrequency) && ($SearchFrequency eq $ValueEntry)) ? "SELECTED" : "";
4724                          print("<OPTION VALUE=\"$ValueEntry\" $Value> $ValueEntry \n");                          print("<OPTION VALUE=\"$ValueEntry\" $Value> $ValueEntry \n");
# Line 4841  sub vGetSaveSearch { Line 4726  sub vGetSaveSearch {
4726                  print("</SELECT> </TD></TR>\n");                  print("</SELECT> </TD></TR>\n");
4727    
4728                  # Send a pull-down which allows the user to select the automatic search delivery format                  # Send a pull-down which allows the user to select the automatic search delivery format
4729                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Select the delivery format: </TD> <TD ALIGN=LEFT VALIGN=TOP> <SELECT NAME=\"DeliveryFormat\">\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Odaberite format za isporuku rezultata pretra¾ivanja: </TD> <TD ALIGN=LEFT VALIGN=TOP> <SELECT NAME=\"DeliveryFormat\">\n");
4730                  foreach $ValueEntry ( sort(keys(%main::DeliveryFormats)) ) {                  foreach $ValueEntry ( sort(keys(%main::DeliveryFormats)) ) {
4731                          $Value = (defined($DeliveryFormat) && ($DeliveryFormat eq  $ValueEntry)) ? "SELECTED" : "";                          $Value = (defined($DeliveryFormat) && ($DeliveryFormat eq  $ValueEntry)) ? "SELECTED" : "";
4732                          print("<OPTION VALUE=\"$ValueEntry\" $Value> $main::DeliveryFormats{$ValueEntry}\n");                          print("<OPTION VALUE=\"$ValueEntry\" $Value> $main::DeliveryFormats{$ValueEntry}\n");
# Line 4849  sub vGetSaveSearch { Line 4734  sub vGetSaveSearch {
4734                  print("</SELECT> </TD></TR>\n");                  print("</SELECT> </TD></TR>\n");
4735    
4736                  # Send a pull-down which allows the user to select the automatic search delivery method                  # Send a pull-down which allows the user to select the automatic search delivery method
4737                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Select the delivery method: </TD> <TD ALIGN=LEFT VALIGN=TOP> <SELECT NAME=\"DeliveryMethod\">\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP> Odaberite metodu isporuke: </TD> <TD ALIGN=LEFT VALIGN=TOP> <SELECT NAME=\"DeliveryMethod\">\n");
4738                  foreach $ValueEntry ( sort(keys(%main::DeliveryMethods)) ) {                  foreach $ValueEntry ( sort(keys(%main::DeliveryMethods)) ) {
4739                          $Value = (defined($DeliveryMethod) && ($DeliveryMethod eq  $ValueEntry)) ? "SELECTED" : "";                          $Value = (defined($DeliveryMethod) && ($DeliveryMethod eq  $ValueEntry)) ? "SELECTED" : "";
4740                          print("<OPTION VALUE=\"$ValueEntry\" $Value> $main::DeliveryMethods{$ValueEntry}\n");                          print("<OPTION VALUE=\"$ValueEntry\" $Value> $main::DeliveryMethods{$ValueEntry}\n");
# Line 4970  sub vSetSaveSearch { Line 4855  sub vSetSaveSearch {
4855                          && !(defined($main::FormData{'OverWrite'}) && ($main::FormData{'OverWrite'} eq "yes")) ) {                          && !(defined($main::FormData{'OverWrite'}) && ($main::FormData{'OverWrite'} eq "yes")) ) {
4856    
4857                  # There is already a saved search with this name, so we suggest corrective action to the user.                  # There is already a saved search with this name, so we suggest corrective action to the user.
4858                  print("<H3> Saving a Search: </H3>\n");                  print("<H3> Èuvanje upita: </H3>\n");
4859                  print("<H3><CENTER> Sorry, there is already a saved search with this name. </CENTER></H3>\n");                  print("<H3><CENTER> Veæ postoji upit pod ovim imenom. </CENTER></H3>\n");
4860                  print("<P>\n");                  print("<P>\n");
4861                  print("Click <B>'back'</B> on your browser, change the <B>'search name'</B> and try again, \n");                  print("Kliknite <B>'back'</B> u browseru, promijenite <B>'Naziv'</B> i poku¹ajte ponovo, \n");
4862                  print("alternatively you can check the box which allows you to automatically over-write a saved search with the same name.\n");                  print("ili kliknuti na kvadratiæ koji vam omoguæava da automatski presnimite saèuvani upit s istim imenom.\n");
4863                  print("<P>\n");                  print("<P>\n");
4864    
4865                  goto bailFromSetSaveSearch;                  goto bailFromSetSaveSearch;
# Line 4988  sub vSetSaveSearch { Line 4873  sub vSetSaveSearch {
4873          if ( !defined($Value) && (defined($main::FormData{'Regular'}) && ($main::FormData{'Regular'} eq "yes")) ) {          if ( !defined($Value) && (defined($main::FormData{'Regular'}) && ($main::FormData{'Regular'} eq "yes")) ) {
4874                                    
4875                  # Regular delivery was requested, but the email address was not specified in the settings                  # Regular delivery was requested, but the email address was not specified in the settings
4876                  print("<H3> Saving a Search: </H3>\n");                  print("<H3> Èuvanje upita: </H3>\n");
4877                  print("<H3><CENTER> Sorry, your email address is not specified in your settings. </CENTER></H3>\n");                  print("<H3><CENTER> E-mail adresa nije specificirana u va¹im postavkama. </CENTER></H3>\n");
4878                  print("<P>\n");                  print("<P>\n");
4879                  print("You need to specify your email address in your settings if you want this search to run on a regular basis, \n");                  print("Potrebno je specificirati e-mail adresu ukoliko ¾elite da se pretra¾ivanje po ovom upitu odvije periodièno. \n");
4880                  print("without your email address, we are not able to send you the search result. <P>\n");                  print("bez e-mail adrese, nismo vam u moguænosti isporuèiti rezultate. <P>\n");
4881                  print("Click the <B>'Settings'</B> option from the menu sidebar, fill in your email address and save the settings, \n");                  print("Kliknite na <B>'Korisnièke postavke'</B>, upi¹ite e-mail adresu i saèuvajte postavke, \n");
4882                  print("then click <B>'back'</B> on your browser three times to go back to the form which allows you to save a search.\n");                  print("nakon toga kliknite na <B>'back'</B> u svom browseru tri puta kako biste se vratili na formu koja vam nudi da saèuvate upit.\n");
4883                  print("<P>\n");                  print("<P>\n");
4884    
4885                  goto bailFromSetSaveSearch;                  goto bailFromSetSaveSearch;
# Line 5121  sub vListSavedSearch { Line 5006  sub vListSavedSearch {
5006    
5007    
5008          # Print out the saved searches          # Print out the saved searches
5009          print("<H3> Saèuvana pretra¾ivanja: </H3>\n");          print("<H3> Saèuvani upiti: </H3>\n");
5010                    
5011    
5012    
# Line 5137  sub vListSavedSearch { Line 5022  sub vListSavedSearch {
5022                    
5023                  print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=3> \n");                  print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=3> \n");
5024                  print("<SELECT NAME=\"Action\">\n");                  print("<SELECT NAME=\"Action\">\n");
5025                  print("<OPTION VALUE=\"ActivateSavedSearch\">Aktiviraj oznaèena saèuvana pretra¾ivanja\n");                  print("<OPTION VALUE=\"ActivateSavedSearch\">Ukljuèi periodièno automatsko pretra¾ivanje po odabranim upitima\n");
5026                  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 po odabranim upitima\n");
5027                  print("<OPTION VALUE=\"DeleteSavedSearch\">Obri¹i oznaèena saèuvana pretra¾ivanja\n");                  print("<OPTION VALUE=\"DeleteSavedSearch\">Obri¹i oznaèene saèuvane upite\n");
5028                  print("</SELECT>\n");                  print("</SELECT>\n");
5029                  print("<INPUT TYPE=SUBMIT VALUE=\"Do It!\">\n");                  print("<INPUT TYPE=SUBMIT VALUE=\"Do It!\">\n");
5030                  print("</TD></TR>\n");                  print("</TD></TR>\n");
# Line 5237  sub vListSavedSearch { Line 5122  sub vListSavedSearch {
5122    
5123                          }                          }
5124                                    
5125                          print("<TR><TD ALIGN=LEFT VALIGN=TOP></TD><TD ALIGN=LEFT VALIGN=TOP></TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetSavedSearch?SavedSearchObject=$SavedSearchEntry\" OnMouseOver=\"self.status='Display the search form with this search'; return true\"> [ Otvori formu za pretra¾ivanje s upisanim ovim pretra¾ivanjem ] </A> </TD></TR>\n");                          print("<TR><TD ALIGN=LEFT VALIGN=TOP></TD><TD ALIGN=LEFT VALIGN=TOP></TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetSavedSearch?SavedSearchObject=$SavedSearchEntry\" OnMouseOver=\"self.status='Display the search form with this search'; return true\"> [ Otvori formu za pretra¾ivanje s upisanim ovim upitom ] </A> </TD></TR>\n");
5126                  }                  }
5127                                    
5128                  print("</FORM></TABLE>\n");                  print("</FORM></TABLE>\n");
# Line 5374  sub vProcessSavedSearch { Line 5259  sub vProcessSavedSearch {
5259                    
5260          # Set the title          # Set the title
5261          if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {          if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {
5262                  $Title = "Obri¹i saèuvana pretra¾ivanja";                  $Title = "Brisanje saèuvanih pretra¾ivanja";
5263          }          }
5264          elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) {          elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) {
5265                  $Title = "Aktiviraj saèuvana pretra¾ivanja";                  $Title = "Ukljuèivanje automatskog periodiènog pretra¾ivanja";
5266          }          }
5267          elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) {          elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) {
5268                  $Title = "Stavi u mirovanje saèuvana pretra¾ivanja";                  $Title = "Iskljuèivanje automatskog periodiènog pretra¾ivanja";
5269          }          }
5270                    
5271                    
# Line 5395  sub vProcessSavedSearch { Line 5280  sub vProcessSavedSearch {
5280          # Check to see if the saved search object is defined          # Check to see if the saved search object is defined
5281          if ( ! defined($main::FormData{'SavedSearchObject'}) ) {          if ( ! defined($main::FormData{'SavedSearchObject'}) ) {
5282                  # Could not find the saved search object                  # Could not find the saved search object
5283                  print("<H3><CENTER> Sorry, no searches were selected. </CENTER></H3>\n");                  print("<H3><CENTER>Niste odabrali niti jedan upit. </CENTER></H3>\n");
5284                  print("<P>\n");                  print("<P>\n");
5285                  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 jedan saèuvani upit nad kojim æe se izvr¹iti akcija.\n");
5286                  print("<P>\n");                  print("<P>\n");
5287                  goto bailFromProcessSavedSearch;                  goto bailFromProcessSavedSearch;
5288          }          }
# Line 5426  sub vProcessSavedSearch { Line 5311  sub vProcessSavedSearch {
5311    
5312                  if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {                  if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {
5313                          if ( unlink($SavedSearchFilePath) ) {                          if ( unlink($SavedSearchFilePath) ) {
5314                                  printf("<P>Successfully deleted: %s\n", $Value{'SearchName'});                                  printf("<P>Uspje¹no pobrisano: %s\n", $Value{'SearchName'});
5315                          }                          }
5316                          else {                          else {
5317                                  printf("<P>Failed to delete: %s\n", $Value{'SearchName'});                                  printf("<P>Nije pobrisano: %s\n", $Value{'SearchName'});
5318                          }                          }
5319                  }                  }
5320                  elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) {                  elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) {
# Line 5443  sub vProcessSavedSearch { Line 5328  sub vProcessSavedSearch {
5328                                  $Value{'SearchStatus'} =  ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ;                                  $Value{'SearchStatus'} =  ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ;
5329                                                                    
5330                                  if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) {                                  if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) {
5331                                          printf("<P>Successfully %s: %s\n",                                          printf("<P>Uspje¹no %s: %s\n",
5332                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'});                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "ukljuèeno" : "iskljuèeno", $Value{'SearchName'});
5333                                  }                                  }
5334                                  else {                                  else {
5335                                          printf("<P>Failed to %s: %s\n",                                          printf("<P>Nije %s: %s\n",
5336                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'});                                                          ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "ukljuèeno" : "iskljuèeno", $Value{'SearchName'});
5337                                  }                                  }
5338                          }                          }
5339                  }                  }
# Line 5550  sub vGetSaveFolder { Line 5435  sub vGetSaveFolder {
5435    
5436    
5437          # Print up the title          # Print up the title
5438          print("<H3> Snimanje foldera s dokumentima: </H3>\n");          print("<H3> Kreiranje korisnièkog foldera: </H3>\n");
5439    
5440          # Print up the form          # Print up the form
5441          printf("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetSaveFolder\" onSubmit=\"return checkForm(this)\" METHOD=POST>\n");          printf("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetSaveFolder\" onSubmit=\"return checkForm(this)\" METHOD=POST>\n");
# Line 5599  sub vGetSaveFolder { Line 5484  sub vGetSaveFolder {
5484                  # Delete the old content                  # Delete the old content
5485                  delete($main::FormData{'Documents'});                  delete($main::FormData{'Documents'});
5486    
5487    ###FIX
5488                  if ( defined($main::FormData{'Document'}) ) {                  if ( defined($main::FormData{'Document'}) ) {
5489                          print("<TR>\n");                          print("<TR>\n");
5490                          &bDisplayDocuments("Document", $main::FormData{'Document'}, "Document", undef, undef, 1);                          &bDisplayDocuments("Document", $main::FormData{'Document'}, "Document", undef, undef, 1);
# Line 6010  sub vListFolder { Line 5895  sub vListFolder {
5895    
5896                    
5897          # Print out the document folders          # Print out the document folders
5898          print("<H3> Folderi: </H3>\n");          print("<H3> Korisnièki folderi: </H3>\n");
5899                    
5900    
5901          # Get the document folder hash          # Get the document folder hash
# Line 7221  sub vLog { Line 7106  sub vLog {
7106                  }                  }
7107                                    
7108    
7109                  if ( defined($main::FormData{'GetSearch.x'}) ) {                  if ( defined($main::FormData{'GetSearch'}) ) {
7110                          $ENV{'PATH_INFO'} = "/GetSearch";                          $ENV{'PATH_INFO'} = "/GetSearch";
7111                          delete($main::FormData{'GetSearch.x'});                          delete($main::FormData{'GetSearch'});
7112                          delete($main::FormData{'GetSearch.y'});                          delete($main::FormData{'GetSearch'});
7113                  }                  }
7114                                    
7115                  if ( defined($main::FormData{'ListSearchHistory.x'}) ) {                  if ( defined($main::FormData{'ListSearchHistory'}) ) {
7116                          $ENV{'PATH_INFO'} = "/ListSearchHistory";                          $ENV{'PATH_INFO'} = "/ListSearchHistory";
7117                          delete($main::FormData{'ListSearchHistory.x'});                          delete($main::FormData{'ListSearchHistory'});
7118                          delete($main::FormData{'ListSearchHistory.y'});                          delete($main::FormData{'ListSearchHistory'});
7119                  }                  }
7120                                    
7121                  if ( defined($main::FormData{'ListSavedSearch.x'}) ) {                  if ( defined($main::FormData{'ListSavedSearch'}) ) {
7122                          $ENV{'PATH_INFO'} = "/ListSavedSearch";                          $ENV{'PATH_INFO'} = "/ListSavedSearch";
7123                          delete($main::FormData{'ListSavedSearch.x'});                          delete($main::FormData{'ListSavedSearch'});
7124                          delete($main::FormData{'ListSavedSearch.y'});                          delete($main::FormData{'ListSavedSearch'});
7125                  }                  }
7126                                    
7127                  if ( defined($main::FormData{'ListFolder.x'}) ) {                  if ( defined($main::FormData{'ListFolder'}) ) {
7128                          $ENV{'PATH_INFO'} = "/ListFolder";                          $ENV{'PATH_INFO'} = "/ListFolder";
7129                          delete($main::FormData{'ListFolder.x'});                          delete($main::FormData{'ListFolder'});
7130                          delete($main::FormData{'ListFolder.y'});                          delete($main::FormData{'ListFolder'});
7131                  }                  }
7132                                    
7133                  if ( defined($main::FormData{'GetUserSettings.x'}) ) {                  if ( defined($main::FormData{'GetUserSettings'}) ) {
7134                          $ENV{'PATH_INFO'} = "/GetUserSettings";                          $ENV{'PATH_INFO'} = "/GetUserSettings";
7135                          delete($main::FormData{'GetUserSettings.x'});                          delete($main::FormData{'GetUserSettings'});
7136                          delete($main::FormData{'GetUserSettings.y'});                          delete($main::FormData{'GetUserSettings'});
7137                  }                  }
7138                                    
7139    
# Line 7490  sub fill_SearchFieldDescriptions_fromDB Line 7375  sub fill_SearchFieldDescriptions_fromDB
7375                  }                  }
7376          }          }
7377  }  }
7378    
7379    #--------------------------------------------------------------------------
7380    # show list of all databases
7381    #
7382    # usage: ShowDatabaseCheckBoxes(@SelectedDatabases)
7383    
7384    sub ShowDatabaseCheckBoxes {
7385            # Parse out the database names and put them into a
7386            # hash table, they should be separated with a '\0'
7387            my %Value;
7388    
7389            foreach my $ItemEntry ( @_ ) {
7390                    $Value{$ItemEntry} = $ItemEntry;
7391            }
7392                    
7393            print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
7394            print "<tr><td colspan=3 align=\"center\">
7395                    <font size=-1>Oznaèi
7396                            <a href=\"javascript:SetChecked(1)\">sve</a>,
7397                            <a href=\"javascript:SetChecked(0)\">niti jednu</a>.
7398                    </font>
7399                    </td></tr>";
7400    
7401            my @html_database;
7402    
7403            foreach my $key ( sort keys %main::DatabaseSort ) {
7404                    my $DatabaseName = $main::DatabaseSort{$key};
7405                    my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : "";
7406                    my $ItemEntry = &lEncodeURLData($DatabaseName);
7407                    if ($main::DatabaseDescriptions{$DatabaseName}) {
7408                            push @html_database,"<TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"Database\" VALUE=\"$DatabaseName\" $Value> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetDatabaseInfo?Database=$ItemEntry\" OnMouseOver=\"self.status='Informacije io bazi $main::DatabaseDescriptions{$DatabaseName} '; return true\"> $main::DatabaseDescriptions{$DatabaseName}  </A> </TD>\n";
7409                    } else {
7410                            push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n";
7411                    }
7412            }
7413    
7414    
7415            if ($main::ConfigurationData{'output-colums'}) {
7416                    # create database names in columns
7417    
7418                    my $cols = $main::ConfigurationData{'show-nr-colums'};
7419                    my $next = int($#html_database/$cols) ;
7420    
7421                    for(my $i=0; $i <= $next ; $i++) {
7422                            print("<tr>");
7423                            for(my $j=0; $j <= $cols; $j++) {
7424                                    print($html_database[$i+$next*$j+$j] || '');
7425                            }
7426                            print("</tr>");
7427                    }
7428    
7429            } else {
7430                    for(my $i=0; $i <= $#html_database ; $i=$i+1) {
7431                            print("<tr>",$html_database[$i],"</tr>");
7432                    }
7433            }
7434    
7435            print("</TABLE>\n");
7436    }

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

  ViewVC Help
Powered by ViewVC 1.1.26