--- search/Search.cgi 2002/06/25 15:25:14 1.14 +++ search/Search.cgi 2002/07/17 16:55:07 1.23 @@ -393,7 +393,7 @@ } print ''; print ''; - print("\n\n"); + print("\n\n"); # Send the header snippet file @@ -506,20 +506,20 @@ my $DISABLED; $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : ""; - print(""); + print(""); if ( defined($main::RemoteUser) ) { $DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : ""; - print""; + print""; $DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : ""; - print""; + print""; $DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : ""; - print""; + print""; $DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : ""; - print""; + print""; } @@ -1509,9 +1509,17 @@ # Initialize the search string $SearchString = ""; +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; +} + # 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 @@ -1519,22 +1527,22 @@ my ($FieldName) = "FieldName" . $Value; my ($FieldContent) = "FieldContent" . $Value; + + if ( defined($Content{$FieldName}) && defined($Content{$FieldContent}) ) { - if ( defined($Content{$FieldName}) ) { - $SearchString .= defined($Content{$FieldContent}) ? - (($SearchString ne "") ? " AND " : "") . "$Content{$FieldName}=(" . $Content{$FieldContent} . ")" : ""; + if ($Content{$FieldName} eq "ISBN") { + # fix stupid problem with dashes in data + $Content{$FieldContent} .= "*"; + } + + $SearchString .= ($SearchString ne "") ? " AND " : ""; + $SearchString .= "$Content{$FieldName}=(" . nuke_accents($Content{$FieldContent}) . ")"; } } - # nuke accented chars - $SearchString =~ tr/ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁčáíóúĄąŽžĘęźČşÁÂĚŞŻżĂăđĐĎËďŇÍÎěŢŮÓÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘¸¨˙Řř/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; - # convert search string to lower case -> make search case insensitive - $SearchString =~ tr/A-Z/a-z/; - # Add the internal search terms - # Add the date restriction on the load time if ( defined($Content{'LastRunTime'}) && ($Content{'LastRunTime'} > 0) ) { $SearchString .= (($SearchString ne "") ? " AND " : "") . "time_t>=$Content{'LastRunTime'}"; @@ -1954,10 +1962,12 @@ # Print the title if ( $HTML ) { printf("%s%s:\n", - defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : ""); +# defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : ""); + $Title); } else { - printf("%s%s:\n", defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : ""); +# printf("%s%s:\n", defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : ""); + print $Title; } @@ -1978,6 +1988,8 @@ $Headline =~ s/ //gs; $Headline =~ s/<.*?>//gs; $Headline =~ s/\s+/ /gs; + # decode some basic html from headline + $Headline =~ s/<(\/?[bi])>/<$1>/g; # Create a generic link for this document $Value = ""; @@ -2008,7 +2020,8 @@ # Put up the headline and the score, this one links to the document if ( $HTML ) { - print("$SelectorText $Headline ( $main::DatabaseDescriptions{$Value{'Database'}} )
\n"); +# print("$SelectorText $Headline ( $main::DatabaseDescriptions{$Value{'Database'}} )
\n"); + print("$SelectorText $Headline
\n"); # if ( defined($URL) && ($URL ne "") ) { # $Value = (length($URL) > $main::DefaultMaxVisibleUrlLength) ? substr($URL, 0, $main::DefaultMaxVisibleUrlLength) . "..." : $URL; @@ -2188,7 +2201,7 @@ print("\n"); # Print the selector - print("\n", + printf("\n", ($ResultCount > 0) ? $ResultCount : "no"); print("
Odabranima se smatraju svi rezultati ukoliko niste učinili nikakav dodatan odabir. \n"); + print("
Odabrani su svi rezultati ukoliko niste učinili nikakav dodatan odabir. \n"); if ( $ResultCount > 0 ) { @@ -2203,7 +2216,7 @@ if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) { print("
Pronađeno: %s rezultata (Maksimalni broj podešen na: $Content{'Max'} )
Pronađeno: %s rezultata (Maksimalni broj podešen na: $Content{'Max'} )
\n"); @@ -2653,7 +2666,7 @@ print(" $SelectorText $Headline
 "); } else { - printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score); + printf("%3d $Headline \n", $Score); } if (0) { ## don't display description @@ -2932,24 +2945,9 @@ # Make sure that we send the header - $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Pretraživanje s više kriterija" : "Jednostavno pretraživanje"; - my $JavaScript = ' - '; + $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Složeno pretraživanje" : "Jednostavno pretraživanje"; - &vSendHTMLHeader($Value, $JavaScript); + &vSendHTMLHeader($Value, $main::JavaScript_SetChecked); undef(%Value); $Value{'GetSearch'} = "GetSearch"; @@ -2988,11 +2986,11 @@ if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) { print("\n"); - print(" Kliknite na trokutić da biste suzili formu.\n"); + print(" Jednostavno pretraživanje (kliknite na trokutić)\n"); } else { print("\n"); - print(" Kliknite na trokutić da biste proširili formu.\n"); + print(" Složeno pretraživanje (kliknite na trokutić)\n"); } print("\n"); @@ -3020,11 +3018,13 @@ for (my $field=1; $field<= $nr_fields; $field++) { - print(""); + print ""; if ($field == 1 ) { - print ("Pretraži u određenom polju:"); + print ""; + print "Pretraži u odabranom polju:"; + print ""; } - print (""); + print (""); print (" \n"); + print(" \n"); } @@ -3064,13 +3063,8 @@ # Database selection if ( %main::DatabaseDescriptions ) { - print(" Odaberite bazu koju želite pretraživati: - - Označi - sve, - niti jednu. - - + print(" Odaberite knjižnicu čiji fond želite pretraživati: + "); # Parse out the database names and put them into a @@ -3136,7 +3130,7 @@ # Send the end date - print(" Ograniči na knjige izdane prije godine:: \n"); $Value = (!defined($main::FormData{'Before'})) ? "SELECTED" : ""; print("