69dcd192baee44a7ad8320a9ed10765b8c002454
[egate.git] / www / mquery.egw
1 <html>
2 <head>
3 <title> WWW/Z39.50 Gateway Query Form</title>
4 </head>
5 <body>
6 {
7 # $Id: mquery.egw,v 1.13 1996/03/08 16:47:04 adam Exp $
8
9     if {[info commands saveState] == ""} {
10         source z39util.tcl
11     }
12
13     global setNo
14     global nextSetNo
15     global hist
16     global targets
17
18     if {[catch {set setNo $nextSetNo}]} {
19         set nextSetNo 1
20         set setNo 1
21     }
22
23     set useIcons 1
24     button-europagate
25     button-new-target 0
26
27     html {<form action="http:} $env(SCRIPT_NAME)
28     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
29
30     set phost {}
31     set i 0
32     foreach t [lsort [egw_form target]] {
33         set host [lindex $t 0]
34         set base [lindex $t 1]
35         if {$host != $phost} {
36             set phost $host
37             incr i
38             set hist($setNo,$i,host) $host
39             set hist($setNo,$i,idAuthentication) [lindex $targets($host) 3]
40         }
41         lappend hist($setNo,$i,database) $base
42     }
43     set oSetNo [lindex $sessionParms 0]
44     if {$i == 0 && [info exists hist($oSetNo,0,host)]} {
45         for {set i 1} {$i <= $hist($oSetNo,0,host)} {incr i} {
46             set hist($setNo,$i,host) $hist($oSetNo,$i,host)
47             set hist($setNo,$i,idAuthentication) \
48                 $hist($oSetNo,$i,idAuthentication)
49             set hist($setNo,$i,database) $hist($oSetNo,$i,database)
50         }
51         incr i -1
52     }
53     if {$i == 0} {
54         html "<h2>No targets specified</h2></body></html>"
55         egw_abort 1
56     }
57     set hist($setNo,0,host) $i
58
59     html "Input your search criteria:<br>\n"
60     set fields [lindex $targets($host) 2]
61     for {set no 1} {$no < 4} {incr no} {
62         html {<select name="menu} $no {">} \n
63         foreach f $fields {
64             html {<option> } [lindex $f 0] \n
65         }
66         html "</select>\n"
67         html {<input type="text" name="entry} $no {" size=35>} \n
68         if {$no < 3} {
69             html {<select name="logic} $no {">} \n
70             html "<option> And\n"
71             html "<option> Or\n"
72             html "<option> And not\n"
73             html "</select>\n"
74         }
75         html "<br>\n"
76     }
77     html {<input type=submit value="Search"><input type=reset value="Reset">}
78     html "<br>\n"
79     html {Display each record in <select name="format">}
80     html "<option>brief\n"
81     html "<option>medium\n"
82     html "</select> notation"
83     html { and sort by <select name="sort">}
84     html "<option>score\n"
85     html "<option>server\n"
86     html "</select><br>\n"
87
88     set useIcons 0
89     button-europagate
90     button-new-target 0
91 }
92 {
93     catch maintenance
94     if {!$debug} return
95     html "<hr>\n"
96     html "<h3>Debug information</h3>\n"
97     html "sessionId: $sessionId <br>\n"
98     html "sessionParms: $sessionParms <br>\n"
99     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
100         html $e {: } $env($e) {<br>} \n
101     }
102     set j $hist($setNo,0,host)
103     for {set i 1} {$i <= $j} {incr i} {
104         html "host=" $hist($setNo,$i,host) " " $hist($setNo,$i,database) 
105         html "<br>\n"
106     }
107     html "form: " [egw_form] " <br>\n"
108     html "target: " $host " <br>\n"
109     html "setNo: " $setNo " <br>\n"
110     html "nextSetNo: " $nextSetNo " <br>\n"
111 }
112 </body></html>