+proc display-result-set-m-score {setNo} {
+ global hist
+ global useIcons
+ global zstatus
+ global targets
+
+ set not $hist($setNo,0,host)
+ for {set i 1} {$i <= $not} {incr i} {
+ if {[lindex $status 0] != "DBOSD"} continue
+
+ if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
+ set nor $hist($setNo,$i,maxPresent)
+ } else {
+ set nor $hist($setNo,$i,offset)
+ }
+ for {set j 1} {$j < $not} {incr j} {
+ if {![string compare [z39$i.$setNo recordType] WAIS]} {
+ lappend scoreArray [list \
+ [z39$i.$setNo getWAIS $j score] $i $setNo $j]
+ } else {
+ lappend scoreArray [list 0 $i $setNo $j]
+ }
+ }
+ }
+ html "score merge<br>"
+}
+
+proc display-result-set-m-server {setNo} {
+ global hist
+ global useIcons
+ global zstatus
+ global targets
+
+ set not $hist($setNo,0,host)
+ html "<dl>\n"
+ for {set i 1} {$i <= $not} {incr i} {
+ if {$zstatus($i) != 2} continue
+ html "<dt><h3>" [lindex $targets($hist($setNo,$i,host)) 0] ": "
+ set status [z39$i.$setNo responseStatus]
+ if {[lindex $status 0] == "NSD"} {
+ z39$i.$setNo nextResultSetPosition 0
+ set code [lindex $status 1]
+ set msg [lindex $status 2]
+ set addinfo [lindex $status 3]
+ html "Error</h3>\n<dd>NSD$code: $msg: $addinfo"
+ } else {
+ set r [z39$i.$setNo resultCount]
+ html "$r hits</h3>\n<dd>\n<ul>\n"
+
+ if {$hist($setNo,$i,offset) > $hist($setNo,maxPresent)} {
+ display-rec 1 $hist($setNo,maxPresent) \
+ display-brief $setNo $i
+ } else {
+ display-rec 1 $hist($setNo,$i,offset) \
+ display-brief $setNo $i
+ }
+ html "</ul>"
+ }
+ html "\n"
+ }
+ html "</dl>\n"
+}
+
+proc display-result-set-m {setNo} {
+ global hist
+ global useIcons
+ global zstatus
+ global targets
+
+ egw_log debug "sort=$hist($setNo,sort)"
+ switch $hist($setNo,sort) {
+ score {
+ display-result-set-m-score $setNo
+ }
+ default {
+ display-result-set-m-server $setNo
+ }
+ }
+}
+