A lot of work on scan. Tables used to display scan terms and hits.
[egate.git] / www / z39util.tcl
index 7903fd4..6860b16 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.25 1996/01/24 16:59:29 adam Exp $
+# $Id: z39util.tcl,v 1.26 1996/01/26 15:50:11 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -105,6 +105,8 @@ proc display-brief {zset no tno} {
        set publisher [$zset getMarc $no field 260 * b]
         set year [$zset getMarc $no field 260 * c]
     } ] } {
+        html { <a href="http:} $env(SCRIPT_NAME) /
+        html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
         set p 0
         foreach a $author {
             if {$p} {
@@ -130,32 +132,20 @@ proc display-brief {zset no tno} {
         if {$p} {
             html ": "
         }
-        html { <a href="http:} $env(SCRIPT_NAME) /
-        html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
        set nope 1
         foreach v $title {
             html $v
             set nope 0
         }
         if {$nope} {
-            html {No title} 
-        }
-        html {</a> }
-       foreach v $cover {
-           html $v
-       }
-        if {0} {
-            html {<br>}
-            foreach v $location {
-                html " $v"
-            }
-            foreach v $publisher {
-                html " $v"
-            }
-            foreach v $year {
-                html " $v"
+            set v [join $cover ""]
+            if {[string length $v] > 40} {
+                html [string range $v 0 38] "..."
+            } else {
+                html $v
             }
-        }
+       }
+        html {</a> }
     }
     html "<br>\n"
 }
@@ -561,6 +551,7 @@ proc z39scan {setNo scanNo tno scanLines scanPos cache} {
 
     $zz callback [list scan-response $zs]
 
+    egw_log debug "scan: ${scanAttr} ${scanTerm}"
     set sessionWait 0
     $zs scan "${scanAttr} ${scanTerm}"
 
@@ -610,16 +601,31 @@ proc display-scan {setNo scanNo tno} {
             set hist($setNo,[expr $scanNo + 1],scanTerm) $t
         }
     }
+    html {<table border=0><tr>}
+    html {<td align=left><b>Scan term</b>}
+    html {<td align=right><b>Hits</b>}
+    html {<tr>} \n
+
     for {set i 0} {$i < $m} {incr i} {
-        regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
-        html {<a href="http:} $env(SCRIPT_NAME)
-        html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo +
-        html $hist($setNo,scan) +  $tterm {">}
+        html {<td align=left>}
+        if {0} {
+            regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
+            html {<a href="http:} $env(SCRIPT_NAME)
+            html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo +
+            html $hist($setNo,scan) +  $tterm {">}
+        } else {
+            regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
+            html {<a href="http:} $env(SCRIPT_NAME)
+            html / $sessionId {/search.egw/} $setNo +
+            html hyper + $tterm {">}
+        }
         html [lindex [$zs scanLine $i] 1]
-        html {</a>: <em>}
+        html {</a>} 
+        html {<td align=right>}
         html [lindex [$zs scanLine $i] 2]
-        html "</em><br>\n"
+        html {<tr>} \n
     }
+    html {</table} \n
 }
 
 proc z39search {setNo piggy tno elements} {
@@ -976,7 +982,8 @@ proc z39history {} {
         for {set i 1} {$i <= 3} {incr i} {
             if {[string length $hist($setNo,form,entry$i)] > 0} {
                 html " <b>" [join $op " "] "</b> "
-                html $hist($setNo,form,menu$i) "=" $hist($setNo,form,entry$i)
+                html [join $hist($setNo,form,menu$i)] "=" 
+                html $hist($setNo,form,entry$i)
                 set op $hist($setNo,form,logic$i)
             }
         }
@@ -1012,9 +1019,9 @@ proc button-define-target {more} {
     html / $sessionId {/tform.egw}
     if {$useIcons} {
         html {"><img src="/egwgif/button-define-target.gif" }
-       html {alt="New Target" border=0></a>}
+       html {alt="Define Target" border=0></a>}
     } else {
-        html {">New Target</a>}
+        html {">Define Target</a>}
         if {$more} {
             html " | \n"
         } else {
@@ -1027,9 +1034,15 @@ proc button-new-target {more} {
     global useIcons
     global env
     global sessionId
+    global mMode
 
     html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId {/targets.egw}
+    html / $sessionId 
+    if {$mMode} {
+        html {/mtargets.egw}
+    } else {
+        html {/targets.egw}
+    }
     if {$useIcons} {
         html {"><img src="/egwgif/button-new-target.gif" }
        html {alt="New Target" border=0></a>}
@@ -1070,9 +1083,16 @@ proc button-new-query {more setNo} {
     global env
     global sessionId
     global hist
+    global mMode
 
     html {<a href="http:} $env(SCRIPT_NAME)
-    html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo {">}
+    html / $sessionId 
+    if {$mMode} {
+        html {/mquery.egw/} $setNo
+    } else {
+        html {/query.egw/} $hist($setNo,host) + $setNo
+    }
+    html {">}
     if {$useIcons} {
         html {<img src="/egwgif/button-new-query.gif" }
        html {alt="New Query" border=0></a>}
@@ -1110,7 +1130,7 @@ proc button-scan-window {more setNo} {
 proc maintenance {} {
     html {<hr>This page is maintained by }
     html {<a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.}
-    html {Last modified 24. january 1996. <br>}
+    html {Last modified 26. january 1996. <br>}
     html {<em> This and the following pages are under construction and }
     html {will continue to be so until the end of January 1996.</em>}
 }