{
# $Id: search.egw,v 1.7 1995/11/02 16:35:36 adam Exp $
proc search-response {sno} {
global sessionWait
set status [z39.$sno responseStatus]
if {[lindex $status 0] == "NSD"} {
z39.$sno nextResultSetPosition 0
set code [lindex $status 1]
set msg [lindex $status 2]
set addinfo [lindex $status 3]
htmlr {Error} $code {: } $msg {: } $addinfo {
}
set sessionWait -2
} else {
set sessionWait 1
}
}
proc ok-response {} {
global sessionWait
set sessionWait 1
}
proc fail-response {} {
global sessionWait
set sessionWait -1
}
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}
"
return
}
if {$type != "DB"} {
return
}
html "${no} "
set rtype [$zset recordType $no]
if {$rtype == "SUTRS"} {
html [join [$zset getSutrs $no]]
htmlr {
}
return
}
if {![catch {
set title [lindex [$zset getMarc $no field 245 * a] 0]
set year [lindex [$zset getMarc $no field 260 * c] 0]
} ] } {
html { } $title {}
html " ${year} "
}
htmlr {
}
}
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 "