Plus (+) characters automatically converted to space in forms.
[egate.git] / www / mquery.egw
index 051dc91..de4b307 100644 (file)
@@ -4,7 +4,7 @@
 </head>
 <body>
 {
-# $Id: mquery.egw,v 1.2 1995/11/08 16:14:32 adam Exp $
+# $Id: mquery.egw,v 1.4 1995/11/10 14:47:31 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
     global nextSetNo
     global hist
 
-    html {<form action="http:} $env(SCRIPT_NAME)
-    html / $sessionId {/msearch.egw/} $setNo {" method=post>} \n
-
     if {[catch {set setNo $nextSetNo}]} {
         set nextSetNo 1
         set setNo 1
     }
-    set hosts [wform target]
-    html "hosts=$hosts <br>\n"
-    set i 1
-    foreach host $hosts {
-        set hist($setNo,$i,host) $host
-        set hist($setNo,$i,database) [lindex [lindex $targets($host) 1] 0]
-        incr i
+
+    html {<form action="http:} $env(SCRIPT_NAME)
+    html / $sessionId {/msearch.egw/} $setNo {" method=post>} \n
+
+    set phost {}
+    set i 0
+    foreach t [lsort [wform target]] {
+        set host [lindex $t 0]
+        set base [lindex $t 1]
+        if {$host != $phost} {
+            set phost $host
+            incr i
+            set hist($setNo,$i,host) $host
+            set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
+        }
+        lappend hist($setNo,$i,database) $base
+    }
+    if {$i == 0} {
+        html "<h2>No targets specified</h2></body></html>"
+        wabort 1
     }
-    set hist($setNo,0,host) [expr $i - 1]
-    set host [lindex $hosts 0]
+    set hist($setNo,0,host) $i
 }
 <hr>
 <h3>Input your search criteria: </h3> <br>
@@ -64,7 +73,7 @@ Records are shown in:
 </select>
 <br>
 <p>
-<input type="submit" value="Send Query">
+<input type=submit value="Search"><input type=reset value="Reset">
 </form>
 <hr>
 This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
@@ -85,6 +94,11 @@ and will continue to be so until the end of December 1995.</em>
     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
         html $e {: } $env($e) {<br>} \n
     }
+    set j $hist($setNo,0,host)
+    for {set i 1} {$i <= $j} {incr i} {
+        html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database) 
+        html "<br>\n"
+    }
     html "form: " [wform] " <br>\n"
     html "target: " $host " <br>\n"
     html "setNo: " $setNo " <br>\n"