3 <title> WWW/Z39.50 Gateway Query Form</title>
7 # $Id: mquery.egw,v 1.15 1996/03/13 14:07:29 adam Exp $
9 if {[info commands saveState] == ""} {
18 if {[catch {set setNo $nextSetNo}]} {
27 html {<form action="http:} $env(SCRIPT_NAME)
28 html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
32 foreach t [lsort [egw_form target]] {
33 set host [lindex $t 0]
34 set base [lindex $t 1]
35 if {$host != $phost} {
38 set hist($setNo,$i,host) $host
39 set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
41 lappend hist($setNo,$i,database) $base
43 set oSetNo [lindex $sessionParms 0]
47 if {$i == 0 && $oSetNo && [info exists hist($oSetNo,0,host)]} {
48 for {set i 1} {$i <= $hist($oSetNo,0,host)} {incr i} {
49 set hist($setNo,$i,host) $hist($oSetNo,$i,host)
50 set hist($setNo,$i,idAuthentication) \
51 $hist($oSetNo,$i,idAuthentication)
52 set hist($setNo,$i,database) $hist($oSetNo,$i,database)
57 html "<h2>No targets specified</h2></body></html>"
64 set curSort $hist($oSetNo,sort)
65 set curFormat $hist($oSetNo,format)
68 set hist($setNo,0,host) $i
70 html "<b>Fill-in this search form:</b><br>\n"
71 set fields [lindex $targets($host) 2]
72 for {set no 1} {$no < 4} {incr no} {
74 html {<select name="menu} $no {">} \n
77 set template [join $hist($oSetNo,form,menu$no)]
79 if {[string length $template] > 0} {
80 html {<option> } $template "\n"
83 set name [lindex $f 0]
84 if {$template == $name} continue
85 html {<option> } $name \n
89 html {<input type="text" name="entry} $no {" size=35 value="}
92 if {[info exists hist($oSetNo,form,entry$no)]} {
93 html [join $hist($oSetNo,form,entry$no) " "]
98 html {<select name="logic} $no {">} \n
101 set template [join $hist($oSetNo,form,logic$no) " "]
103 if {[string length $template] > 0} {
104 html "<option> " $template \n
106 foreach op {And Or {And not}} {
107 if {$template == $op} continue
108 html "<option> " [join $op " "] \n
115 html {<input type=submit value="Search"><input type=reset value="Reset">}
118 html {<b>Display each record in <select name="format">}
119 if {![string compare $curFormat brief]} {
120 html "<option>brief\n"
121 html "<option>medium\n"
123 html "<option>medium\n"
124 html "<option>brief\n"
126 html "</select> notation"
127 html { and sort by <select name="sort">}
128 if {![string compare $curSort score]} {
129 html "<option>score\n"
130 html "<option>server\n"
132 html "<option>server\n"
133 html "<option>score\n"
135 html "</select></b><br>\n"
145 html "<h3>Debug information</h3>\n"
146 html "sessionId: $sessionId <br>\n"
147 html "sessionParms: $sessionParms <br>\n"
148 foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
149 html $e {: } $env($e) {<br>} \n
151 set j $hist($setNo,0,host)
152 for {set i 1} {$i <= $j} {incr i} {
153 html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database)
156 html "form: " [egw_form] " <br>\n"
157 html "target: " $host " <br>\n"
158 html "setNo: " $setNo " <br>\n"
159 html "nextSetNo: " $nextSetNo " <br>\n"