diff options
Diffstat (limited to 'httemplate/elements/contact.html')
-rw-r--r-- | httemplate/elements/contact.html | 56 |
1 files changed, 20 insertions, 36 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 38703bfef..2023a6cfe 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -4,42 +4,18 @@ <TABLE> <TR> - <TD> - <INPUT TYPE = "text" - NAME = "<%$name%>_first" - ID = "<%$id%>_id" - VALUE = "<% $contact->first |h %>" - <% $onchange %> - ><BR> - <FONT SIZE="-2">First name</FONT> - </TD> - <TD> - <INPUT TYPE = "text" - NAME = "<%$name%>_last" - ID = "<%$id%>_id" - VALUE = "<% $contact->get('last') |h %>" - <% $onchange %> - ><BR> - <FONT SIZE="-2">Last name</FONT> - </TD> - <TD> - <INPUT TYPE = "text" - NAME = "<%$name%>_title" - ID = "<%$id%>_id" - VALUE = "<% $contact->title |h %>" - <% $onchange %> - ><BR> - <FONT SIZE="-2">Title/Position</FONT> - </TD> - <TD> - <INPUT TYPE = "text" - NAME = "<%$name%>_comment" - ID = "<%$id%>_id" - VALUE = "<% $contact->comment |h %>" - <% $onchange %> - ><BR> - <FONT SIZE="-2">Comment</FONT> - </TD> +% foreach my $field ( @fields ) { + <TD> + <INPUT TYPE = "text" + NAME = "<%$name%>_<%$field%>" + ID = "<%$id%>_<%$field%>" + VALUE = "<% scalar($cgi->param($name."_$field")) + || $contact->get($field) |h %>" + <% $onchange %> + ><BR> + <FONT SIZE="-2"><% $label{$field} %></FONT> + </TD> +% } </TR> </TABLE> @@ -69,4 +45,12 @@ if ( $curr_value ) { $contact = new FS::contact {}; } +tie my %label, 'Tie::IxHash', + 'first' => 'First name', + 'last' => 'Last name', + 'title' => 'Title/Position', + 'comment' => 'Comment', +; +my @fields = keys %label; + </%init> |