- global host
-
- set newHost $sessionParms
- set databases [lindex $targets($newHost) 1]
-
- htmlr {<head><title> WWW/Z39.50 Gateway Search } $newHost { </title>}
- htmlr {</head><body>}
- wflush
-
- if {[catch {z39 callback ok-response}]} {
- ir z39
- }
- if {$newHost != $host} {
- set host $newHost
- z39 disconnect
- z39 callback ok-response
- z39 failback fail-response
-
- htmlr {Connecting to target } $host { <br>}
- set sessionWait 0
- if {[catch {z39 connect $host}]} {
- htmlr "Cannot connect to target ${host} <br>"
- htmlr "</body></html>"
- wabort
- } elseif {$sessionWait == 0} {
- zwait sessionWait
- if {$sessionWait != 1} {
- htmlr "Cannot connect to target ${host} <br>"
- htmlr "</body></html>"
- wabort
+ global nextSetNo
+ global setNo
+ global hist
+
+ set setNo [lindex $sessionParms 0]
+ set startPos [lindex $sessionParms 1]
+ set endPos [lindex $sessionParms 2]
+
+ if {[egw_form] != ""} {
+ set hist($nextSetNo,idAuthentication) $hist($setNo,idAuthentication)
+ set hist($nextSetNo,host) $hist($setNo,host)
+
+ if {$nextSetNo == $setNo} {
+ set setNo $nextSetNo
+ incr nextSetNo
+ } else {
+ catch {unset hist($setNo,hits)}
+ }
+ set hist($setNo,scan) 0
+
+ set hist($setNo,form,menu1) [egw_form menu1]
+ set hist($setNo,form,menu2) [egw_form menu2]
+ set hist($setNo,form,menu3) [egw_form menu3]
+
+ set hist($setNo,form,entry1) [egw_form entry1]
+ set hist($setNo,form,entry2) [egw_form entry2]
+ set hist($setNo,form,entry3) [egw_form entry3]
+
+ set hist($setNo,form,logic1) [egw_form logic1]
+ set hist($setNo,form,logic2) [egw_form logic2]
+ set hist($setNo,form,logic3) {}
+
+ set host $hist($setNo,host)
+ set databases [lindex $targets($host) 1]
+
+ set b [egw_form base]
+ if {[egw_form baseall] != ""} {
+ set hist($setNo,database) $databases
+ } elseif {$b == ""} {
+ set hist($setNo,database) $databases
+ } else {
+ set hist($setNo,database) $b
+ }
+ set hist($setNo,maxPresent) [egw_form hits]
+ if {$hist($setNo,maxPresent) == ""} {
+ set hist($setNo,maxPresent) 30
+ }
+ set i [lindex $sessionParms 1]
+ if {$i == ""} {
+ for {set j 1} {$j <= 3} {incr j} {
+ if {[egw_form scan$j] != ""} {
+ set i $j
+ break
+ }