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"; |
#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.) |
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 = ( |
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 |
|
|
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=\"Spremljena pretraživanja\" $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 |
|
|
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'}"; |
2076 |
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); |
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); |
2077 |
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); |
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); |
2078 |
my ($Value, %Value, @Values, $ValueEntry); |
my ($Value, %Value, @Values, $ValueEntry); |
2079 |
|
|
2080 |
|
|
2081 |
# Check input parameters |
# Check input parameters |
2082 |
if ( !defined($SearchResults) || !%Content ) { |
if ( !defined($SearchResults) || !%Content ) { |
2083 |
return (0); |
return (0); |
2084 |
} |
} |
2085 |
|
|
|
|
|
|
|
|
2086 |
# Split the search results text into a search results list |
# Split the search results text into a search results list |
2087 |
@SearchResults = split(/\n/, $SearchResults); |
@SearchResults = split(/\n/, $SearchResults); |
|
|
|
2088 |
|
|
2089 |
|
|
2090 |
# First we count up the number of results and scoop up |
# First we count up the number of results and scoop up |
2394 |
} |
} |
2395 |
|
|
2396 |
|
|
2397 |
|
### FIX:: ADD SORT HERE |
2398 |
if ( $ResultCount > 0 ) { |
if ( $ResultCount > 0 ) { |
2399 |
|
|
2400 |
# Loop over each entry in the hits list |
# Loop over each entry in the hits list |
2652 |
if ( $HTML ) { |
if ( $HTML ) { |
2653 |
print("<!-- resultItem -->\n"); |
print("<!-- resultItem -->\n"); |
2654 |
#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>"); |
2655 |
|
# decode some basic html from headline <b> <i> |
2656 |
|
$Headline =~ s/<(\/?[bi])>/<$1>/g; |
2657 |
|
|
2658 |
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> "); |
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> "); |
2659 |
} else { |
} else { |
2660 |
printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score); |
printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score); |
2936 |
|
|
2937 |
|
|
2938 |
# Make sure that we send the header |
# Make sure that we send the header |
2939 |
$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"; |
|
my $JavaScript = '<SCRIPT LANGUAGE="JavaScript"> |
|
|
<!-- hide |
|
|
function SetChecked(val) { |
|
|
dml=document.Search; |
|
|
len = dml.elements.length; |
|
|
var i=0; |
|
|
for( i=0 ; i<len ; i++) { |
|
|
if (dml.elements[i].name==\'Database\') { |
|
|
dml.elements[i].checked=val; |
|
|
} |
|
|
} |
|
|
} |
|
|
// --> |
|
|
</SCRIPT> |
|
|
'; |
|
2940 |
|
|
2941 |
&vSendHTMLHeader($Value, $JavaScript); |
&vSendHTMLHeader($Value, $main::JavaScript_SetChecked); |
2942 |
|
|
2943 |
undef(%Value); |
undef(%Value); |
2944 |
$Value{'GetSearch'} = "GetSearch"; |
$Value{'GetSearch'} = "GetSearch"; |
2977 |
|
|
2978 |
if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) { |
if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) { |
2979 |
print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetSimpleSearch\">\n"); |
print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetSimpleSearch\">\n"); |
2980 |
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"); |
2981 |
} |
} |
2982 |
else { |
else { |
2983 |
print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetExpandedSearch\">\n"); |
print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetExpandedSearch\">\n"); |
2984 |
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"); |
2985 |
} |
} |
2986 |
print("</FORM></TD>\n"); |
print("</FORM></TD>\n"); |
2987 |
|
|
3009 |
|
|
3010 |
for (my $field=1; $field<= $nr_fields; $field++) { |
for (my $field=1; $field<= $nr_fields; $field++) { |
3011 |
|
|
3012 |
print("<TR><TD ALIGN=LEFT VALIGN=TOP>"); |
print "<TR>"; |
3013 |
if ($field == 1 ) { |
if ($field == 1 ) { |
3014 |
print ("Pretraži u određenom polju:"); |
print "<TD ALIGN=LEFT VALIGN=TOP ROWSPAN=$nr_fields>"; |
3015 |
|
print "Pretraži u odabranom polju:"; |
3016 |
|
print "</td>"; |
3017 |
} |
} |
3018 |
print ("</TD><TD ALIGN=RIGHT VALIGN=TOP>"); |
print ("<TD ALIGN=RIGHT VALIGN=TOP>"); |
3019 |
|
|
3020 |
print ("<SELECT NAME=\"FieldName${field}\">"); |
print ("<SELECT NAME=\"FieldName${field}\">"); |
3021 |
for (my $i=0; $i<=$#SearchFieldNames; $i++) { |
for (my $i=0; $i<=$#SearchFieldNames; $i++) { |
3033 |
if (defined($main::FormData{"FieldContent${field}"})) { |
if (defined($main::FormData{"FieldContent${field}"})) { |
3034 |
$Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'"; |
$Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'"; |
3035 |
} |
} |
3036 |
print("</SELECT></TD><TD ALIGN=LEFT><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n"); |
print("</SELECT></TD><TD ALIGN=LEFT VALIGN=TOP><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n"); |
3037 |
} |
} |
3038 |
|
|
3039 |
|
|
3055 |
# Database selection |
# Database selection |
3056 |
if ( %main::DatabaseDescriptions ) { |
if ( %main::DatabaseDescriptions ) { |
3057 |
|
|
3058 |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju želite pretraživati: |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite knjižnicu čiji fond želite pretraživati:</TD></TR> |
3059 |
</td><td> |
<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4> |
|
<font size=-1>Označi |
|
|
<a href=\"javascript:SetChecked(1)\">sve</a>, |
|
|
<a href=\"javascript:SetChecked(0)\">niti jednu</a>. |
|
|
</font> |
|
|
</TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4> |
|
3060 |
"); |
"); |
3061 |
|
|
3062 |
# Parse out the database names and put them into a |
# Parse out the database names and put them into a |
3160 |
print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n"); |
print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n"); |
3161 |
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : ""; |
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : ""; |
3162 |
print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n"); |
print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n"); |
3163 |
|
### FIX:: SORT |
3164 |
|
# print("<OPTION VALUE=\"SORT:700+:DESC\"> autor\n"); |
3165 |
|
# print("<OPTION VALUE=\"SORT:200+:DESC\"> naslov\n"); |
3166 |
print("</SELECT> </TD></TR>\n"); |
print("</SELECT> </TD></TR>\n"); |
3167 |
|
|
3168 |
|
|
3280 |
|
|
3281 |
# Check that at least one database was selected |
# Check that at least one database was selected |
3282 |
if ( !defined($main::FormData{'Database'}) ) { |
if ( !defined($main::FormData{'Database'}) ) { |
3283 |
print("<H3>Database Search:</H3>\n"); |
print("<H3>Pretraživanje baza:</H3>\n"); |
3284 |
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"); |
3285 |
print("<P>\n"); |
print("<P>\n"); |
3286 |
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"); |
3287 |
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"); |
3288 |
goto bailFromGetSearchResults; |
goto bailFromGetSearchResults; |
3289 |
} |
} |
3290 |
|
|
3957 |
|
|
3958 |
|
|
3959 |
# Make sure that we send the header |
# Make sure that we send the header |
3960 |
&vSendHTMLHeader("My Settings", undef); |
&vSendHTMLHeader("My Settings", $main::JavaScript_SetChecked); |
3961 |
undef(%Value); |
undef(%Value); |
3962 |
$Value{'GetUserSettings'} = "GetUserSettings"; |
$Value{'GetUserSettings'} = "GetUserSettings"; |
3963 |
&vSendMenuBar(%Value); |
&vSendMenuBar(%Value); |
3995 |
print("<H3> Postavke: </H3>\n"); |
print("<H3> Postavke: </H3>\n"); |
3996 |
|
|
3997 |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n"); |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n"); |
3998 |
print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetUserSettings\" METHOD=POST>\n"); |
print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetUserSettings\" NAME=\"Search\" METHOD=POST>\n"); |
3999 |
|
|
4000 |
# Send the buttons |
# Send the buttons |
4001 |
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"); |
4057 |
|
|
4058 |
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"); |
4059 |
|
|
4060 |
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"); |
4061 |
|
|
4062 |
# Parse out the database names and put them into a |
# Parse out the database names and put them into a |
4063 |
# hash table, they should be separated with a '\n' |
# hash table, they should be separated with a '\n' |
4064 |
if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) { |
if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) { |
4065 |
@ItemList = split(",", $SelectedDatabases); |
@ItemList = split(",", $SelectedDatabases); |
4066 |
} |
} |
4067 |
|
|
4068 |
&ShowDatabaseCheckBoxes(@ItemList); |
&ShowDatabaseCheckBoxes(@ItemList); |
4069 |
|
|
4070 |
print("</TD></TR>\n"); |
print("</TD></TR>\n"); |
4210 |
$Value{'UserName'} = $main::FormData{'UserName'}; |
$Value{'UserName'} = $main::FormData{'UserName'}; |
4211 |
$Value{'EmailAddress'} = $main::FormData{'EmailAddress'}; |
$Value{'EmailAddress'} = $main::FormData{'EmailAddress'}; |
4212 |
$Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'}; |
$Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'}; |
4213 |
$Value{'SelectedDatabases'} = $main::FormData{'SelectedDatabases'}; |
$Value{'SelectedDatabases'} = $main::FormData{'Database'}; |
4214 |
if ( defined($Value{'SelectedDatabases'}) ) { |
if ( defined($Value{'SelectedDatabases'}) ) { |
4215 |
$Value{'SelectedDatabases'} =~ s/\0/,/g; |
$Value{'SelectedDatabases'} =~ s/\0/,/g; |
4216 |
} |
} |
5020 |
|
|
5021 |
print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=3> \n"); |
print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=3> \n"); |
5022 |
print("<SELECT NAME=\"Action\">\n"); |
print("<SELECT NAME=\"Action\">\n"); |
5023 |
print("<OPTION VALUE=\"ActivateSavedSearch\">Aktiviraj označena sačuvana pretraživanja\n"); |
print("<OPTION VALUE=\"ActivateSavedSearch\">Uključi periodično automatsko pretraživanje označenih pretraživanja\n"); |
5024 |
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 označenih pretraživanja\n"); |
5025 |
print("<OPTION VALUE=\"DeleteSavedSearch\">Obriši označena sačuvana pretraživanja\n"); |
print("<OPTION VALUE=\"DeleteSavedSearch\">Obriši označena pretraživanja\n"); |
5026 |
print("</SELECT>\n"); |
print("</SELECT>\n"); |
5027 |
print("<INPUT TYPE=SUBMIT VALUE=\"Do It!\">\n"); |
print("<INPUT TYPE=SUBMIT VALUE=\"Do It!\">\n"); |
5028 |
print("</TD></TR>\n"); |
print("</TD></TR>\n"); |
5257 |
|
|
5258 |
# Set the title |
# Set the title |
5259 |
if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) { |
if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) { |
5260 |
$Title = "Obriši sačuvana pretraživanja"; |
$Title = "Brisanje sačuvanih pretraživanja"; |
5261 |
} |
} |
5262 |
elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) { |
elsif ( $ENV{'PATH_INFO'} eq "/ActivateSavedSearch" ) { |
5263 |
$Title = "Aktiviraj sačuvana pretraživanja"; |
$Title = "Uključivanje automatskog periodičnog pretraživanja"; |
5264 |
} |
} |
5265 |
elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) { |
elsif ( $ENV{'PATH_INFO'} eq "/SuspendSavedSearch" ) { |
5266 |
$Title = "Stavi u mirovanje sačuvana pretraživanja"; |
$Title = "Isključivanje automatskog periodičnog pretraživanja"; |
5267 |
} |
} |
5268 |
|
|
5269 |
|
|
5278 |
# Check to see if the saved search object is defined |
# Check to see if the saved search object is defined |
5279 |
if ( ! defined($main::FormData{'SavedSearchObject'}) ) { |
if ( ! defined($main::FormData{'SavedSearchObject'}) ) { |
5280 |
# Could not find the saved search object |
# Could not find the saved search object |
5281 |
print("<H3><CENTER> Sorry, no searches were selected. </CENTER></H3>\n"); |
print("<H3><CENTER>Niste odabrali niti jedno pretraživanje. </CENTER></H3>\n"); |
5282 |
print("<P>\n"); |
print("<P>\n"); |
5283 |
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 jedno pretraživanje nad kojim će se izvršiti akcija.\n"); |
5284 |
print("<P>\n"); |
print("<P>\n"); |
5285 |
goto bailFromProcessSavedSearch; |
goto bailFromProcessSavedSearch; |
5286 |
} |
} |
5309 |
|
|
5310 |
if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) { |
if ( $ENV{'PATH_INFO'} eq "/DeleteSavedSearch" ) { |
5311 |
if ( unlink($SavedSearchFilePath) ) { |
if ( unlink($SavedSearchFilePath) ) { |
5312 |
printf("<P>Successfully deleted: %s\n", $Value{'SearchName'}); |
printf("<P>Uspješno pobrisano: %s\n", $Value{'SearchName'}); |
5313 |
} |
} |
5314 |
else { |
else { |
5315 |
printf("<P>Failed to delete: %s\n", $Value{'SearchName'}); |
printf("<P>Nije pobrisano: %s\n", $Value{'SearchName'}); |
5316 |
} |
} |
5317 |
} |
} |
5318 |
elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) { |
elsif ( ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") || ($ENV{'PATH_INFO'} eq "/SuspendSavedSearch") ) { |
5326 |
$Value{'SearchStatus'} = ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ; |
$Value{'SearchStatus'} = ($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "Active" : "Inactive" ; |
5327 |
|
|
5328 |
if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) { |
if ( &iSaveXMLFileFromHash($SavedSearchFilePath, "SavedSearch", %Value) ) { |
5329 |
printf("<P>Successfully %s: %s\n", |
printf("<P>Uspješno %s: %s\n", |
5330 |
($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'}); |
($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "uključeno" : "isključeno", $Value{'SearchName'}); |
5331 |
} |
} |
5332 |
else { |
else { |
5333 |
printf("<P>Failed to %s: %s\n", |
printf("<P>Nije %s: %s\n", |
5334 |
($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "activated" : "suspended", $Value{'SearchName'}); |
($ENV{'PATH_INFO'} eq "/ActivateSavedSearch") ? "uključeno" : "isključeno", $Value{'SearchName'}); |
5335 |
} |
} |
5336 |
} |
} |
5337 |
} |
} |
7104 |
} |
} |
7105 |
|
|
7106 |
|
|
7107 |
if ( defined($main::FormData{'GetSearch.x'}) ) { |
if ( defined($main::FormData{'GetSearch'}) ) { |
7108 |
$ENV{'PATH_INFO'} = "/GetSearch"; |
$ENV{'PATH_INFO'} = "/GetSearch"; |
7109 |
delete($main::FormData{'GetSearch.x'}); |
delete($main::FormData{'GetSearch'}); |
7110 |
delete($main::FormData{'GetSearch.y'}); |
delete($main::FormData{'GetSearch'}); |
7111 |
} |
} |
7112 |
|
|
7113 |
if ( defined($main::FormData{'ListSearchHistory.x'}) ) { |
if ( defined($main::FormData{'ListSearchHistory'}) ) { |
7114 |
$ENV{'PATH_INFO'} = "/ListSearchHistory"; |
$ENV{'PATH_INFO'} = "/ListSearchHistory"; |
7115 |
delete($main::FormData{'ListSearchHistory.x'}); |
delete($main::FormData{'ListSearchHistory'}); |
7116 |
delete($main::FormData{'ListSearchHistory.y'}); |
delete($main::FormData{'ListSearchHistory'}); |
7117 |
} |
} |
7118 |
|
|
7119 |
if ( defined($main::FormData{'ListSavedSearch.x'}) ) { |
if ( defined($main::FormData{'ListSavedSearch'}) ) { |
7120 |
$ENV{'PATH_INFO'} = "/ListSavedSearch"; |
$ENV{'PATH_INFO'} = "/ListSavedSearch"; |
7121 |
delete($main::FormData{'ListSavedSearch.x'}); |
delete($main::FormData{'ListSavedSearch'}); |
7122 |
delete($main::FormData{'ListSavedSearch.y'}); |
delete($main::FormData{'ListSavedSearch'}); |
7123 |
} |
} |
7124 |
|
|
7125 |
if ( defined($main::FormData{'ListFolder.x'}) ) { |
if ( defined($main::FormData{'ListFolder'}) ) { |
7126 |
$ENV{'PATH_INFO'} = "/ListFolder"; |
$ENV{'PATH_INFO'} = "/ListFolder"; |
7127 |
delete($main::FormData{'ListFolder.x'}); |
delete($main::FormData{'ListFolder'}); |
7128 |
delete($main::FormData{'ListFolder.y'}); |
delete($main::FormData{'ListFolder'}); |
7129 |
} |
} |
7130 |
|
|
7131 |
if ( defined($main::FormData{'GetUserSettings.x'}) ) { |
if ( defined($main::FormData{'GetUserSettings'}) ) { |
7132 |
$ENV{'PATH_INFO'} = "/GetUserSettings"; |
$ENV{'PATH_INFO'} = "/GetUserSettings"; |
7133 |
delete($main::FormData{'GetUserSettings.x'}); |
delete($main::FormData{'GetUserSettings'}); |
7134 |
delete($main::FormData{'GetUserSettings.y'}); |
delete($main::FormData{'GetUserSettings'}); |
7135 |
} |
} |
7136 |
|
|
7137 |
|
|
7389 |
} |
} |
7390 |
|
|
7391 |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n"); |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n"); |
7392 |
|
print "<tr><td colspan=3 align=\"center\"> |
7393 |
|
<font size=-1>Označi |
7394 |
|
<a href=\"javascript:SetChecked(1)\">sve</a>, |
7395 |
|
<a href=\"javascript:SetChecked(0)\">niti jednu</a>. |
7396 |
|
</font> |
7397 |
|
</td></tr>"; |
7398 |
|
|
7399 |
my @html_database; |
my @html_database; |
7400 |
|
|