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