3 # $Id: mquery.egw,v 1.17 1996/10/11 13:16:34 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 catch {unset hist($setNo,$i,database)}
41 set hist($setNo,$i,host) $host
42 set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
44 lappend hist($setNo,$i,database) $base
46 set oSetNo [lindex $sessionParms 0]
50 if {$i == 0 && $oSetNo && [info exists hist($oSetNo,0,host)]} {
51 for {set i 1} {$i <= $hist($oSetNo,0,host)} {incr i} {
52 set hist($setNo,$i,host) $hist($oSetNo,$i,host)
53 set hist($setNo,$i,idAuthentication) \
54 $hist($oSetNo,$i,idAuthentication)
55 set hist($setNo,$i,database) $hist($oSetNo,$i,database)
60 html "<h2>No targets specified</h2></body></html>"
67 set curSort $hist($oSetNo,sort)
68 set curFormat $hist($oSetNo,format)
71 set hist($setNo,0,host) $i
73 html "<b>Fill-in this search form:</b><br>\n"
74 set fields [lindex $targets($host) 2]
75 for {set no 1} {$no < 4} {incr no} {
77 html {<select name="menu} $no {">} \n
80 set template [join $hist($oSetNo,form,menu$no)]
82 if {[string length $template] > 0} {
83 html {<option> } $template "\n"
86 set name [lindex $f 0]
87 if {$template == $name} continue
88 html {<option> } $name \n
92 html {<input type="text" name="entry} $no {" size=35 value="}
95 if {[info exists hist($oSetNo,form,entry$no)]} {
96 html [join $hist($oSetNo,form,entry$no) " "]
101 html {<select name="logic} $no {">} \n
104 set template [join $hist($oSetNo,form,logic$no) " "]
106 if {[string length $template] > 0} {
107 html "<option> " $template \n
109 foreach op {And Or {And not}} {
110 if {$template == $op} continue
111 html "<option> " [join $op " "] \n
118 html {<input type=submit value="Search"><input type=reset value="Reset">}
121 html {<b>Display each record in <select name="format">}
122 if {![string compare $curFormat brief]} {
123 html "<option>brief\n"
124 html "<option>medium\n"
126 html "<option>medium\n"
127 html "<option>brief\n"
129 html "</select> notation"
130 html { and sort by <select name="sort">}
131 if {![string compare $curSort score]} {
132 html "<option>score\n"
133 html "<option>server\n"
135 html "<option>server\n"
136 html "<option>score\n"
138 html "</select></b><br>\n"
148 html "<h3>Debug information</h3>\n"
149 html "sessionId: $sessionId <br>\n"
150 html "sessionParms: $sessionParms <br>\n"
151 foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
152 html $e {: } $env($e) {<br>} \n
154 set j $hist($setNo,0,host)
155 for {set i 1} {$i <= $j} {incr i} {
156 html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database)
159 html "form: " [egw_form] " <br>\n"
160 html "target: " $host " <br>\n"
161 html "setNo: " $setNo " <br>\n"
162 html "nextSetNo: " $nextSetNo " <br>\n"