Updated for YAZ 1.7. HTML output tidy up. Added LOC target.
[egate.git] / www / z39util.tcl
index 19c75f3..08398cf 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.46 1996/08/28 09:36:03 adam Exp $
+# $Id: z39util.tcl,v 1.50 2001/02/26 14:32:36 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -69,9 +69,9 @@ proc display-medium {zset no setNo targetNo} {
     global env
     global sessionId
 
-    html {<li>}
     set type [$zset type $no]
     if {$type == "SD"} {
+        html {<li>}
         set err [lindex [$zset diag $no] 1]
         set add [lindex [$zset diag $no] 2]
         if {$add != {}} {
@@ -83,10 +83,11 @@ proc display-medium {zset no setNo targetNo} {
     if {$type != "DB"} {
         return
     }
+    html {<li>}
     set rtype [$zset recordType $no]
     switch $rtype {
         SUTRS {
-            html { <a href="http:} $env(SCRIPT_NAME) / $sessionId
+            html { <a href="} $env(SCRIPT_NAME) / $sessionId
             html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
             html [join [$zset getSutrs $no]]
             html "</a><br>\n"
@@ -108,7 +109,7 @@ proc display-medium {zset no setNo targetNo} {
         set year [$zset getMarc $no field 260 * c]
         set score [$zset getMarc $no field 999 * r]
     } dispError ] } {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         set p 0
         foreach a $author {
@@ -152,7 +153,7 @@ proc display-medium {zset no setNo targetNo} {
             html "; Score " $nscore
         }
     } else {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         html {No Title}
         html {</a> }
@@ -165,9 +166,9 @@ proc display-brief {zset no setNo targetNo} {
     global env
     global sessionId
 
-    html {<li>}
     set type [$zset type $no]
     if {$type == "SD"} {
+        html {<li>}
         set err [lindex [$zset diag $no] 1]
         set add [lindex [$zset diag $no] 2]
         if {$add != {}} {
@@ -179,10 +180,11 @@ proc display-brief {zset no setNo targetNo} {
     if {$type != "DB"} {
         return
     }
+    html {<li>}
     set rtype [$zset recordType $no]
     switch $rtype {
         SUTRS {
-            html { <a href="http:} $env(SCRIPT_NAME) / $sessionId
+            html { <a href="} $env(SCRIPT_NAME) / $sessionId
             html {/showfull.egw/} $setNo + $targetNo + $no + full {">}
             html [string range [join [$zset getSutrs $no]] 0 70]
             html "</a><br>\n"
@@ -203,7 +205,7 @@ proc display-brief {zset no setNo targetNo} {
        set publisher [$zset getMarc $no field 260 * b]
         set year [$zset getMarc $no field 260 * c]
     } dispError ] } {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         set p 0
         foreach a $author {
@@ -251,7 +253,7 @@ proc display-brief {zset no setNo targetNo} {
        }
         html {</a> }
     } else {
-        html { <a href="http:} $env(SCRIPT_NAME) /
+        html { <a href="} $env(SCRIPT_NAME) /
         html $sessionId {/showfull.egw/} $setNo + $targetNo + $no + full {">}
         html {No Title}
         html {</a> }
@@ -301,7 +303,7 @@ proc display-raw {zset no setNo targetNo} {
                 if {[string index $indicator $i] == " "} {
                     html "-"
                 } else {
-                    html [string index $tag $i]
+                    html [string index $indicator $i]
                 }
             }
         }
@@ -724,12 +726,12 @@ proc display-scan {setNo scanNo tno} {
         html {<td align=left>}
         if {0} {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
-            html {<a href="http:} $env(SCRIPT_NAME)
+            html {<a href="} $env(SCRIPT_NAME)
             html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,host) +
             html $hist($setNo,scan) +  $tterm {">}
         } else {
             regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
-            html {<a href="http:} $env(SCRIPT_NAME)
+            html {<a href="} $env(SCRIPT_NAME)
             html / $sessionId {/search.egw/} $setNo + $tno +
             html hyper + $tterm {">}
         }
@@ -972,7 +974,6 @@ proc z39msearch {setNo elements start number cache} {
         }
         egw_log debug "old=$oldHost this=$thisHost"
         z39$i idAuthentication $hist($setNo,$i,idAuthentication)
-        html "Connecting to target " $thisHost " <br>\n"
         set zstatus($i) -1
         if {![catch {z39$i connect $thisHost}]} {
             incr zleft
@@ -1189,7 +1190,7 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} {
         if {!$useIcons} {
             html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $setMax + 1] + [expr $setMax + $hist($setNo,maxPresent)]
         if {$useIcons} {
@@ -1203,7 +1204,7 @@ proc buttons-result-set-s {setNo targetNo setMax startPos after} {
         if {!$useIcons} {
             html "\n | "
         }
-        html {<a href="http:} $env(SCRIPT_NAME)
+        html {<a href="} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo
         html + [expr $startPos - $hist($setNo,maxPresent)]
         html + [expr $startPos - 1]
@@ -1302,7 +1303,7 @@ proc display-result-set-m-server {setNo} {
             set addinfo [lindex $status 3]
             html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
         } else {
-            html {<dt><a href="http:} $env(SCRIPT_NAME)
+            html {<dt><a href="} $env(SCRIPT_NAME)
             html / $sessionId {/search.egw/} $setNo + $i + 1
             html + $hist($setNo,maxPresent) {">}
             html "<h3>" [lindex $targets($hist($setNo,$i,host)) 0] "</a>: "
@@ -1457,7 +1458,7 @@ proc z39history {} {
                 html {<td align=right>}
             }
             if {[info exists hist($setNo,$i,hits)]} {
-                html { <a href="http:} $env(SCRIPT_NAME)
+                html { <a href="} $env(SCRIPT_NAME)
                 html / $sessionId {/search.egw/} $setNo + $i + 1
                 html + $hist($setNo,maxPresent)
                 html {">} $hist($setNo,$i,hits) {</a>}
@@ -1473,7 +1474,7 @@ proc z39history {} {
             } else {
                 html "<dd>\n"
             }
-            html { <a href="http:} $env(SCRIPT_NAME)
+            html { <a href="} $env(SCRIPT_NAME)
             html / $sessionId / $scriptQuery {;/} $setNo + $host
             if {$html3} {
                 html {">}
@@ -1536,6 +1537,7 @@ proc button-feedback {} {
         html {<img src="/egwgif/button-user-feedback.gif" alt="User Feedback"
         border=0></a>}
     } else {
+        html "\n | "
         html {User Feedback</a>}
     }    
 }
@@ -1548,7 +1550,7 @@ proc button-define-target {} {
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/tform.egw}
     if {$useIcons} {
         html {"><img src="/egwgif/button-define-target.gif" }
@@ -1569,7 +1571,7 @@ proc button-new-target {} {
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId / $scriptTarget
     if {$useIcons} {
         html {"><img src="/egwgif/button-new-target.gif" }
@@ -1588,7 +1590,7 @@ proc button-view-history {} {
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/history.egw;}
     catch { html "/" $nextSetNo}
     if {$useIcons} {
@@ -1609,7 +1611,7 @@ proc button-new-query {setNo} {
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,0,host) {">}
 
     if {$useIcons} {
@@ -1629,7 +1631,7 @@ proc button-result-set {setNo tno} {
     if {!$useIcons} {
         html "\n | "
     }
-    html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
+    html {<a href="} $env(SCRIPT_NAME) / $sessionId 
     if {$tno > 0} {
         html {/msearch.egw/} $setNo
     } else {
@@ -1654,7 +1656,7 @@ proc button-scan-window {setNo} {
         html "\n | "
     }
     set targetNo 0
-    html {<a href="http:} $env(SCRIPT_NAME)
+    html {<a href="} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo + {scan} {">}
     if {$useIcons} {
         html {<img src="/egwgif/button-scan-window.gif" }