Fix customer creation.

Point link to Contract controller on creation.
Redirect into customer details after creation.
agranig/1_0_subfix
Andreas Granig 12 years ago
parent 5dfe2afc28
commit 26879effe6

@ -335,7 +335,7 @@ sub customer_create :Chained('customer_list') :PathPart('create') :Args(0) {
$c->response->redirect($c->stash->{close_target});
return;
}
$c->response->redirect($c->uri_for_action('/contract/root'));
$c->response->redirect($c->uri_for('/customer'));
return;
}
}
@ -347,12 +347,7 @@ sub customer_create :Chained('customer_list') :PathPart('create') :Args(0) {
);
if($form->validated) {
$c->flash(messages => [{type => 'success', text => 'Contract successfully created!'}]);
if($c->stash->{close_target}) {
$c->response->redirect($c->stash->{close_target});
return;
}
$c->response->redirect($c->uri_for_action('/contract/root'));
$c->response->redirect($c->uri_for_action('/customer/details', [$item->contract->id]));
return;
}

@ -18,7 +18,7 @@
{ name = 'Details', uri = "/customer/'+full[0]+'/details", class = 'btn-small btn-tertiary', icon = 'icon-list' },
];
helper.top_buttons = [
{ name = 'Create Customer', uri = c.uri_for('/customer/create'), icon = 'icon-star' },
{ name = 'Create Customer', uri = c.uri_for_action('/contract/customer_create'), icon = 'icon-star' },
];
PROCESS 'helpers/datatables.tt';

Loading…
Cancel
Save