-proc display-rec {from to} {
- while {$from < $to} {
- htmlr {<b>} $from {</b><br>}
- if {![catch {
- set title [lindex [z39.1 getMarc $from field 245 * a] 0]
- set year [lindex [z39.1 getMarc $from field 260 * c] 0]
- } ] } {
- htmlr $title { <i> } $year {</i><br>}
+proc display-brief {zset no} {
+ global env
+ global setNo
+ global sessionId
+
+ set type [$zset type $no]
+ if {$type == "SD"} {
+ set err [lindex [$zset diag $no] 1]
+ set add [lindex [$zset diag $no] 2]
+ if {$add != {}} {
+ set add " :${add}"
+ }
+ htmlr "${no} Error ${err}${add} <br>"
+ return
+ }
+ if {$type != "DB"} {
+ return
+ }
+ html "${no} "
+ set rtype [$zset recordType $no]
+ if {$rtype == "SUTRS"} {
+ html [join [$zset getSutrs $no]]
+ htmlr {<br>}
+ return
+ }
+ if {![catch {
+ set title [lindex [$zset getMarc $no field 245 * a] 0]
+ set year [lindex [$zset getMarc $no field 260 * c] 0]
+ } ] } {
+ html {<a href="http://} $env(SERVER_NAME) $env(SCRIPT_NAME) /
+ html $sessionId {/showfull.egw/} $setNo + $no {"> } $title {</a>}
+ html " <i> ${year} </i>"
+ }
+ htmlr {<br>}
+}
+
+proc display-full {zset no} {
+ set type [$zset type $no]
+ if {$type == "SD"} {
+ set err [lindex [$zset diag $no] 1]
+ set add [lindex [$zset diag $no] 2]
+ if {$add != {}} {
+ set add " :${add}"
+ }
+ htmlr "<hr> ${no} <br>"
+ htmlr "Error ${err}${add} <br>"
+ return
+ }
+ if {$type != "DB"} {
+ return
+ }
+ htmlr "<hr> ${no} <br>"
+ set rtype [$zset recordType $no]
+ if {$rtype == "SUTRS"} {
+ htmlr [join [$zset getSutrs $no]]
+ return
+ }
+ if {[catch {set r [$zset getMarc $no line * * *]}]} {
+ htmlr "Unknown record type: $rtype"
+ return
+ }
+ foreach line $r {
+ set tag [lindex $line 0]
+ set indicator [lindex $line 1]
+ set fields [lindex $line 2]
+ set l [string length $indicator]
+ html "$tag "
+ if {$l > 0} {
+ for {set i 0} {$i < $l} {incr i} {
+ if {[string index $tag $i] == " "} {
+ html "_"
+ } else {
+ html [string index $tag $i]
+ }
+ }