Minor changes.
[egate.git] / www / showfull.egw
1 <html>
2 {
3 # $Id: showfull.egw,v 1.11 1995/11/14 09:30:20 adam Exp $
4
5 proc buttons {setNo tno no format count host after} {
6     global sessionId
7     global env
8     global hist
9
10     html "<p>\n"
11     if {$after && $no < $count} {
12         html "<center>\n"
13         html {<a href="http:} $env(SCRIPT_NAME)
14         html / $sessionId {/showfull.egw/} $setNo + $tno + 
15         html [expr $no + 1] + $format
16         html {"><img src="/gif/darrw.gif"></a>}
17         html "</center><p>\n"
18     }
19     if {$no < $count} {
20         html {<a href="http:} $env(SCRIPT_NAME)
21         html / $sessionId {/showfull.egw/} $setNo + $tno + 
22         html [expr $no + 1] + $format
23         html {">Next record</a>} " | \n"
24     }
25     if {$no > 1} {
26         html {<a href="http:} $env(SCRIPT_NAME)
27         html / $sessionId {/showfull.egw/} $setNo + $tno +
28         html [expr $no - 1] + $format
29         html {">Previous record</a>} " | \n"
30     }
31
32     html {<a href="http:} $env(SCRIPT_NAME)
33     html / $sessionId {/showfull.egw/} $setNo + $tno + $no +
34     if {$format == "full"} {
35        html raw {">Raw format</a>} " | \n"
36     } else {
37        html full {">Full format</a>} " | \n"
38     }
39
40     html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
41     if {$tno > 0} {
42         html {/msearch.egw/} 
43     } else {
44         html {/search.egw/}
45     }
46     html $setNo + 1
47     html + $hist($setNo,maxPresent)
48     html {">Result set</a>} " | \n"
49        
50     html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
51     if {$tno > 0} {
52         html {/mquery.egw/} 
53     } else {
54         html {/query.egw/} 
55     }
56     html $host + $setNo 
57     html {">New query</a>} " | \n"
58
59     html {<a href="http:} $env(SCRIPT_NAME) / $sessionId 
60     if {$tno > 0} {
61         html {/mtargets.egw} 
62     } else {
63         html {/targets.egw} 
64     }
65     html {">New target</a>} "<p>\n"
66
67     if {!$after && $no > 1} {
68         html "<p><center>\n"
69         html {<a href="http:} $env(SCRIPT_NAME)
70         html / $sessionId {/showfull.egw/} $setNo + $tno +
71         html [expr $no - 1] + $format
72         html {"><img src="/gif/uarrw.gif"></a>}
73         html "</center><p>\n"
74     }
75 }
76
77     if {[info commands saveState] == ""} {
78         source z39util.tcl
79     }
80
81     html "<head><title> WWW/Z39.50 Gateway Record " $host " </title>\n"
82     html "</head><body>\n"
83
84     global setNo
85     global hist
86
87     set sno [lindex $sessionParms 0]
88     set tno [lindex $sessionParms 1]
89     set no [lindex $sessionParms 2]
90     set format [lindex $sessionParms 3]
91
92     set setNo $sno
93
94     if {$tno > 0} {
95         set zz z39$tno
96         set host $hist($setNo,$tno,host)
97     } else {
98         set zz z39
99         set host $hist($setNo,host)
100     }
101     
102     if {[z39search $setNo 0 $tno F] != "1"} {
103         return
104     }
105     set count [$zz.$setNo resultCount]
106     html "<h2>Record \#$no out of $count </h2><br>\n"
107
108     buttons $setNo $tno $no $format $count $host 0
109
110     eval {z39present $setNo $tno $no $no display-$format F}
111     buttons $setNo $tno $no $format $count $host 1
112 }
113 </body>
114 </html>
115