X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=www%2Fsearch.egw;h=c25bfb93eef8ef02f30415161e29309c6751b282;hb=c6ea088406ba64e6ed5ea833e1c2ae516552e18e;hp=26fce8de8c2143e6af4747fb040db09807c841d5;hpb=cbf0ef7549f996f4d96f41c6dafa76dc17dd7782;p=egate.git
diff --git a/www/search.egw b/www/search.egw
index 26fce8d..c25bfb9 100644
--- a/www/search.egw
+++ b/www/search.egw
@@ -1,254 +1,192 @@
{
-# $Id: search.egw,v 1.5 1995/10/31 16:56:24 adam Exp $
+# $Id: search.egw,v 1.18 1995/12/20 16:31:31 adam Exp $
-proc search-response {} {
- global sessionWait
-
- set status [z39.1 responseStatus]
- if {[lindex $status 0] == "NSD"} {
- z39.1 nextResultSetPosition 0
- set code [lindex $status 1]
- set msg [lindex $status 2]
- set addinfo [lindex $status 3]
- htmlr {Error} $code {: } $msg {: } $addinfo {
}
- set sessionWait -2
- } else {
- set sessionWait 1
- }
-}
-
-proc ok-response {} {
- global sessionWait
- set sessionWait 1
-}
-
-proc fail-response {} {
- global sessionWait
- set sessionWait -1
-}
-
-proc display-brief {zset no} {
- global env
+proc buttons {setNo setMax startPos after} {
global sessionId
-
- set type [$zset type $no]
- if {$type == "SD"} {
- set err [lindex [$zset diag $no] 1]
- set add [lindex [$zset diag $no] 2]
- if {$add != {}} {
- set add " :${add}"
+ global useIcons
+ global env
+ global hist
+
+ if {!$useIcons && $after && $setMax < [z39.$setNo resultCount]} {
+ html "
\n" + html "
\n"
+ if {$useIcons} {
+ html {}
+ }
+ if {$setMax < [z39.$setNo resultCount]} {
+ html {}
+ } else {
+ html {">Next records} " | \n"
}
- htmlr "${no} Error ${err}${add}
"
- return
- }
- if {$type != "DB"} {
- return
}
- html "${no} "
- set rtype [$zset recordType $no]
- if {$rtype == "SUTRS"} {
- html [join [$zset getSutrs $no]]
- htmlr {
}
- return
- }
- if {![catch {
- set title [lindex [$zset getMarc $no field 245 * a] 0]
- set year [lindex [$zset getMarc $no field 260 * c] 0]
- } ] } {
- html { } $title {}
- html " ${year} "
- }
- htmlr {
}
-}
-
-proc display-full {zset no} {
- set type [$zset type $no]
- if {$type == "SD"} {
- set err [lindex [$zset diag $no] 1]
- set add [lindex [$zset diag $no] 2]
- if {$add != {}} {
- set add " :${add}"
+ if {$startPos != "" && $startPos != "1"} {
+ html {}
+ } else {
+ html {">Previous records} " | \n"
}
- htmlr "
\n" + if {!$useIcons && !$after && $startPos != "" && $startPos != "1"} { + html "
\n" } -} -proc display-rec {from to} { - while {$from <= $to} { - display-brief z39.1 $from - incr from - } } -proc build-query {} { - global targets - global t - - set op {} - set q {} - for {set i 1} {$i < 4} {incr i} { - set term [wform entry$i] - if {$term != ""} { - set field [wform menu$i] - foreach x [lindex $targets($t) 2] { - if {[lindex $x 0] == $field} { - set attr [lindex $x 1] - } - } - switch $op { - And - { set q "@and $q ${attr} ${term}" } - Or - { set q "@or $q ${attr} ${term}" } - {And not} - { set q "@not $q ${attr} ${term}" } - {} - { set q "${attr} ${term}" } - } - set op [wform logic$i] - } + if {[info commands saveState] == ""} { + source z39util.tcl } - return $q -} - global sessionWait - global host - - set newHost $sessionParms - set databases [lindex $targets($newHost) 1] - - htmlr {