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=407b3022e4287d33e0670a3c087420ddf508b769;hb=61d0705b4be65fc3c8482b84ee53e39c32c670f8;hpb=0322a96cb28174b6ca694e1f0900135df8c61a9c diff --git a/web/htdocs/details/form.mc b/web/htdocs/details/form.mc index 407b302..2812aec 100644 --- a/web/htdocs/details/form.mc +++ b/web/htdocs/details/form.mc @@ -1,4 +1,4 @@ -%# $Id: form.mc,v 1.2 2006-11-14 16:00:28 mike Exp $ +%# $Id: form.mc,v 1.7 2006-11-15 17:58:35 mike Exp $ <%args> $id => undef $conn @@ -8,21 +8,26 @@ $rec my $xc = irspy_xpath_context($rec); my @fields = ( - [ protocol => 0, "Protocol", "e:serverInfo/\@protocol" ], + [ protocol => [ qw(Z39.50 SRW SRU SRW/U) ], + "Protocol", "e:serverInfo/\@protocol" ], [ host => 0, "Host", "e:serverInfo/e:host" ], [ 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", qw(e:user) ], - [ title => 0, "title", "e:databaseInfo/e:title", + [ title => 0, "Title", "e:databaseInfo/e:title", qw() ], [ description => 5, "Description", "e:databaseInfo/e:description", 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", @@ -44,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); } @@ -55,10 +60,10 @@ if (defined $update) { ZOOM::IRSpy::_really_rewrite_record($conn, $xc->getContextNode()); } -

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

+

<% 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" %>.

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