Lots of changes. They aren't visible though.
[egate.git] / www / msearch.egw
index ca59fef..ee8add3 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: msearch.egw,v 1.8 1996/01/03 15:19:38 adam Exp $
+# $Id: msearch.egw,v 1.16 1996/03/07 12:46:08 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
 
     html "<head><title> WWW/Z39.50 Gateway Search </title>\n"
     html "</head><body>\n"
+
     set setNo [lindex $sessionParms 0]
 
-    if {[wform menu1] != ""} {
+    if {[egw_form menu1] != ""} {
         set hist($nextSetNo,0,host) $hist($setNo,0,host)
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
             set hist($nextSetNo,$i,host) $hist($setNo,$i,host)
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
             set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3]
         }
-        set hist($setNo,maxPresent) [wform hits]
+        set hist($setNo,maxPresent) [egw_form hits]
         if {$hist($setNo,maxPresent) == ""} {
-            set hist($setNo,maxPresent) 30
+            set hist($setNo,maxPresent) 20
         }
     }
-    z39msearch $setNo 1 B
+
+    set useIcons 1
+    button-europagate
+    button-new-query 1 $setNo
+    button-new-target 0
+
+    html "<br>\n"
+    z39msearch $setNo B 1 $hist($setNo,maxPresent) 1
 
     html "<dl>\n"
     set not $hist($setNo,0,host)
             html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
         } else {
             set r [z39$i.$setNo resultCount]
-            html "$r hits</h3>\n<dd>\n"
+            html "$r hits</h3>\n<dd>\n<ul>\n"
 
-            display-rec 1 $hist($setNo,$i,offset) display-brief $i
+            if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
+                display-rec 1 $hist($setNo,maxPresent) display-brief $setNo $i
+            } else {
+                display-rec 1 $hist($setNo,$i,offset) display-brief $setNo $i
+            }
+            html "</ul>"
         }
         html "\n"
     }
     html "</dl>\n"
-}
 
-{
-    global useIcons
-
-    if {$useIcons} {
-        html {<img src="/gif/button-egw.gif">}
-    }
-    html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId {/mtargets.egw}
-    if {$useIcons} {
-       html {"><img src="/gif/button-new-target.gif" border=0></a>}
-    } else {
-       html {"> New target </a>} " | \n"
-    }
-    html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId {/mquery.egw/} $host + $setNo
-    if {$useIcons} {
-        html {"><img src="/gif/button-new-query.gif" border=0></a>}
-    } else {
-        html {"> New query </a>}
-    }
+    set useIcons 0
+    button-europagate
+    button-new-query 1 $setNo
+    button-new-target 0
 }
 
 {
@@ -90,7 +86,7 @@
     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
         html $e {: } $env($e) {<br>} \n
     }
-    html "form: " [wform] " <br>\n"
+    html "form: " [egw_form] " <br>\n"
     html "target: " $host " <br>\n"
     html "query: --" $hist($setNo,1,query) "-- <br>\n"
     html "database: " $hist($setNo,1,database) "<br>\n"