diff --git a/lib/NGCP/Panel/Controller/Contract.pm b/lib/NGCP/Panel/Controller/Contract.pm index a9e14e78a5..d79d26d393 100644 --- a/lib/NGCP/Panel/Controller/Contract.pm +++ b/lib/NGCP/Panel/Controller/Contract.pm @@ -175,16 +175,13 @@ sub edit :Chained('base') :PathPart('edit') :Args(0) { my $contract = $c->stash->{contract_result}; my $billing_mapping = $contract->billing_mappings->find($contract->get_column('bmid')); my $params = {}; - $params = $params->merge($c->session->{created_objects}); unless($posted) { $params->{billing_profile}{id} = $billing_mapping->billing_profile->id; $params->{contact}{id} = $contract->contact_id; $params->{external_id} = $contract->external_id; $params->{status} = $contract->status; } - - # TODO: handle created contact/bilprof - + $params = $params->merge($c->session->{created_objects}); my $form = NGCP::Panel::Form::Contract->new; $form->process( posted => $posted, @@ -193,7 +190,7 @@ sub edit :Chained('base') :PathPart('edit') :Args(0) { ); NGCP::Panel::Utils::Navigation::check_form_buttons( c => $c, form => $form, - fields => {'contract.contact.create' => $c->uri_for('/contact/create'), + fields => {'contact.create' => $c->uri_for('/contact/create'), 'billing_profile.create' => $c->uri_for('/billing/create')}, back_uri => $c->req->uri, ); diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index 4e71e78623..92f8b8283c 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -60,7 +60,7 @@ sub base :Chained('list_customer') :PathPart('') :CaptureArgs(1) { } my $contract = $c->model('DB')->resultset('contracts') - ->search_rs(id => $contract_id); + ->search('me.id' => $contract_id); unless($c->user->is_superuser) { $contract = $contract->search({ 'contact.reseller_id' => $c->user->reseller_id, diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index c9447caa1e..13eceb0daf 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -1609,9 +1609,13 @@ sub edit_master :Chained('master') :PathPart('edit') :Args(0) { } if($lock->first) { - $lock->first->update({ value => $form->field('lock')->value }); - } else { - $lock->create({ value => $form->field('lock')->value }); + if ($form->values->{lock} == 0) { + $lock->delete; + } else { + $lock->first->update({ value => $form->values->{lock} }); + } + } elsif($form->values->{lock} > 0) { + $lock->create({ value => $form->values->{lock} }); } }); $c->flash(messages => [{type => 'success', text => 'Successfully updated subscriber'}]); diff --git a/share/templates/customer/details.tt b/share/templates/customer/details.tt index ff8670855c..679ae24d8f 100644 --- a/share/templates/customer/details.tt +++ b/share/templates/customer/details.tt @@ -14,20 +14,55 @@ Back + [% UNLESS c.user.read_only -%] + + Edit + + [% END -%] +[% back_created = 1 -%] -[% IF messages -%]
| Name | +Value | + + +
|---|---|
| # | +[% contract.contact.reseller.id %] | +
| Name | +[% contract.contact.reseller.name %] | +