Sort of targets in multiple-targets selection.
[egate.git] / www / mtargets.egw
index f23edd2..1f81bfa 100644 (file)
@@ -1,36 +1,81 @@
 <html>
 {
-# $Id: mtargets.egw,v 1.1 1995/11/07 10:44:31 adam Exp $
+# $Id: mtargets.egw,v 1.15 1996/02/19 15:44:59 adam Exp $
     set setNo 1
-    source /usr/local/etc/httpd/conf/ztargets.conf
+    source ztargets.conf
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
+    set mMode 1
+
+    if {![info exists debug]} {
+        if {[lindex $sessionParms 1] == "1"} {
+            set debug 1
+        } else {
+            set debug 0
+        }
+    }
+    set html3 [lindex $sessionParms 0]
+    if {$html3 == ""} {
+        if {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} {
+            set html3 1
+            egw_log debug "New user using Netscape"
+        } else {
+            set html3 0
+            egw_log debug "New user Not using Netscape"
+        }
+    }
 }
 <head>
 <title>Europagate, WWW/Z39.50 Gateway</title>
 </head>
 <body>
-<h1>Search in multiple targets</h1>
-<hr>
-<h3>Choose one or more Z39.50 targets:</h3>
 {
-    html {<form action="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/msearch.egw/} $setNo {" method=post><br>} \n
-    foreach t [array names targets] {
-        html {<input type="checkbox" name="target" value="} $t
-        html {"> } $t \n
+    set useIcons 1
+    button-europagate
+    button-define-target 0
+
+    html "<h2>Choose one or more targets</h2>\n"
+    html {<form action="http:} $env(SCRIPT_NAME)
+    html / $sessionId {/mquery.egw/} $setNo {" method=get><br>} \n
+    html "<dl>\n"
+
+
+
+    proc targetsCmp {l r} {
+        global targets
+        return [string compare [string tolower [lindex $targets($l) 0]] \
+                               [string tolower [lindex $targets($r) 0]]]
+    }
+    set tt [array names targets]
+    set tn [lsort -command targetsCmp $tt]
+    foreach t $tn {
+        html {<dt>} [ lindex $targets($t) 0]
+        html {<dd>}
+        set databases [lindex $targets($t) 1]
+
+        set desc [lindex $targets($t) 4]
+        if {$desc != ""} {
+            html "$desc<br>\n"
+        }
+        foreach d $databases {
+            html {<input type="checkbox" name="target"}
+            html { value="} $t + $d {"> } $d 
+        }
         html "<br>\n"
     }
+    html "</dl>\n"
+    html {<input type="submit" value="Select"></form>} \n
+
+    html "<p>\n"
+    set useIcons 0
+    button-europagate
+    button-define-target 0
 }
-<input type="submit" value="Select">
-</form>
-<hr>
-This page is maintained by <a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.
-Last modified 25. september 1995. <br>
-<em> This and the following pages are under construction and will continue 
-to be so until the end of December 1995.</em>
+
 {
+    catch maintenance
+    if {!$debug} return
     html "<hr>\n"
     html "<h3>Debug information</h3>\n"
     html "sessionId: $sessionId <br>\n"