+proc display-full-wais {zset no setNo targetNo} {
+ global env
+ global hist
+ global sessionId
+
+ set i 0
+ set element junk
+ htmlToken l [join [$zset getWAIS $no text]] {
+ if {[string compare [string index $l 0] {<}]} {
+ if {[info exist data($element)]} {
+ set data($element) $data($element)$l
+ } else {
+ set data($element) $l
+ }
+ continue
+ }
+ switch -- $l {
+ <ti> {
+ set element title
+ }
+ <dm> {
+ set element dateOfLastModification
+ }
+ <ci> {
+ set element controlIdentifier
+ }
+ <lc> {
+ set element lastChecked
+ }
+ <by> {
+ set element bytes
+ }
+ <avli> {
+ set element linkage
+ }
+ <cr> {
+ incr i
+ }
+ <li> {
+ set element "$i,linkage"
+ }
+ <cp> {
+ set element "$i,title"
+ }
+ <ip> {
+ set element ip
+ }
+ default {
+ set element junk
+ }
+ }
+ }
+ if {![info exists data(title)] || ![info exists data(linkage)]} {
+ set nwi 0
+ } else {
+ set nwi 1
+ }
+ if {$nwi} {
+ html {Title: <a href="} $data(linkage) {">} $data(title) "</a><br>\n"
+ html {URL: } $data(linkage) "<br>\n"
+ } else {
+ html {Title: } [join [$zset getWAIS $no headline]] "<br>\n"
+ }
+ html {Score: } [$zset getWAIS $no score] "<br>\n"
+ set lines [$zset getWAIS $no lines]
+ if {$lines > 0} {
+ html {Lines: } $lines "<br>\n"
+ }
+ if {!$nwi} {
+ html "<pre>\n" [join [$zset getWAIS $no text]] "\n</pre>\n"
+ return
+ }
+ if {[info exists data(bytes)]} {
+ html {Bytes: } $data(bytes) "<br>\n"
+ }
+ if {[info exists data(dateOfLastModification)]} {
+ html {Last modified: } $data(dateOfLastModification) "<br>\n"
+ }
+ if {[info exists data(lastChecked)]} {
+ html {Last checked: } $data(lastChecked) "<br>\n"
+ }
+ if {[info exists data(ip)]} {
+ html {<dl><dt>Initial text<dd>} $data(ip) "</dl><br>\n"
+ }
+
+ html {<a href="} $env(SCRIPT_NAME) / $sessionId {/sameas.egw/}
+ html $setNo + $targetNo + 1 + $hist($setNo,maxPresent) +
+ html [egw_enc [$zset getWAIS $no documentID]] {">}
+ html {Similar WAIS record</a><br>}
+ html "<dl><dt>References\n<dd>\n"
+ for {set i 1} {[info exists data($i,linkage)]} {incr i} {
+ html {<a href="} $data($i,linkage) {">}
+ if {[info exists data($i,title)]} {
+ html $data($i,title)
+ } else {
+ html Untitled
+ }
+ html "</a><br>\n"
+ }
+ html "</dl>\n"
+}
+
+proc display-full {zset no setNo targetNo} {
+ set type [$zset type $no]
+ switch $type {
+ SD {
+ set err [lindex [$zset diag $no] 1]
+ set add [lindex [$zset diag $no] 2]
+ if {$add != {}} {
+ set add " :${add}"
+ }
+ html "Error ${err}${add} <br>\n"
+ return
+ }
+ DB {
+ }
+ default {
+ return
+ }
+ }
+ set rtype [$zset recordType $no]
+ switch $rtype {
+ SUTRS {
+ html "<pre>" [join [$zset getSutrs $no]] "</pre><br>\n"
+ return
+ }
+ WAIS {
+ display-full-wais $zset $no $setNo $targetNo
+ return
+ }
+ }
+ if {[catch {set r [$zset getMarc $no line * * *]}]} {
+ html "Unknown record type: $rtype <br>\n"
+ return
+ }
+ display-full-marc $zset $no $setNo $targetNo
+}
+