diff --git a/lib/NGCP/Panel/Controller/Contact.pm b/lib/NGCP/Panel/Controller/Contact.pm index 33729ba761..5a797dd72e 100644 --- a/lib/NGCP/Panel/Controller/Contact.pm +++ b/lib/NGCP/Panel/Controller/Contact.pm @@ -122,6 +122,7 @@ sub edit :Chained('base') :PathPart('edit') :Args(0) { $params->{reseller}{id} = $c->user->reseller_id; } elsif($c->user->is_superuser) { $form = NGCP::Panel::Form::Contact::Admin->new; + $params->{reseller}{id} = $c->stash->{contact}->reseller->id; } else { $form = NGCP::Panel::Form::Contact::Reseller->new; } diff --git a/lib/NGCP/Panel/Form/Contact/Admin.pm b/lib/NGCP/Panel/Form/Contact/Admin.pm index afd765fc90..f5938453de 100644 --- a/lib/NGCP/Panel/Form/Contact/Admin.pm +++ b/lib/NGCP/Panel/Form/Contact/Admin.pm @@ -12,7 +12,8 @@ has_field 'reseller' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/reseller firstname lastname email company/], + render_list => [qw/reseller firstname lastname email company + street postcode city country phonenumber/], ); 1; diff --git a/lib/NGCP/Panel/Form/Contact/Reseller.pm b/lib/NGCP/Panel/Form/Contact/Reseller.pm index e91725bd51..5b037e303c 100644 --- a/lib/NGCP/Panel/Form/Contact/Reseller.pm +++ b/lib/NGCP/Panel/Form/Contact/Reseller.pm @@ -14,21 +14,50 @@ sub build_form_element_class { [qw/form-horizontal/] } has_field 'firstname' => ( type => 'Text', label => 'First Name', + maxlength => 127, ); has_field 'lastname' => ( type => 'Text', label => 'Last Name', + maxlength => 127, ); has_field 'company' => ( type => 'Text', label => 'Company', + maxlength => 127, ); has_field 'email' => ( type => 'Email', required => 1, + maxlength => 255, +); + +has_field 'street' => ( + type => 'Text', + maxlength => 127, +); + +has_field 'postcode' => ( + type => 'Integer', +); + +has_field 'city' => ( + type => 'Text', + maxlength => 127, +); + +has_field 'country' => ( + type => 'Text', + maxlength => 2, +); + +has_field 'phonenumber' => ( + type => 'Text', + maxlength => 31, + label => 'Phone Number', ); has_field 'save' => ( @@ -41,7 +70,8 @@ has_field 'save' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/firstname lastname email company/], + render_list => [qw/firstname lastname email company street postcode city + country phonenumber/], ); has_block 'actions' => (