Attempt to inform user if session has really terminated.
[egate.git] / www / tdefine.egw
index bd8453b..28f27c8 100644 (file)
@@ -1,14 +1,23 @@
 <html>
-<head>
-<title> WWW/Z39.50 Gateway Target Definition Response</title>
-</head>
-<body>
 {
-# $Id: tdefine.egw,v 1.1 1996/01/24 14:14:19 adam Exp $
+# $Id: tdefine.egw,v 1.6 1996/03/14 11:50:49 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
+        if {![info exists debug]} {
+            session-lost
+            egw_abort
+        }
     }
+
+    html {<head><title> WWW/Z39.50 Gateway Target Definition Response</title>}
+    html {</head><body>}
+
+    set useIcons 1
+    button-main
+    button-define-target
+    button-new-target
+
     html "<h2>Target definition response</h2><br>\n"
 
     set name [lindex [egw_form name] 0]
     set databases [lindex [egw_form databases] 0]
     set authentication [egw_form authentication]
     set fields [lindex [egw_form fields] 0]
+    set recordType [lindex [egw_form recordtype] 0]
 
     set ok 1
     if {[string length $name] == 0} {
-        html "You didn't specify a target name. You <em>must</em> specify"
-        html " a target name<br>\n"
+        html "You didn't specify a target name. A target name <em>must</em> "
+        html "be specified.<br>\n"
         set ok 0
     }
     if {[string length $host] == 0} {
-        html "You didn't specify a target name. You <em>must</em> specify"
-        html " a host name<br>\n"
+        html "You didn't specify a target name. A host <em>must</em> "
+        html "be specified.<br>\n"
         set ok 0
     }
     if {[string length $databases] == 0} {
-        html "You didn't specify any database(s). You <em>must</em> specify"
-        html " at least one database</br>\n"
+        html "You didn't specify any database(s). At least one database "
+        html "<em>must</em> be specified.<br>\n"
+        set ok 0
+    }
+    if {[string length $recordType] == 0} {
+        html "You didn't specify any record type. One record type "
+        html "<em>must</em> be specified.<br>\n"
         set ok 0
     }
     catch {unset item}
         html " search fields must be present<br>\n"
         set ok 0
     }
+    if {![string compare recordType WAIS]} {
+        set attrList { {Free-text} {} }
+    }
+    set hostSpec [mergeHostSpec $host $databases]
     if {$ok} {
         global targets
-        set targets($host) [list \
+        set targets($hostSpec) [list \
             [join $name] \
-            $databases \
+            $recordType \
             $attrList \
             $authentication \
             $description \
-            1 ]
+            1 \
+            user ]
         html "Target successfully defined<br>\n"
     }
+    html "<p>\n"
+    set useIcons 0
+    button-main
+    button-define-target
+    button-new-target
 }
 {
-    button-europagate
-    button-define-target 1
-    button-new-target 0
-}
-
-{
     global debug
 
     if {!$debug} return
 
-    html "name=" $name "<br>\n"
+    html "\n<br>name=" $name "<br>\n"
     html "description=" $description "<br>\n"
     html "host=" $host "<br>\n"
     html "databases=" $databases "<br>\n"