--- search/Search.cgi 2002/06/13 17:01:56 1.1.1.1
+++ search/Search.cgi 2002/06/25 19:31:07 1.20
@@ -1,17 +1,21 @@
#!/usr/bin/perl -w
#*****************************************************************************
-# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved *
-# *
-# *
-# This notice is intended as a precaution against inadvertent publication *
-# and does not constitute an admission or acknowledgement that publication *
-# has occurred or constitute a waiver of confidentiality. *
-# *
-# This software is the proprietary and confidential property *
-# of FS Consulting, Inc. *
+# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved *
+# *
+# *
+# This notice is intended as a precaution against inadvertent publication *
+# and does not constitute an admission or acknowledgement that publication *
+# has occurred or constitute a waiver of confidentiality. *
+# *
+# This software is the proprietary and confidential property *
+# of FS Consulting, Inc. *
#*****************************************************************************
+#print "Content-type: text/plain\n\n";
+
+#use Data::Dumper;
+
#--------------------------------------------------------------------------
#
# Author: Francois Schiettecatte (FS Consulting, Inc.)
@@ -179,53 +183,8 @@
#
-# List of default configuration settings
-%main::DefaultSettings = (
- '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-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 ;
-
+# read configuration fields
+require "config.pm";
# List of required configuration settings
@main::RequiredSettings = (
@@ -273,25 +232,6 @@
$main::QueryReportMimeType = "application/x-wais-report";
-
-# 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',
-);
-
-
# Array of mime type names, we use this to map
# mime types to mime type names (which are more readable)
%main::MimeTypeNames = (
@@ -436,7 +376,7 @@
if ( ! $ENV{'GATEWAY_INTERFACE'} ) {
return;
}
-
+
# Bail if we have already sent the header
if ( $main::HeaderSent ) {
return;
@@ -452,6 +392,7 @@
print("$JavaScript\n");
}
print '';
+ print '';
print("\n
\n");
@@ -461,8 +402,11 @@
# Send the banner
print("
\n");
+
+ print("\n");
# Set the flag saying that the header has been sent
@@ -559,43 +503,23 @@
}
}
- if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {
- print("");
- }
- else {
- print("");
+ my $DISABLED;
-
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : "";
+ print("");
if ( defined($main::RemoteUser) ) {
- if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) {
- print("");
- }
- else {
- print("");
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : "";
+ print"";
- if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) {
- print("");
- }
- else {
- print("");
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : "";
+ print"";
- if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) {
- print("");
- }
- else {
- print("");
- }
-
- if ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) {
- print("");
- }
- else {
- print("");
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : "";
+ print"";
+
+ $DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : "";
+ print"";
}
@@ -1595,20 +1519,26 @@
my ($FieldName) = "FieldName" . $Value;
my ($FieldContent) = "FieldContent" . $Value;
+
-
- if ( defined($Content{$FieldName}) ) {
- $SearchString .= defined($Content{$FieldContent}) ?
- (($SearchString ne "") ? " AND " : "") . "$Content{$FieldName}=(" . $Content{$FieldContent} . ")" : "";
+ 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} . ")";
}
}
- # nuke accented chars
- $SearchString =~ tr/ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁčáíóúĄąŽžĘęźČşÁÂĚŞŻżĂăđĐĎËďŇÍÎěŢŮÓÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘¸¨˙Řř/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/;
-
# 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'}";
@@ -2028,10 +1958,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;
}
@@ -2146,18 +2078,15 @@
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);
my ($Value, %Value, @Values, $ValueEntry);
-
-
+
+
# Check input parameters
if ( !defined($SearchResults) || !%Content ) {
return (0);
}
-
-
# Split the search results text into a search results list
@SearchResults = split(/\n/, $SearchResults);
-
# First we count up the number of results and scoop up
@@ -2265,7 +2194,7 @@
print("
\n");
# Print the selector
- 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 ) {
@@ -2280,7 +2209,7 @@
if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) {
print("
Datum - najprije novije\n");
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";
print("
Datum - najprije starije\n");
+### FIX:: SORT
+# print("
autor\n");
+# print("
naslov\n");
print("
\n");
@@ -3369,11 +3282,11 @@
# Check that at least one database was selected
if ( !defined($main::FormData{'Database'}) ) {
- print("
Database Search:
\n");
- print("
Sorry, no database(s) were selected for searching.
\n");
+ print("
Pretraživanje baza:
\n");
+ print("
Niste odabrali knjižnicu koju želite pretraživati.
\n");
print("
\n");
- print("There needs to be a least one database selected in order to perform the search.\n");
- print("Click 'back' on your browser, select at least one database and try again.\n");
+ print("Potrebno je da barem jedna knjižnica bude odabrana, kako biste mogli pretraživati.\n");
+ print("Kliknite na 'back' u svom browseru, odaberite barem jednu knjižnicu i pokušajte ponovo.\n");
goto bailFromGetSearchResults;
}
@@ -4046,7 +3959,7 @@
# Make sure that we send the header
- &vSendHTMLHeader("My Settings", undef);
+ &vSendHTMLHeader("My Settings", $main::JavaScript_SetChecked);
undef(%Value);
$Value{'GetUserSettings'} = "GetUserSettings";
&vSendMenuBar(%Value);
@@ -4084,7 +3997,7 @@
print("
Postavke:
\n");
print("
\n");
- print("
\n");
@@ -5370,13 +5259,13 @@
# Set the title
if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) {
- $Title = "Obriši sačuvana pretraživanja";
+ $Title = "Brisanje sačuvanih pretraživanja";
}
elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) {
- $Title = "Aktiviraj sačuvana pretraživanja";
+ $Title = "Uključivanje automatskog periodičnog pretraživanja";
}
elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) {
- $Title = "Stavi u mirovanje sačuvana pretraživanja";
+ $Title = "Isključivanje automatskog periodičnog pretraživanja";
}
@@ -5391,9 +5280,9 @@
# Check to see if the saved search object is defined
if ( ! defined($main::FormData{'SavedSearchObject'}) ) {
# Could not find the saved search object
- print("
Sorry, no searches were selected.
\n");
+ print("
Niste odabrali niti jedan upit.
\n");
print("
\n");
- 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");
print("