fix some URIs and fix redirection on fees_create

Closes: sipwise-0003085
agranig/1_0_subfix
Gerhard Jungwirth 12 years ago
parent 0436e58e19
commit 309f0c3c91

@ -176,6 +176,11 @@ sub fees_create :Chained('fees_list') :PathPart('create') :Args(0) {
params => $c->request->params,
action => $c->uri_for($c->stash->{profile}->{id}, 'fees', 'create'),
);
return if NGCP::Panel::Utils::check_form_buttons(
c => $c, form => $form, fields => [qw/billing_zone.create/],
back_uri => $c->req->uri,
redir_uri => $c->uri_for($c->stash->{profile}->{id}, 'zones', 'create'),
);
if($form->validated) {
$c->stash->{'profile_result'}->billing_fees
->create(
@ -276,11 +281,11 @@ sub zones_create :Chained('zones_list') :PathPart('create') :Args(0) {
return;
}
$c->flash(messages => [{type => 'success', text => 'Billing Zone successfully created!'}]);
#$c->response->redirect($c->uri_for($c->stash->{profile}->{id}, 'fees'));
$c->response->redirect($c->stash->{zones_root_uri});
return;
}
#$c->stash(close_target => $c->uri_for($c->stash->{profile}->{id}, 'fees'));
$c->stash(close_target => $c->stash->{zones_root_uri});
$c->stash(form => $form);
$c->stash(create_flag => 1);
}

@ -1,4 +1,6 @@
[% META title = 'Billing Fees' -%]
<a href="[% c.uri_for_action('/billing/zones',[c.req.captures.0]) %]" class="btn btn-tertiary btn-large">Edit Zones</a>
[%
helper.name = 'Billing Fees';
helper.messages = messages;
@ -11,7 +13,7 @@
helper.form_object = form;
helper.has_edit = has_edit;
helper.has_preferences = has_preferences;
helper.ajax_uri = c.uri_for( c.action, c.req.captures, 'ajax' );
helper.ajax_uri = c.uri_for_action('/billing/fees_ajax', [c.req.captures.0]);
helper.base_uri = c.uri_for( profile.id, 'fees');
PROCESS 'helpers/datatables.tt';

@ -11,7 +11,7 @@
helper.form_object = form;
helper.has_edit = has_edit;
helper.has_preferences = has_preferences;
helper.ajax_uri = c.uri_for( c.action, c.req.captures, 'ajax' );
helper.ajax_uri = c.uri_for_action( '/billing/zones_ajax',[c.req.captures.0] );
helper.base_uri = c.uri_for( profile.id, 'zones');
PROCESS 'helpers/datatables.tt';

Loading…
Cancel
Save