Lots of changes. They aren't visible though.
[egate.git] / www / showfull.egw
index 04f29ce..4c708dd 100644 (file)
 <html>
 {
-# $Id: showfull.egw,v 1.3 1995/11/06 17:44:21 adam Exp $
+# $Id: showfull.egw,v 1.20 1996/03/07 12:46:09 adam Exp $
+
+proc buttons {setNo tno no format count host after} {
+    global sessionId
+    global useIcons
+    global env
+    global hist
+
+    html "<p>\n"
+    button-europagate
+    if {$no < $count} {
+        html {<a href="http:} $env(SCRIPT_NAME)
+        html / $sessionId {/showfull.egw/} $setNo + $tno + 
+        html [expr $no + 1] + $format
+        if {$useIcons} {
+            html {"><img src="/egwgif/button-next-record.gif" }
+           html {alt="Next Record" border=0></a>}
+        } else {
+            html {">Next</a>} " | \n"
+        }
+    }
+    if {$no > 1} {
+        html {<a href="http:} $env(SCRIPT_NAME)
+        html / $sessionId {/showfull.egw/} $setNo + $tno +
+        html [expr $no - 1] + $format
+        if {$useIcons} {
+            html {"><img src="/egwgif/button-previous-record.gif" }
+           html {alt="Previous Record" border=0></a>}
+        } else {
+            html {">Previous</a>} " | \n"
+        }
+    }
+
+    html {<a href="http:} $env(SCRIPT_NAME)
+    html / $sessionId {/showfull.egw/} $setNo + $tno + $no +
+    if {$format == "full"} {
+        html raw 
+        if {$useIcons} {        
+            html {"><img src="/egwgif/button-raw-marc.gif" }
+           html {alt="Raw Format" border=0></a>}
+        } else {
+            html {">Raw Format</a>} " | \n"
+        }
+    } else {
+        html full
+        if {$useIcons} {
+            html {"><img src="/egwgif/button-full-format.gif" }
+           html {alt="Full Format" border=0></a>}
+        } else {
+            html {">Full Format</a>} " | \n"
+        }
+    }
+
+    html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
+    if {$tno > 0} {
+        html {/msearch.egw/} $setNo
+    } else {
+        html {/search.egw/} $setNo + $tno
+    }
+    html + 1 + $hist($setNo,maxPresent)
+    if {$useIcons} {
+        html {"><img src="/egwgif/button-result-set.gif" }
+       html {alt="Result Set" border=0></a>}
+    } else {
+        html {">Result Set</a>} " | \n"
+    }
+
+    button-new-query 1 $setNo
+    button-new-target 0
+    html "<p>\n"
+}
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
 
-    html "<head><title> WWW/Z39.50 Gateway Record " $host " </title>\n"
-    html "</head><body>\n"
-
     global setNo
     global hist
 
     set sno [lindex $sessionParms 0]
-    set no [lindex $sessionParms 1]
+    set tno [lindex $sessionParms 1]
+    set no [lindex $sessionParms 2]
+    set format [lindex $sessionParms 3]
 
     set setNo $sno
+
+    set zz z39$tno
+    set host $hist($setNo,$tno,host)
     
-    if {[z39search $setNo 0] != "1"} {
+    html "<head><title> WWW/Z39.50 Gateway Record " [splitHostSpec $host]
+    html " </title>\n"
+    html "</head><body>\n"
+
+    if {[z39search $setNo 0 $tno F] != "1"} {
         return
     }
-    set total [z39.$setNo resultCount]
-    html "<h2>Record \#$no out of $total </h2><br>\n"
-}
 
-{
-    if {$no < [z39.$setNo resultCount]} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/showfull.egw/} $setNo + [expr $no + 1]
-        html {"> Next </a>} "| \n"
-    }
-    if {$no > 0} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/showfull.egw/} $setNo + [expr $no - 1]
-        html {"> Prev </a>} "| \n"
-    }
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/search.egw/} $setNo + 1
-    html + [expr $hist($setNo,maxPresent) - 1]
-    html {"> Result </a>} "| \n"
-       
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/targets.egw"> New target </a>} " | \n"
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/query.egw/} $host + $setNo {"> New query </a>}
-}
+    set count [$zz.$setNo resultCount]
 
-{
-    z39present $setNo $no $no display-full
-#   display-full z39.$sno $no
-}
-<hr>
-{
-    if {$no < [z39.$setNo resultCount]} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/showfull.egw/} $setNo + [expr $no + 1]
-        html {"> Next </a>} "| \n"
-    }
-    if {$no > 0} {
-        html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-        html / $sessionId {/showfull.egw/} $setNo + [expr $no - 1]
-        html {"> Prev </a>} "| \n"
-    }
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/search.egw/} $setNo + 1
-    html + [expr $hist($setNo,maxPresent) - 1]
-    html {"> Result </a>} "| \n"
-       
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/targets.egw"> New target </a>} " | \n"
-    html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME)
-    html / $sessionId {/query.egw/} $host + $setNo {"> New query </a>}
-}
+    set useIcons 1
+    buttons $setNo $tno $no $format $count $host 0
+
+    html "<h3>Record \#$no out of $count </h3><br>\n"
 
+    eval {z39present $setNo $tno $no $no display-$format F}
+    set useIcons 0
+    buttons $setNo $tno $no $format $count $host 1
+}
 </body>
 </html>