From da94ac1eb890f060e33052e0a5b30afd24eedabb Mon Sep 17 00:00:00 2001 From: Daniel Tiefnig Date: Wed, 17 Nov 2010 15:39:21 +0000 Subject: [PATCH] renamed contract_detail template to follow naming convention fixed contact field processing to allow unsetting fields added descriptive header for contact fields --- lib/admin/Controller/peering.pm | 6 ++++-- root/tt/{contract_detail.tt => peering_contract_detail.tt} | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) rename root/tt/{contract_detail.tt => peering_contract_detail.tt} (97%) diff --git a/lib/admin/Controller/peering.pm b/lib/admin/Controller/peering.pm index a6f86f4..0554e5e 100644 --- a/lib/admin/Controller/peering.pm +++ b/lib/admin/Controller/peering.pm @@ -792,7 +792,7 @@ Show SIP peering contract details. sub contract_detail : Local { my ( $self, $c ) = @_; - $c->stash->{template} = 'tt/contract_detail.tt'; + $c->stash->{template} = 'tt/peering_contract_detail.tt'; my $contract; my $contract_id = $c->request->params->{contract_id} || undef; @@ -864,7 +864,9 @@ sub save_contract : Local { foreach my $form_field (@$contract_contact_form_fields) { if (defined $c->request->params->{$form_field->{field}} and length($c->request->params->{$form_field->{field}})) { $contact{$form_field->{field}} = $c->request->params->{$form_field->{field}}; - } + } else { + $contact{$form_field->{field}} = undef; + } } } $settings{contact} = \%contact; diff --git a/root/tt/contract_detail.tt b/root/tt/peering_contract_detail.tt similarity index 97% rename from root/tt/contract_detail.tt rename to root/tt/peering_contract_detail.tt index 28f6ba3..3eeb854 100755 --- a/root/tt/contract_detail.tt +++ b/root/tt/peering_contract_detail.tt @@ -46,6 +46,7 @@ [% END %] + Peering contact person or company: [% FOREACH contact_form_field = contact_form_fields %] [% contact_form_field.label %]: