--- search/Search.cgi 2002/06/25 13:48:12 1.11 +++ search/Search.cgi 2002/06/25 19:31:07 1.20 @@ -232,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 = ( @@ -411,6 +392,7 @@ print("$JavaScript\n"); } print ''; + print ''; print("\n\n"); @@ -521,47 +503,23 @@ } } - if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) { - print("\"Search\""); - - - } - else { - - print(""); + my $DISABLED; - - - } + $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : ""; + print(""); if ( defined($main::RemoteUser) ) { - if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) { - print("\"Search"); - } - else { - print(""); - } + $DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : ""; + print""; - if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) { - print("\"Saved"); - } - else { - print(""); - } + $DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : ""; + print""; - if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) { - print("\"Doument"); - } - else { - print(""); - } - - if ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) { - print("\"My"); - } - else { - print(""); - } + $DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : ""; + print""; + + $DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : ""; + print""; } @@ -1561,22 +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/; - # 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'}"; @@ -1996,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; } @@ -2230,7 +2194,7 @@ print("\n"); # Print the selector - print("\n"); @@ -3062,11 +3011,13 @@ for (my $field=1; $field<= $nr_fields; $field++) { - print(""; if ($field == 1 ) { - print ("Pretraži u određenom polju:"); + print ""; } - print ("\n"); + print("\n"); } @@ -3106,13 +3057,8 @@ # Database selection if ( %main::DatabaseDescriptions ) { - print(" + \n"); &bDisplayDocuments("Document", $main::FormData{'Document'}, "Document", undef, undef, 1); @@ -5949,7 +5895,7 @@ # Print out the document folders - print("

Folderi:

\n"); + print("

Korisnički folderi:

\n"); # Get the document folder hash @@ -7160,34 +7106,34 @@ } - if ( defined($main::FormData{'GetSearch.x'}) ) { + if ( defined($main::FormData{'GetSearch'}) ) { $ENV{'PATH_INFO'} = "/GetSearch"; - delete($main::FormData{'GetSearch.x'}); - delete($main::FormData{'GetSearch.y'}); + delete($main::FormData{'GetSearch'}); + delete($main::FormData{'GetSearch'}); } - if ( defined($main::FormData{'ListSearchHistory.x'}) ) { + if ( defined($main::FormData{'ListSearchHistory'}) ) { $ENV{'PATH_INFO'} = "/ListSearchHistory"; - delete($main::FormData{'ListSearchHistory.x'}); - delete($main::FormData{'ListSearchHistory.y'}); + delete($main::FormData{'ListSearchHistory'}); + delete($main::FormData{'ListSearchHistory'}); } - if ( defined($main::FormData{'ListSavedSearch.x'}) ) { + if ( defined($main::FormData{'ListSavedSearch'}) ) { $ENV{'PATH_INFO'} = "/ListSavedSearch"; - delete($main::FormData{'ListSavedSearch.x'}); - delete($main::FormData{'ListSavedSearch.y'}); + delete($main::FormData{'ListSavedSearch'}); + delete($main::FormData{'ListSavedSearch'}); } - if ( defined($main::FormData{'ListFolder.x'}) ) { + if ( defined($main::FormData{'ListFolder'}) ) { $ENV{'PATH_INFO'} = "/ListFolder"; - delete($main::FormData{'ListFolder.x'}); - delete($main::FormData{'ListFolder.y'}); + delete($main::FormData{'ListFolder'}); + delete($main::FormData{'ListFolder'}); } - if ( defined($main::FormData{'GetUserSettings.x'}) ) { + if ( defined($main::FormData{'GetUserSettings'}) ) { $ENV{'PATH_INFO'} = "/GetUserSettings"; - delete($main::FormData{'GetUserSettings.x'}); - delete($main::FormData{'GetUserSettings.y'}); + delete($main::FormData{'GetUserSettings'}); + delete($main::FormData{'GetUserSettings'}); } @@ -7445,6 +7391,12 @@ } 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 ) { @@ -2245,7 +2209,7 @@ if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) { print("
"); + print "
"; + print "Pretraži u odabranom polju:"; + print ""); + print (""); 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 @@ -3336,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; } @@ -4013,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); @@ -4051,7 +3997,7 @@ print("

Postavke:

\n"); print("\n"); - print("\n"); + print("\n"); # Send the buttons print("\n"); @@ -4113,14 +4059,14 @@ print("\n"); - print("\n"); @@ -4266,7 +4212,7 @@ $Value{'UserName'} = $main::FormData{'UserName'}; $Value{'EmailAddress'} = $main::FormData{'EmailAddress'}; $Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'}; - $Value{'SelectedDatabases'} = $main::FormData{'SelectedDatabases'}; + $Value{'SelectedDatabases'} = $main::FormData{'Database'}; if ( defined($Value{'SelectedDatabases'}) ) { $Value{'SelectedDatabases'} =~ s/\0/,/g; } @@ -4694,7 +4640,7 @@ # Give the user a form to fill out - print("

Saving a search:

\n"); + print("

Čuvanje upita:

\n"); @@ -4747,9 +4693,9 @@ print("\n"); # Send the search name and search description fields - print("\n"); + print("\n"); - print("\n"); + print("\n"); if ( defined($main::FormData{'RfDocument'}) ) { print("\n"); @@ -4760,7 +4706,7 @@ print("\n"); - print("\n"); + print("\n"); @@ -4769,10 +4715,10 @@ print("\n"); - print("\n"); + print("\n"); # Send a pull-down which allows the user to select the automatic search frequency - print("\n"); # Send a pull-down which allows the user to select the automatic search delivery format - print("\n"); # Send a pull-down which allows the user to select the automatic search delivery method - print("\n"); @@ -5176,7 +5122,7 @@ } - print("\n"); + print("\n"); } print("
Odabrane baze:
Označite baze koje uvijek želite pretraživati: \n"); + print("
Označite baze 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' if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) { @ItemList = split(",", $SelectedDatabases); } - + &ShowDatabaseCheckBoxes(@ItemList); print("

Search Name (required):
Naziv (obavezno):
Search Description:
Opis:

Kliknite na ovaj kvadratić ako želite postojeći folder s istim imenom zamijeniti ovim novim:
Kliknite na ovaj kvadratić ako želite postojeći upit s istim imenom zamijeniti ovim novim:

Check to run this search on a regular basis:
Kliknite ovaj kvadratić ukoliko želite automatsko periodičko pretraživanje po ovom upitu:
Select the search frequency:
Odaberite frekvenciju automatskog pretraživanja:
Select the delivery format:
Odaberite format za isporuku rezultata pretraživanja:
Select the delivery method:
Odaberite metodu isporuke:
\n"); print("\n"); print("\n"); print("
[ Otvori formu za pretraživanje s upisanim ovim pretraživanjem ]
[ Otvori formu za pretraživanje s upisanim ovim upitom ]
\n"); @@ -5313,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"; } @@ -5334,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("

\n"); goto bailFromProcessSavedSearch; } @@ -5365,10 +5311,10 @@ if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) { if ( unlink($SavedSearchFilePath) ) { - printf("

Successfully deleted: %s\n", $Value{'SearchName'}); + printf("

Uspješno pobrisano: %s\n", $Value{'SearchName'}); } else { - printf("

Failed to delete: %s\n", $Value{'SearchName'}); + printf("

Nije pobrisano: %s\n", $Value{'SearchName'}); } } elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) { @@ -5382,12 +5328,12 @@ $Value{'SearchStatus'} = ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ; if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) { - printf("

Successfully %s: %s\n", - ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'}); + printf("

Uspješno %s: %s\n", + ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "uključeno" : "isključeno", $Value{'SearchName'}); } else { - printf("

Failed to %s: %s\n", - ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'}); + printf("

Nije %s: %s\n", + ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "uključeno" : "isključeno", $Value{'SearchName'}); } } } @@ -5489,7 +5435,7 @@ # Print up the title - print("

Snimanje foldera s dokumentima:

\n"); + print("

Kreiranje korisničkog foldera:

\n"); # Print up the form printf("
\n"); @@ -5538,7 +5484,7 @@ # Delete the old content delete($main::FormData{'Documents'}); - +###FIX if ( defined($main::FormData{'Document'}) ) { print("
\n"); + print ""; my @html_database;
+ Označi + sve, + niti jednu. + +