+ html { <a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId / $scriptQuery {;/} $setNo + $host
+ if {$html3} {
+ html {">}
+ } else {
+ html {">Query</a>: }
+ }
+ set op {}
+ for {set j 1} {$j <= 10} {incr j} {
+ if {![info exists hist($setNo,form,entry$j)]} {
+ break
+ }
+ if {[string length $hist($setNo,form,entry$j)] > 0} {
+ html " <b>" [join $op " "] "</b> "
+ set pre [join $hist($setNo,form,menu$j)]
+ if {[string length $pre] > 0} {
+ html $pre "="
+ }
+ html $hist($setNo,form,entry$j)
+ set op $hist($setNo,form,logic$j)
+ }
+ }
+ if {$html3} {
+ html {</a><tr>} "\n"
+ }
+ }
+ }
+ if {$html3} {
+ html {</table><p>}
+ } else {
+ html {</dl>}
+ }
+ html "\n"
+}
+
+proc displayError {msga msgb} {
+ html "<p><center>\n"
+ html {<img src="/egwgif/noway.gif" alt="Error">}
+ html "<h2>" $msga "</h2>\n"
+ if {[string length $msgb] > 0} {
+ html "<h3>" $msgb "</h3>\n"
+ }
+ html "</center><p>\n"
+}
+
+proc button-main {} {
+ global useIcons
+ html {<a href="http://europagate.dtv.dk/">}
+ if {$useIcons} {
+ html {<img src="/egwgif/button-egw.gif" alt="Europagate" border=0></a>}
+ } else {
+ html {Europagate</a>}
+ }
+}
+
+proc button-feedback {} {
+ global useIcons
+
+ html {<a href="http://europagate.dtv.dk/wwwquest.html">}
+ if {$useIcons} {
+ html {<img src="/egwgif/button-user-feedback.gif" alt="User Feedback"
+ border=0></a>}
+ } else {
+ html "\n | "
+ html {User Feedback</a>}
+ }
+}
+
+proc button-define-target {} {
+ global useIcons
+ global env
+ global sessionId
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/tform.egw}
+ if {$useIcons} {
+ html {"><img src="/egwgif/button-define-target.gif" }
+ html {alt="Define Target" border=0></a>}
+ } else {
+ html {">Define Target</a>}
+ }
+}
+
+proc button-new-target {} {
+ global useIcons
+ global env
+ global sessionId
+ global scriptTarget
+
+ if {[string length $scriptTarget] == 0} return
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId / $scriptTarget
+ if {$useIcons} {
+ html {"><img src="/egwgif/button-new-target.gif" }
+ html {alt="New Target" border=0></a>}
+ } else {
+ html {">New Target</a>}
+ }
+}
+
+proc button-view-history {} {
+ global useIcons
+ global env
+ global sessionId
+ global nextSetNo
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/history.egw;}
+ catch { html "/" $nextSetNo}
+ if {$useIcons} {
+ html {"><img src="/egwgif/button-view-history.gif" alt="View History" }
+ html {border=0></a>}
+ } else {
+ html {">View History</a>}
+ }
+}
+
+proc button-new-query {setNo} {
+ global useIcons
+ global env
+ global sessionId
+ global hist
+ global scriptQuery
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId / $scriptQuery {;/} $setNo + $hist($setNo,0,host) {">}
+
+ if {$useIcons} {
+ html {<img src="/egwgif/button-new-query.gif" }
+ html {alt="New Query" border=0></a>}
+ } else {
+ html {New Query</a>}
+ }
+}
+
+proc button-result-set {setNo tno} {
+ global useIcons
+ global env
+ global sessionId
+ global hist
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ html {<a href="http:} $env(SCRIPT_NAME) / $sessionId
+ if {$tno > 0} {
+ html {/msearch.egw/} $setNo
+ } else {
+ html {/search.egw/} $setNo + $tno
+ }
+ html + 1 + $hist($setNo,maxPresent)
+ if {$useIcons} {
+ html {"><img src="/egwgif/button-result-set.gif" }
+ html {alt="Result Set" border=0></a>}
+ } else {
+ html {">Result Set</a>}
+ }
+}
+
+proc button-scan-window {setNo} {
+ global useIcons
+ global env
+ global sessionId
+ global hist
+
+ if {!$useIcons} {
+ html "\n | "
+ }
+ set targetNo 0
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/search.egw/} $setNo + $targetNo + {scan} {">}
+ if {$useIcons} {
+ html {<img src="/egwgif/button-scan-window.gif" }
+ html {alt="Scan" border=0></a>}
+ } else {
+ html {Scan</a>}
+ }
+}
+
+proc maintenance {} {
+ html {<hr>This page is maintained by }
+ html {<a href="mailto:nobody"> Nobody </a>.}
+ html {Last modified x x x. <br>}
+}
+
+proc splitHostSpec {host} {
+ set i [string first / $host]
+ if {$i > 1} {
+ incr i -1
+ return [string range $host 0 $i]
+ }
+ return $host
+}
+
+proc splitDatabaseSpec {host} {
+ set i [string first / $host]
+ if {$i > 1} {
+ incr i
+ regsub -all -- - [string range $host $i end] { } res
+ return $res
+ }
+ regsub -all -- - $host {} res
+ return $res
+}
+
+proc mergeHostSpec {host databases} {
+ return ${host}/[join $databases -]
+}
+
+proc mkAssoc {assoc host} {
+ global targets
+
+ if {[catch {$assoc failback fail-response}]} {
+ ir $assoc
+ $assoc maximumRecordSize 1000000
+ } else {
+ if {[$assoc comstack] == "tcpip"} return
+ ir $assoc
+ $assoc maximumRecordSize 1000000
+ }
+}
+
+proc serverList {headlineProc targetProc} {
+ global targets
+ global groupsDescription
+
+ proc targetsCmp {l r} {
+ global targets
+ return [string compare [string tolower [lindex $targets($l) 0]] \
+ [string tolower [lindex $targets($r) 0]]]
+ }
+ proc groupCmp {l r} {
+ global groupsOrder
+ if {[catch {set lo $groupsOrder($l)}]} {
+ set lo 10
+ }
+ if {[catch {set ro $groupsOrder($r)}]} {
+ set ro 10