#
-# $Id: z39util.tcl,v 1.23 1996/01/24 08:27:23 adam Exp $
+# $Id: z39util.tcl,v 1.25 1996/01/24 16:59:29 adam Exp $
#
proc saveState {} {
uplevel #0 {
if {$p} {
html ": "
}
- html {<em>}
+ html { <a href="http:} $env(SCRIPT_NAME) /
+ html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
set nope 1
foreach v $title {
html $v
if {$nope} {
html {No title}
}
- html {</em> }
+ html {</a> }
foreach v $cover {
html $v
}
- html {<br>}
- foreach v $location {
- html " $v"
- }
- foreach v $publisher {
- html " $v"
- }
- foreach v $year {
- html " $v"
+ if {0} {
+ html {<br>}
+ foreach v $location {
+ html " $v"
+ }
+ foreach v $publisher {
+ html " $v"
+ }
+ foreach v $year {
+ html " $v"
+ }
}
- html { -- <a href="http:} $env(SCRIPT_NAME) /
- html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
- html "<em>view full</em></a>"
}
html "<br>\n"
}
}
switch $op {
And
- { set q "@and $q ${attr} ${term}" }
+ { set q "@and $q ${attr} \"${term}\"" }
Or
- { set q "@or $q ${attr} ${term}" }
+ { set q "@or $q ${attr} \"${term}\"" }
{And not}
- { set q "@not $q ${attr} ${term}" }
+ { set q "@not $q ${attr} \"${term}\"" }
{}
- { set q "${attr} ${term}" }
+ { set q "${attr} \"${term}\"" }
}
set op [egw_form logic$i]
}
set zs $zz.s$scanNo.$setNo
$zz callback ok-response
$zz failback fail-response
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch [list $zz disconnect]
set sessionWait 0
- if {[catch [list $zz connect $host]]} {
- displayError "Cannot connect to target" $host
+ if {[catch [list $zz connect $thisHost]]} {
+ displayError "Cannot connect to target" $thisHost
return 0
} elseif {$sessionWait == 0} {
if {[catch {egw_wait sessionWait 300}]} {
$zz disconnect
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
if {$sessionWait != 1} {
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
}
$zz idAuthentication $idAuth
set sessionWait 0
if {[catch {$zz init}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {[catch {egw_wait sessionWait 60}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {$sessionWait != "1"} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {![$zz initResult]} {
set u [$zz userInformationField]
$zz disconnect
- displayError "Cannot initialize target $host" $u
+ displayError "Cannot initialize target $thisHost" $u
return 0
}
} else {
}
$zz callback ok-response
$zz failback fail-response
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch [list $zz disconnect]
set sessionWait 0
- if {[catch [list $zz connect $host]]} {
- displayError "Cannot connect to target" $host
+ if {[catch [list $zz connect $thisHost]]} {
+ displayError "Cannot connect to target" $thisHost
return 0
} elseif {$sessionWait == 0} {
if {[catch {egw_wait sessionWait 300}]} {
$zz disconnect
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
if {$sessionWait != 1} {
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
}
$zz idAuthentication $idAuth
set sessionWait 0
if {[catch {$zz init}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {[catch {egw_wait sessionWait 60}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {$sessionWait != "1"} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {![$zz initResult]} {
set u [$zz userInformationField]
$zz disconnect
- displayError "Cannot initialize target $host" $u
+ displayError "Cannot initialize target $thisHost" $u
return 0
}
} else {
$zz.$setNo mediumSetPresentNumber 0
}
set sessionWait 0
+ egw_log debug "search: $query"
$zz.$setNo search $query
if {[catch {egw_wait sessionWait 600}]} {
if {[catch {set oldHost [z39$i connect]}]} {
set oldHost ""
}
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch {z39$i disconnect}
}
z39$i callback [list connect-m-response $i]
for {set i 1} {$i <= $not} {incr i} {
set oldHost [z39$i connect]
set host $hist($setNo,$i,host)
- if {$oldHost == $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost == $thisHost} {
set zstatus($i) 1
continue
}
z39$i idAuthentication $hist($setNo,$i,idAuthentication)
- html "Connecting to target " $host " <br>\n"
+ html "Connecting to target " $thisHost " <br>\n"
set zstatus($i) -1
- if {![catch {z39$i connect $host}]} {
+ if {![catch {z39$i connect $thisHost}]} {
incr zleft
}
}
}
set zleft 0
for {set i 1} {$i <= $not} {incr i} {
- html "host " $hist($setNo,$i,host) ": "
+ html "host " [splitHostSpec $hist($setNo,$i,host)] ": "
if {$zstatus($i) >= 1} {
html "ok <br>\n"
ir-set z39$i.$setNo z39$i
}
}
+proc button-define-target {more} {
+ global useIcons
+ global env
+ global sessionId
+
+ html {<a href="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/tform.egw}
+ if {$useIcons} {
+ html {"><img src="/egwgif/button-define-target.gif" }
+ html {alt="New Target" border=0></a>}
+ } else {
+ html {">New Target</a>}
+ if {$more} {
+ html " | \n"
+ } else {
+ html "\n"
+ }
+ }
+}
+
proc button-new-target {more} {
global useIcons
global env
proc maintenance {} {
html {<hr>This page is maintained by }
html {<a href="mailto:pwh@dtv.dk"> Peter Wad Hansen </a>.}
- html {Last modified 9. january 1996. <br>}
+ html {Last modified 24. january 1996. <br>}
html {<em> This and the following pages are under construction and }
html {will continue to be so until the end of January 1996.</em>}
}
+
+proc splitHostSpec {host} {
+ set i [string last . $host]
+ if {$i > 1} {
+ incr i -1
+ return [string range $host 0 $i]
+ }
+ return $host
+}
+
+proc mergeHostSpec {host databases} {
+ return ${host}.[join $databases -]
+}