From 7e98567d1db6ab1686ed84b8f869bccaf5b3fa79 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 17 Nov 2006 22:39:17 +0000 Subject: [PATCH] Towards orthogonalisation. --- web/htdocs/details/edit.mc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index 92b5fa2..1d789f0 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -1,5 +1,24 @@ -%# $Id: edit.mc,v 1.19 2006-11-16 17:52:06 mike Exp $ +%# $Id: edit.mc,v 1.20 2006-11-17 22:39:17 mike Exp $ +<%doc> +Since this form is used in many different situations, some care is +merited in considering the possibilities: + +New? Copy ID? Situation +-------------------------------------------------------------------------- +Y Blank form for adding a new target. +Y New target submitted successfully. +Y Partial new target submitted, requiring more + + Y Existing target to be edited. + Y Existing target has been updated. + + Y Y Existing target to be copied. + Y New or copied target rejected due to duplicate ID. +-------------------------------------------------------------------------- + <%args> +$new => undef +$copy => undef $id => undef <%perl> @@ -102,7 +121,7 @@ if ($update) {

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

% if ($nchanges) {

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

% } @@ -141,6 +160,9 @@ foreach my $ref (@fields) { % } else { % } +% if (defined $copy) { + +% } -- 1.7.10.4