X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fedit.mc;h=4bb0670eac0559a2f7887facb5c8ae1ba3abe6a2;hb=6b614447756888f630e7af280cb9c03b98ec6b4e;hp=ca1213a9a66423973efa666189701a5d258ff3b0;hpb=96fdcac47776fe4a597004d640f6bce78bb5cc09;p=irspy-moved-to-github.git diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index ca1213a..4bb0670 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -1,4 +1,4 @@ -%# $Id: edit.mc,v 1.29 2007-03-29 16:19:39 mike Exp $ +%# $Id: edit.mc,v 1.31 2007-04-27 14:32:09 mike Exp $ <%args> $op $id => undef @@ -50,20 +50,25 @@ if (defined $id && ($op ne "copy" || !$update)) { } else { # No ID supplied -- this is a brand new record + my $protocol = $r->param("protocol"); my $host = $r->param("host"); my $port = $r->param("port"); my $dbname = $r->param("dbname"); - if (!defined $host || $host eq "" || + if (!defined $protocol || $protocol eq "" || + !defined $host || $host eq "" || !defined $port || $port eq "" || !defined $dbname || $dbname eq "") { print qq[

-You must specify host, port and database name.

\n] if $update; +You must specify protocol, host, port and database name.

\n] if $update; undef $update; } else { - my $query = cql_target($host, $port, $dbname); + ### Should use a utility function for this + my $query = cql_target($protocol, $host, $port, $dbname); my $rs = $conn->search(new ZOOM::Query::CQL($query)); if ($rs->size() > 0) { - my $fakeid = xml_encode(uri_escape("$host:$port/$dbname")); + my $fakeid = + xml_encode(uri_escape(irspy_make_identifier($protocol, $host, + $port, $dbname))); print qq[

There is already a record @@ -81,7 +86,7 @@ my @fields = qw() ], [ country => $m->comp("country-list.mc"), "Country", "i:status/i:country" ], - [ protocol => [ qw(Z39.50 SRW SRU SRW/U) ], + [ protocol => [ qw(Z39.50 SRW SRU) ], "Protocol", "e:serverInfo/\@protocol" ], [ host => 0, "Host", "e:serverInfo/e:host" ], [ port => 0, "Port", "e:serverInfo/e:port" ],