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/; |
|
|
# convert search string to lower case -> make search case insensitive |
|
|
$SearchString =~ tr/A-Z/a-z/; |
|
|
|
|
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'}"; |
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:</TD></TR> |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite knji¾nicu èiji fond ¾elite pretra¾ivati:</TD></TR> |
3059 |
<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4> |
<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4> |
3060 |
"); |
"); |
3061 |
|
|
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 |
|
|
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 |
} |
} |