+
+ set databases [lindex $targets($host) 1]
+
+ if {$initSet == ""} {
+ set databaseDefault [lindex $databases 0]
+ set oSetNo 0
+ } else {
+ set oSetNo $initSet
+ set databaseDefault $hist($oSetNo,database)
+ }
+
+ html {<form action="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/search.egw/} $setNo {+1" method=get>} \n
+ set nodb [llength $databases]
+ if {$nodb > 1} {
+ if {$nodb > 2} {
+ html "Databases:<br>\n"
+ }
+ set i 0
+ foreach d $databases {
+ html {<input type="checkbox" name="base" value="} $d
+ if {[lsearch $databaseDefault $d] == -1} {
+ html {"> } $d \n
+ } else {
+ html {" checked> } $d \n
+ }
+ }
+ html "<br>\n"
+ if {$nodb > 2} {
+ html {<input type="checkbox" name="baseall" value="}
+ html [concat $databases] {"> All <br>} \n
+ }
+ html "Input your search criteria:<br>\n"
+ }
+ set fields [lindex $targets($host) 2]
+ set no 1
+ html {<select name="menu} $no {">} \n
+ set template {}
+ if {$oSetNo > 0} {
+ set template [join $hist($oSetNo,form,menu$no)]
+ }
+ if {[string length $template] > 0} {
+ html {<option> } $template \n
+ }
+ foreach f $fields {
+ set name [lindex $f 0]
+ if {$template == $name} continue
+ html {<option> } $name \n
+ }
+ html "</select>\n"
+ html {<input type="text" name="entry} $no {"}
+ html { size=35> }
+ html {<input type=submit name=submit value="Scan">}
+ html "\n"
+ html {</form>}