Better error handling.
[egate.git] / www / search.egw
index 13333ed..dd7162d 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: search.egw,v 1.15 1995/11/13 15:41:44 adam Exp $
+# $Id: search.egw,v 1.16 1995/11/13 18:17:48 adam Exp $
 
 proc buttons {setNo setMax startPos after} {
     global sessionId
@@ -64,9 +64,29 @@ proc buttons {setNo setMax startPos after} {
         set hist($nextSetNo,host) $hist($setNo,host)
         set setNo $nextSetNo
         html "using host " $hist($setNo,host) " <br\n"
-        incr nextSetNo
 
-        set hist($setNo,query) [build-query $hist($setNo,host)]
+        set query [build-query $hist($setNo,host)]
+        if {"x$query" == "x"} {
+            html "<head><title> WWW/Z39.50 Gateway Search</title>\n<body>\n"
+            displayError "Empty query" \
+                "You must specify at least one search word"
+            html "</body></html>\n"
+            wabort
+        }
+        set hist($setNo,query) $query
+
+        set hist($setNo,form,menu1) [wform menu1]
+        set hist($setNo,form,menu2) [wform menu2]
+        set hist($setNo,form,menu3) [wform menu3]
+
+        set hist($setNo,form,entry1) [wform entry1]
+        set hist($setNo,form,entry2) [wform entry2]
+        set hist($setNo,form,entry3) [wform entry3]
+
+        set hist($setNo,form,logic1) [wform logic1]
+        set hist($setNo,form,logic2) [wform logic2]
+
+        incr nextSetNo
         set b [wform base]
         if {$b == ""} {
             set hist($setNo,database) $databases