3 # $Id: mquery.egw,v 1.16 1996/03/14 11:50:45 adam Exp $
5 if {[info commands saveState] == ""} {
7 if {![info exists debug]} {
18 if {[catch {set setNo $nextSetNo}]} {
23 html {<head><title> WWW/Z39.50 Gateway Query Form</title></head><body>}
29 html {<form action="http:} $env(SCRIPT_NAME)
30 html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
34 foreach t [lsort [egw_form target]] {
35 set host [lindex $t 0]
36 set base [lindex $t 1]
37 if {$host != $phost} {
40 set hist($setNo,$i,host) $host
41 set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
43 lappend hist($setNo,$i,database) $base
45 set oSetNo [lindex $sessionParms 0]
49 if {$i == 0 && $oSetNo && [info exists hist($oSetNo,0,host)]} {
50 for {set i 1} {$i <= $hist($oSetNo,0,host)} {incr i} {
51 set hist($setNo,$i,host) $hist($oSetNo,$i,host)
52 set hist($setNo,$i,idAuthentication) \
53 $hist($oSetNo,$i,idAuthentication)
54 set hist($setNo,$i,database) $hist($oSetNo,$i,database)
59 html "<h2>No targets specified</h2></body></html>"
66 set curSort $hist($oSetNo,sort)
67 set curFormat $hist($oSetNo,format)
70 set hist($setNo,0,host) $i
72 html "<b>Fill-in this search form:</b><br>\n"
73 set fields [lindex $targets($host) 2]
74 for {set no 1} {$no < 4} {incr no} {
76 html {<select name="menu} $no {">} \n
79 set template [join $hist($oSetNo,form,menu$no)]
81 if {[string length $template] > 0} {
82 html {<option> } $template "\n"
85 set name [lindex $f 0]
86 if {$template == $name} continue
87 html {<option> } $name \n
91 html {<input type="text" name="entry} $no {" size=35 value="}
94 if {[info exists hist($oSetNo,form,entry$no)]} {
95 html [join $hist($oSetNo,form,entry$no) " "]
100 html {<select name="logic} $no {">} \n
103 set template [join $hist($oSetNo,form,logic$no) " "]
105 if {[string length $template] > 0} {
106 html "<option> " $template \n
108 foreach op {And Or {And not}} {
109 if {$template == $op} continue
110 html "<option> " [join $op " "] \n
117 html {<input type=submit value="Search"><input type=reset value="Reset">}
120 html {<b>Display each record in <select name="format">}
121 if {![string compare $curFormat brief]} {
122 html "<option>brief\n"
123 html "<option>medium\n"
125 html "<option>medium\n"
126 html "<option>brief\n"
128 html "</select> notation"
129 html { and sort by <select name="sort">}
130 if {![string compare $curSort score]} {
131 html "<option>score\n"
132 html "<option>server\n"
134 html "<option>server\n"
135 html "<option>score\n"
137 html "</select></b><br>\n"
147 html "<h3>Debug information</h3>\n"
148 html "sessionId: $sessionId <br>\n"
149 html "sessionParms: $sessionParms <br>\n"
150 foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
151 html $e {: } $env($e) {<br>} \n
153 set j $hist($setNo,0,host)
154 for {set i 1} {$i <= $j} {incr i} {
155 html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database)
158 html "form: " [egw_form] " <br>\n"
159 html "target: " $host " <br>\n"
160 html "setNo: " $setNo " <br>\n"
161 html "nextSetNo: " $nextSetNo " <br>\n"