X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fform.mc;h=2812aec0ebb2e7f3710f69227a5abb3d7a82dab6;hp=2fd8bf8f2703f712f65ba03d400a2d20a248df7a;hb=61d0705b4be65fc3c8482b84ee53e39c32c670f8;hpb=e277114d1174f602b137e85b08837541f3aaa4b1 diff --git a/web/htdocs/details/form.mc b/web/htdocs/details/form.mc index 2fd8bf8..2812aec 100644 --- a/web/htdocs/details/form.mc +++ b/web/htdocs/details/form.mc @@ -1,4 +1,4 @@ -%# $Id: form.mc,v 1.5 2006-11-15 13:15:19 mike Exp $ +%# $Id: form.mc,v 1.7 2006-11-15 17:58:35 mike Exp $ <%args> $id => undef $conn @@ -14,6 +14,9 @@ my @fields = [ port => 0, "Port", "e:serverInfo/e:port" ], [ dbname => 0, "Database Name", "e:serverInfo/e:database", qw(e:host e:port) ], + [ type => [ qw(Academic Public Corporate Special National Education Other) ], + "Type of Library", "i:status/i:libraryType" ], + [ country => 0, "Country", "i:status/i:country" ], [ username => 0, "Username (if needed)", "e:serverInfo/e:authentication/e:user", qw() ], [ password => 0, "Password (if needed)", "e:serverInfo/e:authentication/e:password", @@ -24,6 +27,7 @@ my @fields = qw(e:title) ], [ author => 0, "Author", "e:databaseInfo/e:author", qw(e:title e:description) ], + [ hosturl => 0, "URL to Hosting Organisation", "i:status/i:hostURL" ], [ contact => 0, "Contact", "e:databaseInfo/e:contact", qw(e:title e:description) ], [ extent => 3, "Extent", "e:databaseInfo/e:extent", @@ -45,7 +49,7 @@ if (defined $update) { my %fieldsByKey = map { ( $_->[0], $_) } @fields; my %data; foreach my $key ($r->param()) { - next if grep { $key eq $_ } qw(id update); + next if grep { $key eq $_ } qw(id update new copy); $data{$key} = $r->param($key); } @@ -59,7 +63,7 @@ if (defined $update) {

<% xml_encode($xc->find("e:databaseInfo/e:title"), "[Untitled]") %>

% if ($nchanges) {

- The record has been updated.
+ The record has been <% $r->param("new") ? "created" : "updated" %>.
Changed <% $nchanges %> field<% $nchanges == 1 ? "" : "s" %>.

% } @@ -72,11 +76,14 @@ foreach my $ref (@fields) { <% $caption %> -% my $data = xml_encode($xc->find($xpath), ""); +% my $rawdata = $xc->findvalue($xpath); +% my $data = xml_encode($rawdata, ""); % if (ref $nlines) { % } elsif ($nlines) { @@ -90,7 +97,11 @@ foreach my $ref (@fields) { +% if (defined $id) { +% } else { + +% }