2 # $Id: z39util.tcl,v 1.29 1996/01/31 15:56:37 adam Exp $
6 set f [open "tcl.state.${sessionId}" w]
7 foreach var [info globals] {
8 if {$var == "f"} continue
9 if {$var == "sessionId"} continue
10 if {$var == "errorInfo"} continue
11 if {[catch {set names [array names $var]}]} {
13 puts $f "set ${var} \{$v\}"
16 eval "set v \$${var}(\$n)"
17 puts $f "set ${var}($n) \{$v\}"
21 puts $f "set ${var} \{$v\}"
29 proc search-response {zz} {
32 set status [$zz responseStatus]
33 if {[lindex $status 0] == "NSD"} {
34 $zz nextResultSetPosition 0
35 set code [lindex $status 1]
36 set msg [lindex $status 2]
37 set addinfo [lindex $status 3]
38 displayError "Diagnostic message" \
39 "$msg: $addinfo<br>\n(error code $code)"
46 proc scan-response {zz} {
49 set status [$zz scanStatus]
51 displayError "Scan fail" ""
63 proc fail-response {} {
68 proc display-brief {zset no tno} {
75 set type [$zset type $no]
77 set err [lindex [$zset diag $no] 1]
78 set add [lindex [$zset diag $no] 2]
82 html "${no} Error ${err}${add} <br>\n"
88 set rtype [$zset recordType $no]
89 if {$rtype == "SUTRS"} {
90 html [join [$zset getSutrs $no]]
95 set author [$zset getMarc $no field 100 * a]
96 set corp [$zset getMarc $no field 110 * a]
97 set meet [$zset getMarc $no field 111 * a]
98 set title [$zset getMarc $no field 245 * a]
99 if {[llength $author] == 0} {
100 set cover [$zset getMarc $no field 245 * {[bc]}]
102 set cover [$zset getMarc $no field 245 * b]
104 set location [$zset getMarc $no field 260 * a]
105 set publisher [$zset getMarc $no field 260 * b]
106 set year [$zset getMarc $no field 260 * c]
108 html { <a href="http:} $env(SCRIPT_NAME) /
109 html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
141 set v [join $cover ""]
142 if {[string length $v] > 40} {
143 html [string range $v 0 38] "..."
153 proc display-raw {zset no tno} {
154 set type [$zset type $no]
156 set err [lindex [$zset diag $no] 1]
157 set add [lindex [$zset diag $no] 2]
161 html "<h3>${no}</h3>\n"
162 html "Error ${err}${add} <br>\n"
168 set rtype [$zset recordType $no]
169 if {$rtype == "SUTRS"} {
170 html [join [$zset getSutrs $no]] "<br>\n"
173 if {[catch {set r [$zset getMarc $no line * * *]}]} {
174 html "Unknown record type: $rtype <br>\n"
178 set tag [lindex $line 0]
179 set indicator [lindex $line 1]
180 set fields [lindex $line 2]
181 set l [string length $indicator]
184 for {set i 0} {$i < $l} {incr i} {
185 if {[string index $indicator $i] == " "} {
188 html [string index $tag $i]
193 foreach field $fields {
194 set id [lindex $field 0]
195 set data [lindex $field 1]
197 html " <b>\$$id</b> "
205 proc put-marc-contents {cc} {
207 if {[string first :// $cc] > 0} {
208 foreach urltype {gopher http ftp mailto} {
209 if {[string first ${urltype}:// $cc] == 0} {
224 proc dl-marc-field {zset no tag id la lb sep} {
226 set c [$zset getMarc $no field $tag * $id]
231 if {$len > 1 && "x$lb" != "x"} {
232 html "<dt><b>$lb</b>\n<dd>"
234 html "<dt><b>$la</b>\n<dd>"
240 put-marc-contents $cc
246 proc dd-marc-field {zset no tag id start stop} {
248 set c [$zset getMarc $no field $tag * $id]
255 put-marc-contents $cc
262 proc dl-marc-field-rec {zset no tag lead start stop startid sep} {
264 set lines [$zset getMarc $no line $tag * *]
265 foreach line $lines {
266 foreach field [lindex $line 2] {
268 html "<dt><b>$lead</b>"
271 set id [lindex $field 0]
272 if {$id == $startid} {
278 html [lindex $field 1]
281 html [lindex $field 1]
290 proc display-full {zset no tno} {
291 set type [$zset type $no]
293 set err [lindex [$zset diag $no] 1]
294 set add [lindex [$zset diag $no] 2]
298 html "Error ${err}${add} <br>\n"
304 set rtype [$zset recordType $no]
305 if {$rtype == "SUTRS"} {
306 html [join [$zset getSutrs $no]] "<br>\n"
309 if {[catch {set r [$zset getMarc $no line * * *]}]} {
310 html "Unknown record type: $rtype <br>\n"
314 set n [dl-marc-field $zset $no 700 a "Author" "Authors" "<br>\n"]
316 set n [dl-marc-field $zset $no 100 a "Author" "Authors" "<br>\n"]
318 set n [dl-marc-field $zset $no 710 a "Corporate Name" {} ", "]
320 set n [dl-marc-field $zset $no 110 a "Corporate Name" {} ", "]
322 set n [dl-marc-field $zset $no 711 a "Meeting Name" {} ", "]
324 dd-marc-field $zset $no 711 {[bndc]} " " ""
326 set n [dl-marc-field $zset $no 111 a "Meeting Name" {} ", "]
328 dd-marc-field $zset $no 111 {[bndc]} " " " "
331 set n [dl-marc-field $zset $no 245 {a} "Title" {} " "]
333 dd-marc-field $zset $no 245 b "<em>" "</em>"
334 dd-marc-field $zset $no 245 c " " ""
336 dl-marc-field $zset $no 245 {[ab]} "Title" {} " "
338 dl-marc-field $zset $no 520 a "Abstract" {} ", "
339 dl-marc-field $zset $no 072 * "Subject code" "Subject codes" ", "
340 dl-marc-field $zset $no 650 * "Subject" {} ", "
341 dl-marc-field $zset $no 260 * "Publisher" {} " "
342 dl-marc-field $zset $no 300 * "Physical Description" {} " "
344 dl-marc-field-rec $zset $no 500 "Notes" "" "<br>\n" "a" ", "
346 dl-marc-field-rec $zset $no 510 "References" "" "<br>\n" "a" ", "
348 dl-marc-field-rec $zset $no 511 "Participant note" "" "<br>\n" "a" ", "
350 dl-marc-field $zset $no 513 a "Report type" {} ", "
351 dl-marc-field $zset $no 513 b "Period covered" {} ", "
352 dl-marc-field-rec $zset $no 515 "Numbering notes" "" "<br>\n" "a" ", "
353 dl-marc-field-rec $zset $no 516 "Data notes" "" "<br>\n" "a" ", "
354 dl-marc-field-rec $zset $no 518 "Date/time notes" "" "<br>\n" "a" ", "
356 dl-marc-field $zset $no 350 a "Price" {} ", "
357 dl-marc-field $zset $no 362 a "Dates of publication" {} ", "
358 dl-marc-field $zset $no 850 a "Holdings" {} ", "
360 dl-marc-field-rec $zset $no 270 "Contact name" "" "<br>\n" p ", "
362 set n [dl-marc-field $zset $no 270 p "Contact name" {} ", "]
367 dl-marc-field $zset $no 270 a "Street" {} ", "
368 dl-marc-field $zset $no 270 b "City" {} ", "
369 dl-marc-field $zset $no 270 c "State" {} ", "
370 dl-marc-field $zset $no 270 e "Zip code" {} ", "
371 dl-marc-field $zset $no 270 d "Country" {} ", "
372 dl-marc-field $zset $no 270 m "Network address" {} ", "
373 dl-marc-field $zset $no 301 a "Service hours" {} ", "
374 dl-marc-field $zset $no 270 k "Phone" {} ", "
375 dl-marc-field $zset $no 270 l "Fax" {} ", "
377 dl-marc-field $zset $no 270 {[abcedmakl]} "Address" {} "<br>\n"
383 dl-marc-field $zset $no 010 a "LC control number" {} ", "
384 dl-marc-field $zset $no 010 b "NUCMC control number" {} ", "
385 dl-marc-field $zset $no 020 a "ISBN" {} ", "
386 dl-marc-field $zset $no 022 a "ISSN" {} ", "
387 set url [$zset getMarc $no field 856 * u]
388 set sp [$zset getMarc $no field 856 * 3]
389 if {"x$url" != "x"} {
390 html "<dt><b>URL</b>\n"
394 html {<dd><a href="} $url {">} [join $sp] "</a>\n"
396 dl-marc-field $zset $no 037 {[abc]} "Acquisition" {} "<br>\n"
397 dl-marc-field $zset $no 037 {[f6]} "Form of issue" {} "<br>\n"
398 dl-marc-field $zset $no 537 * "Source of data" {} "<br>\n"
399 dl-marc-field $zset $no 538 * "System details" {} "<br>\n"
400 dl-marc-field $zset $no 787 {[rstw6]} "Related information" {} "<br>\n"
401 dl-marc-field $zset $no 001 * "Local control number" {} ", "
406 proc display-rec {from to dfunc tno} {
410 while {$from <= $to} {
411 eval "$dfunc z39${tno}.${setNo} $from $tno"
415 while {$from <= $to} {
416 eval "$dfunc z39.${setNo} $from 0"
422 proc build-scan {t i} {
425 set term [egw_form entry$i]
427 set field [join [egw_form menu$i]]
429 foreach x [lindex $targets($t) 2] {
430 if {[lindex $x 0] == $field} {
431 set attr [lindex $x 1]
434 return [list $term $attr]
439 proc build-query {t ilines} {
444 for {set i 1} {$i <= $ilines} {incr i} {
445 set term [join [egw_form entry$i]]
446 if {[string length $term] > 0} {
447 set field [join [egw_form menu$i]]
448 foreach x [lindex $targets($t) 2] {
449 if {[lindex $x 0] == $field} {
450 set attr [lindex $x 1]
455 { set q "@and $q ${attr} \"${term}\"" }
457 { set q "@or $q ${attr} \"${term}\"" }
459 { set q "@not $q ${attr} \"${term}\"" }
461 { set q "${attr} \"${term}\"" }
463 set op [egw_form logic$i]
469 proc z39scan {setNo scanNo tno scanLines scanPos cache} {
476 set host $hist($setNo,$tno,host)
477 set idAuth $hist($setNo,$tno,idAuthentication)
478 set database $hist($setNo,$tno,database)
479 set scanAttr $hist($setNo,$tno,scanAttr)
480 set scanTerm $hist($setNo,$tno,$scanNo,scanTerm)
483 set host $hist($setNo,host)
484 set idAuth $hist($setNo,idAuthentication)
485 set database $hist($setNo,database)
486 set scanAttr $hist($setNo,scanAttr)
487 set scanTerm $hist($setNo,$scanNo,scanTerm)
489 if {[catch [list $zz failback fail-response]]} {
492 if {[catch [list set oldHost [$zz connect]]]} {
495 set zs $zz.s$scanNo.$setNo
496 $zz callback ok-response
497 $zz failback fail-response
498 set thisHost [splitHostSpec $host]
499 if {$oldHost != $thisHost} {
500 catch [list $zz disconnect]
503 if {[catch [list $zz connect $thisHost]]} {
504 displayError "Cannot connect to target" $thisHost
506 } elseif {$sessionWait == 0} {
507 if {[catch {egw_wait sessionWait 300}]} {
509 displayError "Cannot connect to target" $thisHost
512 if {$sessionWait != 1} {
513 displayError "Cannot connect to target" $thisHost
517 $zz idAuthentication $idAuth
519 if {[catch {$zz init}]} {
520 displayError "Cannot initialize target" $thisHost
524 if {[catch {egw_wait sessionWait 60}]} {
525 displayError "Cannot initialize target" $thisHost
529 if {$sessionWait != "1"} {
530 displayError "Cannot initialize target" $thisHost
534 if {![$zz initResult]} {
535 set u [$zz userInformationField]
537 displayError "Cannot initialize target $thisHost" $u
541 if {$cache && ![catch [list $zs numberOfTermsRequested 5]]} {
545 eval $zz databaseNames $database
549 $zs numberOfTermsRequested $scanLines
550 $zs preferredPositionInResponse $scanPos
552 $zz callback [list scan-response $zs]
554 egw_log debug "scan: ${scanAttr} ${scanTerm}"
556 $zs scan "${scanAttr} ${scanTerm}"
558 if {[catch {egw_wait sessionWait 60}]} {
559 egw_log debug "timeout/cancel in scan"
560 displayError "Timeout in scan" {}
561 html "</body></html>\n"
565 if {$sessionWait == -1} {
566 displayError "Scan fail" "Connection closed"
567 html "</body></html>\n"
570 if {$sessionWait != 1} {
576 proc display-scan {setNo scanNo tno} {
587 set zs $zz.s$scanNo.$setNo
588 set m [$zs numberOfEntriesReturned]
591 set t [lindex [$zs scanLine 0] 1]
593 set hist($setNo,$tno,[expr $scanNo - 1],scanTerm) $t
595 set hist($setNo,[expr $scanNo - 1],scanTerm) $t
597 set t [lindex [$zs scanLine [expr $m - 1]] 1]
599 set hist($setNo,$tno,[expr $scanNo + 1],scanTerm) $t
601 set hist($setNo,[expr $scanNo + 1],scanTerm) $t
604 html {<table width=500 border=0><tr>}
605 html {<td align=left><b>Scan term</b>}
606 html {<td align=right><b>Hits</b>}
609 for {set i 0} {$i < $m} {incr i} {
610 html {<td align=left>}
612 regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
613 html {<a href="http:} $env(SCRIPT_NAME)
614 html / $sessionId {/query.egw/} $hist($setNo,host) + $setNo +
615 html $hist($setNo,scan) + $tterm {">}
617 regsub -all {\ } [lindex [$zs scanLine $i] 1] + tterm
618 html {<a href="http:} $env(SCRIPT_NAME)
619 html / $sessionId {/search.egw/} $setNo +
620 html hyper + $tterm {">}
622 html [lindex [$zs scanLine $i] 1]
624 html {<td align=right>}
625 html [lindex [$zs scanLine $i] 2]
631 proc z39search {setNo piggy tno elements} {
638 set host $hist($setNo,$tno,host)
639 set idAuth $hist($setNo,$tno,idAuthentication)
640 set database $hist($setNo,$tno,database)
641 set query $hist($setNo,$tno,query)
644 set host $hist($setNo,host)
645 set idAuth $hist($setNo,idAuthentication)
646 set database $hist($setNo,database)
647 set query $hist($setNo,query)
649 if {[catch [list $zz failback fail-response]]} {
652 if {[catch [list set oldHost [$zz connect]]]} {
655 $zz callback ok-response
656 $zz failback fail-response
657 set thisHost [splitHostSpec $host]
658 if {$oldHost != $thisHost} {
659 catch [list $zz disconnect]
662 if {[catch [list $zz connect $thisHost]]} {
663 displayError "Cannot connect to target" $thisHost
665 } elseif {$sessionWait == 0} {
666 if {[catch {egw_wait sessionWait 300}]} {
668 displayError "Cannot connect to target" $thisHost
671 if {$sessionWait != 1} {
672 displayError "Cannot connect to target" $thisHost
676 $zz idAuthentication $idAuth
678 if {[catch {$zz init}]} {
679 displayError "Cannot initialize target" $thisHost
683 if {[catch {egw_wait sessionWait 60}]} {
684 displayError "Cannot initialize target" $thisHost
688 if {$sessionWait != "1"} {
689 displayError "Cannot initialize target" $thisHost
693 if {![$zz initResult]} {
694 set u [$zz userInformationField]
696 displayError "Cannot initialize target $thisHost" $u
700 if {[info exists hist($setNo,hits)] && \
701 ![catch [list $zz.$setNo smallSetUpperBound 0]]} {
706 ir-set $zz.$setNo $zz
708 if {![lindex $targets($host) 5]} {
711 $zz.$setNo smallSetElementSetNames $elements
712 $zz.$setNo mediumSetElementSetNames $elements
713 $zz.$setNo recordElements $elements
715 egw_log debug "database=$database"
716 eval $zz.$setNo databaseNames $database
718 $zz.$setNo preferredRecordSyntax USMARC
720 $zz callback [list search-response $zz.$setNo]
722 $zz.$setNo largeSetLowerBound 999999
723 $zz.$setNo smallSetUpperBound 0
724 $zz.$setNo mediumSetPresentNumber $hist($setNo,maxPresent)
726 $zz.$setNo largeSetLowerBound 2
727 $zz.$setNo smallSetUpperBound 0
728 $zz.$setNo mediumSetPresentNumber 0
731 egw_log debug "search: $query"
732 $zz.$setNo search $query
734 if {[catch {egw_wait sessionWait 600}]} {
735 egw_log debug "timeout/cancel in search"
736 displayError "Timeout in search" {}
737 html "</body></html>\n"
742 if {$sessionWait == -1} {
743 displayError "Search fail" "Connection closed"
744 html "</body></html>\n"
747 if {$sessionWait != 1} {
750 set hist($setNo,hits) [$zz.$setNo resultCount]
754 proc init-m-response {i} {
758 egw_log debug "init-m-response"
764 proc connect-m-response {i} {
768 egw_log debug "connect-m-response"
769 z39$i callback [list init-m-response $i]
770 if {[catch {z39$i init}]} {
776 proc fail-m-response {i} {
780 egw_log debug "fail-m-response"
785 proc search-m-response {setNo i start number} {
790 egw_log debug "search-m-response"
791 set status [z39$i.$setNo responseStatus]
792 egw_log debug "search-m-response1"
793 if {[lindex $status 0] != "DBOSD"} {
794 egw_log debug "search-m-response2"
799 set nor [z39$i.$setNo numberOfRecordsReturned]
800 egw_log debug "search-m-response3"
801 set hist($setNo,$i,offset) [expr $start + $nor -1]
802 if {[expr $nor + $start] >= [z39$i.$setNo resultCount]} {
803 egw_log debug "search-m-response4"
808 egw_log debug "search-m-response5"
809 if {$nor >= $number} {
810 egw_log debug "search-m-response6"
815 egw_log debug "search-m-response7"
816 set start [expr $start + $nor]
817 set number [expr $number - $nor]
818 if {[expr $start + $number - 1] > [z39$i.$setNo resultCount]} {
819 set number [expr [z39$i.$setNo resultCount] - $start + 1]
821 z39$i callback [list search-m-response $setNo $i $start $number]
822 egw_log debug "mpresent start=$number number=$number"
823 z39$i.$setNo present $start $number
826 proc z39msearch {setNo elements start number cache} {
832 set not $hist($setNo,0,host)
834 for {set i 1} {$i <= $not} {incr i} {
835 set host $hist($setNo,$i,host)
836 if {[catch [list z39$i failback fail-m-response $i]]} {
839 set oldHost [z39$i connect]
840 set thisHost [splitHostSpec $host]
841 if {$oldHost != $thisHost} {
842 catch {z39$i disconnect}
844 z39$i callback [list connect-m-response $i]
845 z39$i failback [list fail-m-response $i]
848 for {set i 1} {$i <= $not} {incr i} {
849 set oldHost [z39$i connect]
850 set host $hist($setNo,$i,host)
851 set thisHost [splitHostSpec $host]
852 if {$oldHost == $thisHost} {
855 egw_log debug "old=$oldHost this=$thisHost"
856 z39$i idAuthentication $hist($setNo,$i,idAuthentication)
857 html "Connecting to target " $thisHost " <br>\n"
859 if {![catch {z39$i connect $thisHost}]} {
864 egw_log debug "Waiting for init response"
865 if {[catch {egw_wait zleft 20}]} {
870 for {set i 1} {$i <= $not} {incr i} {
871 html "host " [splitHostSpec $hist($setNo,$i,host)] ": "
872 egw_log debug "i=$i zstatus=$zstatus($i)"
873 if {$zstatus($i) < 1} {
877 if {[catch [list z39$i.$setNo preferredRecordSyntax USMARC]]} {
879 ir-set z39$i.$setNo z39$i
880 set hist($setNo,$i,offset) 0
881 eval z39$i.$setNo databaseNames $hist($setNo,$i,database)
883 if {![lindex $targets($hist($setNo,$i,host)) 5]} {
886 set thisElements $elements
888 z39$i.$setNo smallSetElementSetNames $thisElements
889 z39$i.$setNo mediumSetElementSetNames $thisElements
890 z39$i.$setNo elementSetNames $thisElements
891 z39$i.$setNo recordElements $thisElements
893 z39$i.$setNo preferredRecordSyntax USMARC
894 z39$i callback [list search-m-response $setNo $i $start $number]
897 z39$i.$setNo largeSetLowerBound 999999
898 z39$i.$setNo smallSetUpperBound 0
899 z39$i.$setNo mediumSetPresentNumber $number
901 z39$i.$setNo largeSetLowerBound 2
902 z39$i.$setNo smallSetUpperBound 0
903 z39$i.$setNo mediumSetPresentNumber 0
907 egw_log debug "setNo=$setNo msearch " $hist($setNo,$i,query)
908 z39$i.$setNo search $hist($setNo,$i,query)
909 } elseif {[z39$i.$setNo resultCount] >= $start} {
910 if {[expr $start + $number - 1] > [z39$i.$setNo resultCount]} {
911 set tnumber [expr [z39$i.$setNo resultCount] - $start + 1]
915 if {![lindex $targets($hist($setNo,$i,host)) 5]} {
918 set thisElements $elements
920 z39$i.$setNo smallSetElementSetNames $thisElements
921 z39$i.$setNo mediumSetElementSetNames $thisElements
922 z39$i.$setNo elementSetNames $thisElements
923 z39$i.$setNo recordElements $thisElements
925 for {set n 0} {$n < $tnumber} {incr n} {
926 if {[z39$i.$setNo type [expr $start + $n]] == ""} {
928 egw_log debug "failed on $n"
933 if {$n == $tnumber} {
939 z39$i.$setNo preferredRecordSyntax USMARC
940 z39$i callback [list search-m-response $setNo $i $start $tnumber]
942 egw_log debug "mpresent start=$start number=$tnumber"
943 z39$i.$setNo present $start $tnumber
949 egw_log debug "Waiting for search/present response"
950 if {[catch {egw_wait zleft 60}]} {
954 for {set i 1} {$i <= $not} {incr i} {
955 if {$zstatus($i) != 2} continue
956 set status [z39$i.$setNo responseStatus]
957 if {0 && [lindex $status 0] != "NSD"} {
958 set hist($setNo,$i,offset) [z39$i.$setNo numberOfRecordsReturned]
963 proc z39present {setNo tno setOffset setMax dfunc elements} {
970 set host $hist($setNo,$tno,host)
973 set host $hist($setNo,host)
976 if {![lindex $targets($host) 5]} {
980 $zz.$setNo elementSetNames $elements
981 $zz.$setNo recordElements $elements
982 set toGet [expr 1 + $setMax - $setOffset]
984 $zz callback [list search-response $zz.$setNo]
986 while {$setMax > 0 && $toGet > 0} {
987 for {set got 0} {$got < $toGet} {incr got} {
988 if {[$zz.$setNo type [expr $setOffset + $got]] == ""} {
994 $zz.$setNo present $setOffset $toGet
995 if {[catch {egw_wait sessionWait 300}]} {
996 egw_log debug "timeout/cancel in present"
1000 if {$sessionWait == "0"} {
1003 if {$sessionWait != "1"} {
1006 set got [$zz.$setNo numberOfRecordsReturned]
1011 display-rec $setOffset [expr $got + $setOffset - 1] $dfunc $tno
1012 set setOffset [expr $got + $setOffset]
1013 set toGet [expr 1 + $setMax - $setOffset]
1018 proc z39history {} {
1026 if {![info exists nextSetNo]} {
1029 html "<h2>History</h2><br>\n"
1031 html {<table width=500 border=1><tr>}
1032 html {<td align=center><b>Target</b>}
1033 html {<td align=center><b>Database</b>}
1034 html {<td align=center><b>Hits</b>}
1035 html {<td align=center><b>Query</b>}
1040 for {set setNo 1} {$setNo < $nextSetNo} {incr setNo} {
1041 if {$hist($setNo,scan) > 0} continue
1042 set host $hist($setNo,host)
1044 html {<td align=left>}
1048 html [lindex $targets($host) 0]
1050 html {<td align=left>} [join $hist($setNo,database)]
1052 if {[llength [lindex $targets($host) 1]] > 1} {
1054 foreach b $hist($setNo,database) {
1061 html {<td align=right>}
1063 if {[info exists hist($setNo,hits)]} {
1064 html { <a href="http:} $env(SCRIPT_NAME)
1065 html / $sessionId {/search.egw/} $setNo + 1
1066 html + $hist($setNo,maxPresent)
1068 html {">} $hist($setNo,hits) {</a>}
1070 html {">Result</a>: } $hist($setNo,hits) { hits.}
1076 html {Search failed.}
1080 html {<td align=left>}
1084 html { <a href="http:} $env(SCRIPT_NAME)
1085 html / $sessionId {/query.egw/} $host + $setNo
1089 html {">Query</a>: }
1092 for {set i 1} {$i <= 3} {incr i} {
1093 if {[string length $hist($setNo,form,entry$i)] > 0} {
1094 html " <b>" [join $op " "] "</b> "
1095 html [join $hist($setNo,form,menu$i)] "="
1096 html $hist($setNo,form,entry$i)
1097 set op $hist($setNo,form,logic$i)
1101 html {</a><tr>} "\n"
1112 proc displayError {msga msgb} {
1113 html "<p><center>\n"
1114 html {<img src="/egwgif/noway.gif" alt="Error">}
1115 html "<h2>" $msga "</h2>\n"
1117 html "<h3>" $msgb "</h3>\n"
1119 html "</center><p>\n"
1122 proc button-europagate {} {
1124 html {<a href="http://europagate.dtv.dk/">}
1126 html {<img src="/egwgif/button-egw.gif" alt="Europagate" border=0></a>}
1128 html {Europagate</a> | }
1132 proc button-define-target {more} {
1137 html {<a href="http:} $env(SCRIPT_NAME)
1138 html / $sessionId {/tform.egw}
1140 html {"><img src="/egwgif/button-define-target.gif" }
1141 html {alt="Define Target" border=0></a>}
1143 html {">Define Target</a>}
1152 proc button-new-target {more} {
1158 html {<a href="http:} $env(SCRIPT_NAME)
1161 html {/mtargets.egw}
1166 html {"><img src="/egwgif/button-new-target.gif" }
1167 html {alt="New Target" border=0></a>}
1169 html {">New Target</a>}
1178 proc button-view-history {more} {
1184 html {<a href="http:} $env(SCRIPT_NAME)
1185 html / $sessionId {/history.egw;}
1186 catch { html "/" $nextSetNo}
1188 html {"><img src="/egwgif/button-view-history.gif" alt="View History" }
1189 html {border=0></a>}
1191 html {">View History</a>}
1200 proc button-new-query {more setNo} {
1207 html {<a href="http:} $env(SCRIPT_NAME)
1210 html {/mquery.egw/} $setNo
1212 html {/query.egw/} $hist($setNo,host) + $setNo
1216 html {<img src="/egwgif/button-new-query.gif" }
1217 html {alt="New Query" border=0></a>}
1219 html {New Query</a>}
1228 proc button-scan-window {more setNo} {
1234 html {<a href="http:} $env(SCRIPT_NAME)
1235 html / $sessionId {/search.egw/} $setNo + {scan} {">}
1237 html {<img src="/egwgif/button-scan-window.gif" }
1238 html {alt="Scan" border=0></a>}
1249 proc maintenance {} {
1250 html {<hr>This page is maintained by }
1251 html {<a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.}
1252 html {Last modified 29. january 1996. <br>}
1253 html {<em> This and the following pages are under construction and }
1254 html {will continue to be so until the end of January 1996.</em>}
1257 proc splitHostSpec {host} {
1258 set i [string last . $host]
1261 return [string range $host 0 $i]
1266 proc mergeHostSpec {host databases} {
1267 return ${host}.[join $databases -]