--- search/Search.cgi 2002/06/25 19:46:16 1.21 +++ search/Search.cgi 2002/10/24 18:42:18 1.27 @@ -393,7 +393,7 @@ } print ''; print ''; - print("\n\n"); + print("\n\n"); # Send the header snippet file @@ -1509,9 +1509,17 @@ # Initialize the search string $SearchString = ""; + # tip gradje + if ( defined($main::FormData{'tip'}) ) { + my @t; + foreach my $tip ( split(/\0/, $main::FormData{'tip'}) ) { + push @t,"tip=$tip"; + } + $SearchString .= "(".join(" or ",@t).") and "; + } # Add the search terms - $SearchString .= defined($Content{'Any'}) ? ((($SearchString ne "") ? " AND " : "") . $Content{'Any'}) : ""; + $SearchString .= defined($Content{'Any'}) ? ((($SearchString ne "") ? " AND " : "") . nuke_accents($Content{'Any'}) ) : ""; # Add the generic field names @@ -1522,18 +1530,14 @@ if ( defined($Content{$FieldName}) && defined($Content{$FieldContent}) ) { - # nuke accented chars - $Content{$FieldContent} =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´­½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; - # convert search string to lower case -> make search case insensitive - $Content{$FieldContent} =~ tr/A-Z/a-z/; - + if ($Content{$FieldName} eq "ISBN") { # fix stupid problem with dashes in data $Content{$FieldContent} .= "*"; } $SearchString .= ($SearchString ne "") ? " AND " : ""; - $SearchString .= "$Content{$FieldName}=(" . $Content{$FieldContent} . ")"; + $SearchString .= "$Content{$FieldName}=(" . nuke_accents($Content{$FieldContent}) . ")"; } } @@ -2348,7 +2352,7 @@ if ( $HTML ) { - printf(" Pronaðeno: %s rezultata (Maksimalni broj pode¹en na: $Content{'Max'} ) \n", + printf(" Pronaðeno: %s rezultata (Maksimalni broj pode¹en na: $Content{'Max'} ) \n", ($ResultCount > 0) ? $ResultCount : "no"); print("\n"); @@ -2982,7 +2986,7 @@ if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) { print("\n"); - print(" Jednostavo pretra¾ivanje (kliknite na trokutiæ)\n"); + print(" Jednostavno pretra¾ivanje (kliknite na trokutiæ)\n"); } else { print("\n"); @@ -2994,7 +2998,7 @@ # Send the start of the form and the buttons print("\n"); - print("
\n"); + print(" \n"); print("\n"); print("
\n"); @@ -3031,7 +3035,6 @@ } elsif ($i == ($field - 1)) { $Selected = "SELECTED"; } - print("
\n"); print("\n"); @@ -3219,8 +3227,6 @@ my ($DatabaseRelevanceFeedbackFilterKey, $DatabaseRelevanceFeedbackFilterFunction); my (@Values, %Value, $Value); - - # Check to see if there are any documents selected, if there are, they need # to be converted to RF documents before we put up the header, this is because # the header creates a search link from existing search fields, we also deduplicate @@ -3275,16 +3281,18 @@ $main::FormData{'Database'} = join("\0", keys(%Databases)); } - + # now add all databases that had to be included always + foreach (my $db = @main::always_selected_databases) { + $Databases{$db} = $Value{$db}; + } # Make sure that we send the header &vSendHTMLHeader("Rezultati pretra¾ivanja", undef); undef(%Value); &vSendMenuBar(%Value); - # Check that at least one database was selected - if ( !defined($main::FormData{'Database'}) ) { + if ( !defined($main::FormData{'Database'}) && $#main::always_selected_databases < 0 ) { print("

Pretra¾ivanje baza:

\n"); print("

Niste odabrali knji¾nicu koju ¾elite pretra¾ivati.

\n"); print("

\n"); @@ -3318,14 +3326,17 @@ # Convert all the '\0' to ',' $Databases =~ tr/\0/,/; - + + # add always selected databases + if (@main::always_selected_databases) { + $Databases .= ",".join(",",@main::always_selected_databases); + } # Add the max doc restriction if ( !defined($main::FormData{'Max'}) ) { $main::FormData{'Max'} = $main::DefaultMaxDoc; } - # Generate the search string $SearchString = &sMakeSearchString(%main::FormData); @@ -3736,7 +3747,7 @@ if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) { print("

\n"); # Send the buttons - print(" \n"); + print(" \n"); @@ -4035,14 +4046,14 @@ print("
\n"); - print(" Search Preferences: \n"); + print(" Postavke pretra¾ivanja: \n"); # Send a pull-down which allows the user to select which search form to default to print(" Forma za pretra¾ivanje: \n"); # Send a pull-down which allows the user to select how many previous searches to store @@ -4062,7 +4073,7 @@ print(" Odabrane baze: \n"); - print(" Oznaèite baze koje uvijek ¾elite pretra¾ivati:\n"); + print(" Oznaèite knji¾nice koje uvijek ¾elite pretra¾ivati:\n"); # Parse out the database names and put them into a # hash table, they should be separated with a '\n' @@ -4100,9 +4111,9 @@ } - print("
\n"); +# print("
\n"); - print(" Document Retrieval Preferences: \n"); +# print(" Document Retrieval Preferences: \n"); # Send a pull-down which allows the user to select whether to display summaries or not, and how long we want them if ( defined($main::ConfigurationData{'allow-similiar-search'}) && ($main::ConfigurationData{'allow-similiar-search'} eq "yes") ) { @@ -4123,10 +4134,10 @@ print("
\n"); - print(" Saved Searches Defaults: \n"); + print(" Postavke saèuvanih upita: \n"); # Send a pull-down which allows the user to select the automatic search frequency (default to weekly) - print(" Saved search frequency: \n"); foreach $ItemEntry ( @main::SearchFrequencies ) { $Value = (defined($SearchFrequency) && ($SearchFrequency eq $ItemEntry)) ? "SELECTED" : ""; print("
\n"); } else { - print("

Sorry, currently, there are no saved searches.

\n"); + print("

Trenutno nemate saèuvanih upita!.

\n"); } @@ -5447,7 +5458,7 @@ print("\n"); # Send the buttons - print("\n"); + print("\n"); print("\n"); @@ -5824,9 +5835,9 @@ } } - print("

Saving a Document Folder:

\n"); + print("

Èuvanje korisnièkog foldera:

\n"); print("

\n"); - print("

Your document folder was successfully saved.

\n"); + print("

Va¹ folder je uspje¹no saèuvan!

\n"); } @@ -6295,7 +6306,7 @@ undef(%Value); &vSendMenuBar(%Value); - print("

Document Folder:

\n"); + print("

Korisnièki folder:

\n"); # Start the form @@ -6307,15 +6318,15 @@ print("

\n"); print("\n"); # Print the folder description - $ArticleFolder{'FolderDescription'} = defined($ArticleFolder{'FolderDescription'}) ? $ArticleFolder{'FolderDescription'} : "(No description defined)"; + $ArticleFolder{'FolderDescription'} = defined($ArticleFolder{'FolderDescription'}) ? $ArticleFolder{'FolderDescription'} : "(Nije naveden)"; $ArticleFolder{'FolderDescription'} =~ s/\n/
/g; $ArticleFolder{'FolderDescription'} =~ s/\r/
/g; print("\n"); @@ -6361,7 +6372,7 @@ print("\n"); $Value = &sGetPrintableDateFromTime($ArticleFolder{'UpdateTime'}); - print("\n"); + print("\n"); print("\n"); @@ -6880,7 +6891,6 @@ # Print out the message header (Content-Type) if ( $DeliveryMethod eq "attachement" ) { print("Mime-Version: 1.0\n"); - print("Content-Type: multipart/mixed; boundary=\"============_-1234567890==_============\"\n"); } else { print("Mime-Version: 1.0\n"); @@ -7376,6 +7386,8 @@ my ($FieldName, $FieldDescription, undef) = split(/\t/, $FieldInformation, 3); $main::SearchFieldDescriptions{$FieldName} = $FieldDescription; } + } else { + &vLog("Error - cant read database description from '$Database'\n"); } } @@ -7392,7 +7404,7 @@ foreach my $ItemEntry ( @_ ) { $Value{$ItemEntry} = $ItemEntry; } - + print("
Odabranima se smatraju svi rezultati ukoliko niste uèinili nikakav dodatan odabir. \n"); print("\n"); @@ -6351,7 +6362,7 @@ print("
Naziv: $ArticleFolder{'FolderName'}
Opis: $ArticleFolder{'FolderDescription'}
Datum kreiranja: $Value
Datum zadnje promijene: $Value
Datum zadnje promijene: $Value

\n"); print "
Oznaèi @@ -7436,4 +7448,16 @@ } print("
\n"); + +} + +#-------------------------------------------------------------------------- +# +sub nuke_accents { + my $tmp = $_[0]; + $tmp =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'".'',"'Rr/; + # convert search string to lower case -> make search case insensitive + $tmp =~ tr/A-Z/a-z/; + return $tmp; } +