e31fff3be9c05ce01f2ad8081f1e382c29587315
[egate.git] / www / msearch.egw
1 <html>
2 {
3 # $Id: msearch.egw,v 1.18 1996/03/11 17:40:47 adam Exp $
4
5     if {[info commands saveState] == ""} {
6         source z39util.tcl
7     }
8     global sessionWait
9     global nextSetNo
10     global setNo
11     global hist
12     global zstatus
13
14     html "<head><title> WWW/Z39.50 Gateway Search </title>\n"
15     html "</head><body>\n"
16
17     set setNo [lindex $sessionParms 0]
18
19     if {[string length [egw_form entry1]] > 0} {
20         if {[string length [egw_form host]] > 0} {
21             set hist($setNo,0,host) [llength [egw_form host]]
22             set i 1
23             foreach t [egw_form host] {
24                 set hist($setNo,$i,host) $t
25                 set hist($setNo,$i,database) [splitDatabaseSpec $t]
26                 set hist($setNo,$i,idAuthentication) {}
27                 incr i
28             }
29         }
30         set hist($nextSetNo,0,host) $hist($setNo,0,host)
31         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
32             set hist($nextSetNo,$i,host) $hist($setNo,$i,host)
33             set hist($nextSetNo,$i,database) $hist($setNo,$i,database)
34             set hist($nextSetNo,$i,idAuthentication) \
35                 $hist($setNo,$i,idAuthentication) 
36         }
37         set setNo $nextSetNo
38         incr nextSetNo
39
40         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
41             set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3]
42         }
43         set hist($setNo,maxPresent) [egw_form hits]
44         if {$hist($setNo,maxPresent) == ""} {
45             set hist($setNo,maxPresent) 20
46         }
47         set hist($setNo,format) [egw_form format]
48         if {![string length $hist($setNo,format)]} {
49             set hist($setNo,format) brief
50         }
51         set hist($setNo,sort) [egw_form sort]
52         if {![string length $hist($setNo,sort)]} {
53             set hist($setNo,sort) server
54         }
55     }
56
57     set useIcons 1
58     button-europagate
59     button-new-query 1 $setNo
60     button-new-target 0
61
62     html "<br>\n"
63     z39msearch $setNo B 1 $hist($setNo,maxPresent) 1
64
65     display-result-set-m $setNo
66
67     set useIcons 0
68     button-europagate
69     button-new-query 1 $setNo
70     button-new-target 0
71 }
72
73 {
74     if {!$debug} return
75     html "<hr>\n"
76     html "<h3>Debug information</h3>\n"
77     html "sessionId: $sessionId <br>\n"
78     html "sessionParms: $sessionParms <br>\n"
79     foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} {
80         html $e {: } $env($e) {<br>} \n
81     }
82     html "form: " [egw_form] " <br>\n"
83     html "query: --" $hist($setNo,1,query) "-- <br>\n"
84     html "database: " $hist($setNo,1,database) "<br>\n"
85     html "sort: " $hist($setNo,sort) "<br>\n"
86     html "format: " $hist($setNo,format) "<br>\n"
87     html "setNo: " $setNo " <br>\n"
88     html "nextSetNo: " $nextSetNo " <br>\n"
89 }
90
91 </body>
92 </html>