- set hosts [wform target]
- html "hosts=$hosts <br>\n"
- set i 1
- foreach host $hosts {
- set hist($setNo,$i,host) $host
- set hist($setNo,$i,database) [lindex [lindex $targets($host) 1] 0]
- incr i
+
+ html {<form action="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
+
+ set phost {}
+ set i 0
+ foreach t [lsort [egw_form target]] {
+ set host [lindex $t 0]
+ set base [lindex $t 1]
+ if {$host != $phost} {
+ set phost $host
+ incr i
+ set hist($setNo,$i,host) $host
+ set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
+ }
+ lappend hist($setNo,$i,database) $base
+ }
+ if {$i == 0} {
+ html "<h2>No targets specified</h2></body></html>"
+ egw_abort 1