Bug fix: the search.egw didn't always obtain the right host.
[egate.git] / www / showfull.egw
1 <html>
2 {
3 # $Id: showfull.egw,v 1.8 1995/11/10 10:20:25 adam Exp $
4
5 proc buttons {setNo no format} {
6     global sessionId
7     global env
8     global hist
9
10     html "<p>\n"
11     if {$no < [z39.$setNo resultCount]} {
12         html {<a href="http:} $env(SCRIPT_NAME)
13         html / $sessionId {/showfull.egw/} $setNo + [expr $no + 1] + $format
14         html {">Next record</a>} " | \n"
15     }
16     if {$no > 1} {
17         html {<a href="http:} $env(SCRIPT_NAME)
18         html / $sessionId {/showfull.egw/} $setNo + [expr $no - 1] + $format
19         html {">Previous record</a>} " | \n"
20     }
21
22     html {<a href="http:} $env(SCRIPT_NAME)
23     html / $sessionId {/showfull.egw/} $setNo + $no +
24     if {$format == "full"} {
25        html raw {">Raw format</a>} " | \n"
26     } else {
27        html full {">Full format</a>} " | \n"
28     }
29
30     html {<a href="http:} $env(SCRIPT_NAME)
31     html / $sessionId {/search.egw/} $setNo + 1
32     html + $hist($setNo,maxPresent)
33     html {">Result</a>} " | \n"
34        
35     html {<a href="http:} $env(SCRIPT_NAME)
36     html / $sessionId {/targets.egw">New target</a>} " | \n"
37     html {<a href="http:} $env(SCRIPT_NAME)
38     html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo 
39     html {">New query</a>} "<p>\n"
40
41 }
42
43     if {[info commands saveState] == ""} {
44         source z39util.tcl
45     }
46
47     html "<head><title> WWW/Z39.50 Gateway Record " $host " </title>\n"
48     html "</head><body>\n"
49
50     global setNo
51     global hist
52
53     set sno [lindex $sessionParms 0]
54     set no [lindex $sessionParms 1]
55     set format [lindex $sessionParms 2]
56
57     set setNo $sno
58     
59     if {[z39search $setNo 0] != "1"} {
60         return
61     }
62     set total [z39.$setNo resultCount]
63     html "<h2>Record \#$no out of $total </h2><br>\n"
64
65     buttons $setNo $no $format
66
67     eval {z39present $setNo $no $no display-$format}
68     buttons $setNo $no $format
69 }
70 </body>
71 </html>
72